This machine is interesting to me because of the way we can do privilege escalation here.
As always let’s start with nmap.
nmap -A -p- 10.10.10.63
Let’s brute force directories on port 50000
We found /askjeeves, so let’s navigate to ` http://10.10.10.63:50000/askjeeves/`
This is Jenkins.
Some googling and we figure out that it is possible to create reverse shell with the following code
We just need to go to http://10.10.10.63:50000/askjeeves/script paste our code and click run.
Start listener:
nc -nvlp 4444
And we got a shell
We can grab a user.txt now.
But first we need to navigate to kohsuke user folder.
Ok, I know there are multiple ways to do privilege escalation on this machine. But as you can tell from the title we will do RotenPotato here.
Let’s do systeminfo
Check privileges
whoami /priv
SeImpersonatePrivilege tells us we can probably use Roten Potato here.
For this we need to generate a reverse shell, but since we will probably have AV on the machine we need to encode it. For this we will use Phantom Evasion, whic can be found here https://github.com/oddcod3/Phantom-Evasion
Do: git clone https://github.com/oddcod3/Phantom-Evasion.git got to Phantom-Evasion folder and run it python phantom-evasion.py
Select following options:
Windows modules
Powershell / Wine-pyinstaller
Windows Powershell Script Dropper
enter
Msfvenom powershell payload
Put your IP and Port you will be listening on.
Choose name for you shell file
multi processes: n
strip executable: n
sign executable: n
Copy created file to our jeeves folder.
Now inside jeeves folder let’s start SimpleHTTPServer on port 80
python -m SimpleHTTPServer 80
Clone repo and copy MSFRotenPotato.exe to our folder and name it rot.exe
https://github.com/decoder-it/lonelypotato