Ring-0 Kernel Telemetry & Host Malware Defense Suite • v0.13.0

Host Malware & Ghost-in-the-Ring Kernel Rootkit Hunter

Enabled by default via the host-malware-rootkit plugin, Axonwall pairs eight battle-tested host integrity & malware engines (rkhunter, chkrootkit, ClamAV, AIDE, YARA, Lynis, unhide, and debsums) with our Ghost-in-the-Ring 5-hook Ring-0 CO-RE BPF-LSM guard and Linux 6.9+ BPF_TOKEN_CREATE mediator—engineered to block Copy Fail (CVE-2026-31431), syscall-less io_uring implants, cross-tenant UserNS bpf_probe_read_kernel() escapes, and self-hiding eBPF rootkits when kprobes and syscall tables lie.

1. Eight-Engine Host Malware & Integrity Suite (host-malware-rootkit)

Network perimeter defense is incomplete if the appliance or hypervisor host itself is compromised. Axonwall orchestrates eight complementary host security scanners from a unified declarative configuration under hostDefense: in /etc/axonwall/security.yaml:

rkhunter, chkrootkit & unhide

Scans kernel symbol tables (/proc/kallsyms), LKM module paths, brute-forced hidden PID/TID namespaces (unhide), promiscuous raw sockets, and trojaned system binaries (ps, ss, ls, sshd).

ClamAV Real-Time & Scheduled

Combines freshclam signature updates with clamonacc Linux fanotify on-access scanning across /tmp, /var/tmp, /dev/shm, and ZFS NAS share mountpoints.

AIDE Cryptographic FIM & debsums

Verifies SHA-512 + xattr + inode cryptographic baselines (AIDE) and Debian package MD5/SHA manifests (debsums) across /boot, /etc/axonwall, /usr/bin, and /usr/sbin.

YARA Live Process & ELF Hunting

Sweeps live process memory maps (/proc/<pid>/mem), anonymous memfd_create fileless payloads, and eBPF ELF sections against curated APT & rootkit rule packs.

Lynis CIS & Kernel Hardening Audit

Continuously scores the appliance against CIS / NIST kernel sysctl, PAM, SSH, and systemd sandboxing benchmarks and exports a real-time Hardening Index to the Web Console.

Automated Quarantine & Alerting

Optional automatic quarantine of malicious ELF drops into /var/lib/axonwall/quarantine (mode 0000), instant VictoriaLogs emission, and AI Security Copilot root-cause triage.

2. The Death of the Syscall Boundary: How io_uring Blinds Traditional EDRs

For twenty years, Linux host intrusion detection (auditd, Falco, Tetragon, Osquery) relied on a simple contract: if a userspace process wants to open a file, read /etc/shadow, spawn a socket, or transmit C2 traffic, it must execute a syscall instruction (openat, read, write, connect, sendmsg).

With io_uring (Linux 5.1+), a process calls io_uring_setup(2) and mmap(2)s two shared ring buffers between userspace and Ring-0: the Submission Queue (SQ) and Completion Queue (CQ). When initialized with IORING_SETUP_SQPOLL, the kernel spawns a dedicated Ring-0 thread (iou-sqp-<pid>) that busy-polls the Submission Queue in shared memory—performing file I/O, DNS resolution, and C2 socket reads/writes with zero system calls. Paired with IOSQE_FIXED_FILE, private file descriptors never even appear in the process's standard files_struct table.

How Curing / RingReaper Implants Bypass Syscall-Based EDRs
text
USERSPACE IMPLANT (e.g., Curing / RingReaper)
  +-------------------------------------------------------------------+
  |  1. Writes SQE (IORING_OP_OPENAT / IORING_OP_CONNECT / OP_SEND)   |
  |     directly into mmap()'d shared memory ring buffer.             |
  |  2. ZERO syscalls issued when IORING_SETUP_SQPOLL is active!      |
  +-------------------------------------------------------------------+
                                   |
        Shared Memory Ring         |  (Bypasses tracepoint/raw_syscalls/sys_enter!)
                                   v
  =====================================================================
  LINUX KERNEL (RING-0)
  +-------------------------------------------------------------------+
  |  [iou-sqp-<pid>] / [io-wq] Kernel Worker Thread                   |
  |    -> Polls SQ ring in kernel space                               |
  |    -> Dispatches io_openat2(), io_connect(), io_sendmsg()         |
  |    -> Writes result CQE to Completion Queue                       |
  +-------------------------------------------------------------------+

3. Hunting & Locking Down io_uring Implants

Axonwall enforces kernel.io_uring_disabled = 2 (or 1 restricting io_uring_setup to a dedicated GID), audits anon_inode:[io_uring] descriptors and iou-sqp-* kernel threads, and hooks tracepoint:io_uring:io_uring_submit_req directly inside fs/io_uring.c:

Ring-0 io_uring Opcode Inspection
bash
# Monitor io_uring SQE opcodes even when IORING_SETUP_SQPOLL is active:
# Opcode 18 = IORING_OP_OPENAT, 16 = IORING_OP_CONNECT, 26 = IORING_OP_SEND,
# Opcode 45 = IORING_OP_SOCKET, 46 = IORING_OP_URING_CMD
sudo bpftrace -e '
tracepoint:io_uring:io_uring_submit_req {
  if (args->opcode == 16 || args->opcode == 18 || args->opcode == 26 || args->opcode == 45 || args->opcode == 46) {
    printf("[IO_URING_ALERT] pid=%d comm=%s ring=%p opcode=%d flags=0x%x\n",
           pid, comm, args->ctx, args->opcode, args->flags);
  }
}'

