CG
SkillsPerforming Active Directory Vulnerability Assessment
Start Free
Back to Skills Library
Vulnerability Management🟡 Intermediate

Performing Active Directory Vulnerability Assessment

Assess Active Directory security posture using PingCastle, BloodHound, and Purple Knight to identify misconfigurations, privilege escalation paths, and attack vectors.

4 min read10 code examples

Prerequisites

  • Domain-joined workstation or domain admin access for scanning
  • PingCastle (https://github.com/netwrix/pingcastle)
  • BloodHound Community Edition with SharpHound collector
  • Purple Knight from Semperis (free community tool)
  • Python 3.9+ for analysis scripts
  • .NET Framework 4.7+ for PingCastle on Windows

Performing Active Directory Vulnerability Assessment

Overview

Active Directory (AD) is the primary identity and access management system in most enterprise environments, making it a critical attack target. This guide covers comprehensive AD security assessment using PingCastle for health checks, BloodHound for attack path analysis, and Purple Knight for security posture scoring. These tools identify misconfigurations, excessive privileges, Kerberos weaknesses, and lateral movement opportunities.

Prerequisites

  • Domain-joined workstation or domain admin access for scanning
  • PingCastle (https://github.com/netwrix/pingcastle)
  • BloodHound Community Edition with SharpHound collector
  • Purple Knight from Semperis (free community tool)
  • Python 3.9+ for analysis scripts
  • .NET Framework 4.7+ for PingCastle on Windows

Tool 1: PingCastle Health Check

Installation and Execution

# Download PingCastle
Invoke-WebRequest -Uri "https://github.com/netwrix/pingcastle/releases/latest/download/PingCastle.zip" `
  -OutFile "PingCastle.zip"
Expand-Archive PingCastle.zip -DestinationPath C:\Tools\PingCastle

# Run health check against current domain
cd C:\Tools\PingCastle
.\PingCastle.exe --healthcheck

# Run health check against specific domain
.\PingCastle.exe --healthcheck --server dc01.corp.local --user CORP\scanner_account --password P@ssw0rd

# Run in scanner mode for multiple domains
.\PingCastle.exe --scanner --scannerlp

# Generate consolidated report
.\PingCastle.exe --healthcheck --level Full

PingCastle Scoring Categories

CategoryDescriptionRisk Areas
Stale ObjectsInactive accounts, old passwords, obsolete OSGhost accounts, expired credentials
Privileged AccountsExcessive admin rights, nested groupsDomain Admin sprawl, SID history
TrustsForest and domain trust configurationsTransitive trust abuse, SID filtering
AnomaliesSecurity setting deviationsGPO misconfigurations, schema issues

Key PingCastle Checks

# Critical items to review in PingCastle report:
- Accounts with "Password Never Expires" flag
- Accounts with Kerberos pre-authentication disabled (AS-REP roastable)
- Accounts with Kerberos delegation (unconstrained/constrained)
- Domain Controllers running unsupported OS versions
- AdminSDHolder permission modifications
- Accounts in privileged groups (Domain Admins, Enterprise Admins, Schema Admins)
- Trust relationships with SID filtering disabled
- GPO vulnerabilities allowing privilege escalation

Tool 2: BloodHound Attack Path Analysis

SharpHound Data Collection

# Download SharpHound collector
# https://github.com/SpecterOps/BloodHound/tree/main/packages/csharp/SharpHound

# Run SharpHound collection (all methods)
.\SharpHound.exe --collectionmethods All --domain corp.local --zipfilename bloodhound_data.zip

# Stealthy collection (minimal noise)
.\SharpHound.exe --collectionmethods Session,LoggedOn --domain corp.local --stealth

# Collection with specific domain controller
.\SharpHound.exe --collectionmethods All --domain corp.local --domaincontroller dc01.corp.local

# Run via PowerShell
Import-Module .\SharpHound.ps1
Invoke-BloodHound -CollectionMethod All -Domain corp.local -OutputDirectory C:\BH_Data

BloodHound CE Setup

# Deploy BloodHound Community Edition with Docker
curl -L https://ghst.ly/getbhce -o docker-compose.yml
docker compose up -d

# Access BloodHound CE at http://localhost:8080
# Default credentials shown in docker compose logs

# Upload SharpHound data through web UI or API
curl -X POST "http://localhost:8080/api/v2/file-upload/start" \
  -H "Authorization: Bearer $BH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "bloodhound_data.zip"}'

Critical BloodHound Queries

# Find shortest path to Domain Admin
MATCH p=shortestPath((u:User)-[*1..]->(g:Group {name:"DOMAIN ADMINS@CORP.LOCAL"}))
WHERE u.name <> "ADMINISTRATOR@CORP.LOCAL"
RETURN p

# Find Kerberoastable accounts with admin privileges
MATCH (u:User {hasspn:true})-[:MemberOf*1..]->(g:Group)
WHERE g.name CONTAINS "ADMIN"
RETURN u.name, u.serviceprincipalnames

# Find computers where Domain Admins are logged in
MATCH (c:Computer)-[:HasSession]->(u:User)-[:MemberOf*1..]->(g:Group {name:"DOMAIN ADMINS@CORP.LOCAL"})
RETURN c.name, u.name

# Find AS-REP roastable accounts
MATCH (u:User {dontreqpreauth:true})
RETURN u.name, u.description

# Find unconstrained delegation hosts
MATCH (c:Computer {unconstraineddelegation:true})
WHERE NOT c.name CONTAINS "DC"
RETURN c.name

# Find GPO abuse paths
MATCH p=(u:User)-[:GenericAll|GenericWrite|WriteOwner|WriteDacl]->(g:GPO)
RETURN p

Tool 3: Purple Knight Assessment

# Download Purple Knight from https://www.purple-knight.com/
# Run as domain admin or with appropriate read permissions

.\PurpleKnight.exe

# Purple Knight checks 130+ security indicators across:
# - Account Security (password policies, privileged accounts)
# - AD Infrastructure (replication, DNS, LDAP signing)
# - Group Policy (GPO permissions, security settings)
# - Kerberos Security (delegation, encryption types, SPN)
# - AD Delegation (AdminSDHolder, OU permissions)

Purple Knight Score Categories

Score RangeRatingAction Required
90-100ExcellentMaintain current posture
75-89GoodAddress high-risk findings
60-74FairPrioritize remediation plan
40-59PoorImmediate remediation required
0-39CriticalEmergency response needed

Common AD Vulnerabilities

1. Kerberoasting Exposure

# Find SPNs assigned to user accounts (Kerberoasting targets)
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName |
  Select-Object Name, ServicePrincipalName, PasswordLastSet, Enabled

2. AS-REP Roasting Exposure

# Find accounts with pre-auth disabled
Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true} -Properties DoesNotRequirePreAuth |
  Select-Object Name, DoesNotRequirePreAuth, Enabled

3. LLMNR/NBT-NS Poisoning Risk

# Check if LLMNR is disabled via GPO
Get-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" -Name EnableMulticast -ErrorAction SilentlyContinue

4. Excessive Privileged Group Membership

# Count members in critical groups
$groups = @("Domain Admins", "Enterprise Admins", "Schema Admins", "Account Operators", "Backup Operators")
foreach ($group in $groups) {
    $count = (Get-ADGroupMember -Identity $group -Recursive).Count
    Write-Output "$group : $count members"
}

Remediation Priorities

FindingRiskRemediation
Kerberoastable admin accountsCriticalRemove SPNs or use MSA/gMSA
Unconstrained delegation on non-DCsCriticalSwitch to constrained/RBCD
Password Never Expires on adminsHighEnable password rotation policy
AS-REP roastable accountsHighEnable Kerberos pre-authentication
AdminSDHolder modificationHighAudit and restore default ACLs
Stale computer accounts (90+ days)MediumDisable and move to quarantine OU
LDAP signing not enforcedMediumEnable via GPO on all DCs

Compliance Framework Mapping

This skill supports compliance evidence collection across multiple frameworks:

  • SOC 2: CC7.1 (Monitoring), CC8.1 (Change Management)
  • ISO 27001: A.12.6 (Technical Vulnerability Management)
  • NIST 800-53: RA-5 (Vulnerability Scanning), SI-2 (Flaw Remediation), CM-6 (Configuration Settings)
  • NIST CSF: ID.RA (Risk Assessment), PR.IP (Information Protection)

Claw GRC Tip: When this skill is executed by a registered agent, compliance evidence is automatically captured and mapped to the relevant controls in your active frameworks.

Deploying This Skill with Claw GRC

Agent Execution

Register this skill with your Claw GRC agent for automated execution:

# Install via CLI
npx claw-grc skills add performing-active-directory-vulnerability-assessment

# Or load dynamically via MCP
grc.load_skill("performing-active-directory-vulnerability-assessment")

Audit Trail Integration

When executed through Claw GRC, every step of this skill generates tamper-evident audit records:

  • SHA-256 chain hashing ensures no step can be modified after execution
  • Evidence artifacts (configs, scan results, logs) are automatically attached to relevant controls
  • Trust score impact — successful execution increases your agent's trust score

Continuous Compliance

Schedule this skill for recurring execution to maintain continuous compliance posture. Claw GRC monitors for drift and alerts when re-execution is needed.

References

  • PingCastle GitHub
  • BloodHound CE
  • Purple Knight
  • MITRE ATT&CK - Active Directory
  • Microsoft AD Security Best Practices

Use with Claw GRC Agents

This skill is fully compatible with Claw GRC's autonomous agent system. Deploy it to any registered agent via MCP, and every execution will be logged in the tamper-evident audit trail.

// Load this skill in your agent
npx claw-grc skills add performing-active-directory-vulnerability-assessment
// Or via MCP
grc.load_skill("performing-active-directory-vulnerability-assessment")

Tags

active-directorypingcastlebloodhoundpurple-knightad-securityprivilege-escalationldapkerberos

Related Skills

Identity & Access Management

Analyzing Active Directory ACL Abuse

3m·intermediate
Red Team & Offensive Security

Conducting Internal Reconnaissance with BloodHound Ce

4m·intermediate
Red Team & Offensive Security

Performing Active Directory BloodHound Analysis

4m·intermediate
Red Team & Offensive Security

Exploiting Constrained Delegation Abuse

4m·advanced
Threat Hunting

Detecting Dcsync Attack in Active Directory

3m·intermediate
Threat Hunting

Detecting Golden Ticket Attacks in Kerberos Logs

3m·intermediate

Skill Details

Domain
Vulnerability Management
Difficulty
intermediate
Read Time
4 min
Code Examples
10

On This Page

OverviewPrerequisitesTool 1: PingCastle Health CheckTool 2: BloodHound Attack Path AnalysisTool 3: Purple Knight AssessmentCommon AD VulnerabilitiesRemediation PrioritiesReferencesCompliance Framework MappingDeploying This Skill with Claw GRC

Deploy This Skill

Add this skill to your Claw GRC agent and start automating.

Get Started Free →