{"slug": "show-hn-nightcrawler-a-local-ai-pentesting-agent-running-on-a-smartphone", "title": "Show HN: Nightcrawler – A local AI pentesting agent running on a smartphone", "summary": "Nightcrawler v0.1.0, an autonomous penetration testing agent that runs entirely on a smartphone, has been released as an open-source project. The agent, which operates without cloud connectivity, uses a 1.2-billion-parameter LFM2.5-1.2B-Instruct-Heretic model on the phone's GPU to discover hosts, map services, find vulnerabilities, and generate a pentest report. It includes optional WiFi cracking and a web dashboard for monitoring, and is designed to be stealthier than traditional scanners by rotating across hosts and performing small actions over time.", "body_md": "An autonomous penetration testing agent that runs entirely on a smartphone. Drop the phone on a network, walk away, and it discovers hosts, maps services, finds vulnerabilities, and generates a pentest report — all without cloud connectivity.\n\n```\n ░█▄░█ █ █▀▀ █░█ ▀█▀ █▀▀ █▀█ ▄▀█ █░█░█ █░░ █▀▀ █▀█\n ░█░▀█ █ █▄█ █▀█ ░█░ █▄▄ █▀▄ █▀█ ▀▄▀▄▀ █▄▄ ██▄ █▀▄  v0.1.0\n\n AUTONOMOUS MOBILE PENTEST AGENT\n OnePlus 8 · NetHunter · LFM2.5-1.2B · OpenCL GPU\n```\n\n**Penetration testing** (pentesting) is the practice of testing a computer network's security by simulating an attack — with the network owner's explicit permission. Professional pentesters are hired to find vulnerabilities *before* real attackers do.\n\nNightcrawler automates this process on a phone. It uses a small AI model (LFM2.5-1.2B-Instruct-Heretic, 1.2 billion parameters) running locally on the phone's GPU to decide what to do next — which host to probe, which tool to use, what to look for. No internet connection or cloud API required.\n\n**WiFi Breach**(optional) — If dropped without WiFi, it can autonomously crack WPA2 networks using an external USB WiFi adapter** Reconnaissance**— Discovers devices on the network using stealthy scans** Enumeration**— Probes discovered services (web servers, file shares, SSH, DNS, etc.)** Exploitation**— Tests for known vulnerabilities and default credentials** Reporting**— Generates a structured pentest report with findings and remediation advice\n\nThe agent operates like a patient human pentester — it rotates across hosts, does one small action per turn, and builds knowledge gradually over hours. This makes it much harder to detect than traditional vulnerability scanners that blast every host at once.\n\n| Term | What it means |\n|---|---|\nDrop box |\nA device left on a target network to perform testing autonomously |\nScope |\nThe set of networks/hosts you're authorized to test |\nRules of Engagement (ROE) |\nA legal document specifying what you're allowed to do |\nStealth |\nTechniques to avoid detection by network monitoring (IDS/IPS) |\nMCP |\nModel Context Protocol — a standard interface for AI tool use |\nC2 |\nCommand and Control — the web dashboard for monitoring and steering the agent |\n\n```\n┌──────────────────────────────────────────────────────────┐\n│                   PHONE (OnePlus 8)                       │\n│                                                           │\n│  ┌─────────────┐     ┌──────────────────┐                │\n│  │  LFM2.5     │     │  Agent Loop      │                │\n│  │  1.2B model │◄───►│  (main.py)       │                │\n│  │  on GPU     │     │  Decides what     │                │\n│  │  (:8080)    │     │  to do next       │                │\n│  └─────────────┘     └────────┬─────────┘                │\n│                               │                           │\n│                      ┌────────▼─────────┐                │\n│                      │  Scope Proxy     │  ← Safety layer │\n│                      │  Validates every │    Blocks out-  │\n│                      │  command before  │    of-scope     │\n│                      │  execution       │    actions      │\n│                      └────────┬─────────┘                │\n│                               │                           │\n│                      ┌────────▼─────────┐                │\n│                      │  Kali MCP Server │  ← Runs the    │\n│                      │  nmap, curl,     │    actual       │\n│                      │  smbclient, ...  │    commands     │\n│                      └──────────────────┘                │\n│                                                           │\n│  ┌──────────────────┐  ┌──────────────────┐              │\n│  │  Web Dashboard   │  │  SQLite DB       │              │\n│  │  (:8888)         │  │  Hosts, vulns,   │              │\n│  │  Monitor & steer │  │  creds, commands │              │\n│  └──────────────────┘  └──────────────────┘              │\n└──────────────────────────────────────────────────────────┘\n```\n\nFor the full system design, see [docs/ARCHITECTURE.md](/garagehq/nightcrawler/blob/main/docs/ARCHITECTURE.md).\n\n**Fully autonomous**— no human in the loop during operation** 100% local inference**— AI runs on the phone's GPU, no cloud needed** Scope-enforced**— two-layer defense prevents out-of-scope actions** Stealth-first**— slow scan rates, host rotation, cover traffic, nmap -T2 only** 27 exploit playbooks**— multi-step attack chains that execute automatically** 24,956-entry CVE database**— version-aware vulnerability matching** Web dashboard**— real-time monitoring, host management, C2 controls** WiFi breach mode**— autonomous WPA2 cracking with USB adapter (Pwnagotchi-inspired)** Passive discovery**— background capture of mDNS/NBNS/DHCP/ARP broadcasts** Multi-network**— data isolated per network, survives DHCP changes via MAC-keyed hosts** Self-healing**— garbage detection, context reset, watchdogs, stuck detection** Training capture**— logs successful interactions for future model fine-tuning** Report generation**— downloadable pentest report with vulns, exploit chains, remediation\n\nSee [docs/FEATURES.md](/garagehq/nightcrawler/blob/main/docs/FEATURES.md) for the complete feature reference.\n\n**Android phone** with[Kali NetHunter](https://www.kali.org/docs/nethunter/)(tested on OnePlus 8, Snapdragon 865)**Root access** via[Magisk](https://github.com/topjohnwu/Magisk)**12GB+ RAM**(model uses ~1.3GB, Android uses ~4GB, rest for tools)\n\n**USB WiFi adapter** for offline WiFi breach mode (Ralink RT3572 recommended)**Custom kernel** with MAC80211 for monitor mode ([build guide](/garagehq/nightcrawler/blob/main/docs/KERNEL_BUILD_PROMPT.md))**NVIDIA AGX** for offloading to a larger model over Tailscale\n\nAll inference via OpenCL on Adreno 650 GPU:\n\n| Model | Quantization | Prompt Speed | Generation Speed |\n|---|---|---|---|\nLFM2.5-1.2B-Instruct-Heretic (production) |\nQ8_0 | 115 tok/s | 13 tok/s |\n| Qwen3.5-0.8B | Q8_0 | 30.5 tok/s | 6.3 tok/s |\n| Qwen3.5-4B | Q4_0 | 10.1 tok/s | 2.0 tok/s |\n\nNote:Android throttles the GPU on battery power (6x slowdown). Nightcrawler includes a GPU governor daemon that forces max performance and auto-throttles at ≤15% battery.\n\n```\n# 1. Install (inside Kali NetHunter chroot)\nbash INSTALL.sh\n\n# 2. Wait for llama-server to start (~5 min after boot)\ncurl -s http://127.0.0.1:8080/health  # Should return {\"status\":\"ok\"}\n\n# 3. Start all services\nbash scripts/run-36h.sh\n\n# 4. Open the web dashboard (from any device on your Tailscale network)\n# https://<your-tailscale-hostname>:8888\nNC_DRY_RUN=1 python3 main.py\n```\n\nThis uses a mock Kali server so you can test the agent loop without executing real network commands.\n\n```\nkali-server-mcp --port 5000 &\npython3 scope_proxy.py --config config.yaml --port 8800 --upstream http://127.0.0.1:5000 &\nbash scripts/webui-daemon.sh start\npython3 main.py &\n```\n\nEdit `config.yaml`\n\nbefore deployment:\n\n```\nmission:\n  id: \"CLIENT-YYYY-XXX\"           # Your engagement ID\n  scope:\n    networks: [\"auto\"]             # \"auto\" = detect from wlan0 at startup\n    excluded_hosts: [\"auto\"]       # \"auto\" = gateway + self IP\n    excluded_ports: [502, 503]     # SCADA/ICS ports to never touch\n  authorization: \"ROE-YYYY-XXX.pdf\"\n  max_runtime_hours: 0             # 0 = no limit\n\nmodel:\n  local:\n    ctx_size: 8192\n    port: 8080\n```\n\n**Dynamic scope detection** means zero config changes when moving between networks — the agent reads the current subnet from `wlan0`\n\nat startup.\n\n```\nnightcrawler/\n├── main.py                  # Entry point\n├── config.yaml              # Mission scope + model config\n├── scope_proxy.py           # Scope enforcement proxy\n├── INSTALL.sh               # Installer\n│\n├── agent/                   # Core agent logic\n│   ├── loop.py              # Decision loop + error recovery\n│   ├── planner.py           # Phase state machine (recon → exploit)\n│   ├── llm_client.py        # LLM API client (llama.cpp / remote)\n│   ├── db.py                # SQLite backend (hosts, vulns, creds)\n│   ├── host_memory.py       # Per-host observations + auto-tagging\n│   ├── cve_db.py            # 24,956-entry CVE database\n│   ├── attack_planner.py    # Strategic directives for exploit phase\n│   ├── output_parser.py     # Extract structured data from tool output\n│   ├── offline_manager.py   # WiFi breach pipeline state machine\n│   ├── net_detect.py        # Auto-detect network from wlan0\n│   ├── cover_traffic.py     # Stealth blending with realistic web traffic\n│   ├── passive_capture.py   # Background tcpdump for broadcast traffic\n│   └── ...\n│\n├── proxy/                   # Scope enforcement components\n│   ├── scope.py             # IP/port/host validation\n│   ├── rate_limiter.py      # Command rate limiting + jitter\n│   └── command_filter.py    # Destructive command blocklist\n│\n├── webui/                   # Web dashboard (Flask)\n│   ├── server.py            # API + stealth middleware\n│   └── templates/index.html # Dashboard UI\n│\n├── data/                    # Static data files\n│   ├── cve_exploits.json    # CVE→exploit command mappings\n│   └── playbooks.json       # 27 multi-step attack playbooks\n│\n├── prompts/                 # LLM prompt templates (hot-reloadable)\n├── scripts/                 # Operational scripts (start, stop, watchdogs)\n├── tests/                   # Test suites (API, UI, offline mode)\n├── kernels/                 # WiFi driver modules + kernel docs\n├── simulation/              # Dry-run mock server\n├── docs/                    # Architecture, GPU setup, features\n├── logs/                    # Runtime data (gitignored)\n└── models/                  # Model files (gitignored)\n```\n\nThe agent uses a simple but effective loop:\n\n**Pick a target**— weighted random selection (70% hosts with known ports, 30% new discovery)** Build context**— inject host memory, network observations, phase guidance into prompt** Ask the LLM**— model produces`REASONING: ... COMMAND: ...`\n\n**Validate**— scope proxy checks the command is in-scope and not destructive** Execute**— command runs via Kali MCP server** Learn**— output parser extracts findings, updates host memory** Reset context**— clear conversation, keep persistent memory, repeat\n\nThe 1.2B model has a ~50% command success rate (inherent to its size). The agent compensates with:\n\n**Garbage detection**— 5-streak reset with varied few-shot examples** Duplicate detection**— forces tool/target diversification** Time-based stuck detection**— 5-minute backstop forces context reset** Direct playbook execution**— multi-step attacks bypass the LLM entirely\n\nThe dashboard at `:8888`\n\nprovides real-time monitoring and control:\n\n**Live feed**— every command, finding, and agent decision** Host cards**— clickable cards showing ports, services, vulnerabilities** Network map**— interactive force-directed graph (drag, zoom, pan)** Vulnerability details**— CVE tags, exploit chains, remediation steps** C2 controls**— star/blacklist hosts, force phase, pause/resume, inject commands** Offline mode**— Pwnagotchi-inspired WiFi attack UI with animated face\n\nThe dashboard is stealth-filtered: it spoofs nginx headers and returns empty 404s to connections from the target network.\n\nFrom 72+ hours of autonomous operation across multiple networks:\n\n**30+ hosts** discovered per network**2,000+ commands** executed autonomously**10+ vulnerabilities** found across multiple services**6+ playbooks** executed via direct execution- Agent memory stable at 35-50MB throughout (no leaks)\n\nContributions are welcome! See [CONTRIBUTING.md](/garagehq/nightcrawler/blob/main/CONTRIBUTING.md) for guidelines.\n\n**Model fine-tuning**— improving command format compliance from ~50% to 85%+** New playbooks**— adding exploit chains for more services** CVE database**— expanding coverage beyond the current 24,956 entries** Adapter support**— testing with more USB WiFi chipsets** Documentation**— tutorials, setup guides for different phones** Testing**— more test coverage, especially for edge cases\n\n```\n# Clone the repo\ngit clone https://github.com/garagehq/nightcrawler.git\ncd nightcrawler\n\n# Dry-run mode (no real commands, no hardware needed)\nNC_DRY_RUN=1 python3 main.py\n\n# Run tests\npython3 -m pytest tests/\n```\n\n**This tool is for authorized penetration testing only.** You must have written permission (Rules of Engagement) from the network owner before deploying Nightcrawler. Unauthorized use against networks you don't own or have permission to test is illegal.\n\nMIT — see [LICENSE](/garagehq/nightcrawler/blob/main/LICENSE) for details.\n\nIf you enjoy this project, you can buy me a coffee ☕:", "url": "https://wpnews.pro/news/show-hn-nightcrawler-a-local-ai-pentesting-agent-running-on-a-smartphone", "canonical_source": "https://github.com/garagehq/nightcrawler/", "published_at": "2026-08-03 11:06:15+00:00", "updated_at": "2026-08-03 11:25:06.149524+00:00", "lang": "en", "topics": ["artificial-intelligence", "ai-agents", "ai-tools", "ai-safety"], "entities": ["Nightcrawler", "LFM2.5-1.2B-Instruct-Heretic", "OnePlus 8", "Kali MCP Server", "NetHunter", "OpenCL"], "alternates": {"html": "https://wpnews.pro/news/show-hn-nightcrawler-a-local-ai-pentesting-agent-running-on-a-smartphone", "markdown": "https://wpnews.pro/news/show-hn-nightcrawler-a-local-ai-pentesting-agent-running-on-a-smartphone.md", "text": "https://wpnews.pro/news/show-hn-nightcrawler-a-local-ai-pentesting-agent-running-on-a-smartphone.txt", "jsonld": "https://wpnews.pro/news/show-hn-nightcrawler-a-local-ai-pentesting-agent-running-on-a-smartphone.jsonld"}}