hackforge 0.1.0__py3-none-any.whl
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.
- forge/__init__.py +6 -0
- forge/attack.py +102 -0
- forge/bridge.py +281 -0
- forge/bridge.service +20 -0
- forge/forge.py +193 -0
- forge/gemini.py +147 -0
- forge/llm.py +75 -0
- forge/mcp_server.py +210 -0
- forge/probes.py +265 -0
- forge/recon.py +245 -0
- forge/report.py +117 -0
- forge/runner.py +103 -0
- forge/sandbox.py +41 -0
- forge/server.py +157 -0
- hackforge-0.1.0.dist-info/METADATA +101 -0
- hackforge-0.1.0.dist-info/RECORD +19 -0
- hackforge-0.1.0.dist-info/WHEEL +4 -0
- hackforge-0.1.0.dist-info/entry_points.txt +2 -0
- targets/seed.txt +35 -0
forge/runner.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"""Runner: scan one target, or patrol a seed list with discovery."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
|
|
7
|
+
from . import attack, probes, recon as recon_mod
|
|
8
|
+
from .report import aggregate, write_target_report
|
|
9
|
+
|
|
10
|
+
HERE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
11
|
+
SEEDS = os.path.join(HERE, "targets", "seed.txt")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class ScanResult:
|
|
16
|
+
target: str
|
|
17
|
+
report: str = ""
|
|
18
|
+
score: int = 0
|
|
19
|
+
findings: list = field(default_factory=list)
|
|
20
|
+
attacks: list = field(default_factory=list)
|
|
21
|
+
discovered: list = field(default_factory=list)
|
|
22
|
+
error: str = ""
|
|
23
|
+
|
|
24
|
+
def to_dict(self):
|
|
25
|
+
return {"target": self.target, "report": self.report, "score": self.score,
|
|
26
|
+
"n_findings": len(self.findings),
|
|
27
|
+
"findings": [{"severity": f["severity"], "title": f["title"],
|
|
28
|
+
"evidence": f["evidence"][:160]} for f in self.findings],
|
|
29
|
+
"n_attacks": len(self.attacks),
|
|
30
|
+
"attacks": [{"name": a["name"], "verdict": a.get("verdict"),
|
|
31
|
+
"value": a.get("value"), "reason": a.get("reason", "")}
|
|
32
|
+
for a in self.attacks],
|
|
33
|
+
"discovered": self.discovered, "error": self.error}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def scan_target(url: str, do_attack: bool = True, n_attacks: int = 5) -> ScanResult:
|
|
37
|
+
res = ScanResult(target=url)
|
|
38
|
+
try:
|
|
39
|
+
rec = recon_mod.recon(url)
|
|
40
|
+
findings = probes.run_probes(rec)
|
|
41
|
+
res.score = probes.score(findings)
|
|
42
|
+
res.findings = findings
|
|
43
|
+
if do_attack:
|
|
44
|
+
try:
|
|
45
|
+
res.attacks = attack.run_attacks(rec, findings, n=n_attacks)
|
|
46
|
+
except Exception as e: # noqa: BLE001 — LLM/sandbox failure shouldn't kill scan
|
|
47
|
+
res.error = f"attack phase: {e}"[:200]
|
|
48
|
+
res.report = write_target_report(url, rec, findings, res.attacks, res.score)
|
|
49
|
+
# discovery: external hosts + internal paths worth queueing
|
|
50
|
+
disc = list(rec.links_external)
|
|
51
|
+
res.discovered = disc[:12]
|
|
52
|
+
except Exception as e: # noqa: BLE001
|
|
53
|
+
res.error = str(e)[:300]
|
|
54
|
+
return res
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def load_seeds(path: str = SEEDS) -> list:
|
|
58
|
+
out = []
|
|
59
|
+
if os.path.exists(path):
|
|
60
|
+
with open(path) as fh:
|
|
61
|
+
for line in fh:
|
|
62
|
+
line = line.strip()
|
|
63
|
+
if line and not line.startswith("#"):
|
|
64
|
+
out.append(line)
|
|
65
|
+
return out
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def patrol(limit_targets: int = 10, do_attack: bool = True, seed_file: str = SEEDS,
|
|
69
|
+
on_progress=None) -> dict:
|
|
70
|
+
"""Scan seeds, then discover: queue external hosts found during scans
|
|
71
|
+
(up to limit_targets total). Returns summary dict."""
|
|
72
|
+
queue = load_seeds(seed_file)
|
|
73
|
+
seen = set()
|
|
74
|
+
results = []
|
|
75
|
+
reports = []
|
|
76
|
+
scanned = 0
|
|
77
|
+
while queue and scanned < limit_targets:
|
|
78
|
+
url = queue.pop(0)
|
|
79
|
+
if url in seen:
|
|
80
|
+
continue
|
|
81
|
+
seen.add(url)
|
|
82
|
+
scanned += 1
|
|
83
|
+
res = scan_target(url, do_attack=do_attack)
|
|
84
|
+
results.append(res)
|
|
85
|
+
if res.report:
|
|
86
|
+
reports.append(res.report)
|
|
87
|
+
if on_progress:
|
|
88
|
+
on_progress(res)
|
|
89
|
+
agg = aggregate(reports) if reports else ""
|
|
90
|
+
summary = {
|
|
91
|
+
"ts": datetime.now().isoformat(timespec="seconds"),
|
|
92
|
+
"scanned": scanned,
|
|
93
|
+
"aggregate": agg,
|
|
94
|
+
"results": [r.to_dict() for r in results],
|
|
95
|
+
"total_findings": sum(len(r.findings) for r in results),
|
|
96
|
+
"reproduced": sum(1 for r in results for a in r.attacks
|
|
97
|
+
if a.get("verdict") == "REPRODUCED"),
|
|
98
|
+
"avg_score": round(sum(r.score for r in results) / max(1, len(results)), 1),
|
|
99
|
+
}
|
|
100
|
+
os.makedirs(os.path.join(HERE, "reports"), exist_ok=True)
|
|
101
|
+
with open(os.path.join(HERE, "reports", "last-patrol.json"), "w") as fh:
|
|
102
|
+
json.dump(summary, fh, indent=1)
|
|
103
|
+
return summary
|
forge/sandbox.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Sandbox: run LLM-written attack snippets in an isolated subprocess."""
|
|
2
|
+
import os
|
|
3
|
+
import subprocess
|
|
4
|
+
import tempfile
|
|
5
|
+
|
|
6
|
+
PRELUDE = """\
|
|
7
|
+
import httpx, json, re, os, sys
|
|
8
|
+
TARGET = {target!r}
|
|
9
|
+
FINAL_URL = {final!r}
|
|
10
|
+
RECON = json.loads({recon!r})
|
|
11
|
+
def ev(line):
|
|
12
|
+
print("EV:", line)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def run_snippet(code: str, target: str, final_url: str, recon_json: str,
|
|
17
|
+
timeout: int = 45) -> dict:
|
|
18
|
+
"""Execute attack snippet. Snippet may use TARGET, FINAL_URL, RECON, ev().
|
|
19
|
+
Evidence lines should be printed via ev(...) or plain print(...)."""
|
|
20
|
+
with tempfile.TemporaryDirectory(prefix="forge-sandbox-") as td:
|
|
21
|
+
script = os.path.join(td, "attack.py")
|
|
22
|
+
with open(script, "w") as fh:
|
|
23
|
+
fh.write(PRELUDE.format(target=target, final=final_url, recon=recon_json))
|
|
24
|
+
fh.write("\n" + code + "\n")
|
|
25
|
+
env = {
|
|
26
|
+
"PATH": os.environ.get("PATH", "/usr/bin:/bin"),
|
|
27
|
+
"HOME": td,
|
|
28
|
+
"FORGE_TARGET": target,
|
|
29
|
+
"LANG": "C.UTF-8",
|
|
30
|
+
}
|
|
31
|
+
try:
|
|
32
|
+
r = subprocess.run(["python3", "-I", script], cwd=td, env=env,
|
|
33
|
+
capture_output=True, text=True, timeout=timeout)
|
|
34
|
+
return {"ok": r.returncode == 0, "exit": r.returncode,
|
|
35
|
+
"timed_out": False,
|
|
36
|
+
"stdout": r.stdout[-4000:], "stderr": r.stderr[-1500:]}
|
|
37
|
+
except subprocess.TimeoutExpired as e:
|
|
38
|
+
return {"ok": False, "exit": -1, "timed_out": True,
|
|
39
|
+
"stdout": (e.stdout or b"").decode(errors="replace")[-2000:]
|
|
40
|
+
if isinstance(e.stdout, bytes) else (e.stdout or "")[-2000:],
|
|
41
|
+
"stderr": "timeout"}
|
forge/server.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""Dashboard + JSON API on :8900 (loopback; tailscale serve for phone)."""
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import threading
|
|
5
|
+
import uuid
|
|
6
|
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
7
|
+
from urllib.parse import urlparse, parse_qs
|
|
8
|
+
|
|
9
|
+
from . import runner
|
|
10
|
+
from .report import REPORTS, aggregate, load_findings
|
|
11
|
+
|
|
12
|
+
JOBS = {} # id -> {status, result, ts}
|
|
13
|
+
JOBS_LOCK = threading.Lock()
|
|
14
|
+
|
|
15
|
+
PAGE = """<!doctype html><html lang=en><meta charset=utf-8>
|
|
16
|
+
<meta name=viewport content="width=device-width,initial-scale=1">
|
|
17
|
+
<title>forge — hackforge</title>
|
|
18
|
+
<style>
|
|
19
|
+
:root{--bg:#0b0e14;--fg:#e6e6e6;--mut:#8a93a6;--pink:#ff5fa2;--card:#131826;--line:#232a3d}
|
|
20
|
+
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--fg);
|
|
21
|
+
font:15px/1.5 ui-monospace,'Cascadia Code',Menlo,monospace;padding:16px;max-width:760px;margin:auto}
|
|
22
|
+
h1{color:var(--pink);font-size:22px}h1 small{color:var(--mut);font-weight:400}
|
|
23
|
+
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:12px;margin:10px 0}
|
|
24
|
+
.row{display:flex;gap:8px;flex-wrap:wrap}
|
|
25
|
+
input,button{background:#0e1320;color:var(--fg);border:1px solid var(--line);border-radius:8px;
|
|
26
|
+
padding:9px 12px;font:inherit}
|
|
27
|
+
input{flex:1;min-width:180px}button{color:var(--pink);cursor:pointer;border-color:var(--pink)}
|
|
28
|
+
button:active{transform:scale(.97)}
|
|
29
|
+
pre{white-space:pre-wrap;word-break:break-word;font-size:13px}
|
|
30
|
+
.sev-high{color:#ff6b6b}.sev-medium{color:#ffa94d}.sev-low{color:#ffd43b}.sev-info{color:var(--mut)}
|
|
31
|
+
.ok{color:#69db7c}.muted{color:var(--mut);font-size:13px}
|
|
32
|
+
a{color:var(--pink)}
|
|
33
|
+
table{width:100%;border-collapse:collapse}td,th{border-bottom:1px solid var(--line);padding:6px 4px;
|
|
34
|
+
text-align:left;font-size:13px}
|
|
35
|
+
</style>
|
|
36
|
+
<h1>⚒ forge <small>hackforge · autonomous H4CK1NG on local models</small></h1>
|
|
37
|
+
<div class=card><div class=row>
|
|
38
|
+
<input id=url placeholder="https://target.example" value="https://yandesbiens.com">
|
|
39
|
+
<button onclick=go()>SCAN</button>
|
|
40
|
+
<button onclick=patrol()>PATROL</button>
|
|
41
|
+
</div><pre id=job class=muted>idle</pre></div>
|
|
42
|
+
<div class=card><b>targets</b><pre id=targets class=muted>…</pre></div>
|
|
43
|
+
<div class=card><b>recent findings</b><div id=findings><span class=muted>…</span></div></div>
|
|
44
|
+
<div class=card><b>reports</b><pre id=reports class=muted>…</pre>
|
|
45
|
+
<div class=muted>API: <a href=/api/targets>/api/targets</a> · <a href=/api/findings>/api/findings</a> ·
|
|
46
|
+
<a href=/api/reports>/api/reports</a> · POST /api/scan {url} · POST /api/patrol {limit} · GET /api/job/<id></div></div>
|
|
47
|
+
<script>
|
|
48
|
+
async function j(u,o){const r=await fetch(u,o);return r.json()}
|
|
49
|
+
async function refresh(){
|
|
50
|
+
const t=await j('/api/targets');document.getElementById('targets').textContent=t.join('\\n');
|
|
51
|
+
const f=await j('/api/findings?n=30');
|
|
52
|
+
document.getElementById('findings').innerHTML=f.map(x=>
|
|
53
|
+
`<div><span class="sev-${x.severity}">●</span> <b>${x.target}</b> ${x.title}
|
|
54
|
+
<div class=muted>${(x.evidence||'').slice(0,110)}</div></div>`).join('')||'<span class=muted>none yet</span>';
|
|
55
|
+
const r=await j('/api/reports');document.getElementById('reports').textContent=r.join('\\n');
|
|
56
|
+
}
|
|
57
|
+
function poll(id){const el=document.getElementById('job');
|
|
58
|
+
const t=setInterval(async()=>{const s=await j('/api/job/'+id);
|
|
59
|
+
el.textContent=JSON.stringify(s.result??s,null,1).slice(0,1500);
|
|
60
|
+
if(s.status==='done'){clearInterval(t);refresh()}},2500);}
|
|
61
|
+
async function go(){const url=document.getElementById('url').value;
|
|
62
|
+
document.getElementById('job').textContent='scanning…';
|
|
63
|
+
const s=await j('/api/scan',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({url})});
|
|
64
|
+
poll(s.id);}
|
|
65
|
+
async function patrol(){document.getElementById('job').textContent='patrol running…';
|
|
66
|
+
const s=await j('/api/patrol',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({limit:6})});
|
|
67
|
+
poll(s.id);}
|
|
68
|
+
refresh();
|
|
69
|
+
</script></html>"""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _run_job(jid: str, fn):
|
|
73
|
+
with JOBS_LOCK:
|
|
74
|
+
JOBS[jid] = {"status": "running", "result": None}
|
|
75
|
+
def worker():
|
|
76
|
+
try:
|
|
77
|
+
res = fn()
|
|
78
|
+
with JOBS_LOCK:
|
|
79
|
+
JOBS[jid] = {"status": "done", "result": res}
|
|
80
|
+
except Exception as e: # noqa: BLE001
|
|
81
|
+
with JOBS_LOCK:
|
|
82
|
+
JOBS[jid] = {"status": "error", "result": {"error": str(e)[:400]}}
|
|
83
|
+
threading.Thread(target=worker, daemon=True).start()
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class Handler(BaseHTTPRequestHandler):
|
|
87
|
+
def log_message(self, fmt, *a): # quiet
|
|
88
|
+
pass
|
|
89
|
+
|
|
90
|
+
def _send(self, code, body, ctype="application/json"):
|
|
91
|
+
if isinstance(body, (dict, list)):
|
|
92
|
+
body = json.dumps(body, indent=1)
|
|
93
|
+
data = body.encode()
|
|
94
|
+
self.send_response(code)
|
|
95
|
+
self.send_header("Content-Type", ctype + "; charset=utf-8")
|
|
96
|
+
self.send_header("Content-Length", str(len(data)))
|
|
97
|
+
self.end_headers()
|
|
98
|
+
self.wfile.write(data)
|
|
99
|
+
|
|
100
|
+
def do_GET(self):
|
|
101
|
+
u = urlparse(self.path)
|
|
102
|
+
if u.path == "/":
|
|
103
|
+
return self._send(200, PAGE, "text/html")
|
|
104
|
+
if u.path == "/api/targets":
|
|
105
|
+
return self._send(200, runner.load_seeds())
|
|
106
|
+
if u.path == "/api/findings":
|
|
107
|
+
n = int(parse_qs(u.query).get("n", ["40"])[0])
|
|
108
|
+
rows = load_findings(n)
|
|
109
|
+
return self._send(200, [{"target": r["target"], "severity": r["severity"],
|
|
110
|
+
"title": r["title"], "evidence": r.get("evidence", ""),
|
|
111
|
+
"ts": r.get("ts", "")} for r in rows])
|
|
112
|
+
if u.path == "/api/reports":
|
|
113
|
+
if not os.path.isdir(REPORTS):
|
|
114
|
+
return self._send(200, [])
|
|
115
|
+
files = sorted(os.listdir(REPORTS))
|
|
116
|
+
return self._send(200, [f"/reports/{f}" for f in files][-25:])
|
|
117
|
+
if u.path.startswith("/api/job/"):
|
|
118
|
+
jid = u.path.rsplit("/", 1)[-1]
|
|
119
|
+
with JOBS_LOCK:
|
|
120
|
+
job = JOBS.get(jid)
|
|
121
|
+
return self._send(200 if job else 404, job or {"error": "no such job"})
|
|
122
|
+
if u.path.startswith("/reports/"):
|
|
123
|
+
f = os.path.join(REPORTS, os.path.basename(u.path))
|
|
124
|
+
if os.path.exists(f):
|
|
125
|
+
with open(f) as fh:
|
|
126
|
+
return self._send(200, fh.read(), "text/plain")
|
|
127
|
+
return self._send(404, {"error": "not found"})
|
|
128
|
+
return self._send(404, {"error": "not found"})
|
|
129
|
+
|
|
130
|
+
def do_POST(self):
|
|
131
|
+
u = urlparse(self.path)
|
|
132
|
+
length = int(self.headers.get("Content-Length") or 0)
|
|
133
|
+
try:
|
|
134
|
+
body = json.loads(self.rfile.read(length) or b"{}")
|
|
135
|
+
except json.JSONDecodeError:
|
|
136
|
+
body = {}
|
|
137
|
+
if u.path == "/api/scan":
|
|
138
|
+
url = body.get("url") or ""
|
|
139
|
+
if not url:
|
|
140
|
+
return self._send(400, {"error": "url required"})
|
|
141
|
+
jid = uuid.uuid4().hex[:10]
|
|
142
|
+
_run_job(jid, lambda: runner.scan_target(
|
|
143
|
+
url, do_attack=not body.get("no_attack", False)).to_dict())
|
|
144
|
+
return self._send(200, {"id": jid})
|
|
145
|
+
if u.path == "/api/patrol":
|
|
146
|
+
limit = int(body.get("limit") or 6)
|
|
147
|
+
jid = uuid.uuid4().hex[:10]
|
|
148
|
+
_run_job(jid, lambda: runner.patrol(limit_targets=limit,
|
|
149
|
+
do_attack=not body.get("no_attack", False)))
|
|
150
|
+
return self._send(200, {"id": jid})
|
|
151
|
+
return self._send(404, {"error": "not found"})
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def serve(port: int = 8900):
|
|
155
|
+
srv = ThreadingHTTPServer(("127.0.0.1", port), Handler)
|
|
156
|
+
print(f"forge serving on http://127.0.0.1:{port} (tailscale serve for phone)")
|
|
157
|
+
srv.serve_forever()
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: hackforge
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: H4CK1NG suite on local models: scan, discover, sandbox-reproduce attacks, report. CLI + stdio MCP server, 7 forge_* tools.
|
|
5
|
+
Project-URL: Repository, https://github.com/Linutesto/hackforge
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: httpx
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
# ⚒ hackforge — H4CK1NG suite on local models
|
|
11
|
+
|
|
12
|
+
mcp-name: io.github.linutesto/hackforge
|
|
13
|
+
|
|
14
|
+
Autonomous web scanner that **scans → discovers → reproduces attacks in a sandbox →
|
|
15
|
+
reports with fixes**. The brain is Qwen4 (35B-A3B) on the local llama.cpp unit (:8093);
|
|
16
|
+
deterministic probes do the heavy lifting so the LLM only spends tokens on hypotheses
|
|
17
|
+
and verdicts. Built for claude/codex/local agents to drive via CLI (all JSON out).
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
forge.py CLI entry (also: forge tool <name> for agents)
|
|
21
|
+
forge/llm.py Qwen4 client (:8093, OpenAI-compatible, think off)
|
|
22
|
+
forge/recon.py fetch + fingerprint + well-known surface (llms.txt, agent.json, .env, .git…)
|
|
23
|
+
forge/probes.py 12 deterministic probe families → findings w/ severity+fix
|
|
24
|
+
forge/attack.py LLM attack planner → hypotheses as python snippets
|
|
25
|
+
forge/sandbox.py isolated subprocess execution, EV: evidence lines
|
|
26
|
+
forge/report.py markdown reports + findings.jsonl + LATEST.md aggregate
|
|
27
|
+
forge/runner.py scan_target / patrol (seed list + link discovery)
|
|
28
|
+
forge/server.py dashboard + JSON API on :8900
|
|
29
|
+
forge/mcp_server.py stdio MCP server (7 tools for Claude Code + any MCP client)
|
|
30
|
+
targets/seed.txt seed list (edit me)
|
|
31
|
+
reports/ generated reports, findings.jsonl, last-patrol.json
|
|
32
|
+
research/ WEB_MAP.md from the web scourage
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python3 ~/hackforge/forge.py scan https://yandesbiens.com # one target
|
|
39
|
+
python3 ~/hackforge/forge.py patrol --limit 8 # autonomous wave
|
|
40
|
+
python3 ~/hackforge/forge.py serve --port 8900 # dashboard+API
|
|
41
|
+
python3 ~/hackforge/forge.py tool list # agent tools
|
|
42
|
+
python3 ~/hackforge/forge.py tool scan --json '{"url":"https://x.tld","no_attack":true}'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Env: `FORGE_LLM` (default http://127.0.0.1:8093/v1/chat/completions),
|
|
46
|
+
`FORGE_MODEL` (default qwen4).
|
|
47
|
+
|
|
48
|
+
## Score
|
|
49
|
+
|
|
50
|
+
100 − (high×15 + medium×7 + low×3 + info×1), floored at 0. Findings carry
|
|
51
|
+
`severity / evidence / fix`; attacks carry `REPRODUCED / NOT_REPRODUCED / INCONCLUSIVE`
|
|
52
|
+
verdicts judged by the local model from sandbox evidence.
|
|
53
|
+
|
|
54
|
+
## MCP server
|
|
55
|
+
|
|
56
|
+
`forge/mcp_server.py` speaks MCP over stdio (hand-rolled JSON-RPC 2.0 — no
|
|
57
|
+
`mcp` package needed, stdlib + httpx only) so Claude Code and any MCP client
|
|
58
|
+
can drive the suite natively. Same 7 tools as `forge tool`, dispatched
|
|
59
|
+
in-process:
|
|
60
|
+
|
|
61
|
+
| MCP tool | forge tool | notes |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `forge_recon` | recon | fetch + fingerprint |
|
|
64
|
+
| `forge_probes` | probes | score + findings |
|
|
65
|
+
| `forge_attacks` | attacks | LLM plan + sandbox, ~2-5 min |
|
|
66
|
+
| `forge_scan` | scan | full run + report file, ~5 min |
|
|
67
|
+
| `forge_patrol` | patrol | wave over targets/seed.txt |
|
|
68
|
+
| `forge_findings` | findings | recent findings.jsonl rows |
|
|
69
|
+
| `forge_targets` | targets | seed list |
|
|
70
|
+
|
|
71
|
+
Tools are `forge_`-prefixed so multiple MCP servers can coexist in one client
|
|
72
|
+
without name collisions (bare names also accepted).
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
python3 ~/hackforge/forge/mcp_server.py # stdio; logs go to stderr
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Add to Claude Code — project-local `.mcp.json` (recommended, commit it):
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"mcpServers": {
|
|
83
|
+
"hackforge": {
|
|
84
|
+
"type": "stdio",
|
|
85
|
+
"command": "python3",
|
|
86
|
+
"args": ["/home/yan/hackforge/forge/mcp_server.py"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
or globally: `claude mcp add hackforge -- python3 /home/yan/hackforge/forge/mcp_server.py`.
|
|
93
|
+
Then `/mcp` in Claude Code shows the 7 `forge_*` tools.
|
|
94
|
+
|
|
95
|
+
`forge_attacks` / `forge_scan` / `forge_patrol` are synchronous and can take
|
|
96
|
+
1-10 minutes — use a generous client timeout. Env: `FORGE_LLM`, `FORGE_MODEL`
|
|
97
|
+
(same as the rest of the suite; Qwen4 at :8093 is shared, so the LLM phase
|
|
98
|
+
stays gentle).
|
|
99
|
+
|
|
100
|
+
Registry: listed on the official MCP registry (registry.modelcontextprotocol.io)
|
|
101
|
+
as `io.github.Linutesto/hackforge` — repo https://github.com/Linutesto/hackforge.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
forge/__init__.py,sha256=DFUagiVi6aGOtJt3lLBIDC-1X5R6qgWLFqGaRCIskPY,210
|
|
2
|
+
forge/attack.py,sha256=5GMrrV2fUp4sM9nyaTB1F7a0WN8rmyi4J1XPzCaSWWE,4547
|
|
3
|
+
forge/bridge.py,sha256=ghniZ4Dd_cvvaz1sFApapcqqG4gsTJOasVZnSVioSSo,13369
|
|
4
|
+
forge/bridge.service,sha256=dIgIYkgG9DrzqufQu36_UpME9esPQPPLuV_zB9C7bK8,589
|
|
5
|
+
forge/gemini.py,sha256=_K2vQW8OA768lVtTqEv86FWVph5n60cL-RHquBvEOR8,5291
|
|
6
|
+
forge/llm.py,sha256=y3cXRIZwFKrHDVaUJfmESfpbUM5qVIUsutummmesAL0,2415
|
|
7
|
+
forge/mcp_server.py,sha256=uVPJRL5t_cJmrlwR15VQv8jwSQKaJ6Wx1UzkCWZLD38,8796
|
|
8
|
+
forge/probes.py,sha256=BiEPYUqlDsq2WY_uiLeaBA6vEo-e_mByTJGqUH2tOSU,14429
|
|
9
|
+
forge/recon.py,sha256=9IqT4lHYykkSwKtBrfYD2tSQp20UUFo0EuL09r-omAQ,9638
|
|
10
|
+
forge/report.py,sha256=IGfAa4tjR40jQhJQKeJsAw5J9axepy_I1ryVxEw2elM,4996
|
|
11
|
+
forge/runner.py,sha256=IHDOOT0gAy-5o8BX4Nh3GJOw_cG04f4Kn1Dt9Ch9sR0,3866
|
|
12
|
+
forge/sandbox.py,sha256=mii1OxOInH8fpJib-8yc66M3Cjfg2vdXKhSztxEi_FU,1675
|
|
13
|
+
forge/server.py,sha256=FeqJN4ga6fmF2voA-Uu345XtOxz5XhqbHK0xOHHhENA,7477
|
|
14
|
+
forge/forge.py,sha256=q9-IspI__ag0o0Y53SpxOGbfi5lIf5uIiUu7on7_Hvg,7039
|
|
15
|
+
targets/seed.txt,sha256=voL7MbOcbq9drXDPO9dXNmwHVEw1QAkwWRVajWb7Cos,1071
|
|
16
|
+
hackforge-0.1.0.dist-info/METADATA,sha256=1nuXg5zaeoEqSEWnKDxspjqik6HfHs5hICRkqYgt9vg,4147
|
|
17
|
+
hackforge-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
18
|
+
hackforge-0.1.0.dist-info/entry_points.txt,sha256=FnB5VIjEubCB4xvBtyxHYhd-pggDX24Yw_CqCOameBA,43
|
|
19
|
+
hackforge-0.1.0.dist-info/RECORD,,
|
targets/seed.txt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# hackforge seed targets — one URL per line, # comments allowed.
|
|
2
|
+
# Patrol scans these, then discovers external hosts from their links.
|
|
3
|
+
# Verified live 2026-12-05 by the scout (research/WEB_MAP.md).
|
|
4
|
+
|
|
5
|
+
# --- Ours (dogfood / control group) ---
|
|
6
|
+
https://yandesbiens.com
|
|
7
|
+
https://a2a.yandesbiens.com
|
|
8
|
+
https://tikaitok.yandesbiens.com
|
|
9
|
+
|
|
10
|
+
# --- Indie / quirky / tiny web ---
|
|
11
|
+
http://textfiles.com
|
|
12
|
+
https://www.wiby.org
|
|
13
|
+
https://www.zoomquilt.org
|
|
14
|
+
https://www.trypap.com
|
|
15
|
+
https://theuselessweb.com
|
|
16
|
+
https://pointerpointer.com
|
|
17
|
+
https://www.hackertyper.com
|
|
18
|
+
|
|
19
|
+
# --- Classics / test surfaces ---
|
|
20
|
+
https://httpbin.org
|
|
21
|
+
https://quotes.toscrape.com
|
|
22
|
+
https://the-internet.herokuapp.com
|
|
23
|
+
http://scanme.nmap.org
|
|
24
|
+
https://jsonplaceholder.typicode.com
|
|
25
|
+
https://dummyjson.com
|
|
26
|
+
|
|
27
|
+
# --- Archaeology ---
|
|
28
|
+
https://www.w3.org/History/19921103-hypertext/hypertext/WWW/TheProject.html
|
|
29
|
+
|
|
30
|
+
# --- Secret-hunter gems (wave 3, verified 2026-12-05, see research/SECRETS.md) ---
|
|
31
|
+
https://telehack.com
|
|
32
|
+
http://staggeringbeauty.com
|
|
33
|
+
https://fourmilab.ch
|
|
34
|
+
https://agents.md
|
|
35
|
+
https://portal.mozz.us/gemini/gemini.circumlunar.space/capcom/
|