You can find the machine there > Loly
Summary
This machine is an easy one, starting off we can find a wordpress installation and we gain access to it by running a brute force attack on the user. Shell uploading was a bit tricky, because common ways were blocked. After privilege escalation to first user was pretty easy we just have to look at wp-config file a really common method & the root one is a simple kernel exploit. Let’s pwn it!
Enumeration/Reconnaissance
Let’s start as always with nmap.
1 |
|
Visiting the web page, is just the default nginx page. No /robots.txt
and such stuff so let’s move on and run gobuster
.
1 |
|
/wordpress
isn’t loading properly, checking the html code we can see a dns-prefetch
and a domain name that’s probably a virtual host let’s add it to /etc/hosts
.
1 |
|
1 |
|
Now we can see the wordpress site, let’s run a wpscan
on it to detect plugins/users.
1 |
|
Interesting, without wasting more time let’s run a brute force attack on loly user.
1 |
|
Shell as www-data
Perfect now we can login in, admin panel is under /wp-admin
. Here i got stuck for couple of minutes, tried ton of stuff but no luck spawning a shell. Anyway then i remembered the plugin adrotate
i enumerated a bit and i found a way to upload a shell & execute it! Follow my steps:
1) Zip your shell!
1 |
|
2) Upload it
3) Execute it
Enumerating the settings of the plugin i found out the where it saves the files:
1 |
|
1 |
|
Shell as loly
A common method is makers to “hide” the user password under wp-config.php
file, so i always check that first and 95% it works!
1 |
|
Shell as root
I did lot of enumeration but nothing, so my last hope is to be something like kernel exploit. I always love to run linux exploit suggester to speed up the process. Always check for highly probable exploits first.
1 |
|
This seems perfect, let’s download and test it out.
1 |
|
Let’s read the flag.
1 |
|
Was fun, enjoyed it a lot!