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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
MemGuard — Zero-dependency Windows EDR utility that detects and mitigates unauthorized LSASS memory access, handle duplication, and LOLBin credential dumping in real time. | Kitploit
Tools/GitHubGitHub/prox0959/memguard
Defensive ToolsMemory ForensicsMalware AnalysisDigital ForensicsIntrusion DetectionIncident ResponseLog Analysis
GitHubprox0959/memguard

MemGuard

Zero-dependency Windows EDR utility that detects and mitigates unauthorized LSASS memory access, handle duplication, and LOLBin credential dumping in real time.

View Repository
1616h 41m agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

🛡️ MemGuard — Zero-Dependency LSASS Memory Shield & EDR Hook Detector

Python Platform Dependencies MITRE ATT&CK License: MIT

A lightweight, zero-dependency Windows EDR utility that detects and mitigates unauthorized LSASS memory access, handle duplication, and LOLBin credential dumping attempts in real time.


📌 Threat Overview: Why Guard LSASS?

In Windows enterprise environments, the Local Security Authority Subsystem Service (lsass.exe) stores active user credentials, Kerberos ticket-granting tickets (TGT), and NTLM password hashes in its virtual memory.

Because LSASS holds the keys to the entire domain, adversaries and red teams routinely target it using:

  1. Direct Memory Access: Tools like Mimikatz, Dumpert, or NanoDump opening handles with PROCESS_VM_READ (0x0010) or PROCESS_ALL_ACCESS (0x1FFFFF).
  2. Living-Off-The-Land Binaries (LOLBins): Legitimate Windows signed binaries abused for dumping, such as rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump <lsass_pid> <dump_path> full or procdump.exe -ma lsass.exe.
  3. Handle Stealing: Duplicating existing open handles from privileged services to bypass typical API monitoring.

Commercial Endpoint Detection and Response (EDR) platforms like CrowdStrike Falcon or SentinelOne charge thousands of dollars in enterprise subscriptions to protect against this exact technique (MITRE ATT&CK T1003.001).

MemGuard provides a completely free, open-source, and transparent Python implementation using native Windows Win32 and NT kernel structures with zero third-party dependencies.


⚙️ Architecture & Technical Mechanics

root@kitploit:~
flowchart TD
    subgraph Host ["Windows 11 / 10 Endpoint"]
        Adversary["Attacker / LOLBin / Mimikatz / ProcDump"] -- OpenProcess (PROCESS_VM_READ) --> LSASS["lsass.exe (PID: 1744)"]
        
        subgraph MemGuard ["MemGuard Defensive Engine"]
            HScan["NtQuerySystemInformation\n(SystemExtendedHandleInformation)"] --> CheckMask{"Access Mask\nAnalysis"}
            CheckMask -- "VM_READ / ALL_ACCESS" --> Alert1["🚨 Critical Alert:\nUnauthorized Handle"]
            
            PEBScan["Process PEB Reader\n(NtQueryInformationProcess)"] --> LOLBinCheck{"CommandLine\nRegex Engine"}
            LOLBinCheck -- "comsvcs.dll / procdump" --> Alert2["🚨 Critical Alert:\nLOLBin Dump Attempt"]
            
            DumpWatch["Triage Directory\nArtifact Scanner"] --> MDMPCheck{"MDMP Header\nValidation"}
            MDMPCheck -- "Valid LSASS .dmp" --> Alert3["🚨 Alert:\nRogue Dump File"]
            
            Alert1 & Alert2 --> Mitigation["Active Mitigation:\nNtSuspendProcess (Freeze)"]
        end
    end

1. NT Kernel Handle Enumeration

Queries NtQuerySystemInformation with SystemExtendedHandleInformation (class 64) to enumerate every open handle across the entire operating system. It duplicates process handles and verifies if their target resolves to the active lsass.exe PID.

2. Access Mask Bitfield Decoding

Analyzes the 32-bit GrantedAccess bitmask of each handle holder:

  • PROCESS_VM_READ (0x0010): CRITICAL (Read process memory — prerequisites for credential dumping)
  • PROCESS_VM_WRITE (0x0020): HIGH (Memory injection / shellcode)
  • PROCESS_VM_OPERATION (0x0008): HIGH (VirtualAllocEx / page protection modification)
  • PROCESS_CREATE_THREAD (0x0002): HIGH (Remote thread creation)
  • PROCESS_ALL_ACCESS (0x1FFFFF): CRITICAL (Unrestricted control)

