Skip to content

BuKarData/SentinelCPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SentinelCPP

A lightweight EDR (Endpoint Detection and Response) agent written in C++ designed to monitor Windows processes in real-time. The program detects new processes, analyzes their metadata, and automatically terminates unauthorized applications.

Features

  • Process Monitoring: Captures system snapshots every 500ms using the Toolhelp32 API to detect new PIDs.
  • Metadata Collection: For every new process, the agent retrieves the full executable path and the Parent Process ID (PPID).
  • Path Heuristics: Verifies if critical system binaries (e.g., svchost.exe, lsass.exe) are executing from the correct System32 directory. Mismatches are flagged as suspicious.
  • Active Response (Kill-switch): Automatically terminates processes found on a hardcoded blacklist (e.g., powershell.exe).
  • Forensic Logging: Writes events to incident_log.txt with severity levels:
    • INFO: Standard process execution telemetry.
    • WARN: Suspicious file location detected.
    • CRITICAL: Blacklisted process detected and terminated.

Technical Stack

  • Language: C++17
  • Platform: Windows API (Win32)
  • Libraries: TlHelp32.h, Windows.h, Chrono (for high-resolution timestamps).

How It Works

  1. Initialization: On startup, the agent builds an in-memory map of currently running processes to establish a baseline and avoid alerting on existing safe processes.
  2. Detection Loop: The program continuously takes system snapshots to identify new PIDs.
  3. Security Pipeline:
    • Attempts to open the process with PROCESS_QUERY_LIMITED_INFORMATION rights.
    • Resolves the absolute path of the binary on the disk.
    • Cross-references the process name against the blacklist and trusted path map.
  4. Audit: Every action is committed to a local log file with precise timestamps.

Roadmap

  • Move from user-mode polling (Sleep/Snapshots) to Event Tracing for Windows (ETW) or a Kernel-mode notify routine for better performance and stealth.
  • Implement DLL Injection detection via remote thread monitoring.
  • Add Registry monitoring for common persistence mechanisms (Run keys).

About

Simple EDR Agent built in C++ for real-time process monitoring, heuristic analysis, and automated threat response.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages