pwnkit-cli 0.3.2 → 0.3.4

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 (94) hide show
  1. package/LICENSE +188 -0
  2. package/README.md +305 -0
  3. package/dist/LICENSE +188 -0
  4. package/dist/README.md +305 -0
  5. package/dist/attacks/data-exfiltration/pii-leakage.yaml +27 -0
  6. package/dist/attacks/encoding-bypass/base64-encoding.yaml +24 -0
  7. package/dist/attacks/jailbreak/dan-roleplay.yaml +27 -0
  8. package/dist/attacks/jailbreak/hypothetical-scenario.yaml +25 -0
  9. package/dist/attacks/jailbreak/multilingual-bypass.yaml +22 -0
  10. package/dist/attacks/output-manipulation/harmful-content.yaml +25 -0
  11. package/dist/attacks/prompt-injection/context-manipulation.yaml +32 -0
  12. package/dist/attacks/prompt-injection/direct-injection.yaml +28 -0
  13. package/dist/attacks/prompt-injection/indirect-injection.yaml +33 -0
  14. package/dist/attacks/system-prompt-extraction/direct-ask.yaml +30 -0
  15. package/dist/attacks/system-prompt-extraction/markdown-exfil.yaml +26 -0
  16. package/dist/attacks/tool-misuse/ssrf-via-tools.yaml +27 -0
  17. package/dist/index.js +58795 -125
  18. package/dist/package.json +40 -0
  19. package/package.json +46 -19
  20. package/dist/commands/audit.d.ts +0 -3
  21. package/dist/commands/audit.d.ts.map +0 -1
  22. package/dist/commands/audit.js +0 -32
  23. package/dist/commands/audit.js.map +0 -1
  24. package/dist/commands/findings.d.ts +0 -3
  25. package/dist/commands/findings.d.ts.map +0 -1
  26. package/dist/commands/findings.js +0 -110
  27. package/dist/commands/findings.js.map +0 -1
  28. package/dist/commands/history.d.ts +0 -3
  29. package/dist/commands/history.d.ts.map +0 -1
  30. package/dist/commands/history.js +0 -34
  31. package/dist/commands/history.js.map +0 -1
  32. package/dist/commands/index.d.ts +0 -7
  33. package/dist/commands/index.d.ts.map +0 -1
  34. package/dist/commands/index.js +0 -7
  35. package/dist/commands/index.js.map +0 -1
  36. package/dist/commands/replay.d.ts +0 -3
  37. package/dist/commands/replay.d.ts.map +0 -1
  38. package/dist/commands/replay.js +0 -83
  39. package/dist/commands/replay.js.map +0 -1
  40. package/dist/commands/review.d.ts +0 -3
  41. package/dist/commands/review.d.ts.map +0 -1
  42. package/dist/commands/review.js +0 -30
  43. package/dist/commands/review.js.map +0 -1
  44. package/dist/commands/run.d.ts +0 -16
  45. package/dist/commands/run.d.ts.map +0 -1
  46. package/dist/commands/run.js +0 -83
  47. package/dist/commands/run.js.map +0 -1
  48. package/dist/commands/scan.d.ts +0 -3
  49. package/dist/commands/scan.d.ts.map +0 -1
  50. package/dist/commands/scan.js +0 -187
  51. package/dist/commands/scan.js.map +0 -1
  52. package/dist/event-handler.d.ts +0 -19
  53. package/dist/event-handler.d.ts.map +0 -1
  54. package/dist/event-handler.js +0 -63
  55. package/dist/event-handler.js.map +0 -1
  56. package/dist/formatters/index.d.ts +0 -14
  57. package/dist/formatters/index.d.ts.map +0 -1
  58. package/dist/formatters/index.js +0 -56
  59. package/dist/formatters/index.js.map +0 -1
  60. package/dist/formatters/json.d.ts +0 -3
  61. package/dist/formatters/json.d.ts.map +0 -1
  62. package/dist/formatters/json.js +0 -4
  63. package/dist/formatters/json.js.map +0 -1
  64. package/dist/formatters/markdown.d.ts +0 -3
  65. package/dist/formatters/markdown.d.ts.map +0 -1
  66. package/dist/formatters/markdown.js +0 -90
  67. package/dist/formatters/markdown.js.map +0 -1
  68. package/dist/formatters/replay.d.ts +0 -24
  69. package/dist/formatters/replay.d.ts.map +0 -1
  70. package/dist/formatters/replay.js +0 -357
  71. package/dist/formatters/replay.js.map +0 -1
  72. package/dist/formatters/terminal.d.ts +0 -4
  73. package/dist/formatters/terminal.d.ts.map +0 -1
  74. package/dist/formatters/terminal.js +0 -190
  75. package/dist/formatters/terminal.js.map +0 -1
  76. package/dist/index.d.ts +0 -3
  77. package/dist/index.d.ts.map +0 -1
  78. package/dist/index.js.map +0 -1
  79. package/dist/spinner.d.ts +0 -16
  80. package/dist/spinner.d.ts.map +0 -1
  81. package/dist/spinner.js +0 -97
  82. package/dist/spinner.js.map +0 -1
  83. package/dist/ui/ScanUI.d.ts +0 -37
  84. package/dist/ui/ScanUI.d.ts.map +0 -1
  85. package/dist/ui/ScanUI.js +0 -58
  86. package/dist/ui/ScanUI.js.map +0 -1
  87. package/dist/ui/renderScan.d.ts +0 -21
  88. package/dist/ui/renderScan.d.ts.map +0 -1
  89. package/dist/ui/renderScan.js +0 -191
  90. package/dist/ui/renderScan.js.map +0 -1
  91. package/dist/utils.d.ts +0 -12
  92. package/dist/utils.d.ts.map +0 -1
  93. package/dist/utils.js +0 -40
  94. package/dist/utils.js.map +0 -1
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "pwnkit-cli",
3
+ "version": "0.3.4",
4
+ "type": "module",
5
+ "description": "AI-powered agentic security scanner. Scan endpoints, audit packages, review source code. Autonomous agents discover, attack, verify, and report.",
6
+ "bin": {
7
+ "pwnkit-cli": "./index.js"
8
+ },
9
+ "files": [
10
+ "index.js",
11
+ "attacks"
12
+ ],
13
+ "keywords": [
14
+ "ai",
15
+ "application-security",
16
+ "mcp",
17
+ "owasp",
18
+ "security",
19
+ "red-team",
20
+ "llm",
21
+ "prompt-injection"
22
+ ],
23
+ "author": "Peak Twilight",
24
+ "homepage": "https://pwnkit.com",
25
+ "bugs": {
26
+ "url": "https://github.com/peaktwilight/pwnkit/issues"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/peaktwilight/pwnkit.git"
31
+ },
32
+ "license": "Apache-2.0",
33
+ "engines": {
34
+ "node": ">=20"
35
+ },
36
+ "dependencies": {
37
+ "better-sqlite3": "^12.8.0",
38
+ "drizzle-orm": "^0.44.0"
39
+ }
40
+ }
package/package.json CHANGED
@@ -1,35 +1,62 @@
1
1
  {
2
2
  "name": "pwnkit-cli",
3
- "version": "0.3.2",
4
3
  "type": "module",
4
+ "version": "0.3.4",
5
+ "description": "AI-powered agentic security scanner. Scan endpoints, audit packages, review source code. Autonomous agents discover, attack, verify, and report.",
5
6
  "bin": {
6
7
  "pwnkit-cli": "dist/index.js"
7
8
  },
8
9
  "files": [
10
+ "LICENSE",
11
+ "README.md",
12
+ "package.json",
9
13
  "dist"
10
14
  ],
11
15
  "scripts": {
12
- "build": "tsc",
13
- "dev": "tsc --watch",
14
- "clean": "rm -rf dist"
16
+ "build": "pnpm -r build && pnpm run build:bundle",
17
+ "build:bundle": "node ./scripts/bundle-cli.mjs",
18
+ "dev": "pnpm -r --parallel dev",
19
+ "lint": "pnpm -r exec tsc --noEmit",
20
+ "test": "pnpm --filter @pwnkit/test-targets test",
21
+ "clean": "pnpm -r clean",
22
+ "vulnerable": "PORT=43100 pnpm --filter @pwnkit/test-targets vulnerable",
23
+ "safe": "PORT=43101 pnpm --filter @pwnkit/test-targets safe"
24
+ },
25
+ "keywords": [
26
+ "ai",
27
+ "application-security",
28
+ "mcp",
29
+ "owasp",
30
+ "security",
31
+ "red-team",
32
+ "llm",
33
+ "prompt-injection"
34
+ ],
35
+ "author": "Peak Twilight",
36
+ "homepage": "https://pwnkit.com",
37
+ "bugs": {
38
+ "url": "https://github.com/peaktwilight/pwnkit/issues"
39
+ },
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/peaktwilight/pwnkit.git"
43
+ },
44
+ "license": "Apache-2.0",
45
+ "engines": {
46
+ "node": ">=20",
47
+ "pnpm": ">=8"
15
48
  },
