Skip to main content
ToolPublished

Built a lightweight, zero-dependency LSASS dump detector and handle table auditor in pure Python (Win32/NT ctypes)

Source Reddit Cybersecurity

0

Discussion

MemGuard is a lightweight, open-source Python tool designed to detect and mitigate unauthorized LSASS memory access and credential dumping attempts on Windows endpoints. It audits handle tables to identify processes with suspicious access rights to lsass.exe, inspects process command lines for known LOLBin dumping techniques, and can freeze suspect processes to preserve forensic artifacts. The tool operates without dependencies, using native Windows APIs and kernel structures. It targets the MITRE ATT&CK technique T1003.001 (OS Credential Dumping via LSASS memory).

r/cybersecurity (opens in a new tab)u/Traditional_Bear54920 points0 comments

Hi all,

OS credential dumping targeting LSASS (T1003.001) remains one of the primary post-exploitation techniques in Windows environments. While modern enterprise EDRs have robust kernel callbacks, I wanted to build a transparent, standalone Python utility to inspect how handle table analysis and memory access masks can detect dumper behavior at the endpoint level.

The tool is called **MemGuard** (MIT licensed, zero dependencies):

GitHub: https://github.com/prox0959/MemGuard

### 🛠️ Key Mechanics:

  1. **Handle Audit:** Queries `NtQuerySystemInformation(SystemExtendedHandleInformation)` to map which processes hold active handles to `lsass.exe`.

  2. **Access Mask Filtering:** Specifically flags unauthorized processes granted `PROCESS_VM_READ` (`0x0010`) while whitelisting core system services (`csrss.exe`, `services.exe`, Windows Defender).

  3. **PEB Inspection:** Direct memory read of `PEB->ProcessParameters->CommandLine` via `NtQueryInformationProcess` to detect LOLBin dump attempts (e.g. `comsvcs.dll MiniDump` or ProcDump flags).

  4. **Active Triage:** Supports freezing suspect processes via `NtSuspendProcess` rather than immediate termination, maintaining volatile RAM for artifact recovery.

Would love to hear thoughts from detection engineers and blue teamers on edge cases or bypasses you'd anticipate (e.g. handle stripping, direct kernel object manipulation).

Feedback and GitHub stars are always welcome!

Links cited in the discussion

References

Community reviews

Loading reviews…