Legacy

Executive Summary

Legacy is a fairly straightforward beginner-level machine that demonstrates the potential security risks of SMB on Windows. Only one publicly available exploit is required to obtain administrator access.

Machine Information

  • Machine Name: Legacy

  • OS: Windows

  • Difficulty: Easy

  • IP Address: 10.129.3.61

  • Date Completed: 05/01/2025

Reconnaissance

Port Scanning

Document nmap scans and other reconnaissance activities.

nmap -sCV -oA nmap/initial 10.129.3.61
Host: 10.129.3.61 ()	Ports: 
                        135/open/tcp//msrpc//Microsoft Windows RPC/
                        139/open/tcp//netbios-ssn//Microsoft Windows netbios-ssn/
                        445/open/tcp//microsoft-ds//Windows XP microsoft-ds/
Host script results:
| smb-os-discovery: 
|   OS: Windows XP (Windows 2000 LAN Manager)
|   OS CPE: cpe:/o:microsoft:windows_xp::-
|   Computer name: legacy
|   NetBIOS computer name: LEGACY\\x00
|   Workgroup: HTB\\x00
|_  System time: 2026-01-10T10:06:46+02:00
|_smb2-time: Protocol negotiation failed (SMB2)
|_smb2-security-mode: Couldn't establish a SMBv2 connection.
| p2p-conficker: 
|   Checking for Conficker.C or higher...
|   Check 1 (port 44351/tcp): CLEAN (Couldn't connect)
|   Check 2 (port 62500/tcp): CLEAN (Couldn't connect)
|   Check 3 (port 29483/udp): CLEAN (Failed to receive data)
|   Check 4 (port 35958/udp): CLEAN (Failed to receive data)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| nbstat: NetBIOS name: nil, NetBIOS user: <unknown>, NetBIOS MAC: 00:50:56:b9:ed:3b (VMware)
| Names:
|   
| Statistics:
|   00:50:56:b9:ed:3b:00:00:00:00:00:00:00:00:00:00:00
|   00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
|_  00:00:00:00:00:00:00:00:00:00:00:00:00:00
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
|_clock-skew: mean: 5d00h57m51s, deviation: 1h24m51s, median: 4d23h57m51s

Open Ports

Port

Service

135

Microsoft Windows RPC

139

Microsoft Windows netbios-ssn

445

Windows XP microsoft-ds

Service Enumeration

It can be seen that SMBc2 is running on the target machine. So, we can use nmap scripts to determine whether the target is vulnerable.

Initial Access

Vulnerability Identified

The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2, Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary code through a crafted RPC request that triggers an overflow during path canonicalization.

  • CVE/Vulnerability: CVE-2008-4250

  • Attack Vector: RPC request

  • Exploitation Method: execute arbitrary code

Exploitation Steps

  1. Running using Rapid7 (metasploit) with windows/smb/ms08_067_netapi

  2. Set RHOST and LHOST to respective value

  3. Run the exploit

Proof of Concept

User Flag

Document how user access was obtained and the user flag captured.

  • Username: john

  • Flag Location:c:/Documents and Settings/john/desktop/user.txt

  • Flag: e69af0e4f443de7e36876fda4ec7644f

Root Flag

Document root access achievement.

  • Flag Location: c:/Documents and Settings/administrator/desktop/root.txt

  • Flag: 993442d258b0e0ec917cae9e695d5713

Key Learnings

Technical Skills

  • Legacy windows are exposed to a critical vulnerability

References

Last updated