pentesting 0.4.9 → 0.5.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.
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-L4MURCOP.js";
12
- import "./chunk-X3X45KYT.js";
11
+ } from "./chunk-ZC53SMRU.js";
12
+ import "./chunk-FHPP7RP2.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
@@ -132,7 +132,7 @@ var SENSITIVE_TOOLS = [
132
132
 
133
133
  // src/config/constants.ts
134
134
  var APP_NAME = "pentesting";
135
- var APP_VERSION = "0.4.9";
135
+ var APP_VERSION = "0.5.1";
136
136
  var APP_DESCRIPTION = "Autonomous Penetration Testing AI Agent";
137
137
  var LLM_API_KEY = process.env.PENTEST_API_KEY || process.env.ANTHROPIC_API_KEY || "";
138
138
  var LLM_BASE_URL = process.env.PENTEST_BASE_URL || void 0;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  APP_NAME,
3
3
  APP_VERSION
4
- } from "./chunk-X3X45KYT.js";
4
+ } from "./chunk-FHPP7RP2.js";
5
5
 
6
6
  // src/core/update/auto-update.ts
7
7
  import { execSync } from "child_process";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  PHASE_STATUS,
16
16
  THOUGHT_TYPE,
17
17
  TOOL_NAME
18
- } from "./chunk-X3X45KYT.js";
18
+ } from "./chunk-FHPP7RP2.js";
19
19
  import {
20
20
  __require
21
21
  } from "./chunk-3RG5ZIWI.js";
@@ -3596,6 +3596,25 @@ Use report_finding tool for important discoveries.
3596
3596
  is_error: !result.success
3597
3597
  }]
3598
3598
  });
3599
+ if (!this.state.target.primary && result.success && result.output) {
3600
+ const ipMatches = result.output.match(/\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b/g);
3601
+ if (ipMatches) {
3602
+ const validIPs = [...new Set(ipMatches)].filter(
3603
+ (ip) => !ip.startsWith("127.") && !ip.startsWith("0.") && !ip.startsWith("255.")
3604
+ );
3605
+ if (validIPs.length === 1) {
3606
+ this.setTarget(validIPs[0]);
3607
+ this.emit(AGENT_EVENT.RESPONSE, `
3608
+ [Target auto-set: ${validIPs[0]}]
3609
+ `);
3610
+ } else if (validIPs.length > 1) {
3611
+ this.emit(AGENT_EVENT.RESPONSE, `
3612
+ [Multiple IPs found: ${validIPs.join(", ")}]
3613
+ [Use /target <ip> to select one]
3614
+ `);
3615
+ }
3616
+ }
3617
+ }
3599
3618
  if (response.stop_reason === "tool_use") {
3600
3619
  return this.executeStep();
3601
3620
  }
@@ -4946,7 +4965,7 @@ var App = ({ autoApprove = false, target }) => {
4946
4965
  setCheckpointCount(contextManagerRef.current?.getCheckpoints().length || 0);
4947
4966
  }
4948
4967
  });
4949
- import("./auto-update-GKUAPLBP.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
4968
+ import("./auto-update-IDSABTT4.js").then(({ checkForUpdateAsync, formatUpdateNotification }) => {
4950
4969
  checkForUpdateAsync().then((result) => {
4951
4970
  if (result.hasUpdate) {
4952
4971
  const notification = formatUpdateNotification(result);
@@ -5166,13 +5185,20 @@ pentesting v${APP_VERSION}`
5166
5185
  return;
5167
5186
  case CLI_COMMAND.START:
5168
5187
  case "s":
5188
+ let startObjective = args.join(" ");
5189
+ const firstArg = args[0];
5190
+ if (firstArg && (firstArg.includes(".") || /^\d+\.\d+\.\d+\.\d+$/.test(firstArg))) {
5191
+ agent.setTarget(firstArg);
5192
+ addMessage(MESSAGE_TYPE.SYSTEM, `Target \u2192 ${firstArg}`);
5193
+ startObjective = args.slice(1).join(" ") || "Perform comprehensive penetration testing";
5194
+ }
5169
5195
  if (!agent.getState().target.primary) {
5170
- addMessage(MESSAGE_TYPE.ERROR, "Set target first: /target <ip>");
5196
+ addMessage(MESSAGE_TYPE.ERROR, "Set target first: /target <ip> or /start <domain>");
5171
5197
  return;
5172
5198
  }
5173
5199
  setIsProcessing(true);
5174
5200
  startTimer();
5175
- const objective = args.join(" ") || "Perform comprehensive penetration testing";
5201
+ const objective = startObjective || "Perform comprehensive penetration testing";
5176
5202
  setCurrentStatus("Initializing...");
5177
5203
  addMessage(MESSAGE_TYPE.SYSTEM, `\u{1F680} Starting: ${objective}`);
5178
5204
  try {
@@ -5421,7 +5447,7 @@ pentesting v${APP_VERSION}`
5421
5447
  return;
5422
5448
  case "update":
5423
5449
  try {
5424
- const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-2U2TR7HJ.js");
5450
+ const { checkForUpdate, formatUpdateNotification, doUpdate } = await import("./update-OWR4FHRQ.js");
5425
5451
  const result = checkForUpdate(true);
5426
5452
  if (result.hasUpdate) {
5427
5453
  const notification = formatUpdateNotification(result);
@@ -5639,7 +5665,9 @@ pentesting v${APP_VERSION}`
5639
5665
  state.currentPhase !== AGENT_STATUS.IDLE && ` ${state.currentPhase} \u2502`
5640
5666
  ] }),
5641
5667
  /* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
5642
- "Ctrl+X mode \u2502 /help \u2502 Ctrl+C ",
5668
+ "v",
5669
+ APP_VERSION,
5670
+ " \u2502 Ctrl+X mode \u2502 /help \u2502 Ctrl+C ",
5643
5671
  isProcessing ? "stop" : "exit"
5644
5672
  ] })
5645
5673
  ] })
@@ -8,8 +8,8 @@ import {
8
8
  readVersionCache,
9
9
  semverTuple,
10
10
  writeVersionCache
11
- } from "./chunk-L4MURCOP.js";
12
- import "./chunk-X3X45KYT.js";
11
+ } from "./chunk-ZC53SMRU.js";
12
+ import "./chunk-FHPP7RP2.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
  export {
15
15
  checkForUpdate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.4.9",
3
+ "version": "0.5.1",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",