Earth

About Release

Download

Description

Difficulty: Easy

Eartharrow-up-right is an easy box though you will likely find it more challenging than "Mercury" in this series and on the harder side of easy, depending on your experience. There are two flags on the box: a user and root flag which include an md5 hash. This has been tested on VirtualBox so may not work correctly on VMware. Any questions/issues or feedback please email me at: SirFlash at protonmail.com, though it may take a while for me to get back to you.

Recon

Get target IP on network:

└─$ ip -4 -brief address show eth0
eth0             UP             10.0.2.15/24
└─$ sudo netdiscover -i eth0 -r 10.0.2.0/24
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname
 -----------------------------------------------------------------------------
 10.0.2.1        52:54:00:12:35:00      1      60  Unknown vendor
 10.0.2.2        52:54:00:12:35:00      1      60  Unknown vendor
 10.0.2.3        08:00:27:64:6e:66      1      60  PCS Systemtechnik GmbH
 10.0.2.17       08:00:27:be:8c:91      1      60  PCS Systemtechnik GmbH # <--
chevron-rightnmap_scan.loghashtag

HTTPs (443)

HTTP was returning Bad Request (400) so I focused on HTTPs first.

The website has default installation of Fedora Webserver.

Writeup.png

Feroxbuster found nothing interesting, there's /icons and /cgi-bin directories on server.

The HTTPs run on certificate and they usually have domain names:

Update /etc/hosts:

terratest.earth.local

Visit new subdomain:

Writeup-1.png

Test the message functionality:

Writeup-2.png

Encryption uses a key, so first thing I thought was XOR. Test it:

Writeup-3.png

Ok, the messages use XOR, but to decode them we need keys..

There seems to be 2 server running on same domain or it's just vhost problem

HTTP:

HTTPs:

Leaked Information

Enumerate other extensions too, because it used wildcard.

Get test data:

XOR

Since XOR is symmetrical encryption we can use plaintext to get the key:

Writeup-4.png

String earthclimatechangebad4humans keeps repeating, meaning it's the XOR key.

circle-check

The key only worked for first message.

Admin Panel

Let's try the login panel now at http://terratest.earth.local/admin/arrow-up-right (HTTP)

Try credentials with user terra and key

Writeup-5.png
circle-check

We can execute commands, so let's get a reverse shell. Get a payload from revshellsarrow-up-right, like:

The command was unsuccessful, error: Remote connections are forbidden.

/var/www/html didn't have anything interesting, but going up to /var there are few noticeable directories.

Writeup-6.png
Writeup-7.png

User.txt

Writeup-8.png
circle-check
Writeup-9.png

Reverse Shell

The error which mentions that remote connections are disabled may just be a filter, it's thrown whenever commands like nc, curl, wget are ran.

When can try encrypting the command and test if we get shell:

Run the command:

Catch the shell:

sudo -l fails because we need password for account. Then we list available suid binaries to escalate privileges.

/usr/bin/reset_root program seems out of the ordinary.

It's an ELF binary, meaning some Reverse Engineering will be required. strings isn't that helpful, strace or ltrace doesn't exist on remote server, so we should dissect the file locally.

Looks like "trigger" conditions to be met 3 files need to be present on system.

Privilege Escalation (root)

Root.txt

Last updated