Home Project Archive Internship Download CV LinkedIn
Refracted Security · Feb – May 2026

AD CS Security
Research Internship

A 14-week offensive security research internship at Refracted Security — producing a complete Active Directory Certificate Services vulnerability catalog (ESC1–ESC16), custom stealth-focused enumeration tooling in PowerShell and Python, a detection gap analysis using Wazuh and Sysmon, and an end-to-end cross-domain trust exploitation case study.

Company
Refracted Security
Duration
14 weeks
Focus
AD CS / Red Team
ESC coverage
ESC1 – ESC16
File type Research internship
Primary output AD CS knowledge base
Tooling PowerShell + Python
Detection stack Wazuh + Sysmon
Downloads

Internship documents.

Official academic documents produced for Thomas More as part of the internship programme, placed here for quick access.

Academic Document
Realization Document

Full technical write-up of the internship assignment — AD CS research, tooling development, monitoring analysis, and cross-domain trust case study. 32 pages.

Academic Document
Project Plan

Initial project plan submitted at the start of the internship — scope, objectives, deliverables, phases, and risk analysis for the AD CS security research assignment.

Academic Document
Personal Reflection

Personal reflection document covering the internship period — learning outcomes, challenges, and professional development.

Documentation Bundle
All Documentation ZIP

Download bundle containing the documentation files currently included in the project.

Context

Why AD CS, and why Refracted.

The company

Refracted is a technical cybersecurity firm specializing in red teaming, OSINT, penetration testing, and incident response. Their team of certified professionals focuses on identifying what is truly at risk — not following trends. One of the few organizations in Belgium offering specialized Red Team internships.

Their "spectrum" model integrates multiple security color teams into a unified defense posture — Red, Blue, Yellow, and everything between. The name reflects this: security broken into its component wavelengths, then unified.

Why this project

Refracted regularly encounters AD CS in client environments during pentests. The problem: AD CS knowledge was fragmented across external blogs, research papers, and tooling documentation — no internal structured reference for consultants during live engagements.

The project's value proposition was clear: build the internal knowledge base. Research ESC1–ESC16 systematically, reproduce each attack path in a lab, develop stealth-focused tooling, and evaluate what a basic SOC actually sees during these attacks.

Mentor

Yannick Hendrickx — internship mentor at Refracted — provided technical guidance throughout and the freedom to shape the direction of the research. High-level discussions on AD and Red Team methodology were central to the project's development. The autonomous scope, with intentional flexibility to evolve the assignment based on findings, was a deliberate design choice.

Project Structure

Three parallel workstreams.

The assignment was executed in three concurrent phases, each feeding the others — research informed tooling, tooling validated research, and detection analysis evaluated both.

01 — Research
Vulnerability Catalog
Deep technical analysis of all AD CS misconfigurations — ESC1 through ESC16 — including attack logic, exploitation path, detection considerations, and mitigations. Built from scratch using primary sources, not aggregated content.
02 — Tooling
Stealth Enumeration Scripts
Custom PowerShell (internal domain perspective) and Python (external/non-joined perspective) tools that enumerate AD CS misconfigurations with significantly lower LDAP footprint than public tools like Certipy. Server-side filtering, targeted queries only.
03 — Detection
SOC Visibility Analysis
Wazuh + Sysmon monitoring stack built from scratch on the lab. Custom detection rules developed, telemetry compared between public tools and the custom scripts. Primary finding: the detection gap is larger than expected even with a dedicated SIEM.
Vulnerability Research

AD CS attack surface: ESC1 – ESC16.

AD CS vulnerabilities generally fall into three structural categories. Understanding which category a given ESC falls into shapes the attack approach, the tools required, and the detection surface.

For each ESC, the research covered: core attack logic, required conditions (template attributes, ACL state, protocol exposure), exploitation walkthrough, and mitigation controls. The full technical documentation was delivered to Refracted's internal knowledge base.

