| name | hunting-for-dcsync-attacks |
| description | Detect DCSync attacks by analyzing Windows Event ID 4662 for unauthorized DS-Replication-Get-Changes requests from non-domain-controller accounts. Use when detecting dcsync attacks by analyzing windows event id 4662 for. |
| domain | cybersecurity |
| tags | ["threat-hunting","dcsync","active-directory","credential-access","t1003.006","mimikatz","windows","dfir"] |
| subdomain | threat-hunting |
| version | 1.0 |
| author | oyi77 |
| license | Apache-2.0 |
| d3fend_techniques | ["Application Protocol Command Analysis","Network Isolation","Network Traffic Analysis","Client-server Payload Profiling","Platform Monitoring"] |
| nist_csf | ["DE.CM-01","DE.AE-02","DE.AE-07","ID.RA-05"] |
Hunting For Dcsync Attacks
Overview
Cybersecurity skill for hunting for dcsync attacks. Follows industry best practices and security standards.
When to Use
Trigger phrases:
-
"hunting for dcsync attacks"
-
"Detect DCSync attacks by analyzing Windows Event ID 4662 for unauthorized DS-Rep"
-
When hunting for DCSync credential theft (MITRE ATT&CK T1003.006)
-
After detecting Mimikatz or similar tools in the environment
-
During incident response involving Active Directory compromise
-
When monitoring for unauthorized domain replication requests
-
During purple team exercises testing AD attack detection
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- Windows Security Event Log forwarding enabled (Event ID 4662)
- Audit Directory Service Access enabled via Group Policy
- Domain Computers SACL configured on Domain Object for machine account detection
- SIEM with Windows event data ingested (Splunk, Elastic, Sentinel)
- Knowledge of legitimate domain controller accounts and replication partners
Workflow
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Define Detection Scope — Identify the specific techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.