Nmap scan report for10.10.10.63Host is up (0.35s latency).PORTSTATESERVICEVERSION80/tcp open http MicrosoftIIS httpd 10.0|_http-title:AskJeeves|_http-server-header: Microsoft-IIS/10.0| http-methods:|_Potentially risky methods:TRACE135/tcp open msrpc MicrosoftWindowsRPC445/tcp open microsoft-ds Microsoft Windows 7-10 microsoft-ds (workgroup: WORKGROUP)50000/tcp open http Jetty 9.4.z-SNAPSHOT|_http-title: Error 404NotFound|_http-server-header:Jetty(9.4.z-SNAPSHOT)ServiceInfo: Host: JEEVES; OS: Windows; CPE: cpe:/o:microsoft:windowsHost script results:| smb2-security-mode:|311:|_Message signing enabled but not required| smb2-time:| date:2023-03-26T17:29:27|_start_date:2023-03-26T17:21:07| smb-security-mode:| account_used: guest| authentication_level: user| challenge_response: supported|_message_signing:disabled (dangerous, but default)|_clock-skew: mean: 40s, deviation: 0s, median: 40s
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.