pentesting 0.52.0 → 0.52.1

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 (2) hide show
  1. package/dist/main.js +13 -5
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -349,7 +349,7 @@ var ORPHAN_PROCESS_NAMES = [
349
349
 
350
350
  // src/shared/constants/agent.ts
351
351
  var APP_NAME = "Pentest AI";
352
- var APP_VERSION = "0.52.0";
352
+ var APP_VERSION = "0.52.1";
353
353
  var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
354
354
  var LLM_ROLES = {
355
355
  SYSTEM: "system",
@@ -3150,13 +3150,21 @@ import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync
3150
3150
  import { join as join3 } from "path";
3151
3151
  function extractFingerprint(tool, command) {
3152
3152
  const cmd = command || "";
3153
+ let effectiveTool = tool.toLowerCase();
3154
+ if (effectiveTool === "run_cmd" || effectiveTool === "run_background") {
3155
+ const firstWord = cmd.trim().split(/\s+/)[0];
3156
+ if (firstWord && !firstWord.startsWith("-")) {
3157
+ effectiveTool = firstWord.toLowerCase();
3158
+ }
3159
+ }
3153
3160
  const targetMatch = cmd.match(
3154
3161
  /(?::\/\/|@)([\w.\-]+(?::\d+)?)|\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::\d+)?\b/
3155
3162
  );
3156
3163
  const target = targetMatch?.[1] || targetMatch?.[2] || "";
3157
- const wordlistMatch = cmd.match(
3158
- /(?:-[wPUL]\s+|--(?:wordlist|passwords?|usernames?)(?:=|\s+))([^\s]+)/i
3159
- );
3164
+ let wordlistMatch = cmd.match(/(?:-[wPUL]\s+)([^\s]+)/);
3165
+ if (!wordlistMatch) {
3166
+ wordlistMatch = cmd.match(/(?:--(?:wordlist|passwords?|usernames?)(?:=|\s+))([^\s]+)/i);
3167
+ }
3160
3168
  const wordlist = wordlistMatch?.[1] || "";
3161
3169
  const portMatch = cmd.match(/(?:-p\s+|--port(?:=|\s+))(\S+)/);
3162
3170
  const port = portMatch?.[1] || "";
@@ -3178,7 +3186,7 @@ function extractFingerprint(tool, command) {
3178
3186
  const m = cmd.match(p);
3179
3187
  return m?.[0]?.trim() || "";
3180
3188
  }).filter(Boolean).join(" ");
3181
- return { tool: tool.toLowerCase(), target, wordlist, flags, port };
3189
+ return { tool: effectiveTool, target, wordlist, flags, port };
3182
3190
  }
3183
3191
  function fingerprintsMatch(a, b) {
3184
3192
  return a.tool === b.tool && a.target === b.target && a.wordlist === b.wordlist && a.flags === b.flags && a.port === b.port;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.52.0",
3
+ "version": "0.52.1",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
@@ -19,7 +19,7 @@
19
19
  "dev:tsx": "tsx src/platform/tui/main.tsx",
20
20
  "build": "tsup",
21
21
  "start": "node dist/main.js",
22
- "test": "mkdir -p /tmp/pentesting-vitest && TMPDIR=/tmp/pentesting-vitest vitest run",
22
+ "test": "mkdir -p .pentesting && TMPDIR=.pentesting vitest run",
23
23
  "test:watch": "vitest",
24
24
  "lint": "tsc --noEmit",
25
25
  "prepublishOnly": "npm run build",
@@ -29,7 +29,7 @@
29
29
  "release:minor": "npm version minor && npm run build && npm run publish:token",
30
30
  "release:major": "npm version major && npm run build && npm run publish:token",
31
31
  "release:docker": "docker buildx build --platform linux/amd64,linux/arm64 -t agnusdei1207/pentesting:latest --push . && docker system prune -af",
32
- "check": "TMPDIR=/tmp npm run test && npm run build && npm run release:docker && bash test.sh"
32
+ "check": "npm run test && npm run build && npm run release:docker && bash test.sh"
33
33
  },
34
34
  "repository": {
35
35
  "type": "git",