pentesting 0.7.6 → 0.7.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.
- package/dist/index.js +62 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4501,6 +4501,20 @@ ${prompt}`
|
|
|
4501
4501
|
}
|
|
4502
4502
|
return targets;
|
|
4503
4503
|
}
|
|
4504
|
+
/**
|
|
4505
|
+
* Clear all targets
|
|
4506
|
+
*/
|
|
4507
|
+
clearTargets() {
|
|
4508
|
+
this.state.target.primary = "";
|
|
4509
|
+
this.state.target.discovered = [];
|
|
4510
|
+
this.emit(AGENT_EVENT.TARGET_SET, { action: "cleared" });
|
|
4511
|
+
}
|
|
4512
|
+
/**
|
|
4513
|
+
* Get target count
|
|
4514
|
+
*/
|
|
4515
|
+
getTargetCount() {
|
|
4516
|
+
return this.getAllTargets().length;
|
|
4517
|
+
}
|
|
4504
4518
|
// ===== Phase Management =====
|
|
4505
4519
|
getCurrentPhase() {
|
|
4506
4520
|
return this.state.phases.find((p) => p.id === this.state.currentPhase);
|
|
@@ -6761,9 +6775,12 @@ var App = ({ autoApprove = false, target }) => {
|
|
|
6761
6775
|
addMessage(
|
|
6762
6776
|
MESSAGE_TYPE.SYSTEM,
|
|
6763
6777
|
`\u2500\u2500 Core \u2500\u2500
|
|
6764
|
-
/target [domain|ip] Set
|
|
6765
|
-
add <t>
|
|
6766
|
-
|
|
6778
|
+
/target [domain|ip] Set primary target
|
|
6779
|
+
add <t> Add to list rm <t> Remove
|
|
6780
|
+
list Show all set <t> Set primary
|
|
6781
|
+
clear Remove all targets
|
|
6782
|
+
/start [goal] Pentest primary target
|
|
6783
|
+
/start all Attack ALL targets
|
|
6767
6784
|
/stop Stop operation
|
|
6768
6785
|
/status Show status report
|
|
6769
6786
|
|
|
@@ -6861,10 +6878,17 @@ ${list}`);
|
|
|
6861
6878
|
if (args[1]) {
|
|
6862
6879
|
agent.setTarget(args[1]);
|
|
6863
6880
|
addMessage(MESSAGE_TYPE.SYSTEM, `\u2605 Primary target \u2192 ${args[1]}`);
|
|
6881
|
+
forceUpdate((n) => n + 1);
|
|
6864
6882
|
} else {
|
|
6865
6883
|
addMessage(MESSAGE_TYPE.ERROR, "Usage: /target set <domain|ip>");
|
|
6866
6884
|
}
|
|
6867
6885
|
break;
|
|
6886
|
+
case "clear":
|
|
6887
|
+
case "reset":
|
|
6888
|
+
agent.clearTargets();
|
|
6889
|
+
addMessage(MESSAGE_TYPE.SYSTEM, "\u2713 All targets cleared");
|
|
6890
|
+
forceUpdate((n) => n + 1);
|
|
6891
|
+
break;
|
|
6868
6892
|
default:
|
|
6869
6893
|
agent.setTarget(subCmd);
|
|
6870
6894
|
addMessage(MESSAGE_TYPE.SYSTEM, `\u{1F3AF} Target \u2192 ${subCmd}`);
|
|
@@ -6872,6 +6896,41 @@ ${list}`);
|
|
|
6872
6896
|
return;
|
|
6873
6897
|
case CLI_COMMAND.START:
|
|
6874
6898
|
case "s":
|
|
6899
|
+
if (args[0]?.toLowerCase() === "all") {
|
|
6900
|
+
const allTargets = agent.getAllTargets();
|
|
6901
|
+
if (allTargets.length === 0) {
|
|
6902
|
+
addMessage(MESSAGE_TYPE.ERROR, "No targets registered. Use /target add <domain|ip> first");
|
|
6903
|
+
return;
|
|
6904
|
+
}
|
|
6905
|
+
setIsProcessing(true);
|
|
6906
|
+
startTimer();
|
|
6907
|
+
const allObjective = args.slice(1).join(" ") || "Perform comprehensive penetration testing";
|
|
6908
|
+
addMessage(MESSAGE_TYPE.SYSTEM, `\u{1F680} Starting multi-target attack on ${allTargets.length} targets`);
|
|
6909
|
+
for (let i = 0; i < allTargets.length; i++) {
|
|
6910
|
+
const currentTarget = allTargets[i];
|
|
6911
|
+
if (agent.shouldStop()) {
|
|
6912
|
+
addMessage(MESSAGE_TYPE.SYSTEM, `\u23F8 Stopped at target ${i + 1}/${allTargets.length}`);
|
|
6913
|
+
break;
|
|
6914
|
+
}
|
|
6915
|
+
agent.setTarget(currentTarget);
|
|
6916
|
+
addMessage(MESSAGE_TYPE.SYSTEM, `
|
|
6917
|
+
\u2501\u2501\u2501 [${i + 1}/${allTargets.length}] ${currentTarget} \u2501\u2501\u2501`);
|
|
6918
|
+
forceUpdate((n) => n + 1);
|
|
6919
|
+
try {
|
|
6920
|
+
const session = await sessionManager2.createSession(allObjective, currentTarget);
|
|
6921
|
+
addMessage(MESSAGE_TYPE.SYSTEM, `\u{1F4C1} Session: ${session.id}`);
|
|
6922
|
+
agent.resume();
|
|
6923
|
+
await agent.runAutonomous(allObjective);
|
|
6924
|
+
} catch (e) {
|
|
6925
|
+
addMessage(MESSAGE_TYPE.ERROR, `${currentTarget}: ${e instanceof Error ? e.message : String(e)}`);
|
|
6926
|
+
}
|
|
6927
|
+
}
|
|
6928
|
+
stopTimer();
|
|
6929
|
+
setIsProcessing(false);
|
|
6930
|
+
setCurrentStatus("");
|
|
6931
|
+
addMessage(MESSAGE_TYPE.SYSTEM, `\u2713 Multi-target attack complete`);
|
|
6932
|
+
return;
|
|
6933
|
+
}
|
|
6875
6934
|
let startObjective = args.join(" ");
|
|
6876
6935
|
const firstArg = args[0];
|
|
6877
6936
|
if (firstArg && (firstArg.includes(".") || /^\d+\.\d+\.\d+\.\d+$/.test(firstArg))) {
|