Skip to main content

AI-powered security scanner for your codebase. Find SQL injection, XSS, IDOR, auth bypass, and more — straight from your terminal.

Project description

OpenHack

Open Source Agentic Security Scanner for your codebase.

Like Claude Code Security / Codex Security but open source. OpenHack does recon -> hunting -> validation -> verification all in one pipeline to find high quality verified vulnerabilities. OpenHack exclusively uses open source models and specializes in web app vulnerabilities.

Install

pipx install openhack

Or with pip:

pip install openhack

Quick start

openhack

On first run you'll go through a one-time setup:

  1. Pick Login with OpenHack account (recommended) — opens a browser, you log in, get $20 in free credits, and the CLI gets a token automatically.
  2. Type /scan . to scan the current directory, or /scan path/to/repo for somewhere else.
  3. While scanning, the Trace tab shows live agent activity (recon → hunters → validators). When the scan finishes, the Findings tab shows everything that was found.

What it does

OpenHack runs a multi-agent pipeline against your codebase:

  • Recon — reads the code, builds a project model
  • Hunters — multiple specialized agents look for different vulnerability classes (input validation, access control, data handling, …)
  • Feature hunters — deeper passes on specific risk categories (XSS rendering, raw SQL, command exec, etc.)
  • Validators — re-read the suspect code to confirm or reject each candidate finding
  • Sandbox verification (/verify sandbox) (Beta — requires Docker) — spins up your app in a Docker container and attempts to exploit each finding with live HTTP requests. Findings that are successfully exploited get a ✓ mark.
  • Browser verification (/verify browser) (Beta — requires Docker when combined with sandbox) — launches a headless browser against the sandboxed app to verify client-side vulnerabilities (XSS, CSRF, DOM-based issues) with real browser execution.

Docker prerequisite. Sandbox verification requires Docker Desktop (or any working Docker daemon) installed and running on the machine where the scan runs. Browser verification inherits this when used with sandbox. If Docker isn't running, /verify sandbox will fail with a clear error before the scan starts.

For every confirmed finding you get: severity, CVSS score, file location, full description, the vulnerable code snippet, and a recommended fix — all rendered with syntax highlighting in the TUI.

Slash commands

Command Description
/scan <path> Full scan on a directory (defaults to current dir)
/pause · /resume Pause and resume a running scan (Ctrl+C also pauses)
/cancel Permanently cancel a running scan
/sessions Browse and re-load past scans (also supports re-running an aborted scan with r)
/findings Re-display findings from last scan
/copy Copy the selected finding (description + vulnerable code + fix) for Codex / Claude Code / OpenCode
/verify sandbox (Beta) Spin up a Docker sandbox and exploit-test each finding with live requests
/verify browser (Beta) Launch a headless browser to verify client-side vulns (XSS, CSRF, etc.)
/login Re-login to your OpenHack account
/setup Run the setup wizard again
/config Show current config; /config <key> <value> to set
/sidebar Show/hide the Findings list sidebar (Ctrl+B)
/cost Cost breakdown for the last scan
/clear Clear scan state and return to landing
/discord Open the OpenHack Discord
/mouse Toggle mouse capture (off = native text selection)
/help List commands
/quit Exit

Keyboard shortcuts (Findings tab)

  • / — switch finding
  • [ · ] — alternate prev / next
  • Mouse wheel or PgUp / PgDn — scroll the details pane
  • y — yank (copy) selected finding for an AI agent
  • < · > — resize the sidebar
  • Ctrl+B — toggle sidebar

Keyboard shortcuts (Trace tab)

  • / — switch agent in the sidebar tree
  • [ · ] — alternate prev / next agent
  • Mouse wheel or PgUp / PgDn — scroll the trace
  • Home — jump to "All" (full trace)
  • End — resume auto-follow-to-bottom

Selecting text

The TUI captures mouse events by default (for scrolling and clicking). To select and copy text natively:

  • macOS: Hold Option (⌥) and drag to select, then Cmd+C to copy.
  • Linux / Windows: Hold Shift and drag to select.
  • Or: Run /mouse to disable mouse capture entirely — the terminal's native selection works normally until you toggle it back on.

CLI commands (headless)

For CI, scripts, or one-off scans where you don't want the TUI:

openhack scan /path/to/repo

OpenHack runs the same pipeline as the TUI, prints progress to stdout, writes a JSON report to ~/.openhack/scans/<session-id>.json, and exits.

Command Description
openhack Launch interactive TUI
openhack scan [path] Full scan, headless (defaults to .)
openhack sessions List all saved scans
openhack resume <id> Resume a scan from its last checkpoint
openhack classify [path] Classify frameworks + detect entry points (no LLM calls)
openhack login Log in to your OpenHack account
openhack setup Run the setup wizard
openhack --help Show usage

Scans are checkpointed after each pipeline stage. If a scan is interrupted or fails, resume it:

openhack resume <session-id>

Configuration

Configuration is stored in ~/.openhack/config (mode 0600 since it contains a bearer token) and persists across sessions.

You can override at runtime via environment variables:

Variable Effect
OPENHACK_API_KEY Bearer token for the OpenHack inference API
OPENHACK_DEV=1 Point the CLI at local dev servers (app on :9080, inference on :8787) for self-hosted setups

Privacy

OpenHack reads and processes your source code locally — prompts are built on your machine. Only LLM tokens (not raw source files) are forwarded to the OpenHack inference API. No source code is uploaded or retained.

Contributing

OpenHack is open source. Issues and PRs welcome on GitHub.

License

AGPL-3.0 — see LICENSE. Free for personal, educational, and open-source use. For commercial licensing without AGPL obligations, contact team@openhack.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openhack-0.1.0.tar.gz (373.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openhack-0.1.0-py3-none-any.whl (306.6 kB view details)

Uploaded Python 3

File details

Details for the file openhack-0.1.0.tar.gz.

File metadata

  • Download URL: openhack-0.1.0.tar.gz
  • Upload date:
  • Size: 373.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for openhack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d12d0895abc383a1532e7b13cf63131ba0740a9f9f0dd5eb1eec5b94db588d7e
MD5 39d870712faec67f75380720d14e5f05
BLAKE2b-256 b88909f5fec1c3375c4037dcdadab93f82600fcff6ee5d744e8808f68f53c26a

See more details on using hashes here.

File details

Details for the file openhack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: openhack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 306.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for openhack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76d23ecee134cbe0d775c4c8e1c25328aab0343f82c12f740620809b4bddce38
MD5 b9be8c040018bb951ff656bee1ddb732
BLAKE2b-256 6f85c1c85551a4b141bae83d8de63194d08bff5633b691e4ed70ab7a18a83f48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page