Reconnaissance
First, I added the new host to my known ones:
Then, I performed a Nmap scan:
So I took a look at the website:
It talks about a php script that creates a bash reverse shell from a php script. I took a look at the unique entry phpbash
:
So as the author says that he used this script in this website, I decided to enumerate with dirsearch ๐ to try to find that script and use it:
So I took a look at the /dev
subdirectory and found those scripts:
Exploitation
I can execute commands, so I executed a python reverse shell (bash one didnโt work):
I got a shell!
So I checked if I could read the user flag (success):
Privilege escalation
If we run sudo -l
:
So the user www-data
can run commands as scriptmanager
without password. So we can perform a sudo -u scriptmanager bash -i
to become scriptmanager
.
Now, after some enumeration I found the /scripts
directory, which contained two files:
It seems that a privileged user is running the test.py
each some time. So I created a .shell.py
:
Got a reverse shell as root :D
Machine pwned!