hacktricks-mcp

v0.5.7
io.github.zebbern/hacktricks-mcp Checked 2 hours ago Published 13 hours ago

Offline HackTricks and HackTricks Cloud search, permissions check, payload and cheatsheet lookups.

A 96/100 Discovery passed License not confirmed SearchCloud

MCP server that gives AI agents fast, offline full-text search and section-level retrieval over two HackTricks books: the HackTricks offensive-security wiki (network services, web, Linux, Windows and macOS hardening, Active Directory, mobile, reverse engineering, forensics, Wi-Fi) and HackTricks Cloud (AWS, GCP, Azure, Kubernetes, CI/CD). It also checks cloud permissions against HackTricks Cloud's rated lists and escalation catalog: how dangerous a permission is, what it lets a principal escalate to, and where to read about it.

Summary extracted from the README.

hacktricks-mcp

MCP server that gives AI agents fast, offline full-text search and section-level retrieval over two HackTricks books: the HackTricks offensive-security wiki (network services, web, Linux, Windows and macOS hardening, Active Directory, mobile, reverse engineering, forensics, Wi-Fi) and HackTricks Cloud (AWS, GCP, Azure, Kubernetes, CI/CD). It also checks cloud permissions against HackTricks Cloud's rated lists and escalation catalog: how dangerous a permission is, what it lets a principal escalate to, and where to read about it.

Beside the books it holds two payload collections, with lookup tools of their own: Payloads All The Things (a topic per attack type, with its payload lists, bypass files and polyglots as ready-made files) and SecLists (wordlists by use, with sizes and download links). An agent that knows the technique's name asks for it by name and gets the topic's pages, files and folders in one call; nothing of the payload collections mixes into the HackTricks results.

A third collection sits beside them: Internal All The Things, 167 cheatsheets and playbooks (shells, PowerShell and Mimikatz, Active Directory with the certificate attacks ESC1 to ESC15, AWS and Azure checklists, C2 frameworks, red team playbooks, CI/CD attacks), with two tools of its own. An agent searches it with the name of a page or the words of the need, reads the titles, then reads the page whole, as its code blocks or in one section. Nothing of it mixes into the other results either.

Unlike grep-based alternatives, this server ships with a pre-built SQLite FTS5 search index (about 2,950 pages, plus the payload collections and the cheatsheets) inside the package. No install-time clone, no ripgrep dependency, and no network access at any query. A GitHub Action re-syncs the index with upstream every 3 days and publishes a patch release to npm, so an unpinned install picks up each new index on its next launch. A running server also checks for a newer index in the background and switches to it when there is one, falling back to the bundled index whenever that fails (offline included).

What a read costs

Pages are long, so the tools return the part that answers. Tokens are as the o200k_base tokenizer counts them (other tokenizers differ by a few percent), measured across the index and, for the search, on 89 questions:

Read Tokens Characters
A search, five hits about 545 about 2,000
A page's outline about 180 about 690
One section of a page about 300 about 1,300
A whole page about 1,950 about 8,400

A page is about six times that section. npm run cost prints the character counts for the current index; how these are measured is in docs/development.md.

The payload tools answer smaller: a topic by name is about 900 characters, a search of five hits about 900, and the map of both collections about 16,000. Measured on 68 needs, a lookup by the technique's name reached the file every time, and a search with the need in the agent's own words 67 times.

The internal tools answer small too: a search of five hits about 1,000 characters, where a page has a median of about 4,200. Measured on 92 needs, a search followed by the read of its best title reached the page every time.

Quick start

Requirements: Node.js 22.13 or newer, also when a client starts servers with its own copy of Node.js (the server uses the built-in node:sqlite, zero native dependencies).

Claude Code:

claude mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latest

Codex CLI:

codex mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latest

Any MCP client (Claude Desktop, Cursor, Kimi, etc.), config JSON:

{
  "mcpServers": {
    "hacktricks": {
      "command": "npx",
      "args": ["-y", "@zebbern/hacktricks-mcp@latest"]
    }
  }
}

