Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2021-36934-HiveNightmare-Lab — Educational lab demonstrating CVE-2021-36934 (HiveNightmare) - Windows LPE via shadow copy ACL misconfiguration. | Kitploit
Tools/GitHubGitHub/d4yon/cve-2021-36934-hivenightmare-lab
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary ExploitationLabs & Practice
GitHub
Share
d4yon/cve-2021-36934-hivenightmare-lab

CVE-2021-36934-HiveNightmare-Lab

Educational lab demonstrating CVE-2021-36934 (HiveNightmare) - Windows LPE via shadow copy ACL misconfiguration.

View Repository
1378 months agoNot yet reviewed

CVE-2021-36934 (HiveNightmare) - Educational Lab

🎯 Objective

Reproduce and analyze the HiveNightmare vulnerability in a controlled lab environment.

📋 Table of Contents

  • Vulnerability Description
  • Implementation
    • Demonstration
    • Lab Setup & Tools
    • Exploitation Steps
  • Mitigation Measures
    • Demonstration
  • Conclusion
  • References

1. Vulnerability Description

CVE-2021-36934, nicknamed "SeriousSAM" or "HiveNightmare", is a local privilege escalation (LPE) vulnerability affecting Windows 10 from version 1809 onwards, initial versions of Windows 11, as well as Windows Server 2019 and 2022. It allows a standard user to duplicate and access protected system files containing sensitive data, such as local password hashes. The core issue lies in misconfigured Access Control Lists (ACLs), granting read permissions to all users on sensitive system files (notably the SAM, SYSTEM, and SECURITY hives). While these files remain locked during normal operation, their backup copies (via shadow copies/restore points) inherit the same misconfigured permissions and become accessible and exploitable by any system user.

2. Implementation

Exploiting the vulnerability requires two prerequisites: (1) System Protection enabled and (2) an existing restore point. These elements are often present by default on Windows 10/11 machines. The implementation relies on extracting copies of the SAM, SYSTEM, and SECURITY files from shadow copies (restore points). These files, normally locked during system execution, become accessible via their snapshot copies which inherit the same ACLs as the originals.

From an unprivileged user account, exploitation can be achieved via public scripts, the most well-known being hivenightmare.exe, written in C. The three recovered files have complementary roles. SAM contains the hashes of local account passwords (encrypted), SECURITY stores additional LSA secrets (cached credentials, service passwords, also encrypted), and SYSTEM provides the decryption key (BootKey). For strict local privilege escalation, only SAM and SYSTEM are necessary to extract NTLM hashes. Once these files are obtained, tools like secretsdump.py or mimikatz can decrypt the hashes and perform pass-the-hash attacks, or gain full administrator access via psexec.py.

2.1 Demonstration

The exploit implementation relies on extracting Windows hives (SAM, SYSTEM, SECURITY) from shadow copies/restore points, then using the extracted hashes to obtain SYSTEM access via secretsdump.py and psexec.py.

2.2 Lab Setup & tools

  • VMware Workstation
  • Windows 10 Build 18362.1256
  • Isolated network (no internet)
  • hivenightmare.exe — Written in C, used to extract hives from shadow copies/restore points
  • secretsdump.py (Impacket) — To dump hashes and plaintext secrets from hive files
  • psexec.py (Impacket) — To spawn a local session by reusing a hash

Tested platform: Windows 10, build 1903 (December 2020 update).

2.3 Exploitation Steps

1. Context: Windows Version We are using a Windows 10 version (1903, Dec. 2020 update) that contains the vulnerability under study.

image

2. Permissions on Sensitive Files We observe that NTFS permissions on the SAM, SYSTEM, and SECURITY hives allow local users to have Read access, inherited here from the config folder.

image

3. Running hivenightmare from a Local User Without Restore Point When launching hivenightmare.exe from a local account without restore points/shadow copies, the tool fails because it cannot find any restore points to exploit.

image image

4. Enabling System Protection and Creating a Restore Point To create the necessary conditions for hive extraction, we enable System Protection then manually create a restore point. Once the restore point exists, hivenightmare will be able to access copies of the sensitive files. image

5. Extracting Sensitive Hives After creating the restore point, hivenightmare.exe is launched again and successfully extracts the SAM, SYSTEM, and SECURITY files from the shadow copy. There are many other scripts (C#, Go, PowerShell,...). Regardless of the technology used, all scripts target the same path:

\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy[i]\Windows\System32\config\[SENSITIVE FILE]
image

6. Analysis on Kali: Retrieving Hashes with secretsdump.py The extracted files are transferred to the Kali machine. We use secretsdump.py (Impacket) to list accounts and retrieve hashes in plaintext.

image

7. Privilege Escalation: Hash Reuse via psexec.py With the extracted hash, we use psexec.py to authenticate and open a session with SYSTEM privileges, granting full control of the machine.

image

3. Mitigation Measures

Microsoft's official fix (KB5004605, July 2021) restores appropriate ACLs on the affected files. However, several complementary measures are recommended. First, manually verify permissions on C:\Windows\System32\config to ensure that only SYSTEM and administrators have full access. Second, delete old shadow copies created before applying the patch, as they retain the vulnerable permissions. For operational reasons (risk of data loss, user impact), automatic deletion of old restore points was not included in the distributed patch. Finally, monitor unusual access to shadow copies through system event logs.

3.1 Demonstration

Here we demonstrate how to mitigate the vulnerability through manual ACL correction and deletion of previous shadow copies.

1. Manual ACL Correction This command breaks inheritance on the C:\Windows\System32\config folder.

image image

2. Verification After ACL Correction The existence of the restore point created before the correction still allows extracting hives from the associated shadow copy.

image

3. Shadow Copy Deletion

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    755
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    510
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    415
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    343
  • 5

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    259
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    258

Explore all tools

Browse our collection of tools

View all tools →