Hetemit
Gaining Access
Nmap scan:
Lots of ports. FTP allows for anonymous access, but just hangs.
Web Enumeration -> Python Code Injection
Port 80 had the default Apache HTTP Server:
Ran a directory scan on this and didn't find much.
Port 50000 had a simple API running:
If we use the /generate
option, it just returns us this:
I tried sending POST requests to this:
Not too sure what to do with that token. However, we notice that this is running a Python server. The /verify
endpoint also accepts POST requests, but it always seems to fail:
Since this was running a Python based server, we can try some Python code injection.
This looks like it works. Another test confirms that it works:
So this script has the os
module imported, meaning we can get an easy reverse shell:
Privilege Escalation
Misconfigured Services + Reboot
The user is able to reboot the system:
This indicates to me that there is some kind of startup script to exploit. I ran a linpeas.sh
scan on the machine to enumerate, and it found quite a few misconfigured services:
We can overwrite this to execute a script that gives us a reverse shell. I included the SUID bit in my script just in case the shell doesn't work:
I also included my SSH key within the authorized_keys
folder for backdoor access.
Afterwards, using vi
we can edit the service file:
Then, we can run sudo /sbin/reboot
to restart the machine. Then we just have to wait for a bit before we can SSH back in. The reverse shell didn't work for some reason, but the SUID binary command did:
Rooted!
Last updated