Skip to content
RCE Write-up Intermediate

Deconstructing Legacy: When Outdated Kernels Meet Host Firewall Deadlocks

The target ran an unpatched Windows XP SP3 system with SMB exposed, vulnerable to MS08-067, a remote code execution flaw in the Server service. An attacker could send a crafted RPC request to gain SYSTEM-level shell access without authentication.

Emmanuel Wiseman Follow

Published on emmanuelwiseman.medium.com

Hack The Box’s Legacy is an iconic infrastructure asset featuring a classic legacy Windows architecture. The operational objective of this assessment was to identify remote code execution parameters across network-facing file sharing layers and evaluate legacy operating system kernel protections.

Emmanuel Wiseman, on emmanuelwiseman.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a heap-based buffer overflow in the NetPathCanonicalize function of netapi32.dll, where a malformed path string is not properly size-checked, allowing overwrite of the instruction pointer.

Impact

The attacker could execute arbitrary code with SYSTEM privileges, leading to full system compromise and data exfiltration.

What the attacker needed

Network access to SMB ports 139/445; Target runs unpatched Windows XP SP3; Attacker can receive reverse shell on a high port

The fix

The system should be decommissioned and migrated to a supported Windows Server version, as Windows XP is past end-of-life and cannot be securely patched.

How it was found

  1. Scan the target with Nmap to find open SMB ports and OS version.
  2. Run Nmap SMB vulnerability scripts to confirm MS08-067.
  3. Set up a listener on a high port (e.g., 9001) to catch the reverse shell.
  4. Generate a non-staged shell payload with msfvenom and embed it in a Python exploit script.
  5. Execute the Python script to send the crafted RPC request and trigger the overflow.
  6. Catch the reverse shell and verify SYSTEM privileges.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This is a very old Windows XP machine that had a well-known security hole in how it handled file-sharing requests. An attacker could send a specially crafted message to take full control of the machine without needing any password. The flaw was in a system file that processes network paths, and it allowed the attacker to run their own code as the highest-level user.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Emmanuel Wiseman

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.