4. Detecting Self-Hiding eBPF Rootkits via /proc/kcore prog_idr & Silicon PMU LBR

Offensive eBPF rootkits (TripleCross, Boopkit, Symbiote) abuse bpf_probe_write_user() (Helper #36) and bpf_override_return() (Helper #58) on sys_exit_getdents64 and fexit/__x64_sys_bpf to hide their PIDs, files, and even their own eBPF program IDs from bpftool prog show.

Because the kernel must maintain every loaded struct bpf_prog inside the internal prog_idr radix tree / XArray so the scheduler and XDP drivers can invoke it, Axonwall walks prog_idr directly in /proc/kcore and diffs the true Ring-0 IDs against sys_bpf(BPF_PROG_GET_NEXT_ID). In parallel, Silicon PMU Last Branch Records (Intel LBR / AMD BRS) and perf_event_open counters (instructions:k, cycles:k) record every hardware jump into bpf_trampoline_* and bpf_prog_* JIT pages inside CPU Model-Specific Registers (MSRs) that eBPF cannot falsify.

5. Preventive Ring-0 Architecture: CO-RE BPF-LSM Hooks & Declarative Configuration

Axonwall compiles and enforces a preventive CO-RE BPF_LSM guard (apps/axonwalld/ebpf/lsm_guard.c) keyed by unspoofable kernel (s_dev, i_ino) executable inode maps rather than mutable comm process names:

1. SEC("lsm/socket_bind")

Neutralizes Copy Fail (CVE-2026-31431) by blocking unauthorized processes from binding AF_ALG (salg_type == "aead") crypto sockets unless their (s_dev, i_ino) matches trustedAfAlgPaths.

2. SEC("lsm/bpf")

Intercepts BPF_PROG_LOAD in Ring-0: in the host namespace (user_ns->level == 0), denies loading unless the calling binary's (s_dev, i_ino) is in trustedBpfLoaderPaths; inside User Namespaces (level > 0), defers safe networking loads to BPF_TOKEN mediation while blocking Ring-0 tracing types.

3. SEC("lsm/uring_sqpoll")

Blocks IORING_SETUP_SQPOLL kernel worker thread creation (-EPERM), eliminating syscall-less ring implants even if an attacker obtains CAP_SYS_NICE or root.

4. SEC("lsm/bpf_token_create")

Audits every Linux 6.9+ bpffs token instantiation and vetoes (-EPERM) any superblock whose delegate_progs bitmask attempts to delegate FORBIDDEN_RING0_TOKEN_PROG_MASK (kprobe, tracepoint, perf_event, raw_tracepoint, tracing, struct_ops, ext, lsm, syscall).

5. SEC("lsm/bpf_token_cmd") — Solving the UserNS vs. Ring-0 `bpf_probe_read_kernel()` Catch-22

Validates every BPF_TOKEN-authorized command inside unprivileged LXC and K3s hostUsers: false containers, permitting verified packet-networking programs (XDP, SCHED_CLS, SOCKET_FILTER, CGROUP_SKB) while guaranteeing no unprivileged tenant can ever load a program capable of calling bpf_probe_read_kernel() against host kernel memory.

/etc/axonwall/security.yaml — HostMalwareDefenseConfigSchema (hostDefense:)
yaml
hostDefense:
  rkhunterEnabled: true
  chkrootkitEnabled: true
  clamavEnabled: true
  aideEnabled: true
  lynisEnabled: true
  yaraEnabled: true
  unhideEnabled: true
  debsumsEnabled: true
  scheduledScanCron: "0 */6 * * *"
  ioUringDisabledMode: 2
  ioUringAllowedGid: 0
  blockIoUringSqpoll: true
  unprivilegedBpfDisabled: true
  bpfJitHardenMode: 2
  kernelLockdownMode: integrity
  bpfLsmGuardEnabled: true
  bpfLsmTokenMediationEnabled: true
  trustedBpfLoaderPaths:
    - /usr/local/bin/axonwalld
    - /usr/sbin/bpftool
  blockAfAlgAeadCopyfail: true
  trustedAfAlgPaths: []
  progIdrKcoreDiffEnabled: true
  pmuLbrBranchTracingEnabled: true
  autoQuarantineOnCritical: false
On-Demand Host Malware & Ring-0 Rootkit Hunting CLI Tools
bash
# Run the full multi-engine host malware + Ring-0 rootkit hunt orchestrator
sudo axonwall-hunt-rootkits

# Audit io_uring anon_inode descriptors, iou-sqp-* threads, and sysctl lockdown
sudo hunt-io-uring-implants.sh

# Audit loaded eBPF programs, kprobes/fentry trampolines, and helper calls
sudo hunt-ebpf-rootkits.sh

# Walk /proc/kcore prog_idr via drgn to expose self-hiding eBPF rootkits
sudo python3 /usr/local/bin/audit_hidden_bpf_prog_idr.py
Manage via Web Console, Neovim TUI, or CLI
Configure hostDefense: in /etc/axonwall/security.yaml via axonwall-config security, inspect live Ring-0 telemetry in the Web Console at /security/rootkit-hunter, or run sudo axonwall-hunt-rootkits from SSH.