THM - Skynet without MetaSploit

Intro
A new, mysterious box. It is Terminator themed, but I have no idea what it will reveal Let’s dive in!
Target
Recon
Not much recon here. Contrary to our previous targets which were “training boxes”, this one is doesn’t hold your hand. Let’s directly enumerate it!
Enum
Usual nmap
scan :
|
|
|
|
we find the following Samba
shares :
Enumerating them further will reveal juicy info inside anonymous
such as passwords' list and a message telling us that all employees are required to change their passwords.
Nikto
and gobuster
will reveal a SquirrelMail version 1.4.23 [SVN]
installation :
Exploitation
Now, using Burp
, we’ll try some credentials stuffing in order to login. From our first SMB recon, we discovered a plausible user : milesdyson
, and a list of passwords.
In the intruder’s tab set up a sniper
attack, using milesdyson
as user and the password field as the only payload :
We, now, load the password list found during SMB enumeration :
And finally, we add a “grep condition” in order to filter our results :
After a little while, we find a working set of credentials:
and we are in Miles' mailbox !
Now, reading Miles' email, we’ll find a password for Samba :
We can now use it in order to connect to the Samba share, like so : smbclient \\\\$target_ip\\milesdyson -U milesdyson
Exploring the share will reveal an odd file called important.txt
. Inside this file, we learn the existence of new CMS
located at : http://$target_ip/45kra24zxs28v3yd/
.
Further scanning reveals admin page :
Doing a quick search, we’ll find the Cuppa CMS
is vulnerable to RFI/LFI.
Getting Initial Shell
We craft the URL to match our target, replacing cuppa
by administrator
, set up a listener
and get initial shell :
We harvest user's flag
in milesdyson
’s home folder :
PrivEsc
We download our classic tools to the box and launch them. Unfortunately here, I didn’t find anything obvious. I tried a few probable exploits, such as dirtyc0w
, and a few others, but nothing worked.
Finally, I paid closer attention to kernel version, and noticed that 4.8.0-58-generic
might be vulnerable.
After a few quick steps of download, compile, “send” to target, I was ready to run it, and BOOM! it worked:
Finally, we collect root's flag
:
Outro
Another box rooted, it seems that even the inventor of neural-net processor can’t resist us! :)