Template Misconfigurations
Flaws in certificate template definitions — SAN injection, permissive EKU, requester agent abuse. ESC1, ESC2, ESC3, ESC9, ESC10, ESC15.
Access Control Issues
Weak ACLs on templates or the CA itself. ESC4, ESC5, ESC7, ESC12, ESC13, ESC14.
Protocol & Mapping Flaws
NTLM relay to enrollment endpoints, certificate-to-account mapping weaknesses, SID extension suppression. ESC6, ESC8, ESC11, ESC16.
ESC1
SAN Misconfiguration
Requester-defined SAN with auth EKU — embed any UPN to impersonate privileged users via PKINIT.
ESC2
Any Purpose EKU
Overly broad EKU allows unintended authentication use of certificates not designed for it.
ESC3
Request Agent Abuse
Certificate Request Agent EKU allows enrollment on behalf of another principal.
ESC4
Weak Template ACL
Write permissions on a template allow modification of its attributes to introduce ESC1-style conditions.
ESC5
PKI Infrastructure ACL
Weak ACLs on PKI objects beyond templates — RPC/DCOM enrollment endpoints, CA containers.
ESC6
CA-Level SAN Injection
EDITF_ATTRIBUTESUBJECTALTNAME2 flag allows SAN specification in any certificate request to this CA.
ESC7
CA Access Control
ManageCA rights allow enabling dangerous flags (e.g., EDITF_ATTRIBUTESUBJECTALTNAME2) on the CA itself.
ESC8
NTLM Relay to Web Enrollment
Coerce DC authentication, relay to HTTP enrollment endpoint, obtain DC certificate. Works cross-forest.
ESC9
No Security Extension
Templates lacking szOID_NTDS_CA_SECURITY_EXT allow SID mapping bypass — shadow credential abuse path.
ESC10
Weak Cert-to-Account Mapping
Registry key weakening of certificate mapping enforcement enables account impersonation via PKINIT.
ESC11
NTLM Relay to RPC
NTLM relay targeting the RPC enrollment interface (ICertPassage) rather than HTTP Web Enrollment.
ESC12
CA Private Key Provider
Abuse of custom KSP (Key Storage Provider) configurations to extract or misuse CA private key material.
ESC13
Policy OID Group Linkage
Issuance policy OID linked to a universal group — cert auth grants the group's memberships. Used on HTB Ping.
ESC14
Explicit Mapping Abuse
Insecurely configured explicit certificate-to-account mappings in AD allow authentication as another identity.
ESC15
Application Policy Injection
EKUwu — arbitrary application policies embedded in certificates permit privileged authentication behavior.
ESC16
SID Extension Suppression
CA configured to omit SID security extensions — re-enables SAN-based identity spoofing despite modern hardening.
Custom Tooling

Stealth-focused enumeration framework.

Public tools like Certipy are noisy because they retrieve and analyze all certificate templates client-side. The custom scripts delegate filtering to the Domain Controller via targeted LDAP queries — reducing observable events to near zero under realistic monitoring conditions.

PowerShell
Internal Domain Perspective
Domain-joined host · Native AD modules
  • Targeted LDAP queries using native AD modules — no external binaries, lower process creation telemetry
  • Server-side attribute filtering for vulnerable conditions (ESC1 ENROLLEE_SUPPLIES_SUBJECT, ESC3 Request Agent EKU, ESC7 ManageCA bit)
  • Enrollment ACL evaluation per template — identifies Authenticated Users or broad group enrollment rights
  • ENROLL_GUID value checking and Remote Registry fallback via RemoteRegistry service startup
  • Read-only — no certificate requests, no template modifications, no CA interaction beyond enumeration
  • Benchmarked against Certipy: generates zero alertable Event ID 1644 entries under tested monitoring conditions
Python
External / Non-Joined Perspective
Kali Linux · Compromised credentials only
  • Operates without domain-joined status — only a compromised username and password required
  • Interacts via RPC/LDAP using Impacket for protocol-level AD access from non-Windows hosts
  • Replicates the PowerShell module's targeted query logic in a cross-platform implementation
  • Models the realistic initial-access scenario: attacker has credentials but no foothold on a domain-joined machine
  • Source code retained by Refracted Security as internal tooling — high-level design documented here
Custom script — targeted ESC1 LDAP filter (concept)
# Standard noisy approach — retrieves ALL templates, filters client-side
# Get-ADObject -SearchBase "CN=Certificate Templates,..." -Filter *

# Targeted approach — LDAP filter handles matching server-side
# Only templates with ENROLLEE_SUPPLIES_SUBJECT + auth EKU are returned
# Result: single short-lived LDAP query, <5ms, no alertable 1644 event
Get-ADObject -SearchBase "CN=Certificate Templates,CN=Public Key Services,..." `
  -LDAPFilter "(&(objectClass=pKICertificateTemplate)(msPKI-Certificate-Name-Flag:1.2.840.113556.1.4.804:=1)(|(pKIExtendedKeyUsage=1.3.6.1.5.5.7.3.2)(pKIExtendedKeyUsage=1.3.6.1.4.1.311.20.2.2)))" `
  -Properties 'msPKI-Certificate-Name-Flag','pKIExtendedKeyUsage','nTSecurityDescriptor'

# → Zero observable 1644 events. Blends with routine directory activity.
Advanced Research

Trust exploitation & persistence.

Beyond AD CS, the internship extended into trust-based attack primitives — how certificate-based authentication bypasses traditional Kerberos trust boundaries and what that means for forest-level security.

Live Case Study
Cross-Domain Exploitation: XYZ.COM → ABC.COM

Attack execution (3 phases)

