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 - Agentless Linux Rootkit Scanner Built in Rust

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:

Detection Modules

Linux builds include 12 parallel detection modules:

  1. Rootkit signatures
  2. Hidden processes
  3. Network anomalies
  4. Suspicious files
  5. Memory analysis
  6. Log tampering / anti-forensics
  7. Persistence mechanisms
  8. io_uring abuse
  9. eBPF program inspection
  10. Kernel hook detection
  11. Container escape indicators
  12. Backdoor patterns

Windows support is also included via 7 PowerShell-based checks.

Who Is It For?

Narayanastra is designed for:

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

Read this post on CyberHx →