blitzstrike 2.4.122 → 2.4.124
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/CHANGELOG.md +21 -0
- package/dist/index.js +328 -148
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,27 @@ All notable changes to Blitz Strike are documented here.
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [2.4.124] — 2026-09-29
|
|
9
|
+
|
|
10
|
+
### Added — TOTP/HOTP generation + WET/DRY traceability
|
|
11
|
+
|
|
12
|
+
- New `totp(secret, …)` — deterministic RFC 6238 TOTP / RFC 4226 HOTP
|
|
13
|
+
generation (base32 or raw ASCII key) so the agent can fill a 2FA field itself
|
|
14
|
+
during authenticated scanning instead of stalling on a prompt.
|
|
15
|
+
- New `wet_dry(type, wet, dry)` — save the RAW output (WET) and PARSED result
|
|
16
|
+
(DRY) of an enrichment step separately and diagnose WHERE a bad deliverable
|
|
17
|
+
broke: WET (model/prompt/timeout) vs DRY (parser) vs template. (158 MCP tools.)
|
|
18
|
+
|
|
19
|
+
## [2.4.123] — 2026-09-29
|
|
20
|
+
|
|
21
|
+
### Added — circuit breaker (`target_health` + `circuit_status`)
|
|
22
|
+
|
|
23
|
+
- New `target_health(target, limit?)`: probe a target (10s timeout) and track
|
|
24
|
+
consecutive failures in a persisted circuit-breaker state; after 5 consecutive
|
|
25
|
+
timeouts/5xx the circuit OPENS (PAUSE) and auto-closes on the next successful
|
|
26
|
+
probe. `circuit_status()` lists every tracked target's state. Tells the agent
|
|
27
|
+
to stop hammering an unresponsive target instead of burning requests. (156 MCP tools.)
|
|
28
|
+
|
|
8
29
|
## [2.4.122] — 2026-09-29
|
|
9
30
|
|
|
10
31
|
### Added — `param_surface` (autonomous parameter discovery + specialist hints)
|
package/dist/index.js
CHANGED
|
@@ -17452,9 +17452,9 @@ var init_variants = __esm(() => {
|
|
|
17452
17452
|
});
|
|
17453
17453
|
|
|
17454
17454
|
// src/sync.ts
|
|
17455
|
-
import { mkdirSync as
|
|
17456
|
-
import { join as
|
|
17457
|
-
import { homedir as
|
|
17455
|
+
import { mkdirSync as mkdirSync11, writeFileSync as writeFileSync10, readFileSync as readFileSync32, readdirSync as readdirSync9, statSync as statSync6, rmSync as rmSync5 } from "node:fs";
|
|
17456
|
+
import { join as join31 } from "node:path";
|
|
17457
|
+
import { homedir as homedir12 } from "node:os";
|
|
17458
17458
|
import { fileURLToPath as fileURLToPath18 } from "node:url";
|
|
17459
17459
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
17460
17460
|
function dirExists(p) {
|
|
@@ -17470,7 +17470,7 @@ function countFiles(dir) {
|
|
|
17470
17470
|
const walk = (d) => {
|
|
17471
17471
|
for (const e of readdirSync9(d, { withFileTypes: true })) {
|
|
17472
17472
|
if (e.isDirectory())
|
|
17473
|
-
walk(
|
|
17473
|
+
walk(join31(d, e.name));
|
|
17474
17474
|
else
|
|
17475
17475
|
n++;
|
|
17476
17476
|
}
|
|
@@ -17483,9 +17483,9 @@ function countFiles(dir) {
|
|
|
17483
17483
|
}
|
|
17484
17484
|
function syncData() {
|
|
17485
17485
|
if (!dirExists(DATA_ROOT2))
|
|
17486
|
-
|
|
17487
|
-
const payloadsPath =
|
|
17488
|
-
const templatesPath =
|
|
17486
|
+
mkdirSync11(DATA_ROOT2, { recursive: true });
|
|
17487
|
+
const payloadsPath = join31(DATA_ROOT2, "payloads");
|
|
17488
|
+
const templatesPath = join31(DATA_ROOT2, "templates");
|
|
17489
17489
|
const hasPayloads = dirExists(payloadsPath) && countFiles(payloadsPath) > 0;
|
|
17490
17490
|
const hasTemplates = dirExists(templatesPath) && countFiles(templatesPath) > 0;
|
|
17491
17491
|
if (hasPayloads && hasTemplates) {
|
|
@@ -17495,8 +17495,8 @@ function syncData() {
|
|
|
17495
17495
|
data_root: DATA_ROOT2
|
|
17496
17496
|
};
|
|
17497
17497
|
}
|
|
17498
|
-
const localPayloads =
|
|
17499
|
-
const localTemplates =
|
|
17498
|
+
const localPayloads = join31(ROOT11, "payloads");
|
|
17499
|
+
const localTemplates = join31(ROOT11, "templates");
|
|
17500
17500
|
let payloadsSynced = false;
|
|
17501
17501
|
let templatesSynced = false;
|
|
17502
17502
|
if (!hasPayloads && dirExists(localPayloads)) {
|
|
@@ -17509,7 +17509,7 @@ function syncData() {
|
|
|
17509
17509
|
}
|
|
17510
17510
|
const gitOk = spawnSync4("git", ["--version"]).status === 0;
|
|
17511
17511
|
if (gitOk && (!dirExists(payloadsPath) || countFiles(payloadsPath) === 0 || !dirExists(templatesPath) || countFiles(templatesPath) === 0)) {
|
|
17512
|
-
const tmp =
|
|
17512
|
+
const tmp = join31(DATA_ROOT2, ".tmp-clone");
|
|
17513
17513
|
if (dirExists(tmp))
|
|
17514
17514
|
rmSync5(tmp, { recursive: true, force: true });
|
|
17515
17515
|
const r = spawnSync4("git", ["clone", "--depth", "1", "--filter=blob:none", "--sparse", GITHUB_REPO, tmp], { timeout: 120000 });
|
|
@@ -17517,11 +17517,11 @@ function syncData() {
|
|
|
17517
17517
|
const sparse = spawnSync4("git", ["-C", tmp, "sparse-checkout", "set", "payloads", "templates"], { timeout: 120000 });
|
|
17518
17518
|
if (sparse.status === 0) {
|
|
17519
17519
|
if (!dirExists(payloadsPath) || countFiles(payloadsPath) === 0) {
|
|
17520
|
-
copyDir(
|
|
17520
|
+
copyDir(join31(tmp, "payloads"), payloadsPath);
|
|
17521
17521
|
payloadsSynced = true;
|
|
17522
17522
|
}
|
|
17523
17523
|
if (!dirExists(templatesPath) || countFiles(templatesPath) === 0) {
|
|
17524
|
-
copyDir(
|
|
17524
|
+
copyDir(join31(tmp, "templates"), templatesPath);
|
|
17525
17525
|
templatesSynced = true;
|
|
17526
17526
|
}
|
|
17527
17527
|
}
|
|
@@ -17541,20 +17541,20 @@ function copyDir(src, dst) {
|
|
|
17541
17541
|
}
|
|
17542
17542
|
}
|
|
17543
17543
|
function manualCopy(src, dst) {
|
|
17544
|
-
|
|
17544
|
+
mkdirSync11(dst, { recursive: true });
|
|
17545
17545
|
for (const e of readdirSync9(src, { withFileTypes: true })) {
|
|
17546
|
-
const s =
|
|
17547
|
-
const d =
|
|
17546
|
+
const s = join31(src, e.name);
|
|
17547
|
+
const d = join31(dst, e.name);
|
|
17548
17548
|
if (e.isDirectory())
|
|
17549
17549
|
manualCopy(s, d);
|
|
17550
17550
|
else
|
|
17551
|
-
|
|
17551
|
+
writeFileSync10(d, readFileSync32(s));
|
|
17552
17552
|
}
|
|
17553
17553
|
}
|
|
17554
17554
|
var ROOT11, DATA_ROOT2, GITHUB_REPO = "https://github.com/shinthink/blitzstrike.git";
|
|
17555
17555
|
var init_sync = __esm(() => {
|
|
17556
|
-
ROOT11 =
|
|
17557
|
-
DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ??
|
|
17556
|
+
ROOT11 = join31(fileURLToPath18(new URL(".", import.meta.url)), "..");
|
|
17557
|
+
DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ?? join31(homedir12(), ".blitzstrike", "data");
|
|
17558
17558
|
});
|
|
17559
17559
|
|
|
17560
17560
|
// src/update.ts
|
|
@@ -17599,15 +17599,15 @@ var init_update = __esm(() => {
|
|
|
17599
17599
|
});
|
|
17600
17600
|
|
|
17601
17601
|
// src/release.ts
|
|
17602
|
-
import { readFileSync as
|
|
17603
|
-
import { join as
|
|
17602
|
+
import { readFileSync as readFileSync34, existsSync as existsSync18 } from "node:fs";
|
|
17603
|
+
import { join as join32 } from "node:path";
|
|
17604
17604
|
import { fileURLToPath as fileURLToPath19 } from "node:url";
|
|
17605
17605
|
import { execSync as execSync4 } from "node:child_process";
|
|
17606
17606
|
function validateRelease() {
|
|
17607
17607
|
const checks = [];
|
|
17608
17608
|
checks.push({ name: "package.json version", ok: true, detail: VERSION });
|
|
17609
17609
|
try {
|
|
17610
|
-
const changelog =
|
|
17610
|
+
const changelog = readFileSync34(join32(ROOT12, "CHANGELOG.md"), "utf8");
|
|
17611
17611
|
const m = changelog.match(/^##\s+\[([0-9]+\.[0-9]+\.[0-9]+)\]/m);
|
|
17612
17612
|
const changelogVersion = m?.[1] ?? null;
|
|
17613
17613
|
checks.push({
|
|
@@ -17639,22 +17639,22 @@ function validateRelease() {
|
|
|
17639
17639
|
return { version: VERSION, checks, consistent: checks.filter((c) => !c.soft).every((c) => c.ok) };
|
|
17640
17640
|
}
|
|
17641
17641
|
function lockfilePresent() {
|
|
17642
|
-
return
|
|
17642
|
+
return existsSync18(join32(ROOT12, "package-lock.json")) || existsSync18(join32(ROOT12, "bun.lock")) || existsSync18(join32(ROOT12, "bun.lockb"));
|
|
17643
17643
|
}
|
|
17644
17644
|
var ROOT12;
|
|
17645
17645
|
var init_release = __esm(() => {
|
|
17646
17646
|
init_version();
|
|
17647
|
-
ROOT12 =
|
|
17647
|
+
ROOT12 = join32(fileURLToPath19(new URL(".", import.meta.url)), "..");
|
|
17648
17648
|
});
|
|
17649
17649
|
|
|
17650
17650
|
// src/dependency.ts
|
|
17651
|
-
import { readFileSync as
|
|
17652
|
-
import { join as
|
|
17651
|
+
import { readFileSync as readFileSync35 } from "node:fs";
|
|
17652
|
+
import { join as join33 } from "node:path";
|
|
17653
17653
|
import { fileURLToPath as fileURLToPath20 } from "node:url";
|
|
17654
17654
|
function checkDependencies() {
|
|
17655
17655
|
let pkg = {};
|
|
17656
17656
|
try {
|
|
17657
|
-
pkg = JSON.parse(
|
|
17657
|
+
pkg = JSON.parse(readFileSync35(join33(ROOT13, "package.json"), "utf8"));
|
|
17658
17658
|
} catch {
|
|
17659
17659
|
return { install_scripts: [], git_dependencies: [], total_dependencies: 0, safe: false };
|
|
17660
17660
|
}
|
|
@@ -17677,13 +17677,13 @@ function checkDependencies() {
|
|
|
17677
17677
|
}
|
|
17678
17678
|
var ROOT13;
|
|
17679
17679
|
var init_dependency = __esm(() => {
|
|
17680
|
-
ROOT13 =
|
|
17680
|
+
ROOT13 = join33(fileURLToPath20(new URL(".", import.meta.url)), "..");
|
|
17681
17681
|
});
|
|
17682
17682
|
|
|
17683
17683
|
// src/cli.ts
|
|
17684
|
-
import { readFileSync as
|
|
17685
|
-
import { join as
|
|
17686
|
-
import { homedir as
|
|
17684
|
+
import { readFileSync as readFileSync36, existsSync as existsSync19, writeFileSync as writeFileSync11, mkdirSync as mkdirSync12 } from "node:fs";
|
|
17685
|
+
import { join as join34, dirname as dirname6 } from "node:path";
|
|
17686
|
+
import { homedir as homedir13 } from "node:os";
|
|
17687
17687
|
import { fileURLToPath as fileURLToPath21 } from "node:url";
|
|
17688
17688
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
17689
17689
|
function which(cmd) {
|
|
@@ -17727,7 +17727,7 @@ async function runDoctor() {
|
|
|
17727
17727
|
detail: h1 ? `X-HackerOne-Research: ${h1}` : "H1_USERNAME not set",
|
|
17728
17728
|
fix: h1 ? undefined : "export H1_USERNAME=<your-hackerone-username> (adds X-HackerOne-Research to outbound requests)"
|
|
17729
17729
|
});
|
|
17730
|
-
const dataOk =
|
|
17730
|
+
const dataOk = existsSync19(join34(ROOT14, "chains.json")) && existsSync19(join34(ROOT14, "tools-catalog.json"));
|
|
17731
17731
|
issues.push({
|
|
17732
17732
|
name: "Data layers (chains + tools-catalog)",
|
|
17733
17733
|
status: dataOk ? "ok" : "fail",
|
|
@@ -17778,21 +17778,21 @@ BlitzStrike — ${verdict}`);
|
|
|
17778
17778
|
function resolveCommand() {
|
|
17779
17779
|
if (which("blitzstrike"))
|
|
17780
17780
|
return { command: "blitzstrike", args: ["serve", "--mcp"] };
|
|
17781
|
-
const src =
|
|
17782
|
-
if (which("bun") &&
|
|
17781
|
+
const src = join34(ROOT14, "src", "index.ts");
|
|
17782
|
+
if (which("bun") && existsSync19(src))
|
|
17783
17783
|
return { command: "bun", args: ["run", src, "serve", "--mcp"] };
|
|
17784
17784
|
if (which("npx"))
|
|
17785
17785
|
return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
|
|
17786
17786
|
if (which("bunx"))
|
|
17787
17787
|
return { command: "bunx", args: ["blitzstrike", "serve", "--mcp"] };
|
|
17788
|
-
const dist =
|
|
17789
|
-
if (
|
|
17788
|
+
const dist = join34(ROOT14, "dist", "index.js");
|
|
17789
|
+
if (existsSync19(dist))
|
|
17790
17790
|
return { command: "bun", args: [dist, "serve", "--mcp"] };
|
|
17791
17791
|
return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
|
|
17792
17792
|
}
|
|
17793
17793
|
function readJson(p) {
|
|
17794
17794
|
try {
|
|
17795
|
-
return JSON.parse(
|
|
17795
|
+
return JSON.parse(readFileSync36(p, "utf8"));
|
|
17796
17796
|
} catch {
|
|
17797
17797
|
return null;
|
|
17798
17798
|
}
|
|
@@ -17800,51 +17800,51 @@ function readJson(p) {
|
|
|
17800
17800
|
function jsonMcpServersWrite(p) {
|
|
17801
17801
|
return (command, args) => {
|
|
17802
17802
|
const dir = dirname6(p);
|
|
17803
|
-
if (!
|
|
17804
|
-
|
|
17803
|
+
if (!existsSync19(dir))
|
|
17804
|
+
mkdirSync12(dir, { recursive: true });
|
|
17805
17805
|
const existing = readJson(p) ?? {};
|
|
17806
17806
|
existing.mcpServers = {
|
|
17807
17807
|
...existing.mcpServers ?? {},
|
|
17808
17808
|
blitzstrike: { command, args }
|
|
17809
17809
|
};
|
|
17810
|
-
|
|
17810
|
+
writeFileSync11(p, JSON.stringify(existing, null, 2));
|
|
17811
17811
|
};
|
|
17812
17812
|
}
|
|
17813
17813
|
function opencodeWrite(p) {
|
|
17814
17814
|
return (command, args) => {
|
|
17815
17815
|
const dir = dirname6(p);
|
|
17816
|
-
if (!
|
|
17817
|
-
|
|
17816
|
+
if (!existsSync19(dir))
|
|
17817
|
+
mkdirSync12(dir, { recursive: true });
|
|
17818
17818
|
const existing = readJson(p) ?? {};
|
|
17819
17819
|
existing.mcp = {
|
|
17820
17820
|
...existing.mcp ?? {},
|
|
17821
17821
|
blitzstrike: { type: "local", command: [command, ...args], enabled: true }
|
|
17822
17822
|
};
|
|
17823
|
-
|
|
17823
|
+
writeFileSync11(p, JSON.stringify(existing, null, 2));
|
|
17824
17824
|
copyOpenCodeAgents();
|
|
17825
17825
|
};
|
|
17826
17826
|
}
|
|
17827
17827
|
function copyOpenCodeAgents() {
|
|
17828
|
-
const srcDir =
|
|
17829
|
-
const dstDir =
|
|
17830
|
-
if (!
|
|
17828
|
+
const srcDir = join34(ROOT14, "opencode-agents");
|
|
17829
|
+
const dstDir = join34(homedir13(), ".config", "opencode", "agents");
|
|
17830
|
+
if (!existsSync19(srcDir))
|
|
17831
17831
|
return;
|
|
17832
|
-
if (!
|
|
17833
|
-
|
|
17832
|
+
if (!existsSync19(dstDir))
|
|
17833
|
+
mkdirSync12(dstDir, { recursive: true });
|
|
17834
17834
|
for (const f of ["Blitz Strike.md", "Blitz.md", "Eagle Eye.md", "Strike.md"]) {
|
|
17835
|
-
const src =
|
|
17836
|
-
const dst =
|
|
17837
|
-
if (
|
|
17838
|
-
|
|
17835
|
+
const src = join34(srcDir, f);
|
|
17836
|
+
const dst = join34(dstDir, f);
|
|
17837
|
+
if (existsSync19(src)) {
|
|
17838
|
+
writeFileSync11(dst, readFileSync36(src, "utf8"));
|
|
17839
17839
|
}
|
|
17840
17840
|
}
|
|
17841
17841
|
}
|
|
17842
17842
|
function codexWrite(p) {
|
|
17843
17843
|
return (command, args) => {
|
|
17844
17844
|
const dir = dirname6(p);
|
|
17845
|
-
if (!
|
|
17846
|
-
|
|
17847
|
-
let existing =
|
|
17845
|
+
if (!existsSync19(dir))
|
|
17846
|
+
mkdirSync12(dir, { recursive: true });
|
|
17847
|
+
let existing = existsSync19(p) ? readFileSync36(p, "utf8") : "";
|
|
17848
17848
|
if (!existing.trimEnd().endsWith(`
|
|
17849
17849
|
`))
|
|
17850
17850
|
existing += `
|
|
@@ -17855,15 +17855,15 @@ function codexWrite(p) {
|
|
|
17855
17855
|
command = "${command}"
|
|
17856
17856
|
args = ${JSON.stringify(args)}
|
|
17857
17857
|
`;
|
|
17858
|
-
|
|
17858
|
+
writeFileSync11(p, existing);
|
|
17859
17859
|
};
|
|
17860
17860
|
}
|
|
17861
17861
|
function hermesWrite(p) {
|
|
17862
17862
|
return (command, args) => {
|
|
17863
17863
|
const dir = dirname6(p);
|
|
17864
|
-
if (!
|
|
17865
|
-
|
|
17866
|
-
let existing =
|
|
17864
|
+
if (!existsSync19(dir))
|
|
17865
|
+
mkdirSync12(dir, { recursive: true });
|
|
17866
|
+
let existing = existsSync19(p) ? readFileSync36(p, "utf8") : "";
|
|
17867
17867
|
existing = existing.replace(/^ blitzstrike:\n(?: .*\n?)*/m, "");
|
|
17868
17868
|
if (!existing.trimEnd().endsWith(`
|
|
17869
17869
|
`))
|
|
@@ -17884,80 +17884,80 @@ mcp_servers:
|
|
|
17884
17884
|
args: ${JSON.stringify(args)}
|
|
17885
17885
|
`;
|
|
17886
17886
|
}
|
|
17887
|
-
|
|
17887
|
+
writeFileSync11(p, existing);
|
|
17888
17888
|
};
|
|
17889
17889
|
}
|
|
17890
17890
|
function detectAgents() {
|
|
17891
|
-
const home =
|
|
17891
|
+
const home = homedir13();
|
|
17892
17892
|
const agents = [];
|
|
17893
|
-
const claudeJson =
|
|
17893
|
+
const claudeJson = join34(home, ".claude.json");
|
|
17894
17894
|
agents.push({
|
|
17895
17895
|
name: "Claude Code",
|
|
17896
17896
|
detectPath: claudeJson,
|
|
17897
|
-
installed: () =>
|
|
17897
|
+
installed: () => existsSync19(claudeJson) || which("claude"),
|
|
17898
17898
|
write: jsonMcpServersWrite(claudeJson)
|
|
17899
17899
|
});
|
|
17900
|
-
const claudeDesktop =
|
|
17900
|
+
const claudeDesktop = join34(home, ".config", "Claude", "claude_desktop_config.json");
|
|
17901
17901
|
agents.push({
|
|
17902
17902
|
name: "Claude Desktop",
|
|
17903
17903
|
detectPath: claudeDesktop,
|
|
17904
|
-
installed: () =>
|
|
17904
|
+
installed: () => existsSync19(claudeDesktop),
|
|
17905
17905
|
write: jsonMcpServersWrite(claudeDesktop)
|
|
17906
17906
|
});
|
|
17907
|
-
const cursor =
|
|
17907
|
+
const cursor = join34(home, ".cursor", "mcp.json");
|
|
17908
17908
|
agents.push({
|
|
17909
17909
|
name: "Cursor",
|
|
17910
17910
|
detectPath: cursor,
|
|
17911
|
-
installed: () =>
|
|
17911
|
+
installed: () => existsSync19(join34(home, ".cursor")) || which("cursor"),
|
|
17912
17912
|
write: jsonMcpServersWrite(cursor)
|
|
17913
17913
|
});
|
|
17914
|
-
const opencode =
|
|
17914
|
+
const opencode = join34(home, ".config", "opencode", "opencode.jsonc");
|
|
17915
17915
|
agents.push({
|
|
17916
17916
|
name: "OpenCode",
|
|
17917
17917
|
detectPath: opencode,
|
|
17918
|
-
installed: () =>
|
|
17918
|
+
installed: () => existsSync19(join34(home, ".config", "opencode")) || which("opencode"),
|
|
17919
17919
|
write: opencodeWrite(opencode)
|
|
17920
17920
|
});
|
|
17921
|
-
const codex =
|
|
17921
|
+
const codex = join34(home, ".codex", "config.toml");
|
|
17922
17922
|
agents.push({
|
|
17923
17923
|
name: "Codex",
|
|
17924
17924
|
detectPath: codex,
|
|
17925
|
-
installed: () =>
|
|
17925
|
+
installed: () => existsSync19(join34(home, ".codex")) || which("codex"),
|
|
17926
17926
|
write: codexWrite(codex)
|
|
17927
17927
|
});
|
|
17928
|
-
const hermes =
|
|
17928
|
+
const hermes = join34(home, ".hermes", "config.yaml");
|
|
17929
17929
|
agents.push({
|
|
17930
17930
|
name: "Hermes",
|
|
17931
17931
|
detectPath: hermes,
|
|
17932
|
-
installed: () =>
|
|
17932
|
+
installed: () => existsSync19(join34(home, ".hermes")) || which("hermes"),
|
|
17933
17933
|
write: hermesWrite(hermes)
|
|
17934
17934
|
});
|
|
17935
|
-
const gemini =
|
|
17935
|
+
const gemini = join34(home, ".gemini", "settings.json");
|
|
17936
17936
|
agents.push({
|
|
17937
17937
|
name: "Gemini CLI",
|
|
17938
17938
|
detectPath: gemini,
|
|
17939
|
-
installed: () =>
|
|
17939
|
+
installed: () => existsSync19(join34(home, ".gemini")) || which("gemini"),
|
|
17940
17940
|
write: jsonMcpServersWrite(gemini)
|
|
17941
17941
|
});
|
|
17942
|
-
const windsurf =
|
|
17942
|
+
const windsurf = join34(home, ".codeium", "windsurf", "mcp_config.json");
|
|
17943
17943
|
agents.push({
|
|
17944
17944
|
name: "Windsurf",
|
|
17945
17945
|
detectPath: windsurf,
|
|
17946
|
-
installed: () =>
|
|
17946
|
+
installed: () => existsSync19(join34(home, ".codeium")) || which("windsurf"),
|
|
17947
17947
|
write: jsonMcpServersWrite(windsurf)
|
|
17948
17948
|
});
|
|
17949
|
-
const copilot =
|
|
17949
|
+
const copilot = join34(home, ".copilot", "mcp.json");
|
|
17950
17950
|
agents.push({
|
|
17951
17951
|
name: "Copilot",
|
|
17952
17952
|
detectPath: copilot,
|
|
17953
|
-
installed: () =>
|
|
17953
|
+
installed: () => existsSync19(join34(home, ".copilot")),
|
|
17954
17954
|
write: jsonMcpServersWrite(copilot)
|
|
17955
17955
|
});
|
|
17956
|
-
const cline =
|
|
17956
|
+
const cline = join34(home, ".cline", "mcp_settings.json");
|
|
17957
17957
|
agents.push({
|
|
17958
17958
|
name: "Cline",
|
|
17959
17959
|
detectPath: cline,
|
|
17960
|
-
installed: () =>
|
|
17960
|
+
installed: () => existsSync19(join34(home, ".cline")),
|
|
17961
17961
|
write: jsonMcpServersWrite(cline)
|
|
17962
17962
|
});
|
|
17963
17963
|
return agents;
|
|
@@ -18075,7 +18075,7 @@ var init_cli = __esm(() => {
|
|
|
18075
18075
|
init_release();
|
|
18076
18076
|
init_dependency();
|
|
18077
18077
|
init_mcp_status();
|
|
18078
|
-
ROOT14 =
|
|
18078
|
+
ROOT14 = join34(fileURLToPath21(new URL(".", import.meta.url)), "..");
|
|
18079
18079
|
});
|
|
18080
18080
|
|
|
18081
18081
|
// node_modules/zod/v3/helpers/util.js
|
|
@@ -32713,7 +32713,7 @@ class StdioServerTransport {
|
|
|
32713
32713
|
|
|
32714
32714
|
// src/server.ts
|
|
32715
32715
|
init_scanner();
|
|
32716
|
-
import { readFileSync as
|
|
32716
|
+
import { readFileSync as readFileSync33 } from "node:fs";
|
|
32717
32717
|
import { execFileSync as execFileSync8 } from "node:child_process";
|
|
32718
32718
|
|
|
32719
32719
|
// src/review-harness.ts
|
|
@@ -60607,19 +60607,156 @@ async function paramSurface(target, class_) {
|
|
|
60607
60607
|
return { ...result, url: base, status_hint: status === 0 ? "fetch failed" : `http ${status}` };
|
|
60608
60608
|
}
|
|
60609
60609
|
|
|
60610
|
-
// src/
|
|
60611
|
-
import { readFileSync as readFileSync26,
|
|
60610
|
+
// src/circuit-breaker.ts
|
|
60611
|
+
import { readFileSync as readFileSync26, writeFileSync as writeFileSync6, mkdirSync as mkdirSync7, existsSync as existsSync13 } from "node:fs";
|
|
60612
60612
|
import { join as join26 } from "node:path";
|
|
60613
|
+
import { homedir as homedir9 } from "node:os";
|
|
60614
|
+
var HOME_DIR4 = process.env.BLITZSTRIKE_HOME ?? join26(homedir9(), ".blitzstrike");
|
|
60615
|
+
var STATE_PATH = join26(HOME_DIR4, "circuit-breaker.json");
|
|
60616
|
+
function loadState() {
|
|
60617
|
+
try {
|
|
60618
|
+
if (existsSync13(STATE_PATH))
|
|
60619
|
+
return JSON.parse(readFileSync26(STATE_PATH, "utf8"));
|
|
60620
|
+
} catch {}
|
|
60621
|
+
return { targets: {} };
|
|
60622
|
+
}
|
|
60623
|
+
function saveState(s) {
|
|
60624
|
+
try {
|
|
60625
|
+
mkdirSync7(HOME_DIR4, { recursive: true });
|
|
60626
|
+
writeFileSync6(STATE_PATH, JSON.stringify(s, null, 2));
|
|
60627
|
+
} catch {}
|
|
60628
|
+
}
|
|
60629
|
+
async function targetHealth(target, limit = 5) {
|
|
60630
|
+
const state = loadState();
|
|
60631
|
+
const entry = state.targets[target] ?? { consecutive_failures: 0, last_checked: "", circuit: "closed" };
|
|
60632
|
+
let healthy = false;
|
|
60633
|
+
let status;
|
|
60634
|
+
const t0 = Date.now();
|
|
60635
|
+
try {
|
|
60636
|
+
const res = await fetch(target, { method: "GET", redirect: "follow", signal: AbortSignal.timeout(1e4), headers: { "User-Agent": "Mozilla/5.0 (compatible; BlitzStrike/2.4)" } });
|
|
60637
|
+
status = res.status;
|
|
60638
|
+
healthy = res.status < 500;
|
|
60639
|
+
} catch {
|
|
60640
|
+
healthy = false;
|
|
60641
|
+
}
|
|
60642
|
+
const responseMs = Date.now() - t0;
|
|
60643
|
+
if (healthy) {
|
|
60644
|
+
entry.consecutive_failures = 0;
|
|
60645
|
+
entry.circuit = "closed";
|
|
60646
|
+
entry.opened_at = undefined;
|
|
60647
|
+
} else {
|
|
60648
|
+
entry.consecutive_failures += 1;
|
|
60649
|
+
if (entry.consecutive_failures >= limit) {
|
|
60650
|
+
entry.circuit = "open";
|
|
60651
|
+
entry.opened_at = entry.opened_at ?? new Date().toISOString();
|
|
60652
|
+
}
|
|
60653
|
+
}
|
|
60654
|
+
entry.last_checked = new Date().toISOString();
|
|
60655
|
+
state.targets[target] = entry;
|
|
60656
|
+
saveState(state);
|
|
60657
|
+
const advice = entry.circuit === "open" ? `CIRCUIT OPEN after ${entry.consecutive_failures} consecutive failures — PAUSE this target and resume when it recovers (the circuit auto-closes on the next successful target_health probe).` : healthy ? `target responsive (HTTP ${status}) — safe to continue.` : `${entry.consecutive_failures}/${limit} consecutive failures — target degraded; consider slowing down or pausing before ${limit}.`;
|
|
60658
|
+
return { target, healthy, status_code: status, response_ms: responseMs, consecutive_failures: entry.consecutive_failures, circuit: entry.circuit, advice };
|
|
60659
|
+
}
|
|
60660
|
+
function circuitStatus() {
|
|
60661
|
+
const state = loadState();
|
|
60662
|
+
const targets = Object.entries(state.targets).map(([target, s]) => ({ target, ...s }));
|
|
60663
|
+
targets.sort((a, b) => b.consecutive_failures - a.consecutive_failures || (a.circuit === "open" ? -1 : 1));
|
|
60664
|
+
return { targets, open_count: targets.filter((t) => t.circuit === "open").length };
|
|
60665
|
+
}
|
|
60666
|
+
|
|
60667
|
+
// src/totp.ts
|
|
60668
|
+
import { createHmac as createHmac2 } from "node:crypto";
|
|
60669
|
+
function base32Decode(secret) {
|
|
60670
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
60671
|
+
const clean = secret.toUpperCase().replace(/=+$/g, "").replace(/[\s-]/g, "");
|
|
60672
|
+
let bits = 0;
|
|
60673
|
+
let value = 0;
|
|
60674
|
+
const out = [];
|
|
60675
|
+
for (const ch of clean) {
|
|
60676
|
+
const idx = alphabet.indexOf(ch);
|
|
60677
|
+
if (idx === -1)
|
|
60678
|
+
continue;
|
|
60679
|
+
value = value << 5 | idx;
|
|
60680
|
+
bits += 5;
|
|
60681
|
+
if (bits >= 8) {
|
|
60682
|
+
out.push(value >>> bits - 8 & 255);
|
|
60683
|
+
bits -= 8;
|
|
60684
|
+
}
|
|
60685
|
+
}
|
|
60686
|
+
return Buffer.from(out);
|
|
60687
|
+
}
|
|
60688
|
+
function keyFromSecret(secret) {
|
|
60689
|
+
const trimmed = secret.trim();
|
|
60690
|
+
return /^[A-Za-z2-7]+=?$/.test(trimmed) ? base32Decode(trimmed) : Buffer.from(trimmed, "utf8");
|
|
60691
|
+
}
|
|
60692
|
+
function hotp(secret, counter, digits, algo) {
|
|
60693
|
+
const key = keyFromSecret(secret);
|
|
60694
|
+
const buf = Buffer.alloc(8);
|
|
60695
|
+
let c = Math.max(0, Math.floor(counter));
|
|
60696
|
+
for (let i = 7;i >= 0; i--) {
|
|
60697
|
+
buf[i] = c & 255;
|
|
60698
|
+
c = Math.floor(c / 256);
|
|
60699
|
+
}
|
|
60700
|
+
const mac = createHmac2(algo, key).update(buf).digest();
|
|
60701
|
+
const offset = mac[mac.length - 1] & 15;
|
|
60702
|
+
const bin = (mac[offset] & 127) << 24 | (mac[offset + 1] & 255) << 16 | (mac[offset + 2] & 255) << 8 | mac[offset + 3] & 255;
|
|
60703
|
+
return String(bin % 10 ** digits).padStart(digits, "0");
|
|
60704
|
+
}
|
|
60705
|
+
function totp(secret, opts) {
|
|
60706
|
+
const digits = opts?.digits ?? 6;
|
|
60707
|
+
const period = opts?.period ?? 30;
|
|
60708
|
+
const algo = opts?.algo ?? "sha1";
|
|
60709
|
+
const now = Math.floor(Date.now() / 1000);
|
|
60710
|
+
const counter = Math.floor(now / period);
|
|
60711
|
+
const token = hotp(secret, counter, digits, algo);
|
|
60712
|
+
return {
|
|
60713
|
+
token,
|
|
60714
|
+
expires_in: period - now % period,
|
|
60715
|
+
algorithm: algo,
|
|
60716
|
+
digits,
|
|
60717
|
+
period,
|
|
60718
|
+
secret_format: /^[A-Za-z2-7]+=?$/.test(secret.trim()) ? "base32" : "raw"
|
|
60719
|
+
};
|
|
60720
|
+
}
|
|
60721
|
+
function hotpToken(secret, counter, opts) {
|
|
60722
|
+
return hotp(secret, counter, opts?.digits ?? 6, opts?.algo ?? "sha1");
|
|
60723
|
+
}
|
|
60724
|
+
|
|
60725
|
+
// src/wet-dry.ts
|
|
60726
|
+
function sha2562(text) {
|
|
60727
|
+
let h = 5381;
|
|
60728
|
+
for (let i = 0;i < text.length; i++)
|
|
60729
|
+
h = (h << 5) + h + text.charCodeAt(i) >>> 0;
|
|
60730
|
+
return `djb2-${h.toString(16).padStart(8, "0")}`;
|
|
60731
|
+
}
|
|
60732
|
+
function wetDryTrace(type, wet, dry, dryOk = true) {
|
|
60733
|
+
const wetOk = wet.trim().length > 0;
|
|
60734
|
+
const diagnosis = !wetOk ? "WET broken — raw output empty/garbage (model, prompt, or timeout problem). Fix the model/prompt, not the parser." : !dryOk ? "DRY broken — raw OK but parse failed (regex/JSON-malformed). Fix the parser, not the model." : "OK — raw and parsed both present. If the report is still bad, the template is the problem.";
|
|
60735
|
+
return {
|
|
60736
|
+
type,
|
|
60737
|
+
wet: wet.trim(),
|
|
60738
|
+
dry: dry.trim(),
|
|
60739
|
+
wet_ok: wetOk,
|
|
60740
|
+
dry_ok: dryOk,
|
|
60741
|
+
diagnosis,
|
|
60742
|
+
sha256_wet: sha2562(wet),
|
|
60743
|
+
sha256_dry: sha2562(dry)
|
|
60744
|
+
};
|
|
60745
|
+
}
|
|
60746
|
+
|
|
60747
|
+
// src/benchmark.ts
|
|
60748
|
+
import { readFileSync as readFileSync27, readdirSync as readdirSync7, writeFileSync as writeFileSync7, rmSync as rmSync3, mkdirSync as mkdirSync8 } from "node:fs";
|
|
60749
|
+
import { join as join27 } from "node:path";
|
|
60613
60750
|
import { fileURLToPath as fileURLToPath16 } from "node:url";
|
|
60614
|
-
import { tmpdir as tmpdir3, homedir as
|
|
60751
|
+
import { tmpdir as tmpdir3, homedir as homedir10 } from "node:os";
|
|
60615
60752
|
init_complex_bugs();
|
|
60616
|
-
var ROOT9 =
|
|
60617
|
-
var CORPUS =
|
|
60618
|
-
var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ??
|
|
60753
|
+
var ROOT9 = join27(fileURLToPath16(new URL(".", import.meta.url)), "..");
|
|
60754
|
+
var CORPUS = join27(ROOT9, "bench", "corpus");
|
|
60755
|
+
var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ?? join27(homedir10(), ".blitzstrike", "corpus");
|
|
60619
60756
|
function parseCorpusFile(path) {
|
|
60620
60757
|
let text;
|
|
60621
60758
|
try {
|
|
60622
|
-
text =
|
|
60759
|
+
text = readFileSync27(path, "utf8");
|
|
60623
60760
|
} catch {
|
|
60624
60761
|
return null;
|
|
60625
60762
|
}
|
|
@@ -60675,7 +60812,7 @@ function loadDir(dir) {
|
|
|
60675
60812
|
for (const f of readdirSync7(dir)) {
|
|
60676
60813
|
if (!f.endsWith(".md"))
|
|
60677
60814
|
continue;
|
|
60678
|
-
const e = parseCorpusFile(
|
|
60815
|
+
const e = parseCorpusFile(join27(dir, f));
|
|
60679
60816
|
if (e)
|
|
60680
60817
|
entries.push(e);
|
|
60681
60818
|
}
|
|
@@ -60686,7 +60823,7 @@ function loadCorpus2() {
|
|
|
60686
60823
|
return [...loadDir(CORPUS), ...loadDir(CAPTURED_CORPUS_DIR)];
|
|
60687
60824
|
}
|
|
60688
60825
|
function captureFalsePositive(input) {
|
|
60689
|
-
|
|
60826
|
+
mkdirSync8(CAPTURED_CORPUS_DIR, { recursive: true });
|
|
60690
60827
|
const slug = (input.note ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) || "captured";
|
|
60691
60828
|
const id = `fp-${slug}-${Date.now().toString(36)}`;
|
|
60692
60829
|
const ext = { php: "php", javascript: "js", typescript: "ts", python: "py", java: "java", js: "js" }[input.language.toLowerCase()] ?? input.language;
|
|
@@ -60702,8 +60839,8 @@ function captureFalsePositive(input) {
|
|
|
60702
60839
|
input.code,
|
|
60703
60840
|
"```"
|
|
60704
60841
|
].filter((l) => l !== null);
|
|
60705
|
-
const path =
|
|
60706
|
-
|
|
60842
|
+
const path = join27(CAPTURED_CORPUS_DIR, `${id}.md`);
|
|
60843
|
+
writeFileSync7(path, lines.join(`
|
|
60707
60844
|
`) + `
|
|
60708
60845
|
`, "utf8");
|
|
60709
60846
|
const entry = { id, language: input.language.toLowerCase(), vulnerable: false, detector: input.detector, note: input.note, sink_type: input.sink_type, code: input.code };
|
|
@@ -60724,8 +60861,8 @@ function detect(entry) {
|
|
|
60724
60861
|
}
|
|
60725
60862
|
const lang = entry.language;
|
|
60726
60863
|
if (lang === "php") {
|
|
60727
|
-
const tmp =
|
|
60728
|
-
|
|
60864
|
+
const tmp = join27(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
|
|
60865
|
+
writeFileSync7(tmp, entry.code);
|
|
60729
60866
|
const r = analyzeDataFlow2(tmp);
|
|
60730
60867
|
rmSync3(tmp, { force: true });
|
|
60731
60868
|
if (r.findings.length > 0)
|
|
@@ -60793,25 +60930,25 @@ function runBenchmark() {
|
|
|
60793
60930
|
}
|
|
60794
60931
|
|
|
60795
60932
|
// src/obligations.ts
|
|
60796
|
-
import { readFileSync as
|
|
60797
|
-
import { join as
|
|
60933
|
+
import { readFileSync as readFileSync28, appendFileSync as appendFileSync4, mkdirSync as mkdirSync9, existsSync as existsSync14, writeFileSync as writeFileSync8 } from "node:fs";
|
|
60934
|
+
import { join as join28 } from "node:path";
|
|
60798
60935
|
import { createHash as createHash6 } from "node:crypto";
|
|
60799
|
-
import { homedir as
|
|
60800
|
-
var
|
|
60801
|
-
var OBLIGATION_PATH =
|
|
60936
|
+
import { homedir as homedir11 } from "node:os";
|
|
60937
|
+
var HOME_DIR5 = process.env.BLITZSTRIKE_HOME ?? join28(homedir11(), ".blitzstrike");
|
|
60938
|
+
var OBLIGATION_PATH = join28(HOME_DIR5, "obligations.jsonl");
|
|
60802
60939
|
function ensureDir3() {
|
|
60803
|
-
if (!
|
|
60804
|
-
|
|
60940
|
+
if (!existsSync14(HOME_DIR5))
|
|
60941
|
+
mkdirSync9(HOME_DIR5, { recursive: true });
|
|
60805
60942
|
}
|
|
60806
60943
|
function shortId2(claim) {
|
|
60807
60944
|
return `obl-${createHash6("sha256").update(`${claim}\x00${Date.now()}`).digest("hex").slice(0, 12)}`;
|
|
60808
60945
|
}
|
|
60809
60946
|
function loadObligations() {
|
|
60810
|
-
if (!
|
|
60947
|
+
if (!existsSync14(OBLIGATION_PATH))
|
|
60811
60948
|
return [];
|
|
60812
60949
|
try {
|
|
60813
60950
|
const out = [];
|
|
60814
|
-
for (const line of
|
|
60951
|
+
for (const line of readFileSync28(OBLIGATION_PATH, "utf8").split(`
|
|
60815
60952
|
`)) {
|
|
60816
60953
|
const t = line.trim();
|
|
60817
60954
|
if (!t)
|
|
@@ -60832,7 +60969,7 @@ function append3(o) {
|
|
|
60832
60969
|
}
|
|
60833
60970
|
function rewrite(entries) {
|
|
60834
60971
|
ensureDir3();
|
|
60835
|
-
|
|
60972
|
+
writeFileSync8(OBLIGATION_PATH, entries.map((e) => JSON.stringify(e)).join(`
|
|
60836
60973
|
`) + (entries.length ? `
|
|
60837
60974
|
` : ""));
|
|
60838
60975
|
}
|
|
@@ -60915,11 +61052,11 @@ init_framework_security();
|
|
|
60915
61052
|
// src/variant-scan.ts
|
|
60916
61053
|
init_scanner();
|
|
60917
61054
|
init_complex_bugs();
|
|
60918
|
-
import { readFileSync as
|
|
61055
|
+
import { readFileSync as readFileSync30 } from "node:fs";
|
|
60919
61056
|
|
|
60920
61057
|
// src/cross-file.ts
|
|
60921
61058
|
init_scanner();
|
|
60922
|
-
import { readFileSync as
|
|
61059
|
+
import { readFileSync as readFileSync29 } from "node:fs";
|
|
60923
61060
|
var PUBLIC_HOOK_RE = /(?:wp_ajax_nopriv_\w+|admin_post_nopriv_\w+|init|template_redirect|wp_loaded|parse_request|user_register|um_user_register|register_new_user|authenticate)/;
|
|
60924
61061
|
var PRIV_SINK_RE = /\b(set_role|add_role|remove_role|set_user_role|wp_set_current_user|wp_set_auth_cookie|wp_insert_user|wp_create_user|wp_update_user)\s*\(/;
|
|
60925
61062
|
var ROLE_META_RE = /update_user_meta\s*\(\s*[^,]+,\s*['"](wp_capabilities|role|roles|capabilities|wp_user_level)['"]/;
|
|
@@ -60971,7 +61108,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
60971
61108
|
for (const file of files) {
|
|
60972
61109
|
let code;
|
|
60973
61110
|
try {
|
|
60974
|
-
code = stripComments(
|
|
61111
|
+
code = stripComments(readFileSync29(file, "utf8"));
|
|
60975
61112
|
} catch {
|
|
60976
61113
|
continue;
|
|
60977
61114
|
}
|
|
@@ -61012,7 +61149,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
61012
61149
|
for (const file of files) {
|
|
61013
61150
|
let code;
|
|
61014
61151
|
try {
|
|
61015
|
-
code = stripComments(
|
|
61152
|
+
code = stripComments(readFileSync29(file, "utf8"));
|
|
61016
61153
|
} catch {
|
|
61017
61154
|
continue;
|
|
61018
61155
|
}
|
|
@@ -61035,7 +61172,7 @@ function detectCrossFilePrivesc(root) {
|
|
|
61035
61172
|
for (const file of files) {
|
|
61036
61173
|
let code;
|
|
61037
61174
|
try {
|
|
61038
|
-
code = stripComments(
|
|
61175
|
+
code = stripComments(readFileSync29(file, "utf8"));
|
|
61039
61176
|
} catch {
|
|
61040
61177
|
continue;
|
|
61041
61178
|
}
|
|
@@ -61150,7 +61287,7 @@ function variantScan(root, opts = {}) {
|
|
|
61150
61287
|
for (const file of files) {
|
|
61151
61288
|
let code;
|
|
61152
61289
|
try {
|
|
61153
|
-
code =
|
|
61290
|
+
code = readFileSync30(file, "utf8");
|
|
61154
61291
|
} catch {
|
|
61155
61292
|
continue;
|
|
61156
61293
|
}
|
|
@@ -61707,7 +61844,7 @@ async function raceTest(input) {
|
|
|
61707
61844
|
}
|
|
61708
61845
|
|
|
61709
61846
|
// src/jwt-analyze.ts
|
|
61710
|
-
import { createHmac as
|
|
61847
|
+
import { createHmac as createHmac3 } from "node:crypto";
|
|
61711
61848
|
function b64urlDecode2(seg) {
|
|
61712
61849
|
return Buffer.from(seg.replace(/-/g, "+").replace(/_/g, "/"), "base64").toString("utf8");
|
|
61713
61850
|
}
|
|
@@ -61773,7 +61910,7 @@ function analyzeJwt(token, opts = {}) {
|
|
|
61773
61910
|
if (/^HS\d+$/i.test(alg) && signature && opts.wordlist && opts.wordlist.length > 0) {
|
|
61774
61911
|
const data = `${token.split(".")[0]}.${token.split(".")[1]}`;
|
|
61775
61912
|
for (const w of opts.wordlist.slice(0, 1e4)) {
|
|
61776
|
-
const sig =
|
|
61913
|
+
const sig = createHmac3("sha256", w).update(data).digest("base64url");
|
|
61777
61914
|
if (sig === signature) {
|
|
61778
61915
|
findings.push({
|
|
61779
61916
|
type: "weak_secret",
|
|
@@ -61814,7 +61951,7 @@ import { spawn as spawn3, execSync as execSync2 } from "node:child_process";
|
|
|
61814
61951
|
import { createServer } from "node:http";
|
|
61815
61952
|
import { randomUUID } from "node:crypto";
|
|
61816
61953
|
import { networkInterfaces } from "node:os";
|
|
61817
|
-
import { existsSync as
|
|
61954
|
+
import { existsSync as existsSync15 } from "node:fs";
|
|
61818
61955
|
var sessions = new Map;
|
|
61819
61956
|
function sleep(ms) {
|
|
61820
61957
|
return new Promise((r) => setTimeout(r, ms));
|
|
@@ -61828,7 +61965,7 @@ function findInteractsh() {
|
|
|
61828
61965
|
const home = process.env.HOME ?? "/root";
|
|
61829
61966
|
const candidates = [`${home}/go/bin/interactsh-client`, "/usr/local/bin/interactsh-client", "/usr/bin/interactsh-client"];
|
|
61830
61967
|
for (const c of candidates)
|
|
61831
|
-
if (
|
|
61968
|
+
if (existsSync15(c))
|
|
61832
61969
|
return c;
|
|
61833
61970
|
return null;
|
|
61834
61971
|
}
|
|
@@ -62833,9 +62970,9 @@ function listPocTypes() {
|
|
|
62833
62970
|
|
|
62834
62971
|
// src/foundry-run.ts
|
|
62835
62972
|
import { execSync as execSync3 } from "node:child_process";
|
|
62836
|
-
import { mkdtempSync as mkdtempSync3, mkdirSync as
|
|
62973
|
+
import { mkdtempSync as mkdtempSync3, mkdirSync as mkdirSync10, writeFileSync as writeFileSync9, rmSync as rmSync4, existsSync as existsSync16 } from "node:fs";
|
|
62837
62974
|
import { tmpdir as tmpdir4 } from "node:os";
|
|
62838
|
-
import { join as
|
|
62975
|
+
import { join as join29 } from "node:path";
|
|
62839
62976
|
function findForge() {
|
|
62840
62977
|
try {
|
|
62841
62978
|
const p = execSync3("which forge 2>/dev/null", { encoding: "utf8", timeout: 3000 }).trim();
|
|
@@ -62845,7 +62982,7 @@ function findForge() {
|
|
|
62845
62982
|
const home = process.env.HOME ?? "/root";
|
|
62846
62983
|
const candidates = [`${home}/.foundry/bin/forge`, "/usr/local/bin/forge", "/usr/bin/forge"];
|
|
62847
62984
|
for (const c of candidates)
|
|
62848
|
-
if (
|
|
62985
|
+
if (existsSync16(c))
|
|
62849
62986
|
return c;
|
|
62850
62987
|
return null;
|
|
62851
62988
|
}
|
|
@@ -62884,14 +63021,14 @@ async function foundryRun(input) {
|
|
|
62884
63021
|
};
|
|
62885
63022
|
}
|
|
62886
63023
|
const poc = input.poc_code ?? foundryPoc(input.class_ ?? "missing_access_control", name);
|
|
62887
|
-
const dir = mkdtempSync3(
|
|
63024
|
+
const dir = mkdtempSync3(join29(tmpdir4(), "blitzstrike-foundry-"));
|
|
62888
63025
|
try {
|
|
62889
63026
|
try {
|
|
62890
63027
|
execSync3(`${forge} init --force --no-git ${dir}`, { stdio: "ignore", timeout: 60000 });
|
|
62891
63028
|
} catch {
|
|
62892
|
-
|
|
62893
|
-
|
|
62894
|
-
|
|
63029
|
+
mkdirSync10(join29(dir, "src"), { recursive: true });
|
|
63030
|
+
mkdirSync10(join29(dir, "test"), { recursive: true });
|
|
63031
|
+
writeFileSync9(join29(dir, "foundry.toml"), `[profile.default]
|
|
62895
63032
|
src = "src"
|
|
62896
63033
|
out = "out"
|
|
62897
63034
|
libs = ["lib"]
|
|
@@ -62901,12 +63038,12 @@ solc = "0.8.20"
|
|
|
62901
63038
|
for (const f of ["Counter.sol", "Counter.t.sol", "Counter.s.sol"]) {
|
|
62902
63039
|
for (const sub of ["src", "test", "script"]) {
|
|
62903
63040
|
try {
|
|
62904
|
-
rmSync4(
|
|
63041
|
+
rmSync4(join29(dir, sub, f), { force: true });
|
|
62905
63042
|
} catch {}
|
|
62906
63043
|
}
|
|
62907
63044
|
}
|
|
62908
|
-
|
|
62909
|
-
|
|
63045
|
+
writeFileSync9(join29(dir, "src", `${name}.sol`), input.contract_code);
|
|
63046
|
+
writeFileSync9(join29(dir, "test", `${name}.t.sol`), poc);
|
|
62910
63047
|
const { out } = runForge(forge, dir, input.timeout_ms ?? 60000);
|
|
62911
63048
|
const tests = parseTestResults(out);
|
|
62912
63049
|
const anyFail = tests.some((t) => t.status === "fail");
|
|
@@ -62924,18 +63061,18 @@ solc = "0.8.20"
|
|
|
62924
63061
|
}
|
|
62925
63062
|
|
|
62926
63063
|
// src/enterprise-benchmark.ts
|
|
62927
|
-
import { existsSync as
|
|
62928
|
-
import { join as
|
|
63064
|
+
import { existsSync as existsSync17, readFileSync as readFileSync31, readdirSync as readdirSync8, statSync as statSync5 } from "node:fs";
|
|
63065
|
+
import { join as join30, resolve } from "node:path";
|
|
62929
63066
|
import { fileURLToPath as fileURLToPath17 } from "node:url";
|
|
62930
63067
|
init_complex_bugs();
|
|
62931
63068
|
var ROOT10 = resolve(fileURLToPath17(new URL(".", import.meta.url)), "..", "bench", "enterprise");
|
|
62932
63069
|
var ENTERPRISE_FIXTURES = [
|
|
62933
|
-
{ id: "php-laravel", dir:
|
|
62934
|
-
{ id: "js-express", dir:
|
|
62935
|
-
{ id: "py-django", dir:
|
|
62936
|
-
{ id: "java-spring", dir:
|
|
62937
|
-
{ id: "wp-batch-route", dir:
|
|
62938
|
-
{ id: "php-complex", dir:
|
|
63070
|
+
{ id: "php-laravel", dir: join30(ROOT10, "php-laravel"), expected_vulns: 4 },
|
|
63071
|
+
{ id: "js-express", dir: join30(ROOT10, "js-express"), expected_vulns: 2 },
|
|
63072
|
+
{ id: "py-django", dir: join30(ROOT10, "py-django"), expected_vulns: 2 },
|
|
63073
|
+
{ id: "java-spring", dir: join30(ROOT10, "java-spring"), expected_vulns: 2 },
|
|
63074
|
+
{ id: "wp-batch-route", dir: join30(ROOT10, "wp-batch-route"), expected_vulns: 3 },
|
|
63075
|
+
{ id: "php-complex", dir: join30(ROOT10, "php-complex"), expected_vulns: 4 }
|
|
62939
63076
|
];
|
|
62940
63077
|
function sourceFiles(root) {
|
|
62941
63078
|
const out = [];
|
|
@@ -62947,7 +63084,7 @@ function sourceFiles(root) {
|
|
|
62947
63084
|
return;
|
|
62948
63085
|
}
|
|
62949
63086
|
for (const e of entries) {
|
|
62950
|
-
const p =
|
|
63087
|
+
const p = join30(dir, e);
|
|
62951
63088
|
let st;
|
|
62952
63089
|
try {
|
|
62953
63090
|
st = statSync5(p);
|
|
@@ -62968,7 +63105,7 @@ function detectFixture(dir) {
|
|
|
62968
63105
|
for (const f of sourceFiles(dir)) {
|
|
62969
63106
|
let code;
|
|
62970
63107
|
try {
|
|
62971
|
-
code =
|
|
63108
|
+
code = readFileSync31(f, "utf8");
|
|
62972
63109
|
} catch {
|
|
62973
63110
|
continue;
|
|
62974
63111
|
}
|
|
@@ -62986,7 +63123,7 @@ function detectFixture(dir) {
|
|
|
62986
63123
|
function runEnterpriseBenchmark() {
|
|
62987
63124
|
const fixtures = [];
|
|
62988
63125
|
for (const fx of ENTERPRISE_FIXTURES) {
|
|
62989
|
-
if (!
|
|
63126
|
+
if (!existsSync17(fx.dir)) {
|
|
62990
63127
|
fixtures.push({ id: fx.id, available: false, detected: 0, expected: fx.expected_vulns, recall: 0 });
|
|
62991
63128
|
continue;
|
|
62992
63129
|
}
|
|
@@ -63181,7 +63318,7 @@ function createServer2() {
|
|
|
63181
63318
|
` + `- A hard block (Cloudflare/WAF/IP-block/captcha) is NOT the end: mark the finding blocked + note the required vantage (residential / authorized / correct-SNI / --resolve direct-to-origin), then CONTINUE to the next lead (origin bypass, non-prod cluster, mobile APK, subdomain).
|
|
63182
63319
|
` + `- Keep trying every lead AND every chain step until each is verified/executed or blocked, THEN generate_report. Never deliver a bare surface map, and never stop at 'found X' when X enables more.
|
|
63183
63320
|
|
|
63184
|
-
` + "TWO PATHS:\\n" + "- Source path on disk -> blitz_scan / taint_file / eagle_eye2 (static).\\n" + "- Live URL -> live_recon / active_scan / strike_verify (web-hunting).\\n\\n" + "DEEPEN A FINDING: attack_plan(target, tech, params) to get the prioritized vector plan (decide what to test next with data); list_chains (escalation), chain_links (compose), technique_lookup(cls), payload_lookup, bypass_lookup (blocked). Ground any detector hit empirically with pattern_lookup(id) — it returns the class's CWE, real-world signature, escalation chains, citable references, per-class bypass techniques, and the high-value assets (crown jewels) that class hits, so a raw hit becomes a class-aware finding. Resolve free-form terminology first with synonym_lookup(term) (IDOR/BOLA/SQLi/prompt-injection → canonical id). For an llm_injection hit, its pattern carries a validation discipline — the RUN-TWICE RULE (reproduce token-for-token across two fresh sessions), NON-GUESSABLE ANCHOR (must leak a real key/URL, not a plausible guess), and OOB PROOF (a verifiable callback log) — apply all three before reporting. BEFORE generating a report, run submission_gate(...) and only ship a finding that passes all 7 questions (reproducible, in-scope, real-impact, no-privileged-assumption, verified-live, evidence-redacted, severity-derived); one false = kill it. Generate the concrete reproduction recipe with auto_poc(type, base_url, endpoint, param) — it emits the exact marker request + negative control + expected differential + Patchstack-style title, so 'reproducible' is executable, not abstract. Calibrate severity with severity_calibrate(type, cvss) to get a P1–P5 tier + VRT-style category. Start each engagement with engagement_scaffold(target, scope) for the folder + scope.md structure, and check data_refresh() to confirm the data layers are consistent. Phase doctrine: read_skill(bs-orchestrate-engagement | bs-web-hunting | bs-source-audit | bs-verify-finding). Campaign plan: read_playbook(target-type). On any failure call retry_guidance(signal) / model_fallback(signal) before giving up. HUNTING DOCTRINE (maximize payout rate): (1) SIBLING RULE — if one endpoint requires auth, check every sibling (/export /delete /share); ~30% of paid IDOR/auth bugs come from siblings — AUTOMATE it with sibling_scan(base_url, endpoint, token_a, token_b), the deterministic live logic-bug prober (sibling enumeration + differential IDOR + auth matrix + mass assignment + rate limit, evidence-first). (2) A→B SIGNAL — a confirmed bug signals a class of developer mistake; hunt B and C (20-min box) before reporting. (3) TWO-ACCOUNT IDOR — always test with attacker account A reading victim account B, and state it in the report. (4) PoC ESCALATION — IDOR shows victim data (not 200), XSS shows cookie exfil (not alert), SSRF shows internal response (not DNS), SQLi shows DB content (not error). (5) FOLLOW THE MONEY — billing/credits/refunds/wallet flows. (6) Kill weak findings with kill_list(type) BEFORE the gate — missing headers, self-XSS, open-redirect-alone, SSRF-DNS-only, GraphQL-introspection-alone are always N/A standalone. (7) CI/CD + SAML/SSO are critical attack surfaces (pull_request_target, expression injection, XML signature wrapping, comment injection). Full doctrine: hunting_doctrine(). WHAT TO HUNT NEXT: watchlist() returns the ranked CWE frequency + high-value CVEs with payout + a saturated flag (prioritize high-freq/high-payout/not-saturated: missing-authz, SQLi, SSRF, deserialization; skip saturated XSS/CSRF/open-redirect unless they chain into takeover). The CVE watchlist now spans 4,000+ product fingerprints (live from nuclei-templates when installed — refresh with sync_cve_corpus() before a big recon pass); live_recon's suggested_cves names the SPECIFIC CVE for the detected product/version — then cve_verify(cve, target) CONFIRMS it live by running the matching nuclei template (VERIFIED only when nuclei actually matches; a CVE is report-ready only after cve_verify, never from the fingerprint alone). For 'scan this target' automation, nuclei_scan(target) fingerprints the stack and runs the WHOLE matched template set (CVE templates + optional broad tech-tag) in one rate-limited pass — use it instead of verifying CVEs one-by-one. SURFACE-FIRST: surface_map(surface) maps an attack surface (image/redirect proxy, edge cache, payment portal, AI agent, file service, Electron, SSO) to its highest-value tests — map surfaces then test, don't spray payloads; then param_surface(target, class) discovers EVERY testable parameter (URL query, form fields, /users/123 path ids + UUIDs, JS refs) + per-class specialist hints — test the DISCOVERED params, not just the hinted one. PRECISION GUARD: resolve_check(host) detects when an ISP/country redirects the domain to a blocking/sinkhole page (gambling/adult/streaming niches) — audit the PUBLIC IP, never the sinkhole.\n" + "KNOWLEDGE BASE (discover, don't guess): skillLookup(topic) / listSkills for the 40 attack-path + hunting skills (ap-*, hp-*, bs-*); list_attack_vectors / attack_vectors(cat) for the 34-category vector taxonomy; taxonomy(kind) for OWASP/CWE/ASVS/API-top-10; read_playbook(type) for the 17 campaign playbooks; list_manuals / read_tool_manual for 317 tool references; list_tools / run_catalog_tool for the 141-tool catalog. Every tool, skill, and data layer is reachable from these. CROSS-TARGET INTELLIGENCE: strike_resolve auto-records confirmed/false_positive verdicts into the empirical ledger; query it with intelligence(action=hit_rates/top_vectors/recall) so a new target on a known tech inherits historical hit-rates (attack_plan already blends them into success_probability). intelligence(action=recall, tech, target) is the per-engagement pattern recall — it returns which patterns historically CONFIRMED on that tech (prioritize them) versus which only ever produced false positives (avoid them), so a new engagement starts from the empirical playbook of past ones. LIVE PENTEST + TARGETING (black-box, WAF-safe): cache_gap(base_url, endpoint) fuzzes path-normalization + static-extension variants for cache deception/poisoning; blind_oracle(base_url, param, value) detects which SINK a param reaches (sql/ssti/xss) via benign arithmetic (id=1+0, test${7*7}) WITHOUT a malicious payload; param_precedence(base_url, param, A, B) maps duplicate-parameter precedence (first/last-wins) for WAF-bypass; broken_link_scan(url) detects expired-domain takeover (crawls outbound refs → DNS/RDAP → flags claimable domains). Logic-bug live probers: jwt_forge(token, endpoint, …) forges JWT confusion tokens (alg:none / RS256→HS256 key-confusion / kid-jku-x5u) and proves which is ACCEPTED live; proto_pollution_probe(target, endpoint) sends __proto__ / constructor.prototype JSON canaries and reports VERIFIED only on reflection; smuggling_test(target) sends CL.TE / TE.CL desync probes over a raw connection. OOB (out-of-band) PROOF for BLIND vulns: oob_start() spins an interactsh listener (unique *.oast.* domain, streams DNS/HTTP interactions — the standard for public targets) or a local HTTP listener for local labs; inject the canary, then oob_poll(id) until the hit arrives; oob_stop(id) to clean up. A blind SSRF/XXE/SQLi/command-injection is CONFIRMED only when the canary actually arrives — never from a guess. SOURCE TARGETING: review_harness(path) FIRST for full coverage — it applies a fixed 5-signal rubric (entry_points/auth_gates/sinks/secrets/logic_bugs) to EVERY source file and sorts the signal-dense ones first (a complete map, not a partial scan); then action_surface(code) maps every wp_ajax_* action to its vuln class + DERIVED priority (what to look for WHERE); security_state(sanitizers, sink) gives a wrong-context sanitization verdict; framework_knowledge(framework) returns auth/nonce primitives for 9 frameworks; variant_scan(root, signature) mass-sweeps an install base for ONE bug family; patch_analyze(old, new) REVERSES a security patch into the 0-day, and its mine_signature feeds variant_scan to sweep unpatched copies. All of these are DETECTION HINTS — verify each live (strike_verify / browser_validate) before it enters the report. NEWEST DETECTORS — understand AND try them: variant_scan also emits priv_esc (privilege escalation — a role/capability/user change fed by request input, traced cross-file via reverse call-graph, e.g. set_role($id, sanitize_key($_POST['um-role'])) or update_user_meta(...,'wp_capabilities', $_POST[...])) and flags uploadAllow=>array('all') unrestricted-upload configs as file_upload (the file-manager/connector shape). TO TRY a priv_esc hit: submit the role field with 'administrator' (or send wp_capabilities meta) and confirm the account actually gains admin. TO TRY an unrestricted-upload hit: POST a .php/.phtml and confirm it lands web-reachable + executes. variant_scan also emits hardcoded_secret (CWE-798) in three tiers: a secret field (api_key/db_password/access_token/aws_*) assigned a literal (HIGH), a known secret FORMAT (JWT eyJ…/AWS AKIA…/GitHub ghp_…/Slack xoxb-…/…) regardless of name (HIGH), or a high-entropy suspect token (MEDIUM — verify before reporting). Verify a frontend/JS secret live via drive_devtools (inspect the JS bundle / network response and confirm the key is actually exposed), and for a backend secret confirm it is reachable/valid. A static hit is a HYPOTHESIS until verified live — never report unverified. For a repo, also scan_git_history(root) — secrets DELETED from HEAD still live in .git history (the removed-later-is-not-fixed trap), and it feeds every recovered pre-deletion blob through the same secret detector. Once you recover a credential, prove it is still ACTIVE with validate_leaked_key(apiBase, endpoints, key|blobUrl) — a READ-ONLY differential test (401-without-key vs 200-with-key = auth bypass PROVEN). Two supply-chain detectors: dependency_confusion (a manifest/build file resolving a package from a public registry — pypi.org/npmjs.org --extra-index-url, or a scoped @company/pkg with no private registry) and ml_supply_chain (torch.load without weights_only=True / joblib.load / np.load(allow_pickle=True) / keras load_model on an untrusted model → pickle RCE). Rust is supported end-to-end: the taint engine (blitz_scan / taint_file) maps Rust sinks (std::process::Command, sqlx/diesel, reqwest/hyper, std::fs, serde/bincode) to the classic classes, plus two Rust-specific detectors — rust_unsafe (transmute / assume_init / from_raw_parts / ptr::* — memory-unsafety surface, CWE-119) and rust_format_string (println!/format! with a variable as the format string — CWE-134). The sqlx query! compile-time macro is treated as safe (suppressed). Two more web-class detectors: jwt_alg_confusion (a JWT verifier that dispatches on the token's alg header and accepts BOTH RS256 and HS256, with the HS256 HMAC secret derived from public/shared key material — CWE-347; the attacker sets alg=HS256 and signs with the public key to forge admin tokens) and cache_deception (a reverse proxy caching static-extension URLs with a cache key that omits the session cookie, over a session-authenticated backend — CWE-525; the victim's cached private response is re-fetched anonymously). TO TRY a jwt_alg_confusion hit: fetch the public key (/.well-known/jwks.json), forge an HS256 token signed with that public key, and confirm admin access. TO TRY a cache_deception hit: request an authenticated path with a static extension appended (.css/.js) and re-fetch it anonymously. Three more detectors: cors_misconfiguration (Access-Control-Allow-Origin reflects the request Origin or is '*' while credentials are true — CWE-942; any site reads the victim's authenticated responses), xss (user input into a DOM sink — innerHTML / dangerouslySetInnerHTML / document.write / .html() / eval — CWE-79), and subdomain_takeover (a dangling CNAME/AliasTarget to a claimable service like *.github.io/*.herokuapp.com/*.amazonaws.com — CWE-404). TO TRY a cors hit: send an evil Origin + confirm the response echoes it with Allow-Credentials:true. TO TRY an xss hit: confirm the sink executes (drive_devtools). TO TRY a takeover hit: verify the CNAME target resolves to an unclaimed/not-found page. Two more client-side detectors: postmessage_no_origin_check (a window message listener that reads event.data but never validates event.origin — CWE-345; any site can drive the handler) and client_trusted_flag (a privilege/entitlement flag like isAdmin/withVip/premium read from request input and used in a security decision — CWE-807/639; derive the flag from server state, never the client). TO TRY a postMessage hit: send a crafted message from an attacker origin and confirm the handler acts on it. TO TRY a client-trusted-flag hit: flip the flag param to true and confirm the privilege is actually granted. WEB3: for Solidity/EVM, call web3_audit(code|path) — a deterministic 13-class smart-contract audit (reentrancy incl. ERC721/ERC1155 callback reentrancy, unchecked return, unchecked arithmetic, tx.origin auth, signature replay, unprotected selfdestruct, delegatecall-to-user-input, missing access control, timestamp dependence, spot-price oracle manipulation incl. slot0/latestRoundData, unbounded loop, abi.encodePacked hash collision, missing address(0) validation) returning ranked findings (class/CWE/severity/line), then foundry_poc(class, contract) to generate an executable Foundry test, and foundry_run(contract_code, poc_code|class_) to actually EXECUTE it — a PASSING PoC test is the proof that the exploit reproduces (deterministic: forge's own test verdict). A web3 hit is a HYPOTHESIS until the Foundry PoC reproduces it.\n" + `PRECISION ANALYSIS — chrome-devtools MCP is MANDATORY, not optional:
|
|
63321
|
+
` + "TWO PATHS:\\n" + "- Source path on disk -> blitz_scan / taint_file / eagle_eye2 (static).\\n" + "- Live URL -> live_recon / active_scan / strike_verify (web-hunting).\\n\\n" + "DEEPEN A FINDING: attack_plan(target, tech, params) to get the prioritized vector plan (decide what to test next with data); list_chains (escalation), chain_links (compose), technique_lookup(cls), payload_lookup, bypass_lookup (blocked). Ground any detector hit empirically with pattern_lookup(id) — it returns the class's CWE, real-world signature, escalation chains, citable references, per-class bypass techniques, and the high-value assets (crown jewels) that class hits, so a raw hit becomes a class-aware finding. Resolve free-form terminology first with synonym_lookup(term) (IDOR/BOLA/SQLi/prompt-injection → canonical id). For an llm_injection hit, its pattern carries a validation discipline — the RUN-TWICE RULE (reproduce token-for-token across two fresh sessions), NON-GUESSABLE ANCHOR (must leak a real key/URL, not a plausible guess), and OOB PROOF (a verifiable callback log) — apply all three before reporting. BEFORE generating a report, run submission_gate(...) and only ship a finding that passes all 7 questions (reproducible, in-scope, real-impact, no-privileged-assumption, verified-live, evidence-redacted, severity-derived); one false = kill it. When a PoC/report comes out under-enriched, wet_dry(type, wet, dry) diagnoses WHERE it broke — WET (model/prompt/timeout) vs DRY (parser) vs template. Generate the concrete reproduction recipe with auto_poc(type, base_url, endpoint, param) — it emits the exact marker request + negative control + expected differential + Patchstack-style title, so 'reproducible' is executable, not abstract. Calibrate severity with severity_calibrate(type, cvss) to get a P1–P5 tier + VRT-style category. Start each engagement with engagement_scaffold(target, scope) for the folder + scope.md structure, and check data_refresh() to confirm the data layers are consistent. Phase doctrine: read_skill(bs-orchestrate-engagement | bs-web-hunting | bs-source-audit | bs-verify-finding). Campaign plan: read_playbook(target-type). On any failure call retry_guidance(signal) / model_fallback(signal) before giving up. HUNTING DOCTRINE (maximize payout rate): (1) SIBLING RULE — if one endpoint requires auth, check every sibling (/export /delete /share); ~30% of paid IDOR/auth bugs come from siblings — AUTOMATE it with sibling_scan(base_url, endpoint, token_a, token_b), the deterministic live logic-bug prober (sibling enumeration + differential IDOR + auth matrix + mass assignment + rate limit, evidence-first). (2) A→B SIGNAL — a confirmed bug signals a class of developer mistake; hunt B and C (20-min box) before reporting. (3) TWO-ACCOUNT IDOR — always test with attacker account A reading victim account B, and state it in the report. (4) PoC ESCALATION — IDOR shows victim data (not 200), XSS shows cookie exfil (not alert), SSRF shows internal response (not DNS), SQLi shows DB content (not error). (5) FOLLOW THE MONEY — billing/credits/refunds/wallet flows. (6) Kill weak findings with kill_list(type) BEFORE the gate — missing headers, self-XSS, open-redirect-alone, SSRF-DNS-only, GraphQL-introspection-alone are always N/A standalone. (7) CI/CD + SAML/SSO are critical attack surfaces (pull_request_target, expression injection, XML signature wrapping, comment injection). Full doctrine: hunting_doctrine(). WHAT TO HUNT NEXT: watchlist() returns the ranked CWE frequency + high-value CVEs with payout + a saturated flag (prioritize high-freq/high-payout/not-saturated: missing-authz, SQLi, SSRF, deserialization; skip saturated XSS/CSRF/open-redirect unless they chain into takeover). The CVE watchlist now spans 4,000+ product fingerprints (live from nuclei-templates when installed — refresh with sync_cve_corpus() before a big recon pass); live_recon's suggested_cves names the SPECIFIC CVE for the detected product/version — then cve_verify(cve, target) CONFIRMS it live by running the matching nuclei template (VERIFIED only when nuclei actually matches; a CVE is report-ready only after cve_verify, never from the fingerprint alone). For 'scan this target' automation, nuclei_scan(target) fingerprints the stack and runs the WHOLE matched template set (CVE templates + optional broad tech-tag) in one rate-limited pass — use it instead of verifying CVEs one-by-one. SURFACE-FIRST: surface_map(surface) maps an attack surface (image/redirect proxy, edge cache, payment portal, AI agent, file service, Electron, SSO) to its highest-value tests — map surfaces then test, don't spray payloads; then param_surface(target, class) discovers EVERY testable parameter (URL query, form fields, /users/123 path ids + UUIDs, JS refs) + per-class specialist hints — test the DISCOVERED params, not just the hinted one. PRECISION GUARD: resolve_check(host) detects when an ISP/country redirects the domain to a blocking/sinkhole page (gambling/adult/streaming niches) — audit the PUBLIC IP, never the sinkhole. CIRCUIT BREAKER: target_health(target) probes the target and tracks consecutive failures — if the circuit OPENS (5 consecutive timeouts/5xx) PAUSE the target and resume when it recovers (auto-closes on a successful probe); circuit_status() lists every tracked target's state.\n" + "KNOWLEDGE BASE (discover, don't guess): skillLookup(topic) / listSkills for the 40 attack-path + hunting skills (ap-*, hp-*, bs-*); list_attack_vectors / attack_vectors(cat) for the 34-category vector taxonomy; taxonomy(kind) for OWASP/CWE/ASVS/API-top-10; read_playbook(type) for the 17 campaign playbooks; list_manuals / read_tool_manual for 317 tool references; list_tools / run_catalog_tool for the 141-tool catalog. Every tool, skill, and data layer is reachable from these. CROSS-TARGET INTELLIGENCE: strike_resolve auto-records confirmed/false_positive verdicts into the empirical ledger; query it with intelligence(action=hit_rates/top_vectors/recall) so a new target on a known tech inherits historical hit-rates (attack_plan already blends them into success_probability). intelligence(action=recall, tech, target) is the per-engagement pattern recall — it returns which patterns historically CONFIRMED on that tech (prioritize them) versus which only ever produced false positives (avoid them), so a new engagement starts from the empirical playbook of past ones. LIVE PENTEST + TARGETING (black-box, WAF-safe): cache_gap(base_url, endpoint) fuzzes path-normalization + static-extension variants for cache deception/poisoning; blind_oracle(base_url, param, value) detects which SINK a param reaches (sql/ssti/xss) via benign arithmetic (id=1+0, test${7*7}) WITHOUT a malicious payload; param_precedence(base_url, param, A, B) maps duplicate-parameter precedence (first/last-wins) for WAF-bypass; broken_link_scan(url) detects expired-domain takeover (crawls outbound refs → DNS/RDAP → flags claimable domains). Logic-bug live probers: jwt_forge(token, endpoint, …) forges JWT confusion tokens (alg:none / RS256→HS256 key-confusion / kid-jku-x5u) and proves which is ACCEPTED live; proto_pollution_probe(target, endpoint) sends __proto__ / constructor.prototype JSON canaries and reports VERIFIED only on reflection; smuggling_test(target) sends CL.TE / TE.CL desync probes over a raw connection; totp(secret) generates an RFC 6238 TOTP token so the agent can fill a 2FA field itself during authenticated scanning. OOB (out-of-band) PROOF for BLIND vulns: oob_start() spins an interactsh listener (unique *.oast.* domain, streams DNS/HTTP interactions — the standard for public targets) or a local HTTP listener for local labs; inject the canary, then oob_poll(id) until the hit arrives; oob_stop(id) to clean up. A blind SSRF/XXE/SQLi/command-injection is CONFIRMED only when the canary actually arrives — never from a guess. SOURCE TARGETING: review_harness(path) FIRST for full coverage — it applies a fixed 5-signal rubric (entry_points/auth_gates/sinks/secrets/logic_bugs) to EVERY source file and sorts the signal-dense ones first (a complete map, not a partial scan); then action_surface(code) maps every wp_ajax_* action to its vuln class + DERIVED priority (what to look for WHERE); security_state(sanitizers, sink) gives a wrong-context sanitization verdict; framework_knowledge(framework) returns auth/nonce primitives for 9 frameworks; variant_scan(root, signature) mass-sweeps an install base for ONE bug family; patch_analyze(old, new) REVERSES a security patch into the 0-day, and its mine_signature feeds variant_scan to sweep unpatched copies. All of these are DETECTION HINTS — verify each live (strike_verify / browser_validate) before it enters the report. NEWEST DETECTORS — understand AND try them: variant_scan also emits priv_esc (privilege escalation — a role/capability/user change fed by request input, traced cross-file via reverse call-graph, e.g. set_role($id, sanitize_key($_POST['um-role'])) or update_user_meta(...,'wp_capabilities', $_POST[...])) and flags uploadAllow=>array('all') unrestricted-upload configs as file_upload (the file-manager/connector shape). TO TRY a priv_esc hit: submit the role field with 'administrator' (or send wp_capabilities meta) and confirm the account actually gains admin. TO TRY an unrestricted-upload hit: POST a .php/.phtml and confirm it lands web-reachable + executes. variant_scan also emits hardcoded_secret (CWE-798) in three tiers: a secret field (api_key/db_password/access_token/aws_*) assigned a literal (HIGH), a known secret FORMAT (JWT eyJ…/AWS AKIA…/GitHub ghp_…/Slack xoxb-…/…) regardless of name (HIGH), or a high-entropy suspect token (MEDIUM — verify before reporting). Verify a frontend/JS secret live via drive_devtools (inspect the JS bundle / network response and confirm the key is actually exposed), and for a backend secret confirm it is reachable/valid. A static hit is a HYPOTHESIS until verified live — never report unverified. For a repo, also scan_git_history(root) — secrets DELETED from HEAD still live in .git history (the removed-later-is-not-fixed trap), and it feeds every recovered pre-deletion blob through the same secret detector. Once you recover a credential, prove it is still ACTIVE with validate_leaked_key(apiBase, endpoints, key|blobUrl) — a READ-ONLY differential test (401-without-key vs 200-with-key = auth bypass PROVEN). Two supply-chain detectors: dependency_confusion (a manifest/build file resolving a package from a public registry — pypi.org/npmjs.org --extra-index-url, or a scoped @company/pkg with no private registry) and ml_supply_chain (torch.load without weights_only=True / joblib.load / np.load(allow_pickle=True) / keras load_model on an untrusted model → pickle RCE). Rust is supported end-to-end: the taint engine (blitz_scan / taint_file) maps Rust sinks (std::process::Command, sqlx/diesel, reqwest/hyper, std::fs, serde/bincode) to the classic classes, plus two Rust-specific detectors — rust_unsafe (transmute / assume_init / from_raw_parts / ptr::* — memory-unsafety surface, CWE-119) and rust_format_string (println!/format! with a variable as the format string — CWE-134). The sqlx query! compile-time macro is treated as safe (suppressed). Two more web-class detectors: jwt_alg_confusion (a JWT verifier that dispatches on the token's alg header and accepts BOTH RS256 and HS256, with the HS256 HMAC secret derived from public/shared key material — CWE-347; the attacker sets alg=HS256 and signs with the public key to forge admin tokens) and cache_deception (a reverse proxy caching static-extension URLs with a cache key that omits the session cookie, over a session-authenticated backend — CWE-525; the victim's cached private response is re-fetched anonymously). TO TRY a jwt_alg_confusion hit: fetch the public key (/.well-known/jwks.json), forge an HS256 token signed with that public key, and confirm admin access. TO TRY a cache_deception hit: request an authenticated path with a static extension appended (.css/.js) and re-fetch it anonymously. Three more detectors: cors_misconfiguration (Access-Control-Allow-Origin reflects the request Origin or is '*' while credentials are true — CWE-942; any site reads the victim's authenticated responses), xss (user input into a DOM sink — innerHTML / dangerouslySetInnerHTML / document.write / .html() / eval — CWE-79), and subdomain_takeover (a dangling CNAME/AliasTarget to a claimable service like *.github.io/*.herokuapp.com/*.amazonaws.com — CWE-404). TO TRY a cors hit: send an evil Origin + confirm the response echoes it with Allow-Credentials:true. TO TRY an xss hit: confirm the sink executes (drive_devtools). TO TRY a takeover hit: verify the CNAME target resolves to an unclaimed/not-found page. Two more client-side detectors: postmessage_no_origin_check (a window message listener that reads event.data but never validates event.origin — CWE-345; any site can drive the handler) and client_trusted_flag (a privilege/entitlement flag like isAdmin/withVip/premium read from request input and used in a security decision — CWE-807/639; derive the flag from server state, never the client). TO TRY a postMessage hit: send a crafted message from an attacker origin and confirm the handler acts on it. TO TRY a client-trusted-flag hit: flip the flag param to true and confirm the privilege is actually granted. WEB3: for Solidity/EVM, call web3_audit(code|path) — a deterministic 13-class smart-contract audit (reentrancy incl. ERC721/ERC1155 callback reentrancy, unchecked return, unchecked arithmetic, tx.origin auth, signature replay, unprotected selfdestruct, delegatecall-to-user-input, missing access control, timestamp dependence, spot-price oracle manipulation incl. slot0/latestRoundData, unbounded loop, abi.encodePacked hash collision, missing address(0) validation) returning ranked findings (class/CWE/severity/line), then foundry_poc(class, contract) to generate an executable Foundry test, and foundry_run(contract_code, poc_code|class_) to actually EXECUTE it — a PASSING PoC test is the proof that the exploit reproduces (deterministic: forge's own test verdict). A web3 hit is a HYPOTHESIS until the Foundry PoC reproduces it.\n" + `PRECISION ANALYSIS — chrome-devtools MCP is MANDATORY, not optional:
|
|
63185
63322
|
` + `- When a lead needs DOM/JS precision — DOM-XSS sink execution, AJAX endpoint + payload interception, JS runtime errors, redirect chains, SSO/token flow, or anything a static HTML glance cannot prove — call drive_devtools(target). It spawns chrome-devtools-mcp and drives a REAL headless browser (navigate -> list_network_requests -> list_console_messages -> evaluate_script), giving reproducible evidence instead of a guess.
|
|
63186
63323
|
` + `- Before calling it, check_mcp() to confirm the browser MCP is available; if not, blitzstrike install-tools or npm i -g chrome-devtools-mcp. Never substitute eyeballing minified JS or a static sink guess when a live browser can PROVE it. This is the precision + consistency layer.
|
|
63187
63324
|
` + "EXTERNAL MCP SERVERS (verified, connect them — NOT one-shot CLIs): chrome-devtools-mcp (29 tools: list_network_requests/get_network_request for raw HTTP interception, list_console_messages for JS errors + DOM-XSS, evaluate_script to run JS, take_screenshot) -> stdio chrome-devtools-mcp --headless --chromeArg=--no-sandbox --chromeArg=--disable-gpu (as root/container this is MANDATORY or the browser crashes; add --proxyServer http://127.0.0.1:8080 to route through Burp, --acceptInsecureCerts for bad TLS). burp-suite-mcp (proxy history + active scan + repeater) -> NOT npm: build the JAR (git clone https://github.com/PortSwigger/mcp-server.git && cd mcp-server && ./gradlew embedProxyJar), load it in Burp Extensions, then connect the client to http://127.0.0.1:9876 (SSE) or the stdio proxy java -jar mcp-proxy-all.jar --sse-url http://127.0.0.1:9876."
|
|
@@ -64072,7 +64209,7 @@ ${statusLine}` : statusLine },
|
|
|
64072
64209
|
let src = code;
|
|
64073
64210
|
if (!src && path) {
|
|
64074
64211
|
try {
|
|
64075
|
-
src =
|
|
64212
|
+
src = readFileSync33(path, "utf8");
|
|
64076
64213
|
} catch {
|
|
64077
64214
|
return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
|
|
64078
64215
|
}
|
|
@@ -64153,7 +64290,7 @@ ${statusLine}` : statusLine },
|
|
|
64153
64290
|
let src = code;
|
|
64154
64291
|
if (!src && path) {
|
|
64155
64292
|
try {
|
|
64156
|
-
src =
|
|
64293
|
+
src = readFileSync33(path, "utf8");
|
|
64157
64294
|
} catch {
|
|
64158
64295
|
return { content: [{ type: "text", text: JSON.stringify({ error: "unreadable path" }) }] };
|
|
64159
64296
|
}
|
|
@@ -64298,6 +64435,49 @@ ${statusLine}` : statusLine },
|
|
|
64298
64435
|
}, async ({ target, class_ }) => {
|
|
64299
64436
|
return { content: [{ type: "text", text: JSON.stringify(await paramSurface(target, class_)) }] };
|
|
64300
64437
|
});
|
|
64438
|
+
server.registerTool("target_health", {
|
|
64439
|
+
title: "Circuit breaker — probe target health and auto-pause when unresponsive",
|
|
64440
|
+
description: "Probe a target (GET with a 10s timeout) and track consecutive failures in a persisted circuit-breaker state. After 5 consecutive timeouts/5xx the circuit OPENS (PAUSE); it auto-closes on the next successful probe. Check this before a big scan and after repeated failures — do NOT keep hammering an unresponsive target.",
|
|
64441
|
+
inputSchema: {
|
|
64442
|
+
target: string2().describe("Target URL, e.g. https://target.com"),
|
|
64443
|
+
limit: number2().optional().describe("Consecutive-failure threshold (default 5)")
|
|
64444
|
+
}
|
|
64445
|
+
}, async ({ target, limit }) => {
|
|
64446
|
+
return { content: [{ type: "text", text: JSON.stringify(await targetHealth(target, limit ?? 5)) }] };
|
|
64447
|
+
});
|
|
64448
|
+
server.registerTool("circuit_status", {
|
|
64449
|
+
title: "List all circuit-breaker states across targets",
|
|
64450
|
+
description: "Return every tracked target's circuit state (consecutive failures, open/closed) so the agent can see which targets are paused and which are safe to resume.",
|
|
64451
|
+
inputSchema: {}
|
|
64452
|
+
}, async () => {
|
|
64453
|
+
return { content: [{ type: "text", text: JSON.stringify(circuitStatus()) }] };
|
|
64454
|
+
});
|
|
64455
|
+
server.registerTool("totp", {
|
|
64456
|
+
title: "Generate a TOTP/HOTP token (RFC 6238) for 2FA-protected logins",
|
|
64457
|
+
description: "Deterministic one-time-password generation for authenticated scanning: produce the current TOTP token from a base32 secret (or raw ASCII key) so the agent can fill a 2FA field itself. Returns the token + seconds until it rotates.",
|
|
64458
|
+
inputSchema: {
|
|
64459
|
+
secret: string2().describe("TOTP secret (base32 or raw ASCII)"),
|
|
64460
|
+
digits: number2().optional().describe("Token length (default 6)"),
|
|
64461
|
+
period: number2().optional().describe("Time step in seconds (default 30)"),
|
|
64462
|
+
algo: string2().optional().describe("HMAC algorithm sha1/sha256/sha512 (default sha1)"),
|
|
64463
|
+
counter: number2().optional().describe("If set, return HOTP at this counter instead of TOTP")
|
|
64464
|
+
}
|
|
64465
|
+
}, async ({ secret, digits, period, algo, counter }) => {
|
|
64466
|
+
const r = counter === undefined ? totp(secret, { digits, period, algo }) : { token: hotpToken(secret, counter, { digits, algo }), algorithm: algo ?? "sha1", digits: digits ?? 6, period: 0, secret_format: "raw", expires_in: 0 };
|
|
64467
|
+
return { content: [{ type: "text", text: JSON.stringify(r) }] };
|
|
64468
|
+
});
|
|
64469
|
+
server.registerTool("wet_dry", {
|
|
64470
|
+
title: "WET/DRY traceability — diagnose the raw→parsed pipeline",
|
|
64471
|
+
description: "Save the RAW output (WET) and PARSED result (DRY) of an LLM enrichment step separately and get a diagnosis of WHERE a bad deliverable broke: WET broken = model/prompt/timeout problem; WET OK but DRY broken = parser problem; both OK but report bad = template problem. Use when a PoC/report comes out under-enriched.",
|
|
64472
|
+
inputSchema: {
|
|
64473
|
+
type: string2().describe("Step name (e.g. poc_enrichment, report_generation)"),
|
|
64474
|
+
wet: string2().describe("Raw LLM/tool output"),
|
|
64475
|
+
dry: string2().describe("Parsed result (empty if parsing failed)"),
|
|
64476
|
+
dry_ok: boolean2().optional().describe("Whether the parse succeeded (default true)")
|
|
64477
|
+
}
|
|
64478
|
+
}, async ({ type, wet, dry, dry_ok }) => {
|
|
64479
|
+
return { content: [{ type: "text", text: JSON.stringify(wetDryTrace(type, wet, dry, dry_ok ?? true)) }] };
|
|
64480
|
+
});
|
|
64301
64481
|
server.registerTool("jwt_forge", {
|
|
64302
64482
|
title: "Forge JWT confusion tokens and verify which is accepted live",
|
|
64303
64483
|
description: "Turn a captured JWT into forged attack tokens (alg:none, HS256 with empty key, HS256 with the public key = RS256→HS256 key confusion, plus kid/jku/x5u hints) and — when an endpoint is given — send each one to prove which is ACCEPTED (status < 400). A JWT hit is report-ready only when a forged token is accepted, never from header analysis alone.",
|
|
@@ -64964,7 +65144,7 @@ ${statusLine}` : statusLine },
|
|
|
64964
65144
|
description: "Route confusion (separate class from source→sink taint): detect attacker-controlled dispatch (call_user_func/forward/dispatch), dynamic method calls ($obj->$m()), dynamic include (LFI), batch/proxy forwarding without per-route auth re-check, and route matching without path normalization.",
|
|
64965
65145
|
inputSchema: { path: string2().describe("Source file path (PHP)") }
|
|
64966
65146
|
}, async ({ path }) => {
|
|
64967
|
-
const code =
|
|
65147
|
+
const code = readFileSync33(path, "utf8");
|
|
64968
65148
|
const findings = detectRouteConfusion(code, path);
|
|
64969
65149
|
return {
|
|
64970
65150
|
content: [{
|
|
@@ -64978,7 +65158,7 @@ ${statusLine}` : statusLine },
|
|
|
64978
65158
|
description: "Complex-bug detection beyond taint: deserialization→POP gadget chain (unserialize + magic method), type juggling (loose ==/!= vs hash/secret), mass assignment (extract/parse_str without a safe flag), prototype pollution (unsafe merge of request data), CRLF/header injection (user input into a header), path confusion (user input into a file path without canonicalization), SSRF (user-controlled URL with no host allowlist), XXE (user XML parsed without disabling entities), SSTI (user input into a template render with no sandbox), wrong-context sanitization (sanitize_text_field() into a SQL query), missing authorization/nonce on WordPress entry points (wp_ajax_* / admin_post_* / register_rest_route without current_user_can, nonce verification, or permission_callback), CORS misconfiguration (reflected/wildcard origin + credentials), XSS (user input into a DOM sink: innerHTML / dangerouslySetInnerHTML / document.write / .html / eval), and subdomain takeover (CNAME/AliasTarget to a claimable service).",
|
|
64979
65159
|
inputSchema: { path: string2().describe("Source file path") }
|
|
64980
65160
|
}, async ({ path }) => {
|
|
64981
|
-
const code =
|
|
65161
|
+
const code = readFileSync33(path, "utf8");
|
|
64982
65162
|
const findings = detectComplexBugs(code, path);
|
|
64983
65163
|
return {
|
|
64984
65164
|
content: [{
|
|
@@ -65064,7 +65244,7 @@ ${statusLine}` : statusLine },
|
|
|
65064
65244
|
let lang = language;
|
|
65065
65245
|
if (path && !code) {
|
|
65066
65246
|
try {
|
|
65067
|
-
src =
|
|
65247
|
+
src = readFileSync33(path, "utf8");
|
|
65068
65248
|
} catch {
|
|
65069
65249
|
return { content: [{ type: "text", text: JSON.stringify({ error: `cannot read ${path}` }) }] };
|
|
65070
65250
|
}
|
|
@@ -65313,15 +65493,15 @@ async function serve() {
|
|
|
65313
65493
|
|
|
65314
65494
|
// src/index.ts
|
|
65315
65495
|
init_cli();
|
|
65316
|
-
import { readFileSync as
|
|
65317
|
-
import { join as
|
|
65496
|
+
import { readFileSync as readFileSync37, existsSync as existsSync20 } from "node:fs";
|
|
65497
|
+
import { join as join35 } from "node:path";
|
|
65318
65498
|
import { fileURLToPath as fileURLToPath22 } from "node:url";
|
|
65319
|
-
var ROOT15 =
|
|
65499
|
+
var ROOT15 = join35(fileURLToPath22(new URL(".", import.meta.url)), "..");
|
|
65320
65500
|
function readVersion() {
|
|
65321
65501
|
try {
|
|
65322
|
-
const p =
|
|
65323
|
-
if (
|
|
65324
|
-
return JSON.parse(
|
|
65502
|
+
const p = join35(ROOT15, "package.json");
|
|
65503
|
+
if (existsSync20(p))
|
|
65504
|
+
return JSON.parse(readFileSync37(p, "utf8")).version ?? "1.0.0";
|
|
65325
65505
|
} catch {}
|
|
65326
65506
|
return "1.0.0";
|
|
65327
65507
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blitzstrike",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.124",
|
|
4
4
|
"description": "Blitz Strike — a universal MCP security-audit toolbelt. BLITZ sweeps the attack surface, EAGLE-EYE traces source-to-sink, STRIKE verifies live. 57 attack chains, 130-tool catalog, intelligence data layer. One server, every agent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|