HackTheBox - Obscurity

Nmap scan results

Poking around on the webpage
Surfing the webserver running at port 8080. The website says that they are using their custom made HTTP Server.

An interesting note kept for the developers on the main page.

Fuzzing with FFUF
We can search for SuperSecureServer.py file on the website using the ffuf command.


Let's download the file using wget and analyze it for vulnerabilities.
Python's exec RCE (String format vulnerability)
The path is controllable by us and is not getting sanitized anywhere, that means we can inject malicious payload over here.


It is working. Now let's get a reverse shell.

Privilege Escalation (robert)
So the SuperSecureCrypt.py encrypts the file with a unique key and also requires that same key to decrypt. There is a file named passwordreminder.txt which is encrypted with some key. Also there are two files check.txt and out.txt.
We have plaintext file and the encrypted file, let's see if we can get the key that was used to encrypt it. I have written a small script to crack it.


Privilege Escalation (root)

If you will check the source code for this BetterSSH.py file, you will find a vulnerable part.
So after entering valid username and password (which we already have), the script opens /etc/shadow file and stores it in /tmp/SSH/<random-name> So we can get that file by running a race condition script in the background.


Crack the hash for root user using john.


Last updated
Was this helpful?
