Tuesday, July 30, 2019



- Layout for this exercise:


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


- Jeeves's IP is

- Scanning with Nmap:

- Connecting to the web server on port 80:

- Connecting to the web server on port 50000:

- Applying dirbuster to both web servers we find the folder askjeeves on port 50000:

- Browsing /askjeeves we find a Jenkins server.

- Jenkins is an open source automation server which enables developers around the world to reliably build, test, and deploy their software:

- Going to Manage Jenkins:

- Checking the Script Console there is available a Groovy Script that allows to write and run code on the server:


3.1 - Getting a remote reverse shell

- The Apache Groovy language is a Java-syntax-compatible object-oriented programming language that can be used as both a programming and scripting language for the Java Platform:

- There are multiple available scripts for getting a reverse shell, for instance this one:

- Just setting a Netcat listener session, adapting the script to our needs and running it:

- The consequence is a remote reverse shell:

- The user is kohsuke:

- However it seems that we cannot get out of the current folder due to lack of enough administrative privileges:

3.2 - Meterpreter session with web_delivery

- Let's create a web_delivery exploit on Kali with the purpose of getting a Meterpreter session:

- Setting all options and running the web_delivery exploit a Powershell script is created:

- Now, the Powershell script must be run on the remote reverse shell from Jeeves:

- As a consequence a Meterpreter session is opened:

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


- RottenPotato is a local privilege escalation binary from service account to System:

- Downloading rottenpotato.exe to Kali:

- Getting as many system privilege as possible with getprivs:

- Uploading rottenpotato.exe to Jeeves:

- Loading the incognito extension:

- Executing rottenpotato.exe:

- Impersonating as System:

- Now we've got System privileges:

- Spawning a shell:


- Reading user.txt:


- Going to the Administrator's Desktop we find hm.txt:

Alternate Data Stream (ADS) is the ability of an NTFS file system (the main file system format in Windows) to store different streams of data, in addition to the default stream which is normally used for a file.

- The two stream types that are commonly used directly by Windows programs are data ($DATA) and index ($INDEX_ALLOCATION).

- The relevant attribute for our scope is the $DATA attribute, which is used to store the data streams of a file.

- In the past, it was common to store a malicious payload within an ADS of a legitimate file. But today, many today security solutions will detect and scan ADSs’.

- For further information:

-  The option dir /R calls FindFirstStreamW and FindNextStreamW on each file or directory in a listing in order to list its $DATA streams: