DEV Community

Narayanastra: Detect Linux Rootkits With One Command (No Install, Written in Rust)

Is Your Linux Server Already Hacked?

When an attacker breaks into a Linux machine, the first thing they do is hide. Rootkits make processes, files, and network connections invisible to ps, ls, netstat, and most antivirus - because those tools ask the OS what's running, and a rootkit controls that answer.

Narayanastra is a free, open-source post-compromise scanner built in Rust. It detects hidden threats by asking the system the same question two independent ways, then comparing the answers.

How It Works

Narayanastra uses cross-view detection:

  • Compares /proc vs raw syscalls
  • Checks netlink vs bind() probes for hidden sockets
  • Verifies kernel modules via multiple interfaces
  • Detects hidden eBPF programs

If answers don't match, something is hiding - Narayanastra shows you what, where, and severity (Danger / Warning / Info) with MITRE ATT&CK IDs.

Zero Setup. One Command.

curl -sL https://github.com/Tekush1/narayanastra/releases/latest/download/narayanastra-linux-x86_64 -o narayanastra
chmod +x narayanastra && sudo ./narayanastra

Single static binary. No agent. No install.

12 Linux Scan Modules

  • rootkit - Hidden kernel modules, hooks
  • process - Hidden/zombie processes
  • network - Hidden sockets, reverse shells
  • files - Tampered binaries, hidden files
  • memory - JIT shellcode, injected code
  • logs - Log wiping, anti-forensics
  • persistence - Cron backdoors, systemd units
  • eBPF - Hidden eBPF programs
  • kernel hooks - Syscall table modifications
  • container - Container escape indicators
  • io_uring - io_uring-based evasion
  • anti-forensics - Active anti-analysis techniques

Scan Modes

  • Quick - fast overview
  • Full (--full) - expensive deep checks
  • Watch - continuous monitoring, new findings only
  • Offline - scan a powered-off disk where malware can't fight back
  • Remote - SSH upload, scan, download report, cleanup
  • Container - offline-style check against container filesystems

Output Formats

Reports in text, JSON, HTML, SARIF, and NDJSON - ready for your SIEM, CI pipeline, or Slack/Discord webhook. Exit codes: 0 clean, 1 warnings, 2 danger, 3 error.

Why Rust?

  • Memory-safe with zero runtime overhead
  • Static musl binary (no glibc dependency)
  • Runs on x86_64 and aarch64 Linux + Windows
  • Parallel modules for fast scans

Open Source & Free (MIT)

Built by Kushagra Dwivedi - founder of CyberHX, a cybersecurity platform focused on practical security tools and training.

GitHub: https://github.com/Tekush1/narayanastra

Star it, try it on your servers, open an issue if you find something interesting. 🛡️

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.