16
49
  "dependencies": {
17
- "@clack/prompts": "^1.1.0",
18
- "@pwnkit/core": "workspace:*",
19
- "@pwnkit/db": "workspace:*",
20
- "@pwnkit/shared": "workspace:*",
21
- "@pwnkit/templates": "workspace:*",
22
- "@pwnkit/test-targets": "workspace:*",
23
- "cfonts": "^3.3.1",
24
- "chalk": "^5.3.0",
25
- "commander": "^12.1.0",
26
- "ink": "^6.8.0",
27
- "ink-spinner": "^5.0.0",
28
- "ora": "^8.0.0",
29
- "react": "^19.2.4"
50
+ "better-sqlite3": "^12.8.0",
51
+ "drizzle-orm": "^0.44.0"
30
52
  },
31
53
  "devDependencies": {
32
- "@types/react": "^19.2.14",
33
- "typescript": "^5.4.0"
54
+ "@types/node": "^25.5.0",
55
+ "esbuild": "^0.27.4"
56
+ },
57
+ "pnpm": {
58
+ "overrides": {
59
+ "esbuild": "^0.27.4"
60
+ }
34
61
  }
35
62
  }
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerAuditCommand(program: Command): void;
3
- //# sourceMappingURL=audit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6B3D"}
@@ -1,32 +0,0 @@
1
- import { runUnified } from "./run.js";
2
- export function registerAuditCommand(program) {
3
- program
4
- .command("audit")
5
- .description("Audit an npm package for security vulnerabilities")
6
- .argument("<package>", "npm package name (e.g. lodash, express)")
7
- .option("--version <version>", "Specific version to audit (default: latest)")
8
- .option("--depth <depth>", "Audit depth: quick, default, deep", "default")
9
- .option("--format <format>", "Output format: terminal, json, md", "terminal")
10
- .option("--runtime <runtime>", "Runtime: auto, claude, codex, gemini, api", "auto")
11
- .option("--db-path <path>", "Path to SQLite database")
12
- .option("--api-key <key>", "API key for LLM provider")
13
- .option("--model <model>", "LLM model to use")
14
- .option("--verbose", "Show detailed output", false)
15
- .option("--timeout <ms>", "AI agent timeout in milliseconds", "600000")
16
- .action(async (packageName, opts) => {
17
- await runUnified({
18
- target: packageName,
19
- targetType: "npm-package",
20
- depth: opts.depth ?? "default",
21
- format: (opts.format === "md" ? "markdown" : opts.format),
22
- runtime: opts.runtime ?? "auto",
23
- timeout: parseInt(opts.timeout, 10),
24
- verbose: opts.verbose,
25
- dbPath: opts.dbPath,
26
- apiKey: opts.apiKey,
27
- model: opts.model,
28
- packageVersion: opts.version,
29
- });
30
- });
31
- }
32
- //# sourceMappingURL=audit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/commands/audit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,mDAAmD,CAAC;SAChE,QAAQ,CAAC,WAAW,EAAE,yCAAyC,CAAC;SAChE,MAAM,CAAC,qBAAqB,EAAE,6CAA6C,CAAC;SAC5E,MAAM,CAAC,iBAAiB,EAAE,mCAAmC,EAAE,SAAS,CAAC;SACzE,MAAM,CAAC,mBAAmB,EAAE,mCAAmC,EAAE,UAAU,CAAC;SAC5E,MAAM,CAAC,qBAAqB,EAAE,2CAA2C,EAAE,MAAM,CAAC;SAClF,MAAM,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;SACrD,MAAM,CAAC,iBAAiB,EAAE,0BAA0B,CAAC;SACrD,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;SAC7C,MAAM,CAAC,WAAW,EAAE,sBAAsB,EAAE,KAAK,CAAC;SAClD,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,EAAE,QAAQ,CAAC;SACtE,MAAM,CAAC,KAAK,EAAE,WAAmB,EAAE,IAAsC,EAAE,EAAE;QAC5E,MAAM,UAAU,CAAC;YACf,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,aAAa;YACzB,KAAK,EAAG,IAAI,CAAC,KAAmB,IAAI,SAAS;YAC7C,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAiB;YACzE,OAAO,EAAG,IAAI,CAAC,OAAuB,IAAI,MAAM;YAChD,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAiB,EAAE,EAAE,CAAC;YAC7C,OAAO,EAAE,IAAI,CAAC,OAAkB;YAChC,MAAM,EAAE,IAAI,CAAC,MAA4B;YACzC,MAAM,EAAE,IAAI,CAAC,MAA4B;YACzC,KAAK,EAAE,IAAI,CAAC,KAA2B;YACvC,cAAc,EAAE,IAAI,CAAC,OAA6B;SACnD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerFindingsCommand(program: Command): void;
3
- //# sourceMappingURL=findings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../../src/commands/findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoEzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4E9D"}
@@ -1,110 +0,0 @@
1
- import chalk from "chalk";
2
- function withFindingsListOptions(command) {
3
- return command
4
- .option("--db-path <path>", "Path to SQLite database")
5
- .option("--scan <scanId>", "Filter by scan ID")
6
- .option("--severity <severity>", "Filter by severity: critical, high, medium, low, info")
7
- .option("--category <category>", "Filter by attack category")
8
- .option("--status <status>", "Filter by status: discovered, verified, confirmed, scored, reported, false-positive")
9
- .option("--limit <n>", "Max findings to show", "50");
10
- }
11
- async function renderFindingsList(opts) {
12
- const { pwnkitDB } = await import("@pwnkit/db");
13
- const db = new pwnkitDB(opts.dbPath);
14
- const rows = db.listFindings({
15
- scanId: opts.scan,
16
- severity: opts.severity,
17
- category: opts.category,
18
- status: opts.status,
19
- limit: parseInt(opts.limit ?? "50", 10),
20
- });
21
- db.close();
22
- if (rows.length === 0) {
23
- console.log(chalk.gray("No findings found."));
24
- return;
25
- }
26
- console.log("");
27
- console.log(chalk.red.bold(" \u25C6 pwnkit") + chalk.gray(` findings (${rows.length})`));
28
- console.log("");
29
- for (const f of rows) {
30
- const sevColor = f.severity === "critical" ? chalk.red.bold :
31
- f.severity === "high" ? chalk.redBright :
32
- f.severity === "medium" ? chalk.yellow :
33
- f.severity === "low" ? chalk.blue :
34
- chalk.gray;
35
- const statusColor = f.status === "reported" ? chalk.green :
36
- f.status === "scored" ? chalk.cyan :
37
- f.status === "verified" ? chalk.yellow :
38
- f.status === "false-positive" ? chalk.strikethrough.gray :
39
- chalk.white;
40
- console.log(` ${sevColor(f.severity.padEnd(8))} ${statusColor(f.status.padEnd(14))} ${chalk.white(f.title)}`);
41
- console.log(` ${chalk.gray(f.id.slice(0, 8))} ${chalk.gray(f.category)} ${chalk.gray(`scan:${f.scanId.slice(0, 8)}`)}`);
42
- console.log("");
43
- }
44
- }
45
- export function registerFindingsCommand(program) {
46
- const findingsCmd = withFindingsListOptions(program
47
- .command("findings")
48
- .description("Browse and manage persisted findings")).action(async (opts) => {
49
- await renderFindingsList(opts);
50
- });
51
- withFindingsListOptions(findingsCmd
52
- .command("list")
53
- .description("List findings from the database")).action(async (opts) => {
54
- await renderFindingsList(opts);
55
- });
56
- findingsCmd
57
- .command("show")
58
- .description("Show detailed information about a finding")
59
- .argument("<id>", "Finding ID (full or prefix)")
60
- .option("--db-path <path>", "Path to SQLite database")
61
- .action(async (id, opts) => {
62
- const { pwnkitDB } = await import("@pwnkit/db");
63
- const db = new pwnkitDB(opts.dbPath);
64
- // Support prefix matching
65
- let finding = db.getFinding(id);
66
- if (!finding) {
67
- const all = db.listFindings({ limit: 1000 });
68
- finding = all.find((f) => f.id.startsWith(id));
69
- }
70
- db.close();
71
- if (!finding) {
72
- console.error(chalk.red(`Finding '${id}' not found.`));
73
- process.exit(1);
74
- }
75
- console.log("");
76
- console.log(chalk.red.bold(" \u25C6 pwnkit") + chalk.gray(" finding detail"));
77
- console.log("");
78
- const sevColor = finding.severity === "critical" ? chalk.red.bold :
79
- finding.severity === "high" ? chalk.redBright :
80
- finding.severity === "medium" ? chalk.yellow :
81
- finding.severity === "low" ? chalk.blue :
82
- chalk.gray;
83
- console.log(` ${chalk.white.bold(finding.title)}`);
84
- console.log(` ${sevColor(finding.severity.toUpperCase())} ${chalk.gray("\u2502")} ${chalk.white(finding.status)} ${chalk.gray("\u2502")} ${chalk.gray(finding.category)}`);
85
- if (finding.score != null) {
86
- console.log(` ${chalk.gray("Score:")} ${chalk.cyan(String(finding.score) + "/100")}`);
87
- }
88
- console.log("");
89
- console.log(` ${chalk.gray("ID:")} ${finding.id}`);
90
- console.log(` ${chalk.gray("Scan:")} ${finding.scanId}`);
91
- console.log(` ${chalk.gray("Template:")} ${finding.templateId}`);
92
- console.log(` ${chalk.gray("Time:")} ${new Date(finding.timestamp).toISOString()}`);
93
- console.log("");
94
- console.log(` ${chalk.gray("Description:")}`);
95
- console.log(` ${finding.description}`);
96
- console.log("");
97
- console.log(` ${chalk.gray("Evidence \u2014 Request:")}`);
98
- console.log(` ${chalk.dim(finding.evidenceRequest)}`);
99
- console.log("");
100
- console.log(` ${chalk.gray("Evidence \u2014 Response:")}`);
101
- console.log(` ${chalk.dim(finding.evidenceResponse)}`);
102
- if (finding.evidenceAnalysis) {
103
- console.log("");
104
- console.log(` ${chalk.gray("Evidence \u2014 Analysis:")}`);
105
- console.log(` ${chalk.dim(finding.evidenceAnalysis)}`);
106
- }
107
- console.log("");
108
- });
109
- }
110
- //# sourceMappingURL=findings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"findings.js","sourceRoot":"","sources":["../../src/commands/findings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,SAAS,uBAAuB,CAAC,OAAgB;IAC/C,OAAO,OAAO;SACX,MAAM,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;SACrD,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;SAC9C,MAAM,CAAC,uBAAuB,EAAE,uDAAuD,CAAC;SACxF,MAAM,CAAC,uBAAuB,EAAE,2BAA2B,CAAC;SAC5D,MAAM,CAAC,mBA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;QAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QACxD,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;YAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerHistoryCommand(program: Command): void;
3
- //# sourceMappingURL=history.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsC7D"}
@@ -1,34 +0,0 @@
1
- import chalk from "chalk";
2
- export function registerHistoryCommand(program) {
3
- program
4
- .command("history")
5
- .description("Show past scan history from the SQLite database")
6
- .option("--db-path <path>", "Path to SQLite database")
7
- .option("--limit <n>", "Number of scans to show", "10")
8
- .action(async (opts) => {
9
- const { pwnkitDB } = await import("@pwnkit/db");
10
- const db = new pwnkitDB(opts.dbPath);
11
- const scans = db.listScans(parseInt(opts.limit, 10));
12
- db.close();
13
- if (scans.length === 0) {
14
- console.log(chalk.gray("No scan history found."));
15
- return;
16
- }
17
- console.log("");
18
- console.log(chalk.red.bold(" \u25C6 pwnkit") + chalk.gray(" scan history"));
19
- console.log("");
20
- for (const s of scans) {
21
- const status = s.status === "completed"
22
- ? chalk.green("done")
23
- : s.status === "failed"
24
- ? chalk.red("fail")
25
- : chalk.yellow("run");
26
- const summary = s.summary ? JSON.parse(s.summary) : null;
27
- const findings = summary?.totalFindings ?? "?";
28
- const duration = s.durationMs ? `${(s.durationMs / 1000).toFixed(1)}s` : "-";
29
- console.log(` ${status} ${chalk.white(s.target)} ${chalk.gray(`[${s.depth}]`)} ${chalk.gray(duration)} ${chalk.yellow(`${findings} findings`)} ${chalk.gray(s.startedAt)}`);
30
- }
31
- console.log("");
32
- });
33
- }
34
- //# sourceMappingURL=history.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;SACrD,MAAM,CAAC,aAAa,EAAE,yBAAyB,EAAE,IAAI,CAAC;SACtD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;QAChD,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,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AC,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,QAAQ,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAChK,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,7 +0,0 @@
1
- export { registerScanCommand } from "./scan.js";
2
- export { registerReplayCommand } from "./replay.js";
3
- export { registerHistoryCommand } from "./history.js";
4
- export { registerFindingsCommand } from "./findings.js";
5
- export { registerReviewCommand } from "./review.js";
6
- export { registerAuditCommand } from "./audit.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,7 +0,0 @@
1
- export { registerScanCommand } from "./scan.js";
2
- export { registerReplayCommand } from "./replay.js";
3
- export { registerHistoryCommand } from "./history.js";
4
- export { registerFindingsCommand } from "./findings.js";
5
- export { registerReviewCommand } from "./review.js";
6
- export { registerAuditCommand } from "./audit.js";
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerReplayCommand(program: Command): void;
3
- //# sourceMappingURL=replay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqF5D"}
@@ -1,83 +0,0 @@
1
- import chalk from "chalk";
2
- import { renderReplay } from "../formatters/replay.js";
3
- export function registerReplayCommand(program) {
4
- program
5
- .command("replay")
6
- .description("Replay the last scan's attack chain as an animated terminal sequence")
7
- .option("--db-path <path>", "Path to SQLite database")
8
- .option("--scan <scanId>", "Replay a specific scan by ID (default: last scan)")
9
- .action(async (opts) => {
10
- try {
11
- const { pwnkitDB } = await import("@pwnkit/db");
12
- const db = new pwnkitDB(opts.dbPath);
13
- let scanRecord;
14
- if (opts.scan) {
15
- scanRecord = db.getScan(opts.scan);
16
- if (!scanRecord) {
17
- // Try prefix match
18
- const all = db.listScans(100);
19
- scanRecord = all.find((s) => s.id.startsWith(opts.scan));
20
- }
21
- if (!scanRecord) {
22
- console.error(chalk.red(`Scan '${opts.scan}' not found.`));
23
- db.close();
24
- process.exit(2);
25
- }
26
- }
27
- else {
28
- const scans = db.listScans(1);
29
- if (scans.length === 0) {
30
- console.error(chalk.red("No scan history found. Run a scan first."));
31
- db.close();
32
- process.exit(2);
33
- }
34
- scanRecord = scans[0];
35
- }
36
- const dbFindings = db.getFindings(scanRecord.id);
37
- const target = db.getTarget(scanRecord.target);
38
- db.close();
39
- const summary = scanRecord.summary ? JSON.parse(scanRecord.summary) : {
40
- totalAttacks: 0, totalFindings: 0,
41
- critical: 0, high: 0, medium: 0, low: 0, info: 0,
42
- };
43
- const findings = dbFindings.map((f) => ({
44
- id: f.id,
45
- templateId: f.templateId,
46
- title: f.title,
47
- description: f.description,
48
- severity: f.severity,
49
- category: f.category,
50
- status: f.status,
51
- evidence: {
52
- request: f.evidenceRequest,
53
- response: f.evidenceResponse,
54
- analysis: f.evidenceAnalysis ?? undefined,
55
- },
56
- timestamp: f.timestamp,
57
- }));
58
- const targetInfo = target
59
- ? {
60
- url: target.url,
61
- type: target.type,
62
- systemPrompt: target.systemPrompt ?? undefined,
63
- detectedFeatures: target.detectedFeatures
64
- ? JSON.parse(target.detectedFeatures)
65
- : undefined,
66
- endpoints: target.endpoints ? JSON.parse(target.endpoints) : undefined,
67
- }
68
- : undefined;
69
- await renderReplay({
70
- target: scanRecord.target,
71
- targetInfo,
72
- findings,
73
- summary,
74
- durationMs: scanRecord.durationMs ?? 0,
75
- });
76
- }
77
- catch (err) {
78
- console.error(chalk.red("Failed to replay: " + (err instanceof Error ? err.message : String(err))));
79
- process.exit(2);
80
- }
81
- });
82
- }
83
- //# sourceMappingURL=replay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/commands/replay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,sEAAsE,CAAC;SACnF,MAAM,CAAC,kBAAkB,EAAE,yBAAyB,CAA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AC,GAAG;oBACf,IAAI,EAAE,MAAM,CAAC,IAAmD;oBAChE,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,SAAS;oBAC9C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;wBACvC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC;wBACrC,CAAC,CAAC,SAAS;oBACb,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;iBACvE;gBACH,CAAC,CAAC,SAAS,CAAC;YAEd,MAAM,YAAY,CAAC;gBACjB,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,UAAU;gBACV,QAAQ;gBACR,OAAO;gBACP,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,CAAC;aACvC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CAAC,oBAAoB,GAAG,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CACrF,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerReviewCommand(program: Command): void;
3
- //# sourceMappingURL=review.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2B5D"}
@@ -1,30 +0,0 @@
1
- import { runUnified } from "./run.js";
2
- export function registerReviewCommand(program) {
3
- program
4
- .command("review")
5
- .description("Deep source code security review of a repository")
6
- .argument("<repo>", "Local path or git URL to review")
7
- .option("--depth <depth>", "Review depth: quick, default, deep", "default")
8
- .option("--format <format>", "Output format: terminal, json, md", "terminal")
9
- .option("--runtime <runtime>", "Runtime: auto, claude, codex, gemini, api", "auto")
10
- .option("--db-path <path>", "Path to SQLite database")
11
- .option("--api-key <key>", "API key for LLM provider")
12
- .option("--model <model>", "LLM model to use")
13
- .option("--verbose", "Show detailed output", false)
14
- .option("--timeout <ms>", "AI agent timeout in milliseconds", "600000")
15
- .action(async (repo, opts) => {
16
- await runUnified({
17
- target: repo,
18
- targetType: "source-code",
19
- depth: opts.depth ?? "default",
20
- format: (opts.format === "md" ? "markdown" : opts.format),
21
- runtime: opts.runtime ?? "auto",
22
- timeout: parseInt(opts.timeout, 10),
23
- verbose: opts.verbose,
24
- dbPath: opts.dbPath,
25
- apiKey: opts.apiKey,
26
- model: opts.model,
27
- });
28
- });
29
- }
30
- //# sourceMappingURL=review.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,QAAQ,CAAC,QAAQ,EAAE,iCAAiC,CAAC;SACrD,MAAM,CAAC,iBAAiB,EAAE,oCAAoC,EAAE,SAAS,CAAC;SAC1E,MAAM,CAAC,mBAAmB,EAAE,mCAAmC,EAAE,UAAU,CAAC;SAC5E,MAAM,CAAC,qBAAqB,EAAE,2CAA2C,EAAE,MAAM,CAAC;SAClF,MAAM,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;SACrD,MAAM,CAAC,iBAAiB,EAAE,0BAA0B,CAAC;SACrD,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;SAC7C,MAAM,CAAC,WAAW,EAAE,sBAAsB,EAAE,KAAK,CAAC;SAClD,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,EAAE,QAAQ,CAAC;SACtE,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,IAAsC,EAAE,EAAE;QACrE,MAAM,UAAU,CAAC;YACf,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,aAAa;YACzB,KAAK,EAAG,IAAI,CAAC,KAAmB,IAAI,SAAS;YAC7C,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAiB;YACzE,OAAO,EAAG,IAAI,CAAC,OAAuB,IAAI,MAAM;YAChD,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAiB,EAAE,EAAE,CAAC;YAC7C,OAAO,EAAE,IAAI,CAAC,OAAkB;YAChC,MAAM,EAAE,IAAI,CAAC,MAA4B;YACzC,MAAM,EAAE,IAAI,CAAC,MAA4B;YACzC,KAAK,EAAE,IAAI,CAAC,KAA2B;SACxC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { ScanDepth, OutputFormat, RuntimeMode } from "@pwnkit/shared";
2
- export interface RunOptions {
3
- target: string;
4
- targetType?: "npm-package" | "source-code" | "url" | "web-app";
5
- depth: ScanDepth;
6
- format: OutputFormat;
7
- runtime: RuntimeMode;
8
- timeout: number;
9
- verbose: boolean;
10
- dbPath?: string;
11
- apiKey?: string;
12
- model?: string;
13
- packageVersion?: string;
14
- }
15
- export declare function runUnified(opts: RunOptions): Promise<void>;
16
- //# sourceMappingURL=run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAO3E,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,KAAK,GAAG,SAAS,CAAC;IAC/D,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EhE"}
@@ -1,83 +0,0 @@
1
- import chalk from "chalk";
2
- import { VERSION } from "@pwnkit/shared";
3
- import { runPipeline, createRuntime } from "@pwnkit/core";
4
- import { formatAuditReport, formatReviewReport, formatReport } from "../formatters/index.js";
5
- import { createpwnkitSpinner } from "../spinner.js";
6
- import { createEventHandler } from "../event-handler.js";
7
- import { buildShareUrl, checkRuntimeAvailability } from "../utils.js";
8
- export async function runUnified(opts) {
9
- const { target, depth, format, runtime, timeout } = opts;
10
- const validRuntimes = ["api", "claude", "codex", "gemini", "auto"];
11
- if (!validRuntimes.includes(runtime)) {
12
- console.error(chalk.red(`Unknown runtime '${runtime}'. Valid: ${validRuntimes.join(", ")}`));
13
- process.exit(2);
14
- }
15
- // Check non-auto runtime availability
16
- if (runtime !== "api" && runtime !== "auto") {
17
- const rt = createRuntime({ type: runtime, timeout });
18
- const available = await rt.isAvailable();
19
- if (!available) {
20
- console.error(chalk.red(`Runtime '${runtime}' not available. Is ${runtime} installed?`));
21
- process.exit(2);
22
- }
23
- }
24
- if (format === "terminal")
25
- checkRuntimeAvailability();
26
- // Ink TUI for terminal, plain text for json/md
27
- const useInkUI = format === "terminal";
28
- let inkUI = null;
29
- let eventHandler;
30
- if (useInkUI) {
31
- const { renderScanUI } = await import("../ui/renderScan.js");
32
- const mode = opts.targetType === "npm-package" ? "audit"
33
- : opts.targetType === "source-code" ? "review"
34
- : "scan";
35
- inkUI = renderScanUI({ version: VERSION, target, depth, mode });
36
- eventHandler = inkUI.onEvent;
37
- }
38
- else {
39
- const spinner = createpwnkitSpinner("Initializing...");
40
- eventHandler = createEventHandler({ format, spinner });
41
- }
42
- try {
43
- const report = await runPipeline({
44
- target,
45
- targetType: opts.targetType,
46
- depth,
47
- format,
48
- runtime,
49
- onEvent: eventHandler,
50
- dbPath: opts.dbPath,
51
- apiKey: opts.apiKey,
52
- model: opts.model,
53
- timeout,
54
- packageVersion: opts.packageVersion,
55
- });
56
- if (inkUI) {
57
- inkUI.setReport(report);
58
- await inkUI.waitForExit();
59
- }
60
- else {
61
- // Pick the right formatter based on target type
62
- const reportAny = report;
63
- const output = reportAny.targetType === "npm-package"
64
- ? formatAuditReport(reportAny, format)
65
- : reportAny.targetType === "source-code"
66
- ? formatReviewReport(reportAny, format)
67
- : formatReport(reportAny, format);
68
- console.log(output);
69
- if (format === "terminal") {
70
- console.log(`\n ${chalk.gray("Share this report:")} ${chalk.cyan(buildShareUrl(reportAny))}\n`);
71
- }
72
- }
73
- // Exit with non-zero if critical/high findings
74
- if (report.summary.critical > 0 || report.summary.high > 0) {
75
- process.exit(1);
76
- }
77
- }
78
- catch (err) {
79
- console.error(chalk.red(err instanceof Error ? err.message : String(err)));
80
- process.exit(2);
81
- }
82
- }
83
- //# sourceMappingURL=run.js.map