Reconnaissance
First, I added the new host to my known ones:
Then, I performed a Nmap scan:
So I took a look at port 5000 website:
If we click on โFor questionsโ we arrive to some kind of form:
Letโs try to inject an XSS:
So I captured the petition with Burpsuite, but had the same result in the repeater. After this, I decided to inject the XSS in the User-Agent
header:
I donโt get the Hacking message now and pop the alert!
I can now attempt to create a blind stored XSS to steal cookies with the following script:
Almost inmediately I received some cookies in my python server:
Remember that they are base64 encoded
So I decoded them and got these cookies:
Now I decided to perform some enumeration with dirsearch:
The /dashboard
seems to be interesting, because initially we canโt access to it. But maybe with the new cookie we actually can:
I got access to the Administration Dashboard!
I captured the petition with Burp and try to execute a Command Injection (which actually worked):
So I tried to inject a reverse shell:
Weโve got a reverse shell!
Privilege Escalation
I inspected the mail of the user dvir
and found an interesting message:
If we run sudo -l
:
I inspected the binary:
So basically, if we create a shell inside initdb.sh
we will become root.
We become root and got root flag!
Machine pwned!