Thursday, January 10, 2019



- Layout for this exercise:


- The goal for this exercise is to develop a hacking process for the vulnerable machine Devel, what is a retired machine from the Hack The Box pentesting platform:


- Devel's IP is

- Scanning with Nmap:

- Scanning deeper port 21 we discover that Devel allows FTP anonymous connections:

- Checking the FTP server with the browser:


- Because the FTP server allows anonymous connections we can upload a malicious reverse shell file from our attacking machine.

- Creating a reverse Meterpreter exploit myshell.aspx with Msfvenom:

- Connecting with FTP:

- Transferring myshell.aspx:

- The transfer is successful:

- Setting a Meterpreter listener:

- Running myshell.aspx:

- As a consequence of running the exploit a successful Meterpreter session is achieved:

- Getting information about the system, current user and folder:


- When trying to browse around the system the access to Users' folders is denied:

- So what we need is to perform a Privilege Escalation process.

- Let's follow two ways to achieve that goal.

4.1 - MS11-046 vulnerability

- Getting a shell:

- systeminfo shows that Devel has never been patched:

- Looking for an exploit to take advantange of that vulnerability:

- Dowloading the exploit 40564.c:

- Following instructions to cross-compile the exploit:

- In case mingw-w64 is not already installed:

- Cross-compiling:

- Transferring from Kali to Devel using the FTP service:

- The transfer is successful:

- Trying to run 40564.exe locally at Devel, however it fails:

- Why? Because the FTP transfer from Kali to Devel was performed into ASCII mode (by default), not  into Binary mode. For further information:

- Now, let's rename the file and transfer it using the Binary option:

- Running 40564_binary.exe the Privilege Escalation is finally successful:

4.2 - MS10_015 vulnerability

- Backgrounding the Meterpreter session:

- Searching for a exploit with local_exploit_suggester and setting Session 1:

- This one seems interesting:

- This exploit is based on the Microsoft MS10_015 vulnerability:

- Using this exploit, setting Session 1 as parameter and running:

- However it doesn't work, and the reason is clear, it has taken by default LHOST what is not the IP used by Kali to connect to the Hack the Box VPN.

- Changing LHOST to now it works, and  we get a 2nd Meterpreter session:

- Eventually the user has got System privileges:


- Reading the 1st flag user.txt.txt:

- Decrypting user.txt.txt:

 - Reading the 2nd flag root.txt.txt:

- Decrypting root.txt.txt: