In this machine on port 80 it's first leak the new vhost
called office.paper!
on responce header X-Backend-Server
after that wordpress version is vernable through Unauthenticated View Private/Draft Posts and we got the hint already with nick comment using the vernability we check the draft message that leak to another vhost and register ourself to that and get the directory Path Traversal
and get the .env
secret and login through ssh and for Privilege escalation we run linpeas
that lead us to CVE-2021-3560.
We see port 80 and 22 are open
Lets visit port 80 and view the site provided.
We find that it is a simple static website and has nothing interesting.Though port 443 was open, there was nothing usefull, just some certificates.
Running gobuster, there are no path/directories found.
After a little bit of digging using curl to see the response headers, we notice another vhost being exposed. curl -I 10.10.11.143
Now lets add it to our /etc/hosts
file.
Visiting the new domain, we find a different page with a different theme.
Looking around the site, we found some interesting comment telling Michael to remove secret from draft.
This made me want so see what secret was on the draft.Unfortunately, you have to be admin, to view drafts. Looking around at the footer, we see that the site was designed with wordpress. Looking with wappalyzer, we see it is wordpress 5.2.3.
Now lets look for wordpress 5.2.3
vulnerabilities.
I found this vulnerability that could allow an unauthenticated user to view private or draft posts due to an issue within WP_Query. So we basically add ?static=1
to the end of the url.http://office.paper/?static=1
Yeet, we found the secret they were talking about. It is a url with a new vhost.
I will add it to my /etc/hosts
file.
Now i can visit the new links http://chat.office.paper/register/8qozr226AhkCHZdyY
to see what is there. I find its a registration page where i can create an account.
So I will create an account so that I can login to the chat system as an employee.
After loging in, we receive a notification at the #general
Channel whereby we can access the previous chats.
Going though the previous chats, I found some bot recyclops
that could allow some LFI. Fortunately, it allow us to send direct messages by clicking on its profile then the message icon. Some if the commands that it allows are like list
and file
I decided to see what this commands output.
We can see the list
command, lists the file in the current directory and this is interesting.
The file
command, prints out the contents of a file so we can read as we can see above.
Now this gives me an idea to try directory file transvasal
using ../
The output, had interesting outputs like the directory hubot
and even user.txt
that returned access denied
when I tried to read it using the file
command.
I gave a look at the hubot
directory where also the results were interesting. There was a .env
file and as ussual, .env
files, are used to store secrets.
Reading the .env
file, I found a username
and password.
I decided to use the credidentials I found to try loging in rocket.chat.
Oops! it failed.
I decide to look for a user in the machine using file ../../../etc/passwd
I found a user dwight so I can now ssh into the machine using this use and the password I got previously. ssh dwight@10.10.11.143
And there was the user.txt
I will host a python server on my attack machine python3 -m http.server 80
so that I can use wget
to download linpeas into the victim machine.
Now I can successfully run linpease in the victim machine so find any vulnerabilities that I can use.
I found that it was vilnerable to CVE-2021-3560
that is Polkit or Pwnkit
which allows unprivileged
user to call privileged methods using DBus.
Polkit-exploit - CVE-2021-3560
Now i'll get the python script in the machine and run it.
Finally we get root. Now lets cat the hash.
Finally we solved the lab and thank you so much for your time, if you liked this writeup and you feel it’s helpful then please share it with your friends.
Happy hacking!