Proof-of-Concept Exploit: EternalBlue (MS17-010)
1. Introduction
EternalBlue (MS17-010) is a critical Windows SMBv1 vulnerability discovered in 2017. It was exploited by the WannaCry ransomware and other malware attacks. This Proof-of-Concept (PoC) demonstrates how the exploit works for educational and ethical testing purposes only.
2. Vulnerability Background
CVE ID:
CVE-2017-0144
Affected Systems:
Windows XP, Windows 7, Windows 8.1, Windows Server 2003, 2008, 2012
Vulnerable Service: SMBv1 (Server Message Block Protocol)
Exploit Type: Remote Code Execution (RCE)
Impact: Allows an attacker to execute arbitrary code remotely without authentication.
How It Works
EternalBlue exploits a flaw in how SMBv1 handles specially crafted packets.
The vulnerability allows an attacker to execute code at SYSTEM level privileges, gaining full control of the target machine.
Microsoft patched this vulnerability in March 2017 with security update MS17-010.
3. Setting Up the Exploit (Kali Linux + Metasploit)
Step 1: Identify a Vulnerable Target
Scan the network for SMB vulnerabilities:
If the scan returns "VULNERABLE", the target is exploitable.
Step 2: Launch the EternalBlue Exploit in Metasploit
Open Metasploit:
Select the EternalBlue module:
Set target details:
Run the exploit:
Note: If successful, a Meterpreter session is opened, granting full control over the target.
4. Post-Exploitation
After gaining access, an attacker can:
List system information:
sysinfo
Capture screenshots:
screenshot
Dump passwords:
hashdump
Enable a persistent backdoor
5. Mitigation & Prevention
Microsoft’s Patch
Apply MS17-010 update from Windows Update.
Disable SMBv1
Run the following PowerShell command to disable SMBv1:
Network Security Best Practices
Use firewalls to block port 445 (SMB traffic) from untrusted sources.
Deploy endpoint security tools to detect SMB exploits.
Monitor network traffic for unusual SMB activity.
6. Ethical Considerations
Unauthorized exploitation is illegal. Always obtain explicit permission before testing systems.