blitzstrike 2.4.126 → 2.4.127

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/index.js +230 -82
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,7 +5,19 @@ 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.125] — 2026-09-29
8
+ ## [2.4.127] — 2026-10-02
9
+
10
+ ### Added — asset discovery + screenshot + authenticated session
11
+
12
+ - New `asset_discovery(domain, include_ports?)`: full passive asset enumeration —
13
+ crt.sh subdomains + common-prefix DNS brute + A-record resolution + optional
14
+ port scan of the main host, returned as a clean asset map.
15
+ - New `screenshot(url, path?)`: headless-browser screenshot for vision-based proof
16
+ (gracefully degrades to "browser unavailable" when chromium is absent).
17
+ - New `auth_login(login_url, user, pass, …)`: HTTP form login → session cookie +
18
+ access/refresh/JWT token extraction, with optional TOTP field for 2FA. (161 MCP tools.)
19
+
20
+ ## [2.4.126] — 2026-09-29
9
21
 
10
22
  ### Added — TOTP/HOTP generation + WET/DRY traceability
11
23
 
package/dist/index.js CHANGED
@@ -17453,8 +17453,8 @@ var init_variants = __esm(() => {
17453
17453
 
17454
17454
  // src/sync.ts
17455
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";
17456
+ import { join as join32 } from "node:path";
17457
+ import { homedir as homedir13 } 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(join31(d, e.name));
17473
+ walk(join32(d, e.name));
17474
17474
  else
17475
17475
  n++;
17476
17476
  }
@@ -17484,8 +17484,8 @@ function countFiles(dir) {
17484
17484
  function syncData() {
17485
17485
  if (!dirExists(DATA_ROOT2))
17486
17486
  mkdirSync11(DATA_ROOT2, { recursive: true });
17487
- const payloadsPath = join31(DATA_ROOT2, "payloads");
17488
- const templatesPath = join31(DATA_ROOT2, "templates");
17487
+ const payloadsPath = join32(DATA_ROOT2, "payloads");
17488
+ const templatesPath = join32(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 = join31(ROOT11, "payloads");
17499
- const localTemplates = join31(ROOT11, "templates");
17498
+ const localPayloads = join32(ROOT11, "payloads");
17499
+ const localTemplates = join32(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 = join31(DATA_ROOT2, ".tmp-clone");
17512
+ const tmp = join32(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(join31(tmp, "payloads"), payloadsPath);
17520
+ copyDir(join32(tmp, "payloads"), payloadsPath);
17521
17521
  payloadsSynced = true;
17522
17522
  }
17523
17523
  if (!dirExists(templatesPath) || countFiles(templatesPath) === 0) {
17524
- copyDir(join31(tmp, "templates"), templatesPath);
17524
+ copyDir(join32(tmp, "templates"), templatesPath);
17525
17525
  templatesSynced = true;
17526
17526
  }
17527
17527
  }
@@ -17543,8 +17543,8 @@ function copyDir(src, dst) {
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 = join31(src, e.name);
17547
- const d = join31(dst, e.name);
17546
+ const s = join32(src, e.name);
17547
+ const d = join32(dst, e.name);
17548
17548
  if (e.isDirectory())
17549
17549
  manualCopy(s, d);
17550
17550
  else
@@ -17553,8 +17553,8 @@ function manualCopy(src, dst) {
17553
17553
  }
17554
17554
  var ROOT11, DATA_ROOT2, GITHUB_REPO = "https://github.com/shinthink/blitzstrike.git";
17555
17555
  var init_sync = __esm(() => {
17556
- ROOT11 = join31(fileURLToPath18(new URL(".", import.meta.url)), "..");
17557
- DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ?? join31(homedir12(), ".blitzstrike", "data");
17556
+ ROOT11 = join32(fileURLToPath18(new URL(".", import.meta.url)), "..");
17557
+ DATA_ROOT2 = process.env.BLITZSTRIKE_DATA ?? join32(homedir13(), ".blitzstrike", "data");
17558
17558
  });
17559
17559
 
17560
17560
  // src/update.ts
@@ -17600,14 +17600,14 @@ var init_update = __esm(() => {
17600
17600
 
17601
17601
  // src/release.ts
17602
17602
  import { readFileSync as readFileSync34, existsSync as existsSync18 } from "node:fs";
17603
- import { join as join32 } from "node:path";
17603
+ import { join as join33 } 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 = readFileSync34(join32(ROOT12, "CHANGELOG.md"), "utf8");
17610
+ const changelog = readFileSync34(join33(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 existsSync18(join32(ROOT12, "package-lock.json")) || existsSync18(join32(ROOT12, "bun.lock")) || existsSync18(join32(ROOT12, "bun.lockb"));
17642
+ return existsSync18(join33(ROOT12, "package-lock.json")) || existsSync18(join33(ROOT12, "bun.lock")) || existsSync18(join33(ROOT12, "bun.lockb"));
17643
17643
  }
17644
17644
  var ROOT12;
17645
17645
  var init_release = __esm(() => {
17646
17646
  init_version();
17647
- ROOT12 = join32(fileURLToPath19(new URL(".", import.meta.url)), "..");
17647
+ ROOT12 = join33(fileURLToPath19(new URL(".", import.meta.url)), "..");
17648
17648
  });
17649
17649
 
17650
17650
  // src/dependency.ts
17651
17651
  import { readFileSync as readFileSync35 } from "node:fs";
17652
- import { join as join33 } from "node:path";
17652
+ import { join as join34 } 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(readFileSync35(join33(ROOT13, "package.json"), "utf8"));
17657
+ pkg = JSON.parse(readFileSync35(join34(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 = join33(fileURLToPath20(new URL(".", import.meta.url)), "..");
17680
+ ROOT13 = join34(fileURLToPath20(new URL(".", import.meta.url)), "..");
17681
17681
  });
17682
17682
 
17683
17683
  // src/cli.ts
17684
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";
17685
+ import { join as join35, dirname as dirname6 } from "node:path";
17686
+ import { homedir as homedir14 } 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 = existsSync19(join34(ROOT14, "chains.json")) && existsSync19(join34(ROOT14, "tools-catalog.json"));
17730
+ const dataOk = existsSync19(join35(ROOT14, "chains.json")) && existsSync19(join35(ROOT14, "tools-catalog.json"));
17731
17731
  issues.push({
17732
17732
  name: "Data layers (chains + tools-catalog)",
17733
17733
  status: dataOk ? "ok" : "fail",
@@ -17778,14 +17778,14 @@ BlitzStrike — ${verdict}`);
17778
17778
  function resolveCommand() {
17779
17779
  if (which("blitzstrike"))
17780
17780
  return { command: "blitzstrike", args: ["serve", "--mcp"] };
17781
- const src = join34(ROOT14, "src", "index.ts");
17781
+ const src = join35(ROOT14, "src", "index.ts");
17782
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 = join34(ROOT14, "dist", "index.js");
17788
+ const dist = join35(ROOT14, "dist", "index.js");
17789
17789
  if (existsSync19(dist))
17790
17790
  return { command: "bun", args: [dist, "serve", "--mcp"] };
17791
17791
  return { command: "npx", args: ["-y", "blitzstrike", "serve", "--mcp"] };
@@ -17825,15 +17825,15 @@ function opencodeWrite(p) {
17825
17825
  };
17826
17826
  }
17827
17827
  function copyOpenCodeAgents() {
17828
- const srcDir = join34(ROOT14, "opencode-agents");
17829
- const dstDir = join34(homedir13(), ".config", "opencode", "agents");
17828
+ const srcDir = join35(ROOT14, "opencode-agents");
17829
+ const dstDir = join35(homedir14(), ".config", "opencode", "agents");
17830
17830
  if (!existsSync19(srcDir))
17831
17831
  return;
17832
17832
  if (!existsSync19(dstDir))
17833
17833
  mkdirSync12(dstDir, { recursive: true });
17834
17834
  for (const f of ["Blitz Strike.md", "Blitz.md", "Eagle Eye.md", "Strike.md"]) {
17835
- const src = join34(srcDir, f);
17836
- const dst = join34(dstDir, f);
17835
+ const src = join35(srcDir, f);
17836
+ const dst = join35(dstDir, f);
17837
17837
  if (existsSync19(src)) {
17838
17838
  writeFileSync11(dst, readFileSync36(src, "utf8"));
17839
17839
  }
@@ -17888,76 +17888,76 @@ mcp_servers:
17888
17888
  };
17889
17889
  }
17890
17890
  function detectAgents() {
17891
- const home = homedir13();
17891
+ const home = homedir14();
17892
17892
  const agents = [];
17893
- const claudeJson = join34(home, ".claude.json");
17893
+ const claudeJson = join35(home, ".claude.json");
17894
17894
  agents.push({
17895
17895
  name: "Claude Code",
17896
17896
  detectPath: claudeJson,
17897
17897
  installed: () => existsSync19(claudeJson) || which("claude"),
17898
17898
  write: jsonMcpServersWrite(claudeJson)
17899
17899
  });
17900
- const claudeDesktop = join34(home, ".config", "Claude", "claude_desktop_config.json");
17900
+ const claudeDesktop = join35(home, ".config", "Claude", "claude_desktop_config.json");
17901
17901
  agents.push({
17902
17902
  name: "Claude Desktop",
17903
17903
  detectPath: claudeDesktop,
17904
17904
  installed: () => existsSync19(claudeDesktop),
17905
17905
  write: jsonMcpServersWrite(claudeDesktop)
17906
17906
  });
17907
- const cursor = join34(home, ".cursor", "mcp.json");
17907
+ const cursor = join35(home, ".cursor", "mcp.json");
17908
17908
  agents.push({
17909
17909
  name: "Cursor",
17910
17910
  detectPath: cursor,
17911
- installed: () => existsSync19(join34(home, ".cursor")) || which("cursor"),
17911
+ installed: () => existsSync19(join35(home, ".cursor")) || which("cursor"),
17912
17912
  write: jsonMcpServersWrite(cursor)
17913
17913
  });
17914
- const opencode = join34(home, ".config", "opencode", "opencode.jsonc");
17914
+ const opencode = join35(home, ".config", "opencode", "opencode.jsonc");
17915
17915
  agents.push({
17916
17916
  name: "OpenCode",
17917
17917
  detectPath: opencode,
17918
- installed: () => existsSync19(join34(home, ".config", "opencode")) || which("opencode"),
17918
+ installed: () => existsSync19(join35(home, ".config", "opencode")) || which("opencode"),
17919
17919
  write: opencodeWrite(opencode)
17920
17920
  });
17921
- const codex = join34(home, ".codex", "config.toml");
17921
+ const codex = join35(home, ".codex", "config.toml");
17922
17922
  agents.push({
17923
17923
  name: "Codex",
17924
17924
  detectPath: codex,
17925
- installed: () => existsSync19(join34(home, ".codex")) || which("codex"),
17925
+ installed: () => existsSync19(join35(home, ".codex")) || which("codex"),
17926
17926
  write: codexWrite(codex)
17927
17927
  });
17928
- const hermes = join34(home, ".hermes", "config.yaml");
17928
+ const hermes = join35(home, ".hermes", "config.yaml");
17929
17929
  agents.push({
17930
17930
  name: "Hermes",
17931
17931
  detectPath: hermes,
17932
- installed: () => existsSync19(join34(home, ".hermes")) || which("hermes"),
17932
+ installed: () => existsSync19(join35(home, ".hermes")) || which("hermes"),
17933
17933
  write: hermesWrite(hermes)
17934
17934
  });
17935
- const gemini = join34(home, ".gemini", "settings.json");
17935
+ const gemini = join35(home, ".gemini", "settings.json");
17936
17936
  agents.push({
17937
17937
  name: "Gemini CLI",
17938
17938
  detectPath: gemini,
17939
- installed: () => existsSync19(join34(home, ".gemini")) || which("gemini"),
17939
+ installed: () => existsSync19(join35(home, ".gemini")) || which("gemini"),
17940
17940
  write: jsonMcpServersWrite(gemini)
17941
17941
  });
17942
- const windsurf = join34(home, ".codeium", "windsurf", "mcp_config.json");
17942
+ const windsurf = join35(home, ".codeium", "windsurf", "mcp_config.json");
17943
17943
  agents.push({
17944
17944
  name: "Windsurf",
17945
17945
  detectPath: windsurf,
17946
- installed: () => existsSync19(join34(home, ".codeium")) || which("windsurf"),
17946
+ installed: () => existsSync19(join35(home, ".codeium")) || which("windsurf"),
17947
17947
  write: jsonMcpServersWrite(windsurf)
17948
17948
  });
17949
- const copilot = join34(home, ".copilot", "mcp.json");
17949
+ const copilot = join35(home, ".copilot", "mcp.json");
17950
17950
  agents.push({
17951
17951
  name: "Copilot",
17952
17952
  detectPath: copilot,
17953
- installed: () => existsSync19(join34(home, ".copilot")),
17953
+ installed: () => existsSync19(join35(home, ".copilot")),
17954
17954
  write: jsonMcpServersWrite(copilot)
17955
17955
  });
17956
- const cline = join34(home, ".cline", "mcp_settings.json");
17956
+ const cline = join35(home, ".cline", "mcp_settings.json");
17957
17957
  agents.push({
17958
17958
  name: "Cline",
17959
17959
  detectPath: cline,
17960
- installed: () => existsSync19(join34(home, ".cline")),
17960
+ installed: () => existsSync19(join35(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 = join34(fileURLToPath21(new URL(".", import.meta.url)), "..");
18078
+ ROOT14 = join35(fileURLToPath21(new URL(".", import.meta.url)), "..");
18079
18079
  });
18080
18080
 
18081
18081
  // node_modules/zod/v3/helpers/util.js
@@ -60744,15 +60744,127 @@ function wetDryTrace(type, wet, dry, dryOk = true) {
60744
60744
  };
60745
60745
  }
60746
60746
 
60747
+ // src/asset-discovery.ts
60748
+ import { resolve4 as resolve44 } from "node:dns/promises";
60749
+ function normalizeDomain(domain) {
60750
+ return domain.replace(/^https?:\/\//i, "").replace(/\/.*$/, "").replace(/:\d+$/, "").trim().toLowerCase();
60751
+ }
60752
+ async function assetDiscovery(domain, includePorts = false) {
60753
+ const d = normalizeDomain(domain);
60754
+ if (!d || !d.includes("."))
60755
+ return { domain: d, subdomains: [], resolved: [], open_ports: [], source: "invalid domain", total: 0 };
60756
+ const [ct, brute] = await Promise.all([subdomainEnum(d), dnsBrute(d)]);
60757
+ const hosts = [...new Set([...ct.subdomains, ...brute.found.map((f) => f.host), d])].sort();
60758
+ const resolved = [];
60759
+ const CHUNK = 10;
60760
+ for (let i = 0;i < hosts.length; i += CHUNK) {
60761
+ const batch = hosts.slice(i, i + CHUNK);
60762
+ await Promise.all(batch.map(async (host) => {
60763
+ try {
60764
+ const ips = await resolve44(host);
60765
+ if (ips.length)
60766
+ resolved.push({ host, ips });
60767
+ } catch {}
60768
+ }));
60769
+ }
60770
+ let open_ports = [];
60771
+ if (includePorts) {
60772
+ const main = resolved.find((r) => r.host === d) ?? resolved[0];
60773
+ if (main) {
60774
+ const scan = await scanPorts(main.ips[0] ?? main.host);
60775
+ open_ports = scan.filter((p) => p.open).map((p) => ({ port: p.port, service: p.service }));
60776
+ }
60777
+ }
60778
+ return {
60779
+ domain: d,
60780
+ subdomains: hosts,
60781
+ resolved,
60782
+ open_ports,
60783
+ source: `${ct.source} + ${brute.source}`,
60784
+ total: hosts.length
60785
+ };
60786
+ }
60787
+
60788
+ // src/screenshot.ts
60789
+ import { join as join27 } from "node:path";
60790
+ import { homedir as homedir10 } from "node:os";
60791
+ async function screenshot(url, path) {
60792
+ const out = path ?? join27(homedir10(), ".blitzstrike", `shot-${Date.now()}.png`);
60793
+ const opened = await browserOpen(url);
60794
+ if (!opened.ok) {
60795
+ return { ok: false, url, detail: opened.unavailable ? `browser unavailable (${opened.detail}) — install playwright-core + a chromium, or use drive_devtools` : `open failed: ${opened.detail}` };
60796
+ }
60797
+ const shot = await browserScreenshot(out);
60798
+ await browserClose();
60799
+ if (!shot.ok) {
60800
+ return { ok: false, url, detail: `screenshot failed: ${shot.detail}` };
60801
+ }
60802
+ return { ok: true, url, path: out, detail: `saved ${out} — inspect with a vision model (vision_analyze) to confirm the rendered state` };
60803
+ }
60804
+
60805
+ // src/auth-session.ts
60806
+ function parseCookies(setCookie) {
60807
+ if (!setCookie)
60808
+ return [];
60809
+ const out = [];
60810
+ for (const part of setCookie.split(/,(?=\s*[A-Za-z0-9_-]+=)/)) {
60811
+ const m = part.trim().match(/^([^=;]+)=([^;]*)/);
60812
+ if (m)
60813
+ out.push({ name: m[1].trim(), value: m[2].trim() });
60814
+ }
60815
+ return out;
60816
+ }
60817
+ function extractTokens(body) {
60818
+ const out = [];
60819
+ for (const re of [/eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, /"access_token"\s*:\s*"([^"]+)"/g, /"token"\s*:\s*"([^"]+)"/g, /"refresh_token"\s*:\s*"([^"]+)"/g]) {
60820
+ for (const m of body.matchAll(re)) {
60821
+ const v = m[1] ?? m[0];
60822
+ if (v && !out.some((t) => t.value === v))
60823
+ out.push({ name: v.startsWith("eyJ") ? "jwt" : "token", value: v });
60824
+ }
60825
+ }
60826
+ return out;
60827
+ }
60828
+ async function authLogin(loginUrl, username, password, opts) {
60829
+ const userField = opts?.user_field ?? "username";
60830
+ const passField = opts?.pass_field ?? "password";
60831
+ const form = new URLSearchParams({ [userField]: username, [passField]: password, ...opts?.extra ?? {} });
60832
+ if (opts?.totp)
60833
+ form.set(opts?.totp_field ?? "code", opts.totp);
60834
+ let res;
60835
+ try {
60836
+ res = await fetch(loginUrl, {
60837
+ method: "POST",
60838
+ redirect: "manual",
60839
+ headers: { "Content-Type": "application/x-www-form-urlencoded", "User-Agent": "Mozilla/5.0 (compatible; BlitzStrike/2.4)" },
60840
+ body: form.toString()
60841
+ });
60842
+ } catch (e) {
60843
+ return { ok: false, login_url: loginUrl, cookies: [], tokens: [], detail: `login request failed: ${e instanceof Error ? e.message : String(e)}` };
60844
+ }
60845
+ const body = await res.text();
60846
+ const cookies = parseCookies(res.headers.get("set-cookie"));
60847
+ const tokens = extractTokens(body);
60848
+ const ok = res.status < 400 && (cookies.length > 0 || tokens.length > 0);
60849
+ return {
60850
+ ok,
60851
+ login_url: loginUrl,
60852
+ status: res.status,
60853
+ cookies: cookies.map((c) => ({ name: c.name, value: redactSecrets(c.value) })),
60854
+ tokens: tokens.map((t) => ({ name: t.name, value: redactSecrets(t.value) })),
60855
+ detail: ok ? `authenticated (HTTP ${res.status}) — ${cookies.length} session cookie(s), ${tokens.length} token(s) captured for authenticated scanning` : `login failed (HTTP ${res.status}) — no session cookie or token captured; check credentials/fields or use browser_agent for a JS login flow`
60856
+ };
60857
+ }
60858
+
60747
60859
  // src/benchmark.ts
60748
60860
  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";
60861
+ import { join as join28 } from "node:path";
60750
60862
  import { fileURLToPath as fileURLToPath16 } from "node:url";
60751
- import { tmpdir as tmpdir3, homedir as homedir10 } from "node:os";
60863
+ import { tmpdir as tmpdir3, homedir as homedir11 } from "node:os";
60752
60864
  init_complex_bugs();
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");
60865
+ var ROOT9 = join28(fileURLToPath16(new URL(".", import.meta.url)), "..");
60866
+ var CORPUS = join28(ROOT9, "bench", "corpus");
60867
+ var CAPTURED_CORPUS_DIR = process.env.BLITZSTRIKE_CORPUS_DIR ?? join28(homedir11(), ".blitzstrike", "corpus");
60756
60868
  function parseCorpusFile(path) {
60757
60869
  let text;
60758
60870
  try {
@@ -60812,7 +60924,7 @@ function loadDir(dir) {
60812
60924
  for (const f of readdirSync7(dir)) {
60813
60925
  if (!f.endsWith(".md"))
60814
60926
  continue;
60815
- const e = parseCorpusFile(join27(dir, f));
60927
+ const e = parseCorpusFile(join28(dir, f));
60816
60928
  if (e)
60817
60929
  entries.push(e);
60818
60930
  }
@@ -60839,7 +60951,7 @@ function captureFalsePositive(input) {
60839
60951
  input.code,
60840
60952
  "```"
60841
60953
  ].filter((l) => l !== null);
60842
- const path = join27(CAPTURED_CORPUS_DIR, `${id}.md`);
60954
+ const path = join28(CAPTURED_CORPUS_DIR, `${id}.md`);
60843
60955
  writeFileSync7(path, lines.join(`
60844
60956
  `) + `
60845
60957
  `, "utf8");
@@ -60861,7 +60973,7 @@ function detect(entry) {
60861
60973
  }
60862
60974
  const lang = entry.language;
60863
60975
  if (lang === "php") {
60864
- const tmp = join27(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
60976
+ const tmp = join28(tmpdir3(), `blitzstrike-bench-${entry.id}-${process.pid}.php`);
60865
60977
  writeFileSync7(tmp, entry.code);
60866
60978
  const r = analyzeDataFlow2(tmp);
60867
60979
  rmSync3(tmp, { force: true });
@@ -60931,11 +61043,11 @@ function runBenchmark() {
60931
61043
 
60932
61044
  // src/obligations.ts
60933
61045
  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";
61046
+ import { join as join29 } from "node:path";
60935
61047
  import { createHash as createHash6 } from "node:crypto";
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");
61048
+ import { homedir as homedir12 } from "node:os";
61049
+ var HOME_DIR5 = process.env.BLITZSTRIKE_HOME ?? join29(homedir12(), ".blitzstrike");
61050
+ var OBLIGATION_PATH = join29(HOME_DIR5, "obligations.jsonl");
60939
61051
  function ensureDir3() {
60940
61052
  if (!existsSync14(HOME_DIR5))
60941
61053
  mkdirSync9(HOME_DIR5, { recursive: true });
@@ -62972,7 +63084,7 @@ function listPocTypes() {
62972
63084
  import { execSync as execSync3 } from "node:child_process";
62973
63085
  import { mkdtempSync as mkdtempSync3, mkdirSync as mkdirSync10, writeFileSync as writeFileSync9, rmSync as rmSync4, existsSync as existsSync16 } from "node:fs";
62974
63086
  import { tmpdir as tmpdir4 } from "node:os";
62975
- import { join as join29 } from "node:path";
63087
+ import { join as join30 } from "node:path";
62976
63088
  function findForge() {
62977
63089
  try {
62978
63090
  const p = execSync3("which forge 2>/dev/null", { encoding: "utf8", timeout: 3000 }).trim();
@@ -63021,14 +63133,14 @@ async function foundryRun(input) {
63021
63133
  };
63022
63134
  }
63023
63135
  const poc = input.poc_code ?? foundryPoc(input.class_ ?? "missing_access_control", name);
63024
- const dir = mkdtempSync3(join29(tmpdir4(), "blitzstrike-foundry-"));
63136
+ const dir = mkdtempSync3(join30(tmpdir4(), "blitzstrike-foundry-"));
63025
63137
  try {
63026
63138
  try {
63027
63139
  execSync3(`${forge} init --force --no-git ${dir}`, { stdio: "ignore", timeout: 60000 });
63028
63140
  } catch {
63029
- mkdirSync10(join29(dir, "src"), { recursive: true });
63030
- mkdirSync10(join29(dir, "test"), { recursive: true });
63031
- writeFileSync9(join29(dir, "foundry.toml"), `[profile.default]
63141
+ mkdirSync10(join30(dir, "src"), { recursive: true });
63142
+ mkdirSync10(join30(dir, "test"), { recursive: true });
63143
+ writeFileSync9(join30(dir, "foundry.toml"), `[profile.default]
63032
63144
  src = "src"
63033
63145
  out = "out"
63034
63146
  libs = ["lib"]
@@ -63038,12 +63150,12 @@ solc = "0.8.20"
63038
63150
  for (const f of ["Counter.sol", "Counter.t.sol", "Counter.s.sol"]) {
63039
63151
  for (const sub of ["src", "test", "script"]) {
63040
63152
  try {
63041
- rmSync4(join29(dir, sub, f), { force: true });
63153
+ rmSync4(join30(dir, sub, f), { force: true });
63042
63154
  } catch {}
63043
63155
  }
63044
63156
  }
63045
- writeFileSync9(join29(dir, "src", `${name}.sol`), input.contract_code);
63046
- writeFileSync9(join29(dir, "test", `${name}.t.sol`), poc);
63157
+ writeFileSync9(join30(dir, "src", `${name}.sol`), input.contract_code);
63158
+ writeFileSync9(join30(dir, "test", `${name}.t.sol`), poc);
63047
63159
  const { out } = runForge(forge, dir, input.timeout_ms ?? 60000);
63048
63160
  const tests = parseTestResults(out);
63049
63161
  const anyFail = tests.some((t) => t.status === "fail");
@@ -63062,17 +63174,17 @@ solc = "0.8.20"
63062
63174
 
63063
63175
  // src/enterprise-benchmark.ts
63064
63176
  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";
63177
+ import { join as join31, resolve } from "node:path";
63066
63178
  import { fileURLToPath as fileURLToPath17 } from "node:url";
63067
63179
  init_complex_bugs();
63068
63180
  var ROOT10 = resolve(fileURLToPath17(new URL(".", import.meta.url)), "..", "bench", "enterprise");
63069
63181
  var ENTERPRISE_FIXTURES = [
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 }
63182
+ { id: "php-laravel", dir: join31(ROOT10, "php-laravel"), expected_vulns: 4 },
63183
+ { id: "js-express", dir: join31(ROOT10, "js-express"), expected_vulns: 2 },
63184
+ { id: "py-django", dir: join31(ROOT10, "py-django"), expected_vulns: 2 },
63185
+ { id: "java-spring", dir: join31(ROOT10, "java-spring"), expected_vulns: 2 },
63186
+ { id: "wp-batch-route", dir: join31(ROOT10, "wp-batch-route"), expected_vulns: 3 },
63187
+ { id: "php-complex", dir: join31(ROOT10, "php-complex"), expected_vulns: 4 }
63076
63188
  ];
63077
63189
  function sourceFiles(root) {
63078
63190
  const out = [];
@@ -63084,7 +63196,7 @@ function sourceFiles(root) {
63084
63196
  return;
63085
63197
  }
63086
63198
  for (const e of entries) {
63087
- const p = join30(dir, e);
63199
+ const p = join31(dir, e);
63088
63200
  let st;
63089
63201
  try {
63090
63202
  st = statSync5(p);
@@ -63318,7 +63430,7 @@ function createServer2() {
63318
63430
  ` + `- 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).
63319
63431
  ` + `- 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.
63320
63432
 
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:
63433
+ ` + "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); asset_discovery(domain) enumerates the FULL passive attack surface — crt.sh subdomains + DNS brute + A-record resolution + optional port scan. 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; auth_login(login_url, user, pass, …) POSTs credentials and extracts the session cookie/token for authenticated scanning (use browser_agent navigate/type/click/get_cookie for JS-heavy logins); screenshot(url) captures a page image for vision-based proof. 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:
63322
63434
  ` + `- 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.
63323
63435
  ` + `- 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.
63324
63436
  ` + "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."
@@ -64478,6 +64590,42 @@ ${statusLine}` : statusLine },
64478
64590
  }, async ({ type, wet, dry, dry_ok }) => {
64479
64591
  return { content: [{ type: "text", text: JSON.stringify(wetDryTrace(type, wet, dry, dry_ok ?? true)) }] };
64480
64592
  });
64593
+ server.registerTool("asset_discovery", {
64594
+ title: "Full passive asset discovery — subdomains, IPs, ports",
64595
+ description: "Enumerate every host under a domain: certificate-transparency subdomains (crt.sh) + common-prefix DNS brute + best-effort A-record resolution + optional port scan of the main host. Returns a clean asset map so the agent knows the full attack surface before choosing where to strike.",
64596
+ inputSchema: {
64597
+ domain: string2().describe("Target domain, e.g. example.com"),
64598
+ include_ports: boolean2().optional().describe("Also scan common ports on the main host (default false)")
64599
+ }
64600
+ }, async ({ domain, include_ports }) => {
64601
+ return { content: [{ type: "text", text: JSON.stringify(await assetDiscovery(domain, include_ports ?? false)) }] };
64602
+ });
64603
+ server.registerTool("screenshot", {
64604
+ title: "Capture a page screenshot for vision-based proof",
64605
+ description: "Capture a headless-browser screenshot of a URL and save it to a file (default ~/.blitzstrike/shot-<ts>.png). The agent then inspects the image with a vision model (a rendered XSS alert, an IDOR data leak, a working login) as extra evidence on top of the marker + control.",
64606
+ inputSchema: {
64607
+ url: string2().describe("URL to screenshot"),
64608
+ path: string2().optional().describe("Output path (default ~/.blitzstrike/shot-<ts>.png)")
64609
+ }
64610
+ }, async ({ url, path }) => {
64611
+ return { content: [{ type: "text", text: JSON.stringify(await screenshot(url, path)) }] };
64612
+ });
64613
+ server.registerTool("auth_login", {
64614
+ title: "Authenticated session — HTTP form login → session cookie/token",
64615
+ description: "POST credentials to a login endpoint and extract the resulting session cookie (Set-Cookie) + any access/refresh/JWT token, returning a reusable session context for authenticated scanning (sibling_scan token_a, nuclei_scan headers, etc.). Optional totp field for 2FA. For JS-heavy login flows use browser_agent (navigate/type/click/get_cookie).",
64616
+ inputSchema: {
64617
+ login_url: string2().describe("Login endpoint URL"),
64618
+ username: string2().describe("Username/email"),
64619
+ password: string2().describe("Password"),
64620
+ user_field: string2().optional().describe("Username form field name (default username)"),
64621
+ pass_field: string2().optional().describe("Password form field name (default password)"),
64622
+ extra: record(string2(), string2()).optional().describe("Extra form fields (CSRF token, etc.)"),
64623
+ totp: string2().optional().describe("TOTP code for 2FA (generate with totp)"),
64624
+ totp_field: string2().optional().describe("2FA field name (default code)")
64625
+ }
64626
+ }, async ({ login_url, username, password, user_field, pass_field, extra, totp, totp_field }) => {
64627
+ return { content: [{ type: "text", text: JSON.stringify(await authLogin(login_url, username, password, { user_field, pass_field, extra, totp, totp_field })) }] };
64628
+ });
64481
64629
  server.registerTool("jwt_forge", {
64482
64630
  title: "Forge JWT confusion tokens and verify which is accepted live",
64483
64631
  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.",
@@ -65494,12 +65642,12 @@ async function serve() {
65494
65642
  // src/index.ts
65495
65643
  init_cli();
65496
65644
  import { readFileSync as readFileSync37, existsSync as existsSync20 } from "node:fs";
65497
- import { join as join35 } from "node:path";
65645
+ import { join as join36 } from "node:path";
65498
65646
  import { fileURLToPath as fileURLToPath22 } from "node:url";
65499
- var ROOT15 = join35(fileURLToPath22(new URL(".", import.meta.url)), "..");
65647
+ var ROOT15 = join36(fileURLToPath22(new URL(".", import.meta.url)), "..");
65500
65648
  function readVersion() {
65501
65649
  try {
65502
- const p = join35(ROOT15, "package.json");
65650
+ const p = join36(ROOT15, "package.json");
65503
65651
  if (existsSync20(p))
65504
65652
  return JSON.parse(readFileSync37(p, "utf8")).version ?? "1.0.0";
65505
65653
  } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blitzstrike",
3
- "version": "2.4.126",
3
+ "version": "2.4.127",
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": {