@zebbern/hacktricks-mcp 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -9
- package/data/hacktricks.db +0 -0
- package/data/meta.json +8 -4
- package/data/toc.json +14631 -5537
- package/dist/books.js +27 -0
- package/dist/db.js +349 -64
- package/dist/kubernetes-rbac.js +138 -0
- package/dist/markdown.js +12 -0
- package/dist/permission-check.js +224 -0
- package/dist/permissions.js +195 -0
- package/dist/refresh.js +185 -0
- package/dist/server.js +331 -74
- package/dist/toc.js +25 -5
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -1,46 +1,88 @@
|
|
|
1
1
|
# hacktricks-mcp
|
|
2
2
|
|
|
3
|
-
MCP server that gives AI agents fast, offline full-text search and section-level retrieval over the [HackTricks](https://github.com/HackTricks-wiki/hacktricks) offensive-security wiki.
|
|
3
|
+
MCP server that gives AI agents fast, offline full-text search and section-level retrieval over two HackTricks books: the [HackTricks](https://github.com/HackTricks-wiki/hacktricks) offensive-security wiki (network services, web, Linux, Windows and macOS hardening, Active Directory, mobile, reverse engineering, forensics, Wi-Fi) and [HackTricks Cloud](https://github.com/HackTricks-wiki/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.
|
|
4
4
|
|
|
5
|
-
Unlike grep-based alternatives, this server ships with a **pre-built SQLite FTS5 search index** (
|
|
5
|
+
Unlike grep-based alternatives, this server ships with a **pre-built SQLite FTS5 search index** (about 2,950 pages) 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**, commits it back to this repo 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).
|
|
6
6
|
|
|
7
7
|
## Quick start
|
|
8
8
|
|
|
9
9
|
Requirements: Node.js 22.13 or newer (uses the built-in `node:sqlite`, zero native dependencies).
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Claude Code:**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
claude mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latest
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Codex CLI:**
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
codex mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latest
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Any MCP client** (Claude Desktop, Cursor, Kimi, etc.), config JSON:
|
|
12
24
|
|
|
13
25
|
```json
|
|
14
26
|
{
|
|
15
27
|
"mcpServers": {
|
|
16
28
|
"hacktricks": {
|
|
17
29
|
"command": "npx",
|
|
18
|
-
"args": ["-y", "@zebbern/hacktricks-mcp"]
|
|
30
|
+
"args": ["-y", "@zebbern/hacktricks-mcp@latest"]
|
|
19
31
|
}
|
|
20
32
|
}
|
|
21
33
|
}
|
|
22
34
|
```
|
|
23
35
|
|
|
36
|
+
**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:
|
|
37
|
+
|
|
38
|
+
- Claude Code: `/plugin install hacktricks --marketplace zebbern/hacktricks-mcp`
|
|
39
|
+
- Codex CLI: `codex plugin marketplace add zebbern/hacktricks-mcp`, then `codex plugin add hacktricks --marketplace hacktricks-mcp`
|
|
40
|
+
- ZCode: add `zebbern/hacktricks-mcp` as a plugin marketplace, then install `hacktricks`
|
|
41
|
+
- Kimi Work: use [this plugin link](kimi-work://plugin?id=hacktricks)
|
|
42
|
+
|
|
43
|
+
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:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
mkdir -p ~/.codex/agents && curl -fsSLo ~/.codex/agents/hacktricks-researcher.toml https://raw.githubusercontent.com/zebbern/hacktricks-mcp/main/.codex/agents/hacktricks-researcher.toml
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Packaging details live in [docs/agents.md](docs/agents.md).
|
|
50
|
+
|
|
24
51
|
Then ask things like:
|
|
25
52
|
|
|
26
53
|
- *"Search HackTricks for kerberoast and give me the attack commands"*
|
|
27
54
|
- *"How do I escalate privileges from the lxd group?"*
|
|
28
55
|
- *"Show me the SSRF section of the pentesting-web pages"*
|
|
56
|
+
- *"What can I do with access to a Jenkins script console?"*
|
|
57
|
+
- *"List every HackTricks page about AWS IAM"*
|
|
58
|
+
- *"Is `iam:CreatePolicyVersion` dangerous? What can I do with `iam:PassRole` and `lambda:CreateFunction`?"*
|
|
29
59
|
|
|
30
60
|
## Tools at a glance
|
|
31
61
|
|
|
32
62
|
| Tool | What it does |
|
|
33
63
|
|---|---|
|
|
34
|
-
| `hacktricks_search` | Ranked full-text search with snippets,
|
|
35
|
-
| `hacktricks_get_page` | Read a page, a single section, or just its code blocks |
|
|
36
|
-
| `hacktricks_get_toc` |
|
|
64
|
+
| `hacktricks_search` | Ranked full-text search over both books that takes a plain question or technical terms, with snippets, abbreviation handling (`privesc`, `sqli`, `rce`, ...) and an optional category filter |
|
|
65
|
+
| `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 |
|
|
66
|
+
| `hacktricks_get_toc` | A compact map of both books (categories and chapters with page counts), or the pages under the entries matching a filter |
|
|
67
|
+
| `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 |
|
|
37
68
|
|
|
38
69
|
All tools are strictly read-only. Full reference: [docs/tools.md](docs/tools.md).
|
|
39
70
|
|
|
71
|
+
## Environment variables
|
|
72
|
+
|
|
73
|
+
| Variable | Effect |
|
|
74
|
+
|---|---|
|
|
75
|
+
| `HACKTRICKS_OFFLINE=1` | Never use the network: no background check for a newer index |
|
|
76
|
+
| `HACKTRICKS_INDEX_URL` | Download newer indexes from this base URL instead of this project's releases |
|
|
77
|
+
| `HACKTRICKS_CACHE_DIR` | Where downloaded indexes are kept |
|
|
78
|
+
| `HACKTRICKS_DB` | Serve the database at this path; the background check stays off |
|
|
79
|
+
|
|
80
|
+
How the refresh works and how it fails safely: [docs/architecture.md](docs/architecture.md#runtime-index-refresh).
|
|
81
|
+
|
|
40
82
|
## Documentation
|
|
41
83
|
|
|
42
84
|
- [docs/tools.md](docs/tools.md): complete tool reference with parameters and examples
|
|
43
|
-
- [docs/architecture.md](docs/architecture.md): how the index
|
|
85
|
+
- [docs/architecture.md](docs/architecture.md): how the index, the 3-day sync and the background refresh work
|
|
44
86
|
- [docs/development.md](docs/development.md): local setup, tests, releasing
|
|
45
87
|
- [docs/agents.md](docs/agents.md): agent skill, MCP registry and plugin packaging
|
|
46
88
|
|
|
@@ -52,5 +94,5 @@ All tools are strictly read-only. Full reference: [docs/tools.md](docs/tools.md)
|
|
|
52
94
|
|
|
53
95
|
## Credits
|
|
54
96
|
|
|
55
|
-
- [HackTricks](https://github.com/HackTricks-wiki/hacktricks) by Carlos Polop and contributors
|
|
97
|
+
- [HackTricks](https://github.com/HackTricks-wiki/hacktricks) and [HackTricks Cloud](https://github.com/HackTricks-wiki/hacktricks-cloud) by Carlos Polop and contributors
|
|
56
98
|
- [Model Context Protocol SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
package/data/hacktricks.db
CHANGED
|
Binary file
|
package/data/meta.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"schema": 3,
|
|
3
|
+
"books": {
|
|
4
|
+
"hacktricks": "d2a6bf07ef17ddcf5dd597607273da8ab0207a83",
|
|
5
|
+
"hacktricks-cloud": "49dae1447e92cf1a65390b52f95fed6c15f41d2f"
|
|
6
|
+
},
|
|
7
|
+
"syncedAt": "2026-11-27T23:17:44.217Z",
|
|
8
|
+
"pageCount": 2952,
|
|
9
|
+
"dbBytes": 64061440
|
|
6
10
|
}
|