Skip to main content

eBPF-based System Inspector and Forensic Tool

Project description

sys-inspector - eBPF-based System Inspector and Audit Tool

OBS Build Status PyPI version License: GPL v3 Python 3.6+ Platform: Linux GitHub Stars GitHub Forks GitHub Release Build Status Issues Code Size Last Commit Code Quality

Sys-Inspector is an advanced observability and forensic tool powered by eBPF (Extended Berkeley Packet Filter).

Unlike traditional tools that poll /proc periodically, Sys-Inspector hooks directly into the Linux Kernel to capture events (process execution, file I/O, network connections) in real-time.

Features (v0.30.9)

  • Kernel-Level Visibility: Uses eBPF kprobes/tracepoints for zero-blindspot monitoring.
  • Deep Forensics:
    • Real-time MD5 Hashes: Calculates hashes of executed binaries instantly.
    • Context Awareness: Detects SSH origin IPs, Sudo users, and Tmux sessions.
    • Recursive Alert Bubbling: Child process anomalies (e.g., Unsafe Libs, Net Errors) propagate warnings up to the parent process in the tree view.
  • Topology & Infrastructure:
    • Storage Topology: Hierarchical view of Disks -> Partitions -> LVM -> Mount Points with HCTL info.
    • Network Topology: Auto-detection of Gateway, DNS servers, and Interfaces.
  • Enterprise Reporting:
    • Generates self-contained, interactive HTML Dashboards.
    • Custom Logo Support: Embeds your organization's logo automatically.
    • Visual Badges: Instant identification of [SSH], [SUDO], [UNSAFE], [NET ERR].

Requirements

  • Linux Kernel 4.15+ (5.x+ recommended for BTF support).
  • Root privileges (sudo).
  • Python 3.6+.
  • BCC Tools (python3-bcc).
  • iproute2 (for tc command, required only for Chaos Maker).

Installation (PyPI)

Works on any Linux distribution with Python 3.6+.

pip install sys-inspector

Installation (RPM / openSUSE)

You can install Sys-Inspector directly via zypper using the openSUSE Build Service repository.

  1. Add the Repository:
zypper addrepo [https://download.opensuse.org/repositories/home:mariosergiosl:sys-inspector/15.6/home:mariosergiosl:sys-inspector.repo](https://download.opensuse.org/repositories/home:mariosergiosl:sys-inspector/15.6/home:mariosergiosl:sys-inspector.repo)
  1. Refresh and Accept GPG Key: During the refresh, you will be asked to trust the repository GPG key.

Fingerprint: 7CF0 5795 053C F397 8E00 948E 9F8D 1AC9 E2BE EABC

zypper refresh
# Type 'a' to trust always when prompted.
  1. Install the Package:
zypper install sys-inspector
  1. Run: Once installed, the command is available globally:
sys-inspector

Usage

Sys-Inspector can now be run with or without arguments. It handles directory creation automatically.

1. Default Mode (Recommended)

Captures 20 seconds of activity and saves the report to /var/log/sys-inspector/ with an auto-generated name containing the hostname and timestamp.

sudo python3 src/inspector.py
# Output Example: /var/log/sys-inspector/sys-inspector_v0.30.3_hostname_20251201_100000.html

2. Custom Parameters

You can specify the duration and the output file path manually.

# Capture for 60 seconds and save to a specific file
sudo python3 src/inspector.py --duration 60 --html /tmp/my_investigation.html

Argument	Short	Default	Description
--duration	-d	20	Capture duration in seconds.
--html		(Auto)	Path to output HTML file. If omitted, defaults to /var/log/sys-inspector/.

3. Custom Logo

To include your company logo in the report header, simply place a PNG file at the following path:

/etc/sys-inspector/logo.png

The application will automatically detect, resize (max-height: 40px), encode it to Base64, and embed it in the HTML.

Chaos Engineering (Testing Tool)

Included in scripts/chaos_maker.sh is a stress testing tool designed to validate the inspector's detection capabilities.

⚠️ WARNING: DO NOT RUN ON PRODUCTION SYSTEMS. This script uses tc (Traffic Control) to purposefully degrade network quality (packet loss/latency) and consumes CPU/Disk resources.

Capabilities:

  • Network Degradation: Injects 100ms latency and 20% packet loss to trigger [NET ERR] alerts in the report.
  • Process Anomalies: Hides processes in /dev/shm to trigger [WARN] alerts.
  • Unsafe Library Loading: Forces loading of dynamic libraries from /tmp via a Python script to trigger [UNSAFE] alerts.
  • Disk Stress: Generates high I/O throughput to test IO accounting.

How to Run:

sudo ./scripts/chaos_maker.sh

To Stop: Press Ctrl+C. The script traps the signal and automatically cleans up the network rules (tc qdisc del) and temporary files.

Project Structure

├── src/
│   ├── inspector.py           # Main Entry Point   └── sys_inspector/
│       ├── bpf_programs.py    # C eBPF Code       ├── sys_info.py        # Inventory & Topology       └── report_generator.py # HTML Engine
├── scripts/
│   ├── chaos_maker.sh         # Chaos Engineering Tool   └── run_python_test.sh     # Linter (Pylint/Flake8)
├── logs/                      # Default output directory
└── README.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sys_inspector-0.30.9.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sys_inspector-0.30.9-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

Details for the file sys_inspector-0.30.9.tar.gz.

File metadata

  • Download URL: sys_inspector-0.30.9.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for sys_inspector-0.30.9.tar.gz
Algorithm Hash digest
SHA256 8457dd62bf6ef01ee1021ead7b1aadc196f737d6ec7535c947124f9722f3df60
MD5 4f920ce2ee038f2a7a0a493d4b05f8fa
BLAKE2b-256 ba3d2a8c0eb4c61c9a1da8761d51efc9bebc8297c0f2a52b2a3a657a43824604

See more details on using hashes here.

File details

Details for the file sys_inspector-0.30.9-py3-none-any.whl.

File metadata

  • Download URL: sys_inspector-0.30.9-py3-none-any.whl
  • Upload date:
  • Size: 34.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.25.1 requests-toolbelt/1.0.0 urllib3/1.26.20 tqdm/4.64.1 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for sys_inspector-0.30.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ed4666bca3970c2642d78cca1bda49e5a3b8376a130c55bba9c489208f8beae1
MD5 085c12b80aa6ce9c2438c6ee00a134a5
BLAKE2b-256 4d8d024e7c5bb01285e9b9c217dd1109c5f9bb032b9b3b6d9ff8c6c1fbea1aac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page