Sitemap
dj4m

dj4m

Loly

5 min readNov 27, 2025

--

Summary

This machine start by identifying a wordpress endpoint, enumerating users and bruteforcing the password, from there attacker can achieve shell access exploiting file upload feature. With access to the target the attacker can move to other system user and then get root access by identifying and exploiting kernel vulnerability.

Nmap Scan

Press enter or click to view image in full size

Enumeration

Nmap only shows a HTTP service on port 80 and looking at it It does not show much just the index page for nginx server

Press enter or click to view image in full size

If anything else is present it should be rendered on a separate path or vhost so I will start by a directory/file fuzzing to try and find that

Press enter or click to view image in full size

This leads to wordpress endpoint that does a redirect so let’s check that.

Press enter or click to view image in full size

No I have some content wot work with but the rendering is still broken, this usually happens when the referred files(CSS, javascript etc) are not properly loaded, the most common reason for that is that the page refer these files with a host name that our system does not know, and we can see that in the page source

Press enter or click to view image in full size

To fix that I just need to add loly.lc to my /etc/hosts file so the system can resolve the hostname to the target IP

Once that is done the wordpress website should render properly on the browser and any other tools for crowling should be able to do their job properly since the host is known now

Press enter or click to view image in full size

From the screenshot above I can identify user loly already the user who published the “Hello World!” post

I run wpscan to see if any thing interesting is identified but the only interesting path were authenticated attacks.

Foothold

Since interesting paths are authenticated I will try to bruteforce the identified user’s password, for wordpress I can use wpscan tool instead of hydra as it should be more adapted for wordpress.

Press enter or click to view image in full size

so now I have access to this user and I can understand from the message indicated bellow that the user is wordpress administrator

Press enter or click to view image in full size

Initial Access

As wordpress administrator the usual path is injeccting php either as web shell or reverse shell depending on what is available so let’s see what we can do here.

Get dj4m’s stories in your inbox

Join Medium for free to get updates from this writer.

I was able to find a file upload feature under adrotate

Press enter or click to view image in full size

This does not allow to upload php files but since it allows zip files it probably handle unzipping the uploaded zip so I can use that to upload a zipped PHP then access it as raw PHP file. Trying that I uploaded my web shell file after creating the zip archeive

then I tried accessing under /banners which did not work at first but a quick search solved the problem the path was /wp-content/banners

Press enter or click to view image in full size

Now I have a web shell where I can run commands on the system

Press enter or click to view image in full size

I leverage that to a rev shell, I like having a web shell as first step because I can always use it to trigger as many rev shells as I need

Press enter or click to view image in full size

through the rev shell I upgrade through python to have a better shell then I just get local.txt flag

Press enter or click to view image in full size

Privilege Escalation

Looking through wordpress file I was able to find credentials in config file

Press enter or click to view image in full size

and checking /etc/passwd I could identify the user on the system

Press enter or click to view image in full size

Using that I was able to move to usr loly which was part of different groups

At this point manual enumeration did not lead anywhere so I fall back to linpeas which showed a bunch of paths

Press enter or click to view image in full size

I was able to use the first listed exploit to get root access and drop the proof.txt flag

Press enter or click to view image in full size

--

--