How tmanh191/ebpf-ransomware-reactive-detector works
This is a Linux eBPF ransomware detector. A privileged operator starts the Python controller, which configures BPF maps and attaches probes; kernel events are tracked and scored per process, then delivered to Python for display, CSV logging, and termination of processes flagged with major severity. Detection covers filesystem, encryption, and network activity, with sequence and threshold-pattern matching. The shared C header defines the event and configuration structures. The source excerpts are partial, so only shown wiring and README-documented capabilities are represented.
Main entry points: detector.py Event handler · bpf.c Kernel probes · bpf.h Event schema
Components 12
Kernel Monitoring
- Kernel probes
bpf.c - Event schema
bpf.h - Event ring buffer
bpf.c
Detection
- Python controller
detector.py - Process event tracking
bpf.c - Pattern and threshold scoring
bpf.c
Response and Reporting
- Event handler
detector.py - Process termination
detector.py - Terminal output
detector.py - CSV event log
detector.py
Other components
- Root operator
- BCC runtime
Connections 11
- Root operator → Python controller: starts
README.md - Python controller → BCC runtime: loads BPF
detector.py - Python controller → Kernel probes: configures and attaches
detector.py - Kernel probes → Process event tracking: records events
bpf.c - Process event tracking → Pattern and threshold scoring: analyzes stats
bpf.c - Pattern and threshold scoring → Event ring buffer: submits events
bpf.c - Event ring buffer → Event handler: delivers events
detector.py - Event handler → Process termination: kills major alerts
detector.py - Event handler → Terminal output: prints events
detector.py - Event handler → CSV event log: logs events
detector.py - Kernel probes → Event schema: uses definitions
bpf.c