写在前面:合法学习边界
Metasploit 只在授权测试环境使用。对非授权目标进行攻击可能触犯法律。

1
| ① 信息收集 → ② 选择 EXP → ③ 配置参数 → ④ 执行攻击 → ⑤ 获取会话
|
二、常用命令
1
2
3
4
5
6
7
| msfconsole -q # 启动
search tomcat # 搜索漏洞
use exploit/... # 选择 EXP
set RHOSTS 192.168.1.1 # 设置目标
set PAYLOAD ... # 设置载荷
exploit # 执行
sessions -l # 查看会话
|
三、Meterpreter 常用命令
1
2
3
4
| sysinfo · getsystem · upload · download
portfwd add -l 8080 -p 80
run autoroute -s 192.168.1.0/24
run persistence -U -i 5 -p 4444
|
四、小结
Metasploit 是渗透测试核心框架。掌握 search/use/set/exploit 四步曲 + Meterpreter 会话管理,可完成从漏洞发现到权限维持的完整攻击链。