Narayanastra - Agentless Linux Rootkit Scanner Built in Rust
By Kushagra Dwivedi · 2 min read
Narayanastra is a free, open-source (MIT-licensed) post-compromise rootkit and backdoor scanner for Linux, written in Rust by Kushagra Dwivedi. If you suspect a Linux server has been compromised, this tool helps you find out — scanning for
Narayanastra is a free, open-source (MIT-licensed) post-compromise rootkit and backdoor scanner for Linux, written in Rust by Kushagra Dwivedi. If you suspect a Linux server has been compromised, this tool helps you find out — scanning for hidden processes, rootkits, backdoors, and persistence mechanisms without installing any agent on the target system.
It was recently listed on Hacker News (Show HN) and is available at: github.com/Tekush1/narayanastra
How It Works
Narayanastra queries the system in two independent ways and compares the results. A mismatch between what the kernel reports and what /proc shows is a strong indicator that something is hiding. Every finding is labeled Danger, Warning, or Info, and each carries a MITRE ATT&CK technique ID where applicable.
Key Features
Agentless & cross-view detection
Compares raw kernel data (syscalls, netlink, bind()) with /proc output to expose hidden processes, sockets, kernel modules, and eBPF programs.
Doesn't trust the host
Avoids relying on tools like ps or ss that a rootkit could poison. It reads /proc using raw syscalls and only runs root-owned external binaries by absolute path.
Offline forensics
Can scan a mounted disk image while the suspected rootkit isn't running — useful for post-incident analysis.
HMAC-signed baselines
Supports integrity baselines and live-versus-offline comparison to detect changes over time.
Multiple output formats
Text and JSON by default; HTML, SARIF, and NDJSON available on request — integrates easily into existing security pipelines.
Single static binary
Ships as a ~3.5 MB musl-compiled binary. No installation required. Just drop and run.
Quick Start
# Download and run a quick scan
sudo ./narayanastra-linux-x86_64
# Deep scan
sudo ./narayanastra-linux-x86_64 --full
# Watch mode (continuous monitoring)
sudo ./narayanastra-linux-x86_64 --watch
# Offline forensics on a mounted image
sudo ./narayanastra-linux-x86_64 --offline
# Container scan
sudo ./narayanastra-linux-x86_64 --container
Exit codes:
- 0 — Clean, nothing found
- 1 — Warnings detected
- 2 — Danger signals found
- 3 — Scanner error or incomplete scan
Detection Modules
Linux builds include 12 parallel detection modules:
- Rootkit signatures
- Hidden processes
- Network anomalies
- Suspicious files
- Memory analysis
- Log tampering / anti-forensics
- Persistence mechanisms
- io_uring abuse
- eBPF program inspection
- Kernel hook detection
- Container escape indicators
- Backdoor patterns
Windows support is also included via 7 PowerShell-based checks.
Who Is It For?
Narayanastra is designed for:
- Sysadmins who need a quick compromise check on a server
- Incident responders working a live or post-mortem investigation
- Blue teams adding a rootkit scan to their detection pipeline
- Security students learning about Linux malware and detection techniques
The tool is intended only for systems you own or are authorized to scan.
Limitations
As a user-space scanner, Narayanastra cannot fully defeat a kernel rootkit that controls every view it checks. Some modules require root or specific kernel capabilities — the report clearly states when a view is unavailable rather than silently skipping it.
Resources
- GitHub: https://github.com/Tekush1/narayanastra
- Hacker News: Show HN thread listing