This box is from VulnHub and is on the TjNUll list for OSCP preparation. Controlling the whole VM included the following steps:
- Enumeration of port 80 and 8008
- Finding hidden directory from HTML comments
- Enumeration and password bruteforce using WP-Scan
- ZIP password cracking
- Gathering informations along the way
I am going to start with the initial Nmap scan. I use the autorecon script. The initial Nmap scan shows 3 open ports.
Nmap scan report for 10.0.0.9
Host is up, received arp-response (0.00040s latency).
Scanned at 2022-03-31 19:49:26 EDT for 9s
Not shown: 997 closed tcp ports (reset)
PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 64 OpenSSH 7.2p2 Ubuntu 4ubuntu1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 a0:ca:62:ce:f6:7e:ae:8b:62:de:0b:db:21:3f:b0:d6 (RSA)
| ssh-rsa
80/tcp open http syn-ack ttl 64 Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Welcome to Callahan Auto
| http-robots.txt: 4 disallowed entries
| /6packsofb...soda /lukeiamyourfather
|_/lookalivelowbridge /flag-numero-uno.txt
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.18 (Ubuntu)
8008/tcp open http syn-ack ttl 64 Apache httpd 2.4.18 ((Ubuntu))
|_http-title: KEEP OUT
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.18 (Ubuntu)
Uptime guess: 198.838 days (since Mon Sep 13 23:42:33 2021)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=258 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE
HOP RTT ADDRESS
1 0.40 ms 10.0.0.9
Looking at the webpage and viewing its source page, I found the chat between Nick and Richard. They mentioned the backup file in another directory and the name of the directory is the name of the place where Richard and Tom Jr had a big fight. Following the youtube video. I can see the name of the place is prehistoricforest.
And I found the WordPress website located at /prehistoricforest.
After the wpscan, I found the username list (ignored the names found from passive detection) and started wpscan to Bruteforce the login page with those usernames.
And boom got a hit!
I found a draft post inside the tom account and it has a hint for the password in it. Looks like it means the ssh password.
After trying a few possible combinations it didn’t work. There is a password-protected post in WordPress homepage.
Reading the above post from Tom Jr, the hint for password lies in the /richard directory.
There is an image in that directory. Downloading that image and running ExifTool, I can see the password hash.
Cracking the password using crackstation.net, the password is spanky.
Reading the post now, it has the rant from the parting worker and a weird setup about the FTP.
The most easily guessable password is the username itself. And viola it is right. I was in after waiting for a few min for the FTP port to open.
Readme file from FTP gave us more hints.
Now going to the NickIzL33t. I found this screen and no matter what I try couldn’t move ahead. Looking after hints its turns out you can only access the page from iOS Safari (Steve Jobs).
Changing the user-agent we are able to see the page now.
I tried some directory wordlist to find the hidden directory but no luck. Then I tried the rockyou.txt list and was able to find the directory. I used the following command.
gobuster dir -u http://10.0.0.9:8008/NickIzL33t/ -a "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Snapchat/10.77.5.59 (like Safari/604.1)" -x html -w /usr/share/wordlists/rockyou.txt -t 100 --no-error
Few more hints.
Here is the hint for the BigTom Password.
So lets create a python script to generate a password according to the requirements. It was year 1995 when Tommy Boy was out in ttheature.
import string
from sys import argv
openfile = open(argv[1],'a')
numbers = list(range(10))
uppercase = string.ascii_uppercase
lowercase = string.ascii_lowercase
list_symbols= '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~)'
list_of_symbols = []
for symbols in list_symbols:
d.append(list_of_symbols)
for uppercase_letter in uppercase:
for numbers_one in numbers:
for numbers_two in numbers:
for lower_letter in lowercase:
for lower_letter_second in lowercase:
for symb in list_of_symbols:
pass1 = "bev" + str(uppercase_letter) + str(numbers_one) + str(numbers_two) + str(lower_letter) + str(lower_letter_second) + str(symb) + str(1995) + "\n"
# pass2 = al + str(num) + "Flesh\n"
# pass3 = al + str(num) + "Curtains\n"
openfile.write(pass1)
# openfile.write(pass2)
# openfile.write(pass3)
openfile.close()
And run john, we were able to crack the password.
The password is bevH00tr$1995.
Now extracting that zip we find another crucial clue for tom password.
We had already found the last part of the password above. ( which was 1938!!). So the username and password for Callahan Auto Server is bigtommysenior:fatguyinalittlecoat1938!!
Now, I can ssh into the system.
Now I renamed the callahanbak.bak file to index.html and copied it to /var/www/html/ and the website is back up.
There is a zip file in the home directory but I couldn’t crack it. Let’s look for priv escalation. Also, found a .5.txt file in the root directory that can only be read by www-data. Now running the linpeas script, I can see one interesting writable file.
This might be the same directory where Nick used to upload secret stuff. After uploading the PHP reverseshell. We get into the system with www-data.
Now let’s read that file content.
And the box is done. I thought we will have root access but no that’s the scope of this box. It helped to gain more enumeration skills.