Mustacchio

Date: 14, June, 2021

Author: Dhilip Sanjay S


Click Here to go to the TryHackMe room.

Enumeration

Nmap

$ nmap -sC -sV -p- 10.10.230.120 -oN nmap.out
Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-14 14:57 IST
Nmap scan report for 10.10.230.120
Host is up (0.16s latency).
Not shown: 65532 filtered ports
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 58:1b:0c:0f:fa:cf:05:be:4c:c0:7a:f1:f1:88:61:1c (RSA)
|   256 3c:fc:e8:a3:7e:03:9a:30:2c:77:e0:0a:1c:e4:52:e6 (ECDSA)
|_  256 9d:59:c6:c7:79:c5:54:c4:1d:aa:e4:d1:84:71:01:92 (ED25519)
80/tcp   open  http    Apache httpd 2.4.18 ((Ubuntu))
| http-robots.txt: 1 disallowed entry 
|_/
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Mustacchio | Home
8765/tcp open  http    nginx 1.10.3 (Ubuntu)
|_http-server-header: nginx/1.10.3 (Ubuntu)
|_http-title: Mustacchio | Login
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 1269.52 seconds

Gobuster

Port 80

Mustacchio - Home

Users.bak

Mustacchio - Users.bak
  • It's an sqlite database backup

Enumerating Backup file

  • Using sqlite, we can find the admin's password:

Cracking Admin's hash

  • Use john to crack the admin's hash

  • May be this is the password for the admin panel at Port 8765


Admin Panel

Port 8765

Mustacchio - Admin

Don't Forget

  • There was a backup file at /auth/dontforget.bak

  • Contents of that file:

  • Waste of time!!!

Add Comment

  • The admin panel comment box was accepting only XML

Mustacchio - Add Comment

XXE

  • Try a basic XXE payload:

  • The Output of the XXE:

Mustacchio - XXE

Initial Access

Barry's Private Key

  • In the home page of the admin panel, there was a comment:

  • So, try to read Barry's Private Key using XXE:

  • And we get the Private key successfully.

Passphrase

  • Save the id_rsa, change the permissions.

  • But we need the passphrase!

  • Use john to find the passphrase:

User Flag


Privilege Escalation

Check SUID binaries

Live Log

  • The shared object can be used for Privilege escalation!

  • But unfortunately, gcc was not installed on the machine.

  • The other binary being used here is tail.

Tail

  • Change the path variable.

  • Create a tail executable in /home/barry which opens /bin/bash:

Root Flag


Last updated