<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: implementing-ad-certificate-security
description: >-
  Secure Active Directory Certificate Services (AD CS) against ESC1-ESC8 attack vectors by auditing templates, enrollment permissions, and CA configurations.
domain: cybersecurity
subdomain: active-directory-security
tags:
  - adcs
  - certificate
  - esc1
  - pki-security
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1649"]
  frameworks: ["MITRE ATT&CK", "SpecterOps"]
  tools: ["certipy", "certify", "openssl"]
---

# Implementing Ad Certificate Security

## Overview

Secure Active Directory Certificate Services (AD CS) against ESC1-ESC8 attack vectors by auditing templates, enrollment permissions, and CA configurations.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `certipy` | Security tooling |
| `certify` | Security tooling |
| `openssl` | Security tooling |
| Certipy or Certify, domain credentials, CA server access | Environment requirement |

## Quick Reference

```bash
# Quick start commands
node scripts/agent.js --help
certipy find -u user@corp.local -p 'P@ssw0rd' -dc-ip 10.0.0.1
```

## Workflow

### Step 1: Enumerate Certificate Templates

```bash
certipy find -u user@corp.local -p 'P@ssw0rd' -dc-ip 10.0.0.1
```

### Step 2: Identify Vulnerable Templates

```bash
node scripts/agent.js enumerate --domain corp.local --dc-ip 10.0.0.1
```

### Step 3: Harden CA Configuration

```bash
node scripts/agent.js harden --domain corp.local --ca-name CORP-CA
```

## Detection

```yaml
title: Ad Certificate Security Detection
id: eefc68b7-a0f2-4e33-a3b4-67f05b06f10e
status: experimental
description: Detects suspicious activity related to implementing ad certificate security techniques in active directory security context
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    CommandLine: "*implementing*ad*"
  condition: selection
level: medium
tags:
  - attack.t1649
  - attack.credential_access
falsepositives:
  - Authorized Active Directory administration using approved management tools
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| Ad Certificate Security Detection | windows/process_creation | Sigma rule (medium) |
| ATT&CK Coverage | MITRE ATT&CK | T1649 |

## Verification

- **Verify template enumeration**: `node scripts/agent.js enumerate --domain corp.local --dc-ip 10.0.0.1`
- **Confirm ESC mitigations**: `node scripts/agent.js audit --domain corp.local`

## References

- MITRE ATT&CK: T1649
- Frameworks: MITRE ATT&CK, SpecterOps
- Tools: certipy, certify, openssl
