Jeeves
https://app.hackthebox.com/machines/114
Difficulty: HARD
Reconnaissance
Nmap
HTTP - Port 80
Enumerating the port 80 you can see that there is askjenkins service.
Here when you search something it throws an error but is an image.
There is just an error.html and nothing else even when you search something.
So, at the first view a think this was a rabbit hole to make us waste our time.
HTTP Jetty - Port 50000
Starting to Enumerate the http ports by fuzzing their url's.
We found something a jenkins server in the port 50000 so, this can be our opportunity to gain a foothold on the machine.
When you enter the askjeeves directory you see that we can edit things here.
Time to exploit this : }
SMB & NetBIOS - Port 445/139
You cannot see any files and vulns here, nothing interesting.
Exploitation
HTTP Jetty - Port 50000
To exploit Jenkins using the script console use the following script and change the variables to your IP and so on.
Remember set your netcat with the specified port first to get the cmd shell.
Here you can see that we gain access to the system.
Privilege escalation
There are 2 different ways to root the machine.
Method 1
The first method is to look for in some directories and you will find a kdbx database so, you can download this to start cracking the database of passwords.
To make the crackeable hash use the following commands
Once you have the password, open the database with keepassxc and use the cracked password.
You'll see different passwords, but the most interesting is the first one, beacuse we have an NTLMv1 hash and we can use it to try pass the hash with the user administrator and others.
Here we try to pass the hash to the use admin in the machine and fortunately is the hash of the user admin.
So, you can gain a shell using psexec to get nt authority privileges.
Method 2
Enumerating the privileges information, we can see that the SeImpersonatePrivilege is enable so, we can exploit this using the juicypotato binary.
Once we download the binary to the machine, I'll start doing a backdoor user and assigning to it administrator privileges.
Now set the administrator group to papishampoo.
After those two commands we need to modify it in the windows registry too using the following.
Now use crackmapexec to see if we have the administrator privileges.
We can that we pwned as well by doing this.
Last updated