How risksense/zerologon works
Project type and purpose
• This is a small Python-based command-line security tool (exploit script) targeting CVE-2020-1472 (“ZeroLogon”).
• It provides two main operations:
• set_empty_pw.py – forces the Domain Controller (DC) machine account password to an empty value via the Netlogon RPC interface
• reinstall_original_pw.py – restores the original machine account NT hash to avoid breaking the domain
• It depends on the Impacket library for RPC operations and uses standard Windows tooling (secretsdump, wmiexec) to extract registry hives.
File structure
• Top-level files:
• set_empty_pw.py and reinstall_original_pw.py – the two CLI entry points
• requirements.txt – declares Impacket and any other Python dependencies
• README.md – describes usage and workflow
• LICENSE – license terms
• No conventional “src” or “lib” directories—this is a single-module, script-driven project.
README for additional insights
• Describes a multi-step workflow:
a. invoke set_empty_pw.py → forces empty machine password via Impacket RPC
b. run secretsdump.py and wmiexec.py → pull SYSTEM, SAM, SECURITY hives from the DC
c. extract original NT hash locally from those hive files
d. invoke reinstall_original_pw.py → restore the DC’s original machine account password
• Relies on external tools (Impacket scripts, reg save, WMExec)
Diagramming the architecture
a. Main components
• CLI Scripts (Python): set_empty_pw.py, reinstall_original_pw.py
• Python runtime + Impacket library (RPC client)
• Network boundary → Target Domain Controller’s Netlogon RPC service
• Windows Domain Controller internals: Registry (SYSTEM/SAM/SECURITY hives)
• External tools invoked by the scripts: secretsdump.py, wmiexec.py
• Local filesystem for temporary hive files and original-hash storage
b. Relationships & interactions
• set_empty_pw.py → calls Impacket RPC client → sends Netlogon messages over TCP to DC
• On success, operator invokes secretsdump.py / wmiexec.py → RPC calls to DC → retrieves hive files
• Hive files stored locally → processed to extract original NT hash
• reinstall_original_pw.py → calls Impacket RPC client → sends RPC messages to set machine account back to original hash
c. Architectural patterns / design principles
• Separation of concerns: two focused CLI tools (one to manipulate DC password, one to restore it)
• Reliance on an external RPC-client library (Impacket) for Netlogon protocol implementation
d. Significant technologies / libraries
• Python 3 runtime
• Impacket (RPC, DCE/RPC, NTLM)
• Windows RPC endpoint for Netlogon (MS-RPC)
• Windows registry hive extraction via reg.exe and secretsdump.py
Detail
• Call out dependencies (Impacket commit hash in requirements.txt)
• Don’t over-simplify—list every actor, tool, and data store involved in the exploit and restore processes.