Skip to main content

HTB - Jeeves

alt

Basic Nmap scan

Nmap Command: nmap -Pn -n -sC -sV -oA scan_boxs/jeeves/nmap/10.10.10.63-d-scan 10.10.10.63
Nmap scan report for 10.10.10.63
Host is up (0.15s latency).
Not shown: 996 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: Ask Jeeves
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
135/tcp open msrpc Microsoft Windows RPC
445/tcp open microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP)
50000/tcp open http Jetty 9.4.z-SNAPSHOT
|_http-title: Error 404 Not Found
|_http-server-header: Jetty(9.4.z-SNAPSHOT)
Service Info: Host: JEEVES; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode:
| 3.1.1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2022-08-22T07:03:41
|_ start_date: 2022-08-22T06:59:26
| smb-security-mode:
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
|_clock-skew: mean: 4h59m58s, deviation: 0s, median: 4h59m58s

Open ports : 80,135,445,50000

PORTSERVICEPRODUCTVERSIONEXTRAINFO
80httpMicrosoft IIS httpd10.0
135msrpcMicrosoft Windows RPC
445microsoft-dsMicrosoft Windows 7 - 10 microsoft-dsworkgroup: WORKGROUP
50000httpJetty9.4.z-SNAPSHOT

port 80

Enumerating port 80 landed on a page
alt

Attempting to a search a word testing landed on an error page. This could provide us with wealth of information.
alt

alt

alt

But looks like its just pointing us to an error page which has a same error image file. This could be miss leading or maybe its giving us hint that the machine is running Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) lets dig in deeper gobuster and nikto

port 50000

Not much info on this port
alt

gobuster found something found something interesting.

http://10.10.10.63:50000/askjeeves            (Status: 302) [Size: 0] [--> http://10.10.10.63:50000/askjeeves/]

We have jenkins running on the machine.

alt

Looks like jenkins version 2.87 is running.

Exploit

Exploit Junkins

To exploit Junkins there are two way to exploit

  • Create a project and setup build option to execute shell. This option was not successful.
  • The second option is through Script Console and use groovy script to create reverse shell.

alt

alt

Accessing Script Console.
alt

Reverse shell

groovy reverse shell

Generating Groovy reverse shell script:
alt

Executing the groovy reverse shell script on Jenkins script console.
alt

Catching reverse shell with ncat.
alt

User Flag

alt

Privilege escalation

With the current reverse shell has limits on the access.
alt

lets get a powershell reverse shell bypassing profile.

alt

Executing the powershell reverse shell script on the shell we already have.
alt

Catching the reverse shell on port 9002 with ncat.
alt

As we can see we can navigate the internal folder and access kohsuke user director.

Upon exploring further into user folder we see and interesting file CEH.kdbx and looks like a keepass file which is a password manager. This could have critical details and access to a potential user.

Copying the CEH.kdbx file to our local machine.
alt

alt

Checking file type
alt

Cracking keepass

alt

alt

Cracked file with john
alt

Open the CEH.kdbx file with keepasse tool
alt

alt

Upon exploring Backup stuff looks interesting.

alt

Exploit

aad3b435b51404eeaad3b435b51404ee:e0fb1fb85756c24235ff238cbe81fe00

Using psexec.py to connect to machine

alt

Looks no root.txt file in here
alt

Alternative data stream

Looking for alternative stream. dir /r

alt

root flag

Read alternative data stream from the file ADS data.

powershell.exe -c "Get-Content hm.txt -stream root.txt"

alt