HTB: Bounty
| ターゲット // Bounty | |
|---|---|
| Platform | HTB |
| OS | Windows |
| Difficulty | Easy |
| IP | 10.129.X.X |
Enumeration#
Nmap#
▶ Nmap output
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 7.5
|_http-title: Bounty
|_http-server-header: Microsoft-IIS/7.5
| http-methods:
| Supported Methods: OPTIONS TRACE GET HEAD POST
|_ Potentially risky methods: TRACE
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Port 80 - IIS 7.5#
Directory fuzzing reveals two interesting hits:
/transfer.aspx (Status: 200) [Size: 941]
/uploadedfiles/ (accessible)
transfer.aspx is a file upload form, and uploaded files land in /uploadedfiles/. The question is – what file types are allowed?
Foothold#
web.config Upload RCE#
IIS 7.5 has a known trick: if you can upload a web.config file, you can achieve code execution through embedded ASP code. The upload form accepts .config files.
First, confirm RCE with a ping callback:
| |
Upload, browse to /uploadedfiles/web.config, catch the ping on tcpdump – confirmed RCE.
Reverse Shell#
Swap the ping payload for a PowerShell reverse shell:
| |
Shell as IIS apppool user.
Privilege Escalation#
SeImpersonate → Juicy Potato#
The service account has SeImpersonatePrivilege. This is a direct path to SYSTEM via Juicy Potato (MS16-075 reflection).
Spawned a Meterpreter session and used windows/local/ms16_075_reflection_juicy for a clean escalation to SYSTEM.
Proof#
whoami
nt authority\system
Key Takeaways#
- IIS 7.x allows code execution through
web.configuploads when the handler is misconfigured – always test.configas an upload extension - The
/uploadedfiles/directory being accessible is a dead giveaway for upload-based attacks SeImpersonatePrivilegeon Windows service accounts is almost always exploitable via potato attacks