DEV Community

RICK SANCHEZ
RICK SANCHEZ

Posted on

Vulnhub Harry Potter Aragog - Walkthrough

Import the Vulnerable machine in your virtual box. Change the Network settings to bridged adapter so that you can access the machine.

Let's get started !

Image description

Inital Scanning

Nmap Scan

Image description

We can see that our machine is hosting and the ssh port is open. Let's check out the website.

Image description

Dirbuster

Use dirbuster to find the directories

Image description

We found '/blog' directory

Image description

Note
Configue the /etc/hosts to access other hyperlinks

By Looking at footer of the website we are able to confirm that it is a wordpress website and we can confirm it using wappalyzer

Image description

Metasploit

Scan for vulnerability

Image description

we use this module in metasploit to scan for the vulnerability.

Image description

we found a exploit on msf

Image description

run the exploit with the following options

Image description

Run the exploit

Image description

we got the meterpreter shell.

In the home directory we can see two folders

Image description

Inside hagrid's folder we found the First Horcrux

Image description

Here is the first Horcrux

horcrux_{MTogUmlkRGxFJ3MgRGlBcnkgZEVzdHJvWWVkIEJ5IGhhUnJ5IGluIGNoYU1iRXIgb2YgU2VDcmV0cw==}

Now we need to privelate the user permission

Image description

linpeas

Upload the lipeas.sh to the server

Image description

run linpeas

Image description

We found the DB login details

Image description

Login to the database with the credentials

Image description

we got the user password hash.

Image description

Crack the hash with john the ripper.

Image description

ssh to hagrid98 with the password

Image description

Now its time to escalate to the root user.

Use pspy to find the process running in the backgound here is a guide on how to get started with pspy

https://vk9-sec.com/how-to-enumerate-services-in-use-with-pspy/

we found that backup.sh is running in background with interval and it is running as the root user.

Image description

Re-write the .backup.sh with a reverse shell.

https://www.revshells.com

Image description

run a listener on netcat and after sometime you will get the root shell

Image description

The second Horcrux

horcrux_{MjogbWFSdm9MbyBHYVVudCdzIHJpTmcgZGVTdHJPeWVkIGJZIERVbWJsZWRPcmU=}

Image description

Decode the Horcrux with base64:

1: RidDlE's DiAry dEstroYed By haRry in chaMbEr of SeCrets
2: maRvoLo GaUnt's riNg deStrOyed bY DUmbledOre

Top comments (0)