Antonio Tascón

I'm a Cybersec enthusiast looking to make a career in the field.

Skynet Write Up

19 Dec 2020 » cybersecurity, writeUps, tryHackMe

This is a write-up for the room Skynet from tryhackme.

Initial Enumeration

We run nmap to enumerate open ports and services in the machine.

nmap

The host OS seems to be Ubuntu.

  • Port 22, OpenSSH 7.2p2
  • Port 80, Apache 2.4.18
  • Port 110, pop3.
  • Port 139/445, samba 4.3.11
  • Port 143, imap.

The server on port 80 is this page

port80

Running gobuster against the server gives us some other interesting folders but the only one we can access is /squirrelmail

squirrel

We don’t have any credentials and the version doesn’t seem to be vulnerable.

Next we try to enumerate the samba service using enum4linux

samba

We find a username milesdyson. The shares are:

samba

We connect to the anonymous share and have access to some files

files

The content of the files is

attention.txt

log1.txt

Using hydra to brute-force the squirrel mail login page we obtain some credentials.

hydra

The only useful email seems to be this one

email

With this new credentials we connect to the share, under the /notes directory we find a file important.txt with the content

important.txt

If we navigate to this directory we can see this page

secret directory

Exploitation

Using gobuster we find the directory /administrator, we have the login page of Cuppa CMS. According to this entry this cms is vulnerable to local and remote file inclusion.

To test it we try to read /etc/passwd having success.

passwd

Now we use a php-reverse-shell and upload it obtaining a shell into the system.

payload

shell

We can now access the user flag.

Privilege Escalation

In my case I used a kernel exploit to escalate privileges in this machine. I downloaded this exploit, compiled it and run it to root.

root

The intended method on the other hand is to exploit a cronjob this machine has running every minute. The program executed is named backup.sh and is vulnerable to a wildcard expansion of the tar program. This method is explained in this other write-up.