Page cover

Root Me

Date : 8th November, 2021

Author : Dhaval Kotak

Room : Root Me

Reconnaissance

nanomite @ zeus in ~/thm/rootme
⚡️ nmap -A 10.10.237.244 | tee nmap.log
Starting Nmap 7.91 ( https://nmap.org ) at 2021-11-08 22:47 IST
Nmap scan report for 10.10.237.244
Host is up (0.40s latency).
Not shown: 998 closed ports
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 4a:b9:16:08:84:c2:54:48:ba:5c:fd:3f:22:5f:22:14 (RSA)
|   256 a9:a6:86:e8:ec:96:c3:f0:03:cd:16:d5:49:73:d0:82 (ECDSA)
|_  256 22:f6:b5:a6:54:d9:78:7c:26:03:5a:95:f3:f9:df:cd (ED25519)
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: HackIT - Home
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 41.96 seconds

Scan the machine, how many ports are open?

2

What version of Apache is running?

2.4.29

What service is running on port 22?

ssh

Find directories on the web server using the GoBuster tool.

What is the hidden directory?

/panel/

Getting A Shell

First, visit http://IP_ADDR/panel/

The website does not allow uploading files with .php extension.

So I tried some other extension for php files and .phtml seems to be working. So upload a reverse shell file on the form.

Open up a netcat listener on your machine : nc -vlnp 1234

Now, visit http://IP_ADDR/php-rev-shell.phtml

user.txt

Privilege Escalation

Now that we have a shell, let's escalate our privileges to root.

Search for files with SUID permission, which file is weird?

/usr/bin/python

Find the exploit for the binary on GTFObins

root.txt

Last updated