As a plugin (bundles the agent skill that teaches efficient use and a researcher subagent that keeps multi-page research out of the main agent's context). The repository is its own marketplace:

  • Claude Code: /plugin install hacktricks --marketplace zebbern/hacktricks-mcp
  • Codex CLI: codex plugin marketplace add zebbern/hacktricks-mcp, then codex plugin add hacktricks --marketplace hacktricks-mcp
  • ZCode: Settings > Plugins > Add > Add plugin marketplace, enter zebbern/hacktricks-mcp, then install hacktricks from the Personal tab
  • Kimi Work: use this plugin link

The researcher subagent comes with the plugin on Claude Code, ZCode and Kimi. Codex plugins cannot bundle subagents, so on Codex copy its definition once:

mkdir -p ~/.codex/agents && curl -fsSLo ~/.codex/agents/hacktricks-researcher.toml https://raw.githubusercontent.com/zebbern/hacktricks-mcp/main/.codex/agents/hacktricks-researcher.toml

Packaging details are in docs/agents.md.

The skill alone, for other hosts (Cursor, OpenCode, Windsurf and the other agents the skills CLI supports): the installer adds the skill and nothing else, so add the MCP server with the config above as well. The command asks which agents to install into; -a <agent> names one:

npx skills add zebbern/hacktricks-mcp --skill hacktricks

Then ask things like:

  • "Search HackTricks for kerberoast and give me the attack commands"
  • "How do I escalate privileges from the lxd group?"
  • "Show me the SSRF section of the pentesting-web pages"
  • "What can I do with access to a Jenkins script console?"
  • "List every HackTricks page about AWS IAM"
  • "Is iam:CreatePolicyVersion dangerous? What can I do with iam:PassRole and lambda:CreateFunction?"
  • "Give me the payload files for SQL Injection, then the authentication bypass list"
  • "Which SecLists wordlist has the most common passwords? Give me its link"
  • "I need a file to upload that gets past a filter blocking php"
  • "Give me reverse shell one-liners for bash and PowerShell"
  • "How do I abuse ADCS ESC8? Give me the commands"
  • "Checklist for what these AWS access keys can reach"

If the server does not start

The host's log shows why. Each of these has a one-line fix:

  • hacktricks-mcp needs Node.js 22.13 or newer: update Node.js and start the host again. On a Node.js that old the executable says so itself.
  • npm error code ENOENT on a path under _npx: the npx cache holds a broken entry, usually from an install that was cut short. Delete the _npx folder in npm's cache (%LOCALAPPDATA%\npm-cache\_npx on Windows, ~/.npm/_npx elsewhere) and start again; the package is downloaded once more.
  • npm error code EBUSY naming hacktricks.db under _npx (Windows): a hacktricks-mcp server started from 0.3.6 or older is still running in another session and holds the file that npx wants to replace. Close that session, which ends its server, and start again. A server started from 0.3.7 on holds no file of the package open.
  • 'hacktricks-mcp' is not recognized: the server was started with the package named without a tag (@zebbern/hacktricks-mcp or a fixed version) from inside a clone of this repository, where npx runs the local copy. Use the install line from the quick start.

Tools at a glance

Tool What it does
hacktricks_search Ranked full-text search over both books that takes terms (the technique's name, or the words of a situation), with snippets, abbreviation handling (privesc, sqli, rce, ...) and an optional category filter
hacktricks_get_page Read a page's section list with sizes, a single section, the whole page, or just its code blocks; the first lines carry the link to cite
hacktricks_get_toc A compact map of both books (categories and chapters with page counts), or the pages under the entries matching a filter
hacktricks_cloud_permissions Rate cloud permissions (AWS, GCP, Azure, Kubernetes) against HackTricks Cloud and list the escalation techniques they enable, with the page section that explains each
payloads_topics The map of Payloads All The Things and SecLists: topics and folders with what each holds, or only those matching a filter word
payloads_get Read a payload topic by name, a folder, a page, a file by path or link; a text file comes back as written, a wordlist or webshell with its download link
payloads_search Search the payload collections for terms, or for text exactly as typed with its lines; filter by file ending or collection
internal_search Search the cheatsheets and playbooks of Internal All The Things for terms, with each page's size; or for text exactly as typed, with its lines
internal_get Read a cheatsheet or playbook by its name (reverse shell, amsi bypass, ESC8), whole, as its code blocks or in one section; a folder or an area by name lists its pages; no target gives the map

All tools are strictly read-only. Full reference: docs/tools.md.

Environment variables

Variable Effect
HACKTRICKS_OFFLINE=1 Never use the network: no background check for a newer index
HACKTRICKS_INDEX_URL Download newer indexes from this base URL instead of this project's releases
HACKTRICKS_CACHE_DIR Where downloaded indexes are kept
HACKTRICKS_DB Serve the database at this path; the background check stays off

An empty or blank variable counts as unset. How the refresh works and how it fails safely: docs/architecture.md.

Documentation

Security and license

  • The server executes nothing from the wiki. It answers from a local index that it opens read-only, and every query is a parameterized SQL statement.
  • HackTricks content is offensive-security reference material. Use it only on systems you are authorized to test.
  • The payload files are the same material in its rawest form. Antivirus software flags many of them when they are written to disk, so save or download them into a folder it leaves alone.
  • A text that antivirus software flags is never held: a webshell or a flagged file comes back as a download link, and a flagged block inside a page is a note with the page's link, because that text is flagged wherever it lands, an agent's session log included. With the list of 2026-11-29, Windows Defender flags none of the 3,400 texts the index holds when an agent host logs them, and not the index file either (docs/architecture.md). The skill tells the agent to hand such a link to you rather than fetch the page. The antivirus industry's test file is listed with its link and never held.
  • HackTricks and HackTricks Cloud belong to Carlos Polop and contributors; Payloads All The Things and Internal All The Things to Swissky and contributors; SecLists to Daniel Miessler and contributors (MIT). This repository holds derived index data and its own server code (MIT).
  • Built on the Model Context Protocol TypeScript SDK.