01
Credential extraction — LSA process memory patched on compromised DC to retrieve RC4 and AES keys for the xyz$ inter-realm trust account.
02
Inter-realm TGT acquisition — Rubeus used to request a TGT directly from ABC.COM's KDC using the extracted NTLM hash. Trust account bypasses standard referral ticket flow.
03
Domain takeover — TGT provided LDAP write permissions in ABC.COM. New attacker-controlled user created. Added to Domain Admins group. Full administrative control achieved.

Key findings

  • Trust account over-privilege: Trust accounts often hold elevated LDAP write permissions required for cross-domain operations — exploitable if the account is compromised
  • Secret symmetry: Both domains store identical trust secrets — a breach in either environment exposes the entire trust boundary
  • AD CS as trust amplifier: ESC8 across trusts bypasses SID filtering entirely because NTLM relay is a protocol-level attack independent of Kerberos trust boundaries
  • NTAuth store risk: A CA from Forest A accidentally present in Forest B's NTAuthCertificates collapses the forest boundary completely
Also researched
Golden gMSA
KDS root key extraction to compute any gMSA password offline — silent persistence outside standard monitoring and MFA scope
Also researched
SID History Injection
Child-to-parent SID history injection in Kerberos PAC — intra-forest escalation to Enterprise Admins via forged ticket
Also researched
Unconstrained Delegation
TGT harvesting from trusted-forest users who authenticate to a compromised machine — cross-forest credential capture
Detection Analysis

The detection gap.

Wazuh + Sysmon deployed on DC and CA. Custom rules written. Public tools and custom scripts compared. The results were more concerning than expected.

Custom Wazuh rule — AD CS LDAP enumeration detection
<group name="ad_recon">

  <rule id="110000" level="0">
    <if_sid>60000, 60009</if_sid>
    <field name="win.system.channel">^Directory Service$</field>
    <description>Windows Directory Service channel group</description>
  </rule>

  <rule id="110001" level="5">
    <if_sid>110000</if_sid>
    <field name="win.system.eventID">^1644$</field>
    <description>AD DS: LDAP search operation (Event 1644) — potential AD CS recon</description>
  </rule>

</group>
Finding 01 — Detection Gap
Certipy is quieter than expected
Certipy generated only a single detectable LDAP Event ID 1644 during enumeration — not the flood of events initially anticipated. Modern tooling is already optimized for low observability.
Finding 02 — Detection Gap
Custom scripts: near-zero telemetry
Server-side filtering and millisecond query durations meant the custom PowerShell and Python tools generated zero alertable 1644 entries under realistic monitoring conditions. Completely invisible to the configured SOC.
Finding 03 — Detection Gap
Frequency-based alerting is impractical
Even a small lab with a single client continuously generates LDAP background traffic. Lowering detection thresholds to catch targeted recon would produce severe alert fatigue — making frequency-based detection fundamentally unreliable.
Finding 04 — Detection Gap
Trust attacks nearly invisible by default
Golden gMSA abuse and trust account manipulation generated no meaningful telemetry under default logging configurations. Required additional object access auditing policies that most organizations do not have enabled.
Finding 05 — Positive
Event ID 1644 is the right signal
Despite the detection gap findings, 1644 queries against certificate-specific Distinguished Names (CN=Certificate Templates, CN=Enrollment Services) provide the most reliable indicator of AD CS reconnaissance when combined with source IP correlation.
Finding 06 — Positive
Sysmon + advanced audit policies are essential
Without Sysmon and manually configured audit policies, targeted PowerShell reconnaissance is entirely indistinguishable from legitimate administrative activity. Baseline coverage is insufficient for AD CS threat detection.
Outcomes

What this internship produced.

📋
Internal knowledge base
Complete AD CS vulnerability catalog — ESC1 through ESC16 — with attack logic, exploitation paths, detection indicators, and mitigations. Delivered as structured internal documentation for Refracted's consulting teams.
🔧
Stealth enumeration tooling
PowerShell and Python scripts retained by Refracted as internal operational tooling. Lower observability than Certipy under tested monitoring conditions. Source code confidential per internship agreement.
🔍
Detection gap research
Documented analysis of what a Wazuh + Sysmon SOC actually sees during AD CS attacks. Actionable findings on which event IDs matter, what configurations are required, and where the blind spots remain.
Personal reflection

The internship confirmed that AD CS is one of the most underestimated attack surfaces in enterprise environments — routinely deployed, rarely audited, and poorly understood by the defenders tasked with protecting it. The combination of offensive research and defensive analysis in the same project made the detection gap findings concrete rather than theoretical.

Working at a small, highly technical firm with direct access to experienced red teamers compressed the learning curve considerably. The freedom to shape the assignment's direction — choosing AD CS, expanding into trust research, deciding to benchmark detection visibility — made the outcome significantly more valuable than a prescriptive project would have been.