pentesting 0.40.4 → 0.40.7

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 +19 -12
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -306,7 +306,7 @@ var ORPHAN_PROCESS_NAMES = [
306
306
 
307
307
  // src/shared/constants/agent.ts
308
308
  var APP_NAME = "Pentest AI";
309
- var APP_VERSION = "0.40.4";
309
+ var APP_VERSION = "0.40.7";
310
310
  var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
311
311
  var LLM_ROLES = {
312
312
  SYSTEM: "system",
@@ -2128,7 +2128,8 @@ var StateSerializer = class {
2128
2128
  if (important.length > 0) {
2129
2129
  lines.push(` Important Findings:`);
2130
2130
  for (const f of important.slice(0, DISPLAY_LIMITS.FINDING_PREVIEW)) {
2131
- lines.push(` [${f.severity.toUpperCase()}] ${f.title} (${f.category || "general"})`);
2131
+ const tactic = f.attackPattern ? ` [ATT&CK:${f.attackPattern}]` : "";
2132
+ lines.push(` [${f.severity.toUpperCase()}] ${f.title} (${f.category || "general"})${tactic}`);
2132
2133
  }
2133
2134
  }
2134
2135
  }
@@ -4515,11 +4516,12 @@ Detail: ${detail}
4515
4516
  },
4516
4517
  {
4517
4518
  name: TOOL_NAMES.ADD_FINDING,
4518
- description: "Add a security finding",
4519
+ description: "Add a security finding. Always include attackPattern for MITRE ATT&CK mapping.",
4519
4520
  parameters: {
4520
4521
  title: { type: "string", description: "Finding title" },
4521
- severity: { type: "string", description: "Severity" },
4522
- affected: { type: "array", items: { type: "string" }, description: "Affected host:port" }
4522
+ severity: { type: "string", description: "Severity: critical, high, medium, low, info" },
4523
+ affected: { type: "array", items: { type: "string" }, description: "Affected host:port" },
4524
+ attackPattern: { type: "string", description: "MITRE ATT&CK tactic: initial_access, execution, persistence, privilege_escalation, defense_evasion, credential_access, discovery, lateral_movement, collection, exfiltration, command_and_control, impact" }
4523
4525
  },
4524
4526
  required: ["title", "severity"],
4525
4527
  execute: async (p) => {
@@ -4537,7 +4539,8 @@ Detail: ${detail}
4537
4539
  evidence,
4538
4540
  isVerified: validation.isVerified,
4539
4541
  remediation: "",
4540
- foundAt: Date.now()
4542
+ foundAt: Date.now(),
4543
+ ...p.attackPattern ? { attackPattern: p.attackPattern } : {}
4541
4544
  });
4542
4545
  const hasExploit = validation.isVerified;
4543
4546
  const target = affected[0] || "unknown";
@@ -11475,7 +11478,7 @@ import { useState as useState3, useEffect as useEffect3 } from "react";
11475
11478
  import { Text as Text3 } from "ink";
11476
11479
  import { jsx as jsx3 } from "react/jsx-runtime";
11477
11480
  var FRAMES = ["\u2669", "\u266A", "\u266B", "\u266C", "\u266B", "\u266A"];
11478
- var INTERVAL = 150;
11481
+ var INTERVAL = 400;
11479
11482
  var MusicSpinner = ({ color }) => {
11480
11483
  const [index, setIndex] = useState3(0);
11481
11484
  useEffect3(() => {
@@ -11657,6 +11660,10 @@ var App = ({ autoApprove = false, target }) => {
11657
11660
  cancelInputRequest,
11658
11661
  addMessage
11659
11662
  } = useAgent(autoApproveMode, target);
11663
+ const isProcessingRef = useRef3(isProcessing);
11664
+ isProcessingRef.current = isProcessing;
11665
+ const autoApproveModeRef = useRef3(autoApproveMode);
11666
+ autoApproveModeRef.current = autoApproveMode;
11660
11667
  const inputRequestRef = useRef3(inputRequest);
11661
11668
  inputRequestRef.current = inputRequest;
11662
11669
  const handleExit = useCallback3(() => {
@@ -11693,7 +11700,7 @@ var App = ({ autoApprove = false, target }) => {
11693
11700
  addMessage("error", "Set target first: /target <ip>");
11694
11701
  break;
11695
11702
  }
11696
- if (!autoApproveMode) {
11703
+ if (!autoApproveModeRef.current) {
11697
11704
  setAutoApproveMode(true);
11698
11705
  agent.setAutoApprove(true);
11699
11706
  addMessage("system", "\u{1F680} Autonomous mode enabled (auto-approve ON)");
@@ -11711,7 +11718,7 @@ var App = ({ autoApprove = false, target }) => {
11711
11718
  break;
11712
11719
  }
11713
11720
  addMessage("system", `--- ${findings.length} Findings ---`);
11714
- findings.forEach((f) => addMessage("system", `[${f.severity}] ${f.title}`));
11721
+ findings.forEach((f) => addMessage("system", `[${f.severity}] ${f.title}${f.attackPattern ? ` (ATT&CK: ${f.attackPattern})` : ""}`));
11715
11722
  break;
11716
11723
  case UI_COMMANDS.ASSETS:
11717
11724
  case UI_COMMANDS.ASSETS_SHORT:
@@ -11752,7 +11759,7 @@ ${procData.stdout || "(no output)"}
11752
11759
  default:
11753
11760
  addMessage("error", `Unknown command: /${cmd}`);
11754
11761
  }
11755
- }, [agent, addMessage, executeTask, setMessages, handleExit, autoApproveMode]);
11762
+ }, [agent, addMessage, executeTask, setMessages, handleExit]);
11756
11763
  const handleSubmit = useCallback3(async (value) => {
11757
11764
  const trimmed = value.trim();
11758
11765
  if (!trimmed) return;
@@ -11778,10 +11785,10 @@ ${procData.stdout || "(no output)"}
11778
11785
  useInput(useCallback3((ch, key) => {
11779
11786
  if (key.escape) {
11780
11787
  if (inputRequestRef.current.isActive) cancelInputRequest();
11781
- else if (isProcessing) abort();
11788
+ else if (isProcessingRef.current) abort();
11782
11789
  }
11783
11790
  if (key.ctrl && ch === "c") handleExit();
11784
- }, [cancelInputRequest, isProcessing, abort, handleExit]));
11791
+ }, [cancelInputRequest, abort, handleExit]));
11785
11792
  useEffect4(() => {
11786
11793
  const onSignal = () => handleExit();
11787
11794
  process.on("SIGINT", onSignal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.40.4",
3
+ "version": "0.40.7",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",