Skip to content

Instantly share code, notes, and snippets.

View Ghost-Developmentx's full-sized avatar
💭
Talk Less, Do More

Ghost Ghost-Developmentx

💭
Talk Less, Do More
View GitHub Profile
# Pseudo-code for SIEM/EDR detection rule
def detect_lsass_dump_attempt(event):
"""
Detects potential LSASS dumping activity
"""
indicators = []
# Check for process accessing LSASS with suspicious rights
if (event.target_process == "lsass.exe" and
event.access_rights & PROCESS_VM_READ and
<Sysmon schemaversion="4.90">
<EventFiltering>
<!-- Detect LSASS memory access -->
<ProcessAccess onmatch="include">
<TargetImage condition="is">C:\Windows\System32\lsass.exe</TargetImage>
<GrantedAccess condition="is">0x1410</GrantedAccess> <!-- PROCESS_VM_READ -->
</ProcessAccess>
<!-- Detect suspicious LSASS child processes -->
<ProcessCreate onmatch="include">
#include <windows.h>
#include <stdio.h>
// Direct syscall to NtOpenProcess (bypassing user-mode hooks)
extern NTSTATUS NtOpenProcess(
PHANDLE ProcessHandle,
ACCESS_MASK DesiredAccess,
POBJECT_ATTRIBUTES ObjectAttributes,
PCLIENT_ID ClientId
);