Known legitimate Windows system processes (services.exe, csrss.exe, wininit.exe, Windows Defender MsMpEng.exe) are whitelisted, while unverified third-party processes holding dump-capable handles are immediately flagged.

3. Pure Python PEB Command-Line Reader

Inspects running processes by reading the Process Environment Block (PEB) directly from virtual memory via NtQueryInformationProcess(ProcessBasicInformation) and ReadProcessMemory:

  • Traverses PEB -> ProcessParameters -> CommandLine (UNICODE_STRING).
  • Detects obfuscated LOLBin invocations (comsvcs.dll, #24, MiniDumpWriteDump, procdump -ma).
  • Zero dependence on WMI, PowerShell, or external modules!

4. Active Threat Freezing (NtSuspendProcess)

When run with the --suspend flag, MemGuard freezes the offending process's threads in place using native ntdll.NtSuspendProcess, preventing memory extraction while preserving the attacker process in RAM for live forensic analysis.


🚀 Installation & Usage

No pip installation needed! Clone and run directly with Python 3.8+:

root@kitploit:~
git clone https://github.com/prox0959/MemGuard.git
cd MemGuard

1. One-Shot Security Triage Scan

root@kitploit:~
python memguard.py --scan

2. Continuous Real-Time EDR Guard Mode

root@kitploit:~
# Monitor system every 3 seconds
python memguard.py --monitor --interval 3

# Monitor with automatic active mitigation (freeze dumper processes)
python memguard.py --monitor --interval 2 --suspend

3. Export Forensic Incident Report (JSON)

root@kitploit:~
python memguard.py --scan --json incident_report.json

4. Bilingual CLI Support (English / Turkish)

root@kitploit:~
python memguard.py --scan --lang tr

📸 Sample Terminal Output

root@kitploit:~
███╗   ███╗███████╗███╗   ███╗ ██████╗ ██╗   ██╗ █████╗ ██████╗ ██████╗ 
████╗ ████║██╔════╝████╗ ████║██╔════╝ ██║   ██║██╔══██╗██╔══██╗██╔══██╗
██╔████╔██║█████╗  ██╔████╔██║██║  ███╗██║   ██║███████║██████╔╝██║  ██║
██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██║   ██║██║   ██║██╔══██║██╔══██╗██║  ██║
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝╚██████╔╝██║  ██║██║  ██║██████╔╝
╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝ 
Zero-Dependency LSASS Memory Dump Shield & EDR Hook Detector | Pure Python
► MITRE ATT&CK: T1003.001 (OS Credential Dumping: LSASS Memory)
    
[*] Privilege Level: Elevated (Administrator) - Full Kernel Handle Access
[*] SeDebugPrivilege Status: Enabled Successfully
[*] Target Security Process Found: lsass.exe (PID: 1744) | Path: C:\Windows\System32\lsass.exe

--- LSASS Handle Table Audit (NtQuerySystemInformation) ---
  ✓ No unauthorized or suspicious handles targeting LSASS detected.

--- Process Heuristics & LOLBin CommandLine Inspection ---
  ✓ No credential dumping processes or LOLBin signatures found.

--- Dump File Artifacts & Honeypot Tripwire ---
  ✓ No rogue memory dump (.dmp) files identified in triage directories.

Audit Summary: 0 handle threats, 0 process threats, 0 dump artifacts.

🛠️ Project Structure

root@kitploit:~
MemGuard/
├── memguard.py              # Main CLI entry point & real-time monitoring loop
├── core/
│   ├── __init__.py
│   ├── win_api.py           # Native Win32/NT kernel ctypes prototypes & PEB reader
│   ├── handle_scanner.py    # NtQuerySystemInformation handle table & access mask auditor
│   ├── process_auditor.py   # Heuristic LOLBin cmdline inspection & parent verification
│   └── honey_dmp.py         # MiniDump (.dmp) artifact validator
├── LICENSE                  # MIT License
├── README.md                # Technical Documentation
└── requirements.txt         # Zero dependencies notice

👤 Author

Developed by Çınar (@prox0959)
High school student researching low-level operating system internals, defensive security, and Windows memory forensics.


⚖️ License

Distributed under the MIT License.

Download Tool