Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
MemGuard — 의존성이 전혀 없는 Windows EDR 유틸리티로, 무단 LSASS 메모리 접근, 핸들 복제, LOLBin 자격 증명 덤프를 실시간으로 탐지하고 완화합니다. | Kitploit
도구/GitHubGitHub/prox0959/memguard
Defensive ToolsMemory ForensicsMalware AnalysisDigital ForensicsIntrusion DetectionIncident ResponseLog Analysis
GitHubprox0959/memguard

MemGuard

의존성이 전혀 없는 Windows EDR 유틸리티로, 무단 LSASS 메모리 접근, 핸들 복제, LOLBin 자격 증명 덤프를 실시간으로 탐지하고 완화합니다.

저장소 보기
1616시간 52분 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

🛡️ MemGuard — 제로 의존성 LSASS 메모리 보호막 및 EDR 후킹 탐지기

Python Platform Dependencies MITRE ATT&CK License: MIT

무단 LSASS 메모리 접근, 핸들 복제, 그리고 LOLBin 자격 증명 덤프 시도를 실시간으로 탐지하고 완화하는 경량의 제로 의존성 Windows EDR 유틸리티입니다.


📌 위협 개요: LSASS를 보호해야 하는 이유

Windows 엔터프라이즈 환경에서 로컬 보안 기관 하위 시스템 서비스(lsass.exe) 는 활성 사용자 자격 증명, Kerberos 티켓 부여 티켓(TGT), 그리고 NTLM 비밀번호 해시를 가상 메모리에 저장합니다.

LSASS가 전체 도메인의 열쇠를 쥐고 있기 때문에, 공격자와 레드 팀은 일상적으로 다음과 같은 방법으로 이를 노립니다:

  1. 직접 메모리 접근: Mimikatz, Dumpert, NanoDump 같은 도구가 PROCESS_VM_READ(0x0010) 또는 PROCESS_ALL_ACCESS(0x1FFFFF)로 핸들을 엽니다.
  2. LOLBin(Living-Off-The-Land Binaries): rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump <lsass_pid> <dump_path> full 또는 procdump.exe -ma lsass.exe처럼 덤프에 악용되는 정상 서명된 Windows 바이너리입니다.
  3. 핸들 탈취: 일반적인 API 모니터링을 우회하기 위해 권한 있는 서비스에서 기존에 열린 핸들을 복제합니다.

CrowdStrike Falcon이나 SentinelOne 같은 상용 EDR(엔드포인트 탐지 및 대응) 플랫폼은 바로 이 기법(MITRE ATT&CK T1003.001)을 방어하기 위해 기업 구독료로 수천 달러를 청구합니다.

MemGuard는 제로 서드파티 의존성으로 네이티브 Windows Win32 및 NT 커널 구조를 사용하는 완전히 무료이고 오픈 소스이며 투명한 Python 구현을 제공합니다.


⚙️ 아키텍처 및 기술적 메커니즘

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 커널 핸들 열거

SystemExtendedHandleInformation(클래스 64)과 함께 NtQuerySystemInformation을 쿼리하여 운영 체제 전체에 걸쳐 열려 있는 모든 핸들을 열거합니다. 프로세스 핸들을 복제하고 대상이 활성 lsass.exe PID로 확인되는지 검증합니다.

2. 접근 마스크 비트필드 디코딩

각 핸들 보유자의 32비트 GrantedAccess 비트마스크를 분석합니다:

  • PROCESS_VM_READ(0x0010): 치명적 (프로세스 메모리 읽기 — 자격 증명 덤프의 전제 조건)
  • PROCESS_VM_WRITE(0x0020): 높음 (메모리 주입 / 셸코드)
  • PROCESS_VM_OPERATION(0x0008): 높음 (VirtualAllocEx / 페이지 보호 수정)
  • PROCESS_CREATE_THREAD(0x0002): 높음 (원격 스레드 생성)
  • PROCESS_ALL_ACCESS(0x1FFFFF): 치명적 (무제한 제어)

알려진 정상 Windows 시스템 프로세스(services.exe, csrss.exe, wininit.exe, Windows Defender MsMpEng.exe)는 화이트리스트에 포함되며, 덤프 가능한 핸들을 보유한 검증되지 않은 서드파티 프로세스는 즉시 플래그됩니다.

3. 순수 Python PEB 명령줄 리더

NtQueryInformationProcess(ProcessBasicInformation)와 ReadProcessMemory를 통해 가상 메모리에서 직접 프로세스 환경 블록(PEB) 을 읽어 실행 중인 프로세스를 검사합니다:

  • PEB -> ProcessParameters -> CommandLine (UNICODE_STRING)을 순회합니다.
  • 난독화된 LOLBin 호출(comsvcs.dll, #24, MiniDumpWriteDump, procdump -ma)을 탐지합니다.
  • WMI, PowerShell 또는 외부 모듈에 대한 의존성이 전혀 없습니다!

4. 활성 위협 동결 (NtSuspendProcess)

--suspend 플래그와 함께 실행하면, MemGuard는 네이티브 ntdll.NtSuspendProcess를 사용하여 문제가 되는 프로세스의 스레드를 제자리에서 동결시켜, 메모리 추출을 방지하는 동시에 라이브 포렌식 분석을 위해 공격자 프로세스를 RAM에 보존합니다.


🚀 설치 및 사용법

pip 설치가 필요 없습니다! Python 3.8+로 직접 클론하고 실행하세요:

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

1. 원샷 보안 트리아지 스캔

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

2. 연속 실시간 EDR 가드 모드

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. 포렌식 사고 보고서 내보내기 (JSON)

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

4. 이중 언어 CLI 지원 (영어 / 터키어)

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

📸 터미널 출력 예시

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.

🛠️ 프로젝트 구조

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

👤 작성자

Çınar (@prox0959) 가 개발했습니다.
저수준 운영 체제 내부 구조, 방어 보안, 그리고 Windows 메모리 포렌식을 연구하는 고등학생입니다.


⚖️ 라이선스

MIT License에 따라 배포됩니다.

도구 다운로드