Olympus
Olympus CTF
Step 1: Nmap
Scan ports 22 and 80 with version and default-script detection:
nmap -sS -sV -sC -p 22,80 olympus.thm --min-rate=1000
Step 2: FFUF
Fuzz for web content, filtering out 403 responses:
ffuf -w /usr/share/wordlists/SecLists/Discovery/Web-Content/common.txt:FUZZ -u http://olympus.thm/FUZZ -fc 403
Step 3: SQLi
Testing the Victor CMS search field feature reveals a SQLi:
'SELECT * FROM users WHERE username='' and password='' OR 1=1;
Let's capture this with Burp Suite and plug it into SQLmap to automate our injection attack.
Copy this over to a text editor and run it through SQLmap.
We discovered a flag in olympus, let's dump it.
sqlmap -r req.txt --batch --dump -T flag -D olympus
Now let's see what that users table can offer us.
Step 4: Enumerate Subdomain
We discovered three users: root, zeus, and prometheus. Additionally, we discovered a subdomain that can be added to our /etc/hosts list.
Running the following hash through john reveals a password that can be paired with prometheus.
$2y$10$YC6uoMwK9VpB5QL513vfLu1RV2sgBf01c0lzPHcz1qK2EArDvnj3C
Let's enumerate the newly discovered subdomain.
I'm sure the uploads directory will play an important role later, in the meantime let's see if we can login with these credentials.
And we're in. There looks to be an upload feature, let's see if we can upload a reverse shell.
It looks to have uploaded somewhere, but not sure where.
Let's go back to sqlmap and dump the chats table to see if the file name was changed upon uploading.
sqlmap -r req.txt --batch --dump -T chats -D olympus
Looks like it did. Let's copy this and see if we can visit go to it using the /uploads/ directory we found earlier.
Going to the path drops us into a shell.
Searching for SUID binaries reveals cputils.
We can copy over zeus id_rsa key and then ssh in with it.
Crack it using ssh2john and john.
Linpeas and pspy64 didn't reveal anything worth while on zeus account; however, after looking around the file system for a while we came across this:
Inside of the php file seems to be a backdoor.
Running uname -a; w; /lib/defended/libc.so.99 drops us into a root shell.