Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/0xkirisame/spica
Defensive ToolsIndicator of Compromise (IOC) ManagementForensicsMalware AnalysisBinary AnalysisIntrusion DetectionPapers & ResearchLearning & EducationIncident ResponseAnomaly Detection
GitHub0xkirisame/spica

SPiCa

eBPF-based Linux rootkit detector using multi-channel cross-view analysis (sched_switch, NMI, /proc) to detect DKOM, tracepoint tampering, and process hiding with hardware-level integrity verification.

View Repository
1046651 month agoReviewed by Kitploit
Share

SPiCa

System Process Integrity & Cross-view Analysis

SPiCa

"I'm going to sing, so shine bright, SPiCa..."

SPiCa is an eBPF-based Linux rootkit detector written in Rust. The name comes from the Hatsune Miku song SPiCa and the star it references — Spica (Alpha Virginis), the brightest point in Virgo. What looks like a single star to the naked eye is actually a spectroscopic binary: two stars in mutual orbit, indistinguishable as separate objects without measuring their spectra. SPiCa applies the same principle to kernel observation: multiple independent channels measure the same kernel state from physically distinct mechanisms, and a rootkit that suppresses one is exposed by the others.

Disclaimer: Significant portions of this codebase were generated or refactored with GLM assistance. Rigorous testing and iterative design were applied, but review the code for security and performance before production use.


Table of Contents

  1. Threat Model
  2. Architecture Overview
  3. The sched_switch Ledger Writers
  4. The NMI Ledger Notary
  5. Detection Logic
  6. Integrity Model: Freeze + Chain + Notary
  7. LSM Gates: Module Blocking + Deny-by-Default bpf()
  8. Why There Is No Key
  9. TPM PCR Anchoring (Implemented) + One-Time Uninstall Token (Design)
  10. Defense in Depth
  11. The BTF Bug Incident
  12. Known Limitations & Attack Surface
  13. Build & Run
  14. Roadmap
  15. Glossary

1. Threat Model

The constrained adversary: the eBPF rootkit

SPiCa is designed to defeat the eBPF-constrained adversary — an attacker with elevated privileges (CAP_BPF or CAP_SYS_ADMIN) who loads a privileged eBPF program into the kernel. This adversary is fundamentally weaker than an LKM rootkit because the BPF verifier imposes hard constraints:

ConstraintEffect on adversary
Bounded loops (~1M instructions per program)Cannot scan all of kernel memory
Pointer safety (direct dereference requires provably valid, bounded target)Cannot follow arbitrary pointers
Restricted helpers (per-program-type allowlist)Cannot call kmalloc, vmalloc, or any kernel allocation function
No arbitrary kernel write (bpf_probe_write_kernel heavily restricted)Cannot modify task_struct, tracepoint funcs arrays, or BPF program bytecode
Map access scoped to loaded referencesCannot access maps belonging to other programs (ID enumeration is closed by the deny-by-default bpf() gate — see §7)

With LKMs blocked by the LSM gate after boot, this constrained adversary is the realistic remaining threat. SPiCa's anti-evasion machinery is calibrated for this threat — every defense is honest about what it covers and what it doesn't.

Non-goals

  • Nation-state kernel exploits — memory corruption yielding arbitrary kernel write without init_module. SPiCa raises the floor by blocking the easier LKM vector but does not ceiling the adversary.
  • Hostile LKMs loaded before SPiCa started — defense in depth (Secure Boot, module signing, IMA) is required for the boot window.
  • Verifier exploits — if the BPF verifier is unsound (historical CVEs: CVE-2020-27194, CVE-2022-23222, CVE-2023-2163), the adversary escapes the constrained model into arbitrary kernel code execution. This is a separate threat class. SPiCa's defenses hold under a correct verifier.

SPiCa is the last-resort layer in a defense-in-depth stack, not a substitute for the layers above.


2. Architecture Overview

SPiCa runs seven eBPF programs attached to kernel hooks, plus a userspace detection engine that cross-correlates their output against the system's view of itself (/proc).

Observation channels, each suppressible only by a mechanism of escalating cost

ChannelMechanismWhat suppresses itCost of suppression
/procprocfs directory enumerationDKOM (unlink process from task list)Low — well-understood rootkit technique
Ledger writers (sched_switch, fork, exit)eBPF tracepoints appending to per-CPU hash chainsDetach programs; filter contextMedium — requires kernel write to funcs array, and the chain freezes → TAMPER
NMI notaryHardware perf counter interrupt → eBPF perf eventHook the IDT/NMI handlerNear-certain kernel panic — hardware interrupt, not maskable

The key architectural property: a rootkit cannot suppress the ledger and the notary simultaneously without the suppression itself becoming detectable or destabilizing. Suppressing NMI requires patching the IDT (Interrupt Descriptor Table), which panics on most kernels. Suppressing the ledger writers stops the chains advancing — and the NMI notary (which snapshots chain position from hardware interrupt context) is still running to notice. This is the "live bomb" — the attacker's only path to total blindness is one that likely crashes the system.

Detection model — one loop, three views, one truth table

Every tick takes exactly three snapshots and classifies every TGID against a single differential anchored on the ledger — no separate check paths, no second loops:

ViewWhat it isWhat spoofs it
Lledger sighting — chain-verified kernel scheduler truth (frozen, NMI-notarized)only kernel-level suppression → TAMPER/SILENT
R/proc via raw getdents64DKOM (kernel unlinks the task)
C/proc via libc readdir — the view every tool (ps/ls/top) getsLD_PRELOAD hook or DKOM
L R C  → verdict
1 0 0  → DKOM     — scheduler runs it, kernel won't list it (both /proc paths blind)
x 1 0  → HOOK     — kernel lists it, libc hides it (LD_PRELOAD interception)
0 1 x  → GHOST    — /proc lists what the scheduler has never run (fake/idle entry)
0 0 1  → INJECT   — libc reports a process the kernel doesn't have (fabricated entry)

Every deviation from the honest 111 pattern is a detection, and the pattern itself localizes the layer — kernel, libc, or entry-fabrication. Channel-level integrity rides above the table: chain gap/divergence/notary mismatch → TAMPER; global silence → SILENT.

Each detection class is a differential verdict: a discrepancy between two or more channels. The detection engine is a pure function over the registry + /proc snapshot + channel timestamps — no I/O, no side effects, fully unit-testable.

The ledger redesign: from secrecy to tamper-evidence

The original architecture tried to hide state (XOR key in .bss, "verifier-bounded address secrecy"). That assumption was wrong: .bss globals are backed by an ordinary BPF_MAP_TYPE_ARRAY map, enumerable with BPF_MAP_GET_NEXT_ID → BPF_MAP_GET_FD_BY_ID → BPF_MAP_LOOKUP_ELEM by any CAP_SYS_ADMIN process — the key was readable, and worse, BPF_MAP_UPDATE_ELEM could spoof the heartbeat itself from userspace, defeating the NMI integrity check without touching the kernel.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    786
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    506
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    429
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    345
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    262
  • 6

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    256

Explore all tools

Browse our collection of tools

View all tools →