Skip to main content

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

0
Medium
Published: 09/24/2026 (09/24/2026, 19:32:37 UTC)
Source: Reddit Cybersecurity

Description

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).

Reddit Discussion

r/cybersecurity·posted by u/Traditional_Bear5492
00

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 this discussion

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/24/2026, 19:47:47 UTC

Technical Analysis

MemGuard implements a zero-dependency Windows endpoint detection utility in pure Python that monitors for unauthorized access to lsass.exe memory, a common target for credential dumping attacks. It enumerates system handles via NtQuerySystemInformation(SystemExtendedHandleInformation) to find processes holding handles to lsass.exe with critical access rights such as PROCESS_VM_READ or PROCESS_ALL_ACCESS. It whitelists known system processes and flags unverified ones. Additionally, it reads the Process Environment Block (PEB) to inspect command lines for LOLBin-based dumping attempts (e.g., comsvcs.dll MiniDump, procdump). When configured, it can suspend suspicious processes using NtSuspendProcess to prevent memory dumps while preserving volatile memory for forensic analysis. The tool is intended as a free, transparent alternative to commercial EDRs for detecting credential dumping techniques.

Potential Impact

Credential dumping from LSASS memory can expose sensitive user credentials, including Kerberos tickets and NTLM hashes, potentially allowing attackers to escalate privileges and move laterally within a Windows domain environment. MemGuard helps detect and mitigate these attacks by identifying unauthorized handle access and suspicious process behavior, reducing the risk of credential theft. However, it is a detection and mitigation tool rather than a vulnerability or exploit itself.

Defensive Guidance

MemGuard provides active detection and mitigation capabilities for LSASS memory dumping attempts. It can be run in monitoring mode to alert on suspicious activity or in active mode to suspend offending processes, preserving forensic evidence. Since this is a defensive tool, no patch is applicable. Users should deploy MemGuard as part of their endpoint security strategy to complement existing protections. No vendor advisory or patch status applies.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Source Type
reddit
Subreddit
cybersecurity
Reddit Score
0
Discussion Level
minimal
Content Source
reddit_link_post
Post Type
link
Newsworthiness Assessment
{"score":27,"reasons":["external_link","established_author","very_recent"],"isNewsworthy":true}
Has External Source
true
Trusted Domain
false

Threat ID: 6ab57e5df7a7c54106c37b05

Added to database: 09/24/2026, 19:47:41 UTC

Last enriched: 09/24/2026, 19:47:47 UTC

Last updated: 09/25/2026, 01:47:42 UTC

Views: 6

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses