Symfonos 3
Symfonos 3 Vulnhub Walkthrough
Enumeration
Nmap
Let's put the IP to the browser
And we got this at the inspect elements
So, I decided to use dirb and gobuster
dirb & gobuster
We got a directory called gate
Nothing seems to be interesting, so let's continue to enumerate
I can't enumerate anything from dirb so I changed to gobuster
We got a directory called /cerberus
Further enumeration I got /tartarus
and I got this
At the inspect elements, it says it may be misleading
It seems that we might gone into a rabbit hole. So let's back to square one
I use dirbuster to enumerate the URL again
Then, when we enumerate, we got the underworld directory under cgi-bbin
Lets navigate to /cgi-bin/underworld
Got this..hmmm
After some research, found out that at the Pentesterlab, the exploit is called shellshock
Exploitation
Reverse Shell
We can get a reverse shell by using this command
And we need to set up a listener at out machine
Got a reverse shell. Then we can type the python code to spawn a proper shell
After that I use tcpdump
to grab the ftp server network and store it at /tmp directory.
Then we can use nc
to transfer the file to our machine to analyse it
After that we can use wireshark to analyse it.
We can filter it by tcp.port == 21
and then we right click and choose follow TCP stream and then we can see this
We got the password (PTpZTfU4vxgzvRBE) and username for user hades
We can su
to the user hades
Privilege Escalation
After that we run the pspy
again
Then we got this
We know that there is a file running at /opt/ftpclient
that can run as root.
But when we go to the /opt/ftpclient
we can see that we have no permission to edit the files.
Python Library Hijacking
After researching and asking the author of this machine cause I didn't know how it works, it is python library hijacking.
Using this command will show the path that all the directories that python will look for to import the library according to the directories.
As we can see here there are bunch of folders
If we cat
into the ftpclient.py
that is under /opt/ftpclient
, we can see that the file is importing a library called ftplib
We navigate to /usr/lib/python2.7
Then we can type ls -la | grep ftplib
We can see that ftplib.py can be modify by the user that is under group gods
which can be edited by hades.
We first rename the file to become a backup file
Then we can nano ftplib.py to create a new file to replace the old one.
Type in these code to get a reverse shell
Then save the file.
Go to our machine to set up a listener
After waiting for 1 minute, we get a reverse shell back
Then type the python code to get a proper shell
Then, we got root !
Navigate to /root
to get the flag.txt
Congratulation !
Last updated