Task 1 :
Deploy the machine and proceed!
Task 2 : Some Nmap Scans!
- Use Nmap to Scan all the ports
Looks like port 21 is open and Anonymous login is allowed. Keep that in mind.
Lets check out the webpage first.
Task 3 : Planning an escape!
Clicking the link brings us to another normal looking webpage, but after viewing the source we found some interesting comments.
We could run Gobuster but since it’s telling us to go checkout the FTP, Lets do it! Note that you could use the Anonymous login on FTP.
Let’s get all the files by using the get command and exit out of FTP.
Opening up the text file, looks like it’s just some normal conversation. Let’s run the executable file.
Since we’re given a compiled code, perhaps we can reverse engineer it to something useful! This is where my good friend Ghidra comes to play. It’s a tool to reverse engineer compiled code. Or for simple purposes, turn back a compiled code to code.
After inspecting the code with Ghidra, I found the function that it used to check if it’s the passphrase the program wants. Upon further inspection, I found 2 words that seem odd. So I tried both of those words and 1 is actually the passphrase!
Another passphrase or word? Hm, perhaps it has something to do with the jpg file! For this act, I will use steghide to extract hidden files in the picture.
Task 4: What is rize trying to say?
Opening up reveals some weird language.
Apparently it’s Morsecode and I need to decode it. This is where my good friend Cyberchef comes to play! It also stated that there is a secret directory!
Inserting the name into the url brings me to a secret directory!
Hm, it’s telling us to scan it. Perhaps there’s more to this. Let’s run Gobuster on it.
The sub-directory brings us to this page
Clicking NO and YES brings us to the same result but but but. If you look closely at the URL it seems to be fetching a file from a server. Perhaps a local one.
Lets change the flower.gif to ../etc/passwd
After a staring at the URL for an hour, I remembered. HTML URL encoding. I changed it with this.
%2F%2E%2E%2F%2E%2E%2F%2E%2E%2Fetc%2Fpasswd
Looks like we found the username and password hash for the user. Let’s crack it using John. Turns out the password was really weak.
Task 5 : Fight Jason!
Let’s SSH in the server with the credentials that we have. And from there we can find our user.txt
Let’s check out if we have sudo permission.
We can run sudo it looks like but only on jail.py.
Let’s view what’s inside jail.py
Shoot, looks like some keywords are blocked. After this I got stuck and went looking for an answer online, search up “Escaping Python Jails”. It guides as a way to use python built-ins functions to break out of it.
__builtins__.__dict__[‘__IMPORT__’.lower()](‘OS’.lower()).__dict__[‘SYSTEM’.lower()](‘cat /root/root.txt’)
Next run the python file as sudo and enter those very commands and..
Submit those 2 flags and we are donezo.
Thank you for reading my writeup!