Nyx: The Revolutionary Forensic Trace Cleaner for All Platforms
Every command you type, every application you launch, every file you open leaves a digital fingerprint. In an era where digital forensics tools can reconstruct your entire computing history from scattered artifacts, maintaining privacy feels like an impossible battle. Enter Nyx—the self-contained, cross-platform powerhouse that obliterates over 50 categories of forensic traces with a single command. Created by renowned security researcher Simone Margaritelli (evilsocket), this alpha-stage tool is already turning heads in cybersecurity circles for its unprecedented scope and surgical precision across Linux, macOS, and Windows.
This comprehensive guide dives deep into Nyx's capabilities, revealing how it protects your digital footprint, real-world scenarios where it shines, and step-by-step instructions for deployment. Whether you're a penetration tester sanitizing post-engagement artifacts, a privacy-conscious developer, or a security professional hardening systems, you'll discover why Nyx is becoming the essential tool in every security-aware user's arsenal. We'll dissect actual code examples, explore advanced usage patterns, and compare it against existing solutions—giving you everything needed to master this revolutionary forensic cleaner.
What Is Nyx and Why Is It Reshaping Digital Privacy?
Nyx is a self-contained forensic trace removal script named after the Greek goddess of night—an apt metaphor for plunging your digital activities into darkness. Developed by evilsocket, the cybersecurity persona of Simone Margaritelli, this tool represents a paradigm shift in privacy protection. Margaritelli, famous for creating BetterCAP and other offensive security tools, brings his deep understanding of digital forensics to create something equally powerful but defensive in nature.
Unlike traditional privacy tools that focus on browser caches or temporary files, Nyx takes a scorched-earth approach to forensic artifacts. The tool operates as a single bash script on Linux/macOS and a PowerShell script on Windows, requiring zero dependencies beyond standard system utilities. This design philosophy ensures maximum portability and minimal attack surface—critical considerations for security software.
The project explicitly carries an alpha software warning, which paradoxically contributes to its trending status in security communities. This transparency about maturity level builds trust while signaling rapid evolution. What makes Nyx genuinely revolutionary is its cross-platform uniformity—the same conceptual approach works identically whether you're sanitizing a Ubuntu server, a macOS workstation, or a Windows 11 machine. In a landscape where most privacy tools are platform-specific, Nyx's universal approach addresses a critical gap.
Nyx's trending momentum stems from three converging factors: escalating privacy concerns in post-Snowden era, the proliferation of digital forensics in corporate environments, and the cybersecurity community's growing appreciation for offensive-informed defensive tools. As forensic analysis becomes standard in incident response, insider threat investigations, and even routine IT audits, the ability to ethically and effectively sanitize systems has transformed from a niche skill to essential knowledge.
Key Features: The Technical Arsenal That Makes Nyx Unstoppable
Nyx's feature set reads like a forensic analyst's worst nightmare—comprehensive, systematic, and ruthlessly efficient. The tool organizes its capabilities into OS-specific modules, each targeting distinct artifact categories that forensic tools exploit to reconstruct user activities.
Linux Domination: 15 Specialized Modules
The Linux implementation is Nyx's most mature component, boasting 15 dedicated modules that clean traces from over 50 applications and system components:
-
Shell Module: Obliterates history files across 20+ interpreters including bash, zsh, python, mysql, redis, mongo, docker, IPython, Ruby IRB, PHP, Perl, Erlang, Lua, Julia, Scala, Haskell, Octave, and MATLAB. It doesn't just delete files—it targets command histories and recently-used file lists that betray your workflow patterns.
-
Logs Module: Performs surgical strikes on system logs (auth, syslog, kernel, boot), web server logs (Apache, Nginx), journald entries, database logs (MySQL, PostgreSQL, Redis, MongoDB), VPN/proxy logs (OpenVPN, Squid), mail server logs (Postfix, Dovecot), and monitoring stacks (Elasticsearch, Logstash, Kibana). This prevents timeline reconstruction from service logs.
-
Audit Module: Targets Linux Audit Framework logs, search logs, and in-kernel audit rules themselves—critical for evading system-level monitoring that many enterprises deploy.
-
Network Module: Wipes ARP caches, NetworkManager connection histories, DHCP leases, MySQL binary logs, InnoDB transaction logs, VPN configurations (OpenVPN, WireGuard), mail spool files, and iptables rules that reveal network activity patterns.
-
User Module: The most expansive module, sanitizing login records, thumbnails, GTK bookmarks, GNOME Tracker databases, Zeitgeist activity logs, and traces from development ecosystems (Git, SVN, Mercurial, Maven, Gradle, npm, pip, Cargo). It extends to cloud tools (AWS, GCP, Azure, Kubernetes, Terraform), monitoring systems (Prometheus, Grafana), backup solutions (Rsync, Restic, Borg, Duplicity), and security tools (Metasploit, Nmap, Aircrack-ng, John the Ripper, Hashcat).
macOS Precision: 7 Tailored Modules
macOS support addresses Apple's unique forensic landscape:
-
macOS Module: Targets .DS_Store files, user trash metadata, Spotlight indexes, QuickLook thumbnails, and unified system logs that macOS uses for file tracking.
-
Unified Module: Focuses on unified logging system (10.12+), diagnostic reports, and log archives—Apple's modern replacement for traditional text logs.
-
FileEvents Module: Wipes FSEvents databases that record every file system modification and quarantine databases that track downloaded files.
-
Usage Module: Sanitizes the KnowledgeC database (Apple's user activity goldmine), Notification Center history, and recent items lists across applications.
Windows Annihilation: 7 Powerful Modules
Windows support demonstrates Nyx's enterprise-aware design:
-
Events Module: Clears Event logs including Security, System, Application, Sysmon, PowerShell/Operational, AppLocker, and AMSI logs that EDR solutions monitor religiously.
-
Registry Module: Targets MRU (Most Recently Used) lists, USB device history, BAM/DAM (Background Activity Monitor), ShellBags, UserAssist keys, Terminal Server Client cache, and Office MRUs—favorite hunting grounds for forensic investigators.
-
Filesystem Module: Wipes the USN journal (NTFS change log), recycle bin metadata, thumbcache, shortcuts, index files, SRUM database, and notification history.
-
Security Module: The crown jewel for enterprise environments, targeting EDR/AV logs (CrowdStrike Falcon, SentinelOne, Carbon Black, McAfee, Symantec), Windows Defender ATP, Firewall logs, WMI activity, BitLocker keys, Group Policy cache, and Hyper-V/WSL/Docker logs.
Real-World Use Cases: Where Nyx Transforms Your Security Posture
Scenario 1: Post-Engagement Sanitization for Penetration Testers
After completing a client penetration test, your Linux attack VM contains a treasure trove of forensic evidence: bash history with exploited IP addresses, Metasploit logs revealing successful payloads, Nmap scan results in command history, and Wireshark captures with sensitive network data. Running sudo ./nyx.sh -m shell,pentest,network,logs --force executes a surgical cleanup, removing all traces of your testing activities while preserving the system for future engagements. The dry-run capability lets you verify the sanitization scope before committing, ensuring you don't accidentally destroy evidence needed for your report.
Scenario 2: Privacy Protection on Shared Workstations
You're a privacy-conscious developer using a shared macOS machine in a co-working space. Your activities—repositories cloned, APIs tested, client databases queried—are being logged by macOS's KnowledgeC database and Spotlight. A simple ./nyx.sh --dry-run reveals exactly what artifacts exist, then sudo ./nyx.sh -m macos,usage,shell --force eliminates your digital trail. This prevents subsequent users or administrators from reconstructing your project work, protecting both your intellectual property and client confidentiality.
Scenario 3: Sensitive Project Isolation for Consultants
As a security consultant handling multiple client projects on the same Windows laptop, you need compartmentalization between engagements. Windows Timeline, PowerShell history, and registry MRUs create cross-contamination risks. Executing . yx.ps1 -Modules REGISTRY,HISTORY,TEMP -Force between projects ensures that commands, file accesses, and application usage from Client A never leak into Client B's environment. The audit logging feature (-LogFile) creates a sanitized record for compliance purposes.
Scenario 4: Incident Response Environment Preparation
Before deploying a Linux forensics workstation for incident response, you must ensure it's free from prior investigation artifacts that could contaminate evidence. Running sudo ./nyx.sh --force on a fresh imaging of your analysis VM guarantees no residual logs, shell histories, or temporary files from previous cases. This establishes a clean baseline, crucial for maintaining chain-of-custody integrity and preventing cross-case contamination that could be challenged in legal proceedings.
Step-by-Step Installation & Setup Guide
Prerequisites and Security Considerations
Before deploying Nyx, understand that administrative privileges are mandatory—this tool modifies system-level files and logs. On Linux/macOS, you'll need sudo access. On Windows, PowerShell must run as Administrator. Always download Nyx directly from the official GitHub repository to prevent supply chain attacks. The alpha status means you should test thoroughly in non-production environments first.
Linux and macOS Installation
The installation process leverages standard Unix utilities, ensuring compatibility across distributions:
# Step 1: Download the script directly from GitHub's raw content server
# Using wget for its simplicity and widespread availability
wget https://github.com/evilsocket/nyx/raw/refs/heads/main/nyx.sh
# Step 2: Enable execution permissions
# The +x flag makes the script executable, required for direct invocation
chmod +x nyx.sh
# Step 3: Perform a dry-run to audit what will be cleaned
# This critical first run reveals the scope of changes without modifying anything
sudo ./nyx.sh --dry-run
# Step 4: Execute full sanitization after reviewing dry-run output
# The --force flag bypasses interactive confirmation for automation
sudo ./nyx.sh --force
Security Best Practice: After downloading, verify the script's integrity by checking its hash against community-verified values, even though the repository uses HTTPS. Store Nyx in a protected directory like /usr/local/bin with restricted permissions: sudo mv nyx.sh /usr/local/bin/nyx && sudo chmod 700 /usr/local/bin/nyx.
Windows Installation
Windows deployment uses PowerShell's native web request capabilities:
# Step 1: Download the PowerShell script using Invoke-WebRequest
# This cmdlet is PowerShell's equivalent to wget/curl
Invoke-WebRequest -Uri "https://github.com/evilsocket/nyx/raw/refs/heads/main/nyx.ps1" -OutFile "nyx.ps1"
# Step 2: Execute dry-run to preview changes
# PowerShell requires explicit path notation for local scripts
.\nyx.ps1 -DryRun
# Step 3: Run full cleaning with audit logging
# -Force enables execution, -LogFile creates forensic record of cleaning actions
.\nyx.ps1 -Force -LogFile "nyx-audit.log"
Critical Windows Note: Execution policy may block scripts. Set it temporarily: Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process. Always run from an elevated PowerShell prompt (right-click → Run as Administrator).
REAL Code Examples from the Repository: Deep Dive Analysis
Linux/macOS Download and Execution Pattern
# Download nyx.sh from the main branch's raw content
# The URL structure ensures you get the latest version directly from source
wget https://github.com/evilsocket/nyx/raw/refs/heads/main/nyx.sh
# Make the script executable - without this, the system treats it as text
chmod +x nyx.sh
# CRITICAL FIRST STEP: Dry-run mode simulates all operations
# This parses the system, identifies targets, but performs NO deletions
# Always run this first to understand the blast radius
sudo ./nyx.sh --dry-run
# Full execution with force flag
# Bypasses "Are you sure?" prompts for automated/scripted usage
# Iterates through all applicable modules, cleaning each artifact category
sudo ./nyx.sh --force
Technical Insight: The --dry-run flag is implemented by creating a sandboxed execution path where file deletion commands are replaced with echo statements. This allows you to preview commands like rm -rf /var/log/auth.log without execution risk.
Windows PowerShell Implementation
# Download the PowerShell implementation
# Invoke-WebRequest uses TLS 1.2+ by default, ensuring secure transmission
Invoke-WebRequest -Uri "https://github.com/evilsocket/nyx/raw/refs/heads/main/nyx.ps1" -OutFile "nyx.ps1"
# Execute with dry-run parameter
# PowerShell's verb-noun syntax makes parameters self-documenting
.\nyx.ps1 -DryRun
# Full execution with audit trail
# -Force enables destructive operations, -LogFile captures all actions
# The log itself becomes a forensic artifact, so secure it appropriately
.\nyx.ps1 -Force -LogFile "nyx-audit.log"
PowerShell Specifics: The -OutFile parameter saves the script to current directory. The leading \.\ is required because PowerShell doesn't execute scripts in the current path by default (security feature). The -LogFile creates a CSV-formatted audit trail showing every action, timestamp, and result.
Selective Module Execution
# List all available modules for your OS
# This queries the script's internal module registry and displays OS-specific options
./nyx.sh --list
# Targeted cleaning: only shell and logs modules
# Comma-separated values allow precise control, reducing system impact
# Perfect for scheduled cleanups between specific operations
sudo ./nyx.sh -m shell,logs
# Verbose debugging during dry-run
# Shows each decision point: file discovery, permission checks, deletion logic
./nyx.sh --dry-run --debug
Module Selection Strategy: The -m flag accepts case-insensitive module names. On Linux, shell,logs,audit creates a minimal footprint cleanup ideal for post-command sanitization. The --debug output reveals Nyx's internal logic, helping you understand what gets cleaned and why.
Windows Advanced Mode
# Enable advanced mode with memory hardening
# This activates additional techniques like memory scrubbing and handles advanced artifacts
.\nyx.ps1 -Advanced -Force
# Clean specific modules with case-insensitive matching
# PowerShell's parameter binding automatically handles uppercase/lowercase
.\nyx.ps1 -Modules EVENTS,TEMP -Force
# Comprehensive audit with debug verbosity
# Combines logging with console output for real-time monitoring
.\nyx.ps1 -Force -LogFile "audit.log" -Debug
Advanced Mode Explained: The -Advanced flag on Windows enables registry transaction flushing, memory-resident artifact clearing, and TPM log sanitization. This mode takes longer but provides deeper cleaning necessary for high-security environments.
Advanced Usage & Best Practices for Maximum Security
The Dry-Run Doctrine
Never execute Nyx without --dry-run first in a new environment. This discipline prevents accidental data loss and reveals the tool's scope on your specific system configuration. Schedule dry-runs weekly to audit what artifacts accumulate over time.
Selective Module Strategy
Instead of --force cleaning everything, adopt a targeted approach:
- Pre-engagement: Clean only
shell,logsto prevent cross-contamination - Post-browser: Use
browsermodule after sensitive research - Developer context: Run
-m shell,package,mlto clean project-specific traces
Automation and Scheduling
Linux/macOS: Create a cron job for periodic sanitization:
# Edit crontab: crontab -e
# Add line for daily cleanup at 2 AM
0 2 * * * /usr/local/bin/nyx --force -m shell,logs,temp
Windows: Use Task Scheduler with a PowerShell script that calls Nyx with appropriate parameters. Enable -LogFile to maintain compliance records.
Audit Log Management
When using -LogFile, treat the log as a sensitive artifact. Immediately encrypt it:
# After Nyx execution
gpg --encrypt --recipient your@email.com nyx-audit.log
shred -u nyx-audit.log # Securely delete original
Alpha Software Precautions
Since Nyx is alpha software:
- Test on disposable VMs before production use
- Review script updates before deploying new versions
- Contribute bug reports to help stabilize the codebase
- Maintain backups of critical data outside Nyx's cleaning scope
Comparison: Nyx vs. Existing Privacy Tools
| Feature | Nyx | BleachBit | CCleaner | Manual Scripts |
|---|---|---|---|---|
| Cross-Platform | ✅ Linux/macOS/Windows | ✅ Linux/Windows | ❌ Windows/macOS only | ❌ Platform-specific |
| Forensic Focus | ✅ Deep artifact cleaning | ⚠️ Basic traces | ⚠️ Consumer-focused | ⚠️ Incomplete coverage |
| Single Script | ✅ Self-contained | ❌ Requires installation | ❌ Requires installation | ⚠️ Fragmented approach |
| Enterprise Artifacts | ✅ EDR/AV logs, SIEM | ❌ Limited | ❌ Minimal | ❌ Rarely included |
| Open Source | ✅ GPL 3 | ✅ GPL 3 | ❌ Proprietary | ✅ Varies |
| Active Development | ✅ Alpha, rapid iteration | ⚠️ Mature, slower | ⚠️ Commercial focus | ❌ Community-dependent |
| Command-Line | ✅ Native | ✅ Native | ⚠️ GUI-focused | ✅ Native |
Why Nyx Wins: Traditional tools like BleachBit focus on consumer privacy (cookies, caches). Nyx targets forensic-grade artifacts that incident responders and law enforcement exploit. Its single-script architecture eliminates installation trails that could be forensically recovered. The inclusion of security tool traces (Metasploit, Nmap, Burp Suite) acknowledges the unique needs of cybersecurity professionals—something no commercial tool addresses.
Frequently Asked Questions: Expert Answers
Q: Is Nyx safe to run on production systems?
A: As alpha software, Nyx carries inherent risks. Always test in a staging environment matching your production configuration. The --dry-run flag is your safety net—use it religiously. For critical systems, run Nyx after backups and during maintenance windows.
Q: Will Nyx delete my important files or break applications? A: Nyx targets forensic artifacts, not user data. It won't touch your documents, projects, or databases. However, it will delete shell histories, logs, and temporary files. Some applications may lose recent file lists or command history—intentional privacy features, not bugs.
Q: How does Nyx differ from simply running rm -rf ~/.bash_history?
A: Manual deletion leaves gaps. Nyx cleans dozens of history files across shells (bash, zsh, fish), interpreters (Python, Ruby, PHP), and tools (Docker, MySQL). It also wipes in-memory artifacts, log rotations, and forensic recovery points that simple deletion misses.
Q: Can forensic tools detect that Nyx was used? A: Yes—Nyx is not anti-forensics in the evasion sense. It creates its own artifacts (audit logs, timestamp changes). However, it removes the content investigators care about. Use Nyx ethically: for privacy protection, not evidence destruction.
Q: Why is Nyx still in alpha if it's so powerful? A: Alpha status reflects feature completeness, not stability. Margaritelli is transparent about rapid iteration. The core cleaning engines are solid, but module coverage expands weekly. Alpha means "use with caution," not "non-functional."
Q: How frequently should I run Nyx?
A: Daily for high-security environments via automated scheduling. Weekly for personal privacy. After each sensitive operation for researchers handling confidential data. The --dry-run flag lets you audit artifact accumulation rates on your system.
Conclusion: Embrace the Night, Control Your Digital Shadow
Nyx represents a fundamental shift in privacy tool design—forensic-aware, cross-platform, and uncompromisingly thorough. While its alpha status demands cautious deployment, the tool's architecture and evilsocket's reputation suggest a bright future. The ability to sanitize EDR logs, development tool histories, and security research artifacts addresses a gap that commercial tools deliberately ignore.
For cybersecurity professionals, Nyx is becoming as essential as Nmap or Metasploit. For privacy advocates, it offers enterprise-grade protection previously reserved for corporate environments. The single-script design philosophy ensures you can audit every line of code before execution—a critical feature in an era of supply chain attacks.
Your next step: Download Nyx from the official GitHub repository, run --dry-run on a test system, and witness the shocking volume of forensic artifacts accumulating on your machine. Join the Discord community to share use cases, report bugs, and shape Nyx's evolution. In the arms race between surveillance and privacy, Nyx hands you a powerful weapon—wield it wisely.
The night is yours to command. Your digital shadow is yours to control. Nyx makes it possible.