πPass the Certificate (ESC8 & ADCS)
π― Overview
Pass the Certificate is an advanced Active Directory attack technique that leverages X.509 certificates to obtain Ticket Granting Tickets (TGTs) and ultimately achieve domain compromise. This attack primarily exploits:
Active Directory Certificate Services (AD CS) vulnerabilities
PKINIT authentication mechanism
Machine account privileges for DCSync
ESC8 NTLM relay attacks against ADCS HTTP endpoints
"Pass-the-Certificate attacks combine ADCS exploitation with Kerberos authentication to achieve domain admin privileges"
π PKINIT Authentication Architecture
Public Key Cryptography for Initial Authentication
PKINIT is an extension of the Kerberos protocol that enables:
X.509 certificate-based authentication
Smart card and certificate logons
Elimination of password-based pre-authentication
Machine account authentication via certificates
Certificate Authentication Flow
Attack Prerequisites
ADCS web enrollment enabled (HTTP endpoint accessible)
Valid domain credentials for NTLM relay coercion
Network access to both CA server and Domain Controller
KerberosAuthentication template (or similar machine template)
ποΈ ESC8 - NTLM Relay to ADCS HTTP Endpoint
ESC8 Attack Overview
ESC8 (Escalation 8) is an NTLM relay attack that:
Targets ADCS HTTP web enrollment endpoint
Relays machine account authentication
Obtains machine certificates for domain-joined computers
Bypasses PKI security through relay attack
Attack Architecture
π ESC8 Attack Execution
Phase 1: Environment Setup
Required Tools Installation
Network Reconnaissance
Phase 2: NTLM Relay Attack Setup
Configure ntlmrelayx Listener
Phase 3: Authentication Coercion
Printer Bug Exploitation
Expected Relay Results
π§ OpenSSL Troubleshooting (Critical)
Common PKCS12 Generation Error
Package Conflict Issues
Fix Method 1: Downgrade pyOpenSSL
Fix Method 2: Ubuntu Package Method (Tested Working)
Fix Method 2.5: Force Installation (If dpkg errors)
Fix Method 3: Virtual Environment
Common Troubleshooting Scenarios
Port Already in Use Error
Printerbug RPC Errors
ntlmrelayx Hanging on "Getting certificate..."
π« PKINITtools Certificate Processing
Environment Setup
Kerberos Configuration
TGT Generation from Certificate
π DCSync Attack with Machine Account
Machine Account Privileges
Machine accounts in Active Directory have:
Replication privileges by default
DCSync capability (DRSUAPI access)
High privileges for domain operations
No interactive logon restrictions
Execute DCSync
Full Domain Dump (Optional)
π Administrative Access via Pass-the-Hash
Evil-WinRM Connection
Post-Exploitation
π― HTB Academy Lab Walkthrough
Lab Environment
Domain: INLANEFREIGHT.LOCAL
Domain Controller: dc01.inlanefreight.local (10.129.234.174)
Certificate Authority: 10.129.234.172
Credentials: wwhite:package5shores_topher1
Target: Administrator's flag
Step-by-Step Execution
1. ESC8 NTLM Relay Setup
2. Authentication Coercion
3. PKINITtools Setup
4. DCSync Administrator
5. Administrator Access
Validation and Verification
Confirm Certificate Generation
Validate TGT Generation
Confirm DCSync Success
π‘οΈ Defense and Detection
Attack Detection
Prevention Strategies
Monitoring Queries
π‘ Key Takeaways
ADCS is high-value target - Machine certificates = domain admin
OpenSSL compatibility critical - Modern Kali has PKCS12 issues
Machine accounts have DCSync - No privilege escalation needed
NTLM relay still effective - Even in modern environments
Certificate authentication bypasses - Many traditional controls
PKINITtools essential - Converts certificates to Kerberos tickets
Virtual environments solve - Many compatibility issues
HTTPS vs HTTP matters - HTTP ADCS endpoints vulnerable
π Alternative Attack Vectors
Shadow Credentials
Other ESC Techniques
π Quick Reference - ESC8 Attack Chain
Complete Attack Commands
Emergency OpenSSL Fix
π― HTB Academy Answer Key
Attack Type: ESC8 NTLM Relay to ADCS
Certificate Generated: DC01$.pfx (machine certificate)
Administrator Hash: fd02e525dd676fd8ca04e200d265f20c
Final Flag: a1fc497a8433f5a1b4c18274019a2cdb
Critical Fix: pyOpenSSL downgrade to version 22.1.0
Last updated