@pensar/apex 2.3.0 → 2.4.0
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/build/{agent-9xna7jhw.js → agent-5ejt5vpz.js} +11 -11
- package/build/agent-mvpgvgks.js +19 -0
- package/build/agent-nhs1w5w0.js +29 -0
- package/build/{apps-43pqbz7r.js → apps-17wvz1d7.js} +20 -20
- package/build/{auth-c1z670rx.js → auth-z3h9859n.js} +38 -20
- package/build/authentication-3s97cpk4.js +19 -0
- package/build/blackboxAgent-gw0a1ca4.js +19 -0
- package/build/{blackboxPentest-tgc2t3y6.js → blackboxPentest-44333zss.js} +17 -17
- package/build/{cli-vckbhnyk.js → cli-0n4r54hq.js} +2 -2
- package/build/{cli-bnkgdywr.js → cli-2cbwdk78.js} +1 -1
- package/build/{cli-j0n189ee.js → cli-32z0017y.js} +2 -2
- package/build/{cli-zm8tfpv7.js → cli-5k33webc.js} +25 -9
- package/build/{cli-f7hanqbw.js → cli-72cvcqhg.js} +2 -2
- package/build/{cli-eveg9djy.js → cli-9rhzhgx2.js} +3 -2
- package/build/{cli-72b18z0n.js → cli-b1adytsy.js} +3 -3
- package/build/{cli-8rxa073f.js → cli-bc05qbss.js} +8 -6
- package/build/{cli-q24twygk.js → cli-dm0fc0bm.js} +1 -1
- package/build/{cli-yz80qkzn.js → cli-ee3axgts.js} +7 -1
- package/build/{cli-bv2807tj.js → cli-gq40s5b3.js} +3 -3
- package/build/{cli-gpnb45ck.js → cli-j54qa6tm.js} +7 -7
- package/build/{cli-wszshs5e.js → cli-k71t434r.js} +4 -4
- package/build/{cli-baqhqbe5.js → cli-k8kc47pq.js} +3 -3
- package/build/{cli-50906d27.js → cli-mavved45.js} +91 -29
- package/build/{cli-jyp2c6th.js → cli-qqt4gj1w.js} +2 -2
- package/build/{cli-n2m2yy5b.js → cli-repbyhkk.js} +1250 -614
- package/build/{cli-3k1x5rn3.js → cli-swpbx60z.js} +1045 -1045
- package/build/{cli-zx8gk8xv.js → cli-tkc598ey.js} +296 -54
- package/build/{cli-7tw4xfnw.js → cli-tznv8pf1.js} +1 -1
- package/build/{cli-barsn8br.js → cli-vnynf0js.js} +2 -2
- package/build/{cli-f71s6kcw.js → cli-vq52kp7j.js} +81 -215
- package/build/{cli-zk1ch6qf.js → cli-xshasbwe.js} +34 -9
- package/build/cli.js +52 -46
- package/build/{config-jzqjz606.js → config-f1mj4nhd.js} +5 -5
- package/build/{doctor-q3qws68e.js → doctor-ekneewa3.js} +10 -9
- package/build/{fastStrike-ebz1ph9a.js → fastStrike-8zka43xs.js} +36 -16
- package/build/{fixes-86yebsj0.js → fixes-b89s5haw.js} +19 -19
- package/build/{index-8db1d2q3.js → index-4ad3sdwk.js} +18 -18
- package/build/{index-97vx1a24.js → index-6d22pyxt.js} +1148 -1086
- package/build/{index-h2hj2hj9.js → index-cbwn03kz.js} +16 -16
- package/build/index-ghwf5z3v.js +12 -0
- package/build/{index-468j74f3.js → index-hqjdg6fg.js} +113 -97
- package/build/{index-gq9h8j5j.js → index-mtq7kmxz.js} +132 -132
- package/build/{index-tke6896d.js → index-psqjpw5m.js} +10 -10
- package/build/{index-mr2cseg4.js → index-rbzhk712.js} +19 -19
- package/build/{index-e8c8zcrf.js → index-sf16jm0m.js} +31 -26
- package/build/{index-32hn8rrw.js → index-y5w6n3tb.js} +3 -3
- package/build/{issues-kh4wg8c5.js → issues-xx5bs4md.js} +19 -19
- package/build/{logs-bj28xmbf.js → logs-qtxe51w2.js} +19 -19
- package/build/{main-3d7dfdvs.js → main-mmjp338j.js} +9 -9
- package/build/{multipart-parser-6zd16497.js → multipart-parser-g2xxkezz.js} +2 -2
- package/build/{offesecAgent-8ky7gccp.js → offesecAgent-b9e2xm6v.js} +11 -11
- package/build/{parse-7djk9jyf.js → parse-rtccymzn.js} +3 -3
- package/build/pentest-xtc1sjdw.js +29 -0
- package/build/{pentests-62d6zw6p.js → pentests-6ks3szc4.js} +19 -19
- package/build/{targetedPentest-me4jnr3z.js → targetedPentest-s1ptvq8e.js} +14 -14
- package/build/{targets-e5k1mrky.js → targets-sxygyj87.js} +19 -19
- package/build/threatModel-xsm6fwk5.js +27 -0
- package/build/{token-rdcbn380.js → token-3bbp59y6.js} +3 -3
- package/build/{token-util-sxb85ahn.js → token-util-6xjme11b.js} +2 -2
- package/build/{uninstall-jt1bca2p.js → uninstall-tvsh81v8.js} +2 -2
- package/build/{upload-krd8bnex.js → upload-7wdyyqmr.js} +11 -11
- package/build/{utils-skmqhyfg.js → utils-7fwdkqk6.js} +17 -13
- package/package.json +1 -1
- package/build/agent-71z4e7jg.js +0 -19
- package/build/agent-ga5fecfs.js +0 -27
- package/build/authentication-hgs7ym0m.js +0 -19
- package/build/blackboxAgent-gem3mxa9.js +0 -19
- package/build/index-ag14v3sg.js +0 -12
- package/build/pentest-rs0181nf.js +0 -29
- package/build/threatModel-k4f3zgqd.js +0 -27
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-repbyhkk.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-tznv8pf1.js";
|
|
7
7
|
import {
|
|
8
8
|
createLogger,
|
|
9
9
|
hasToolCall,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
init_lazyLogger,
|
|
12
12
|
init_structured,
|
|
13
13
|
scopedLogger
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-tkc598ey.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
@@ -31,7 +31,7 @@ Obtain valid credentials/sessions that other agents can use for authenticated te
|
|
|
31
31
|
# Operating Mode
|
|
32
32
|
|
|
33
33
|
- Fully autonomous — no human intervention
|
|
34
|
-
- If you encounter barriers (CAPTCHA, MFA), report failure with details
|
|
34
|
+
- If you encounter barriers (CAPTCHA, or MFA with no TOTP seed available), report failure with details
|
|
35
35
|
- Call \`complete_authentication\` when done (success or failure)
|
|
36
36
|
|
|
37
37
|
# Available Tools
|
|
@@ -125,6 +125,22 @@ These are the ONLY way downstream agents receive the session credentials.
|
|
|
125
125
|
|
|
126
126
|
**Then**, call the \`response\` tool with your final summary to end the run. This is required — complete_authentication persists the data, response terminates the agent.
|
|
127
127
|
|
|
128
|
+
# MFA / TOTP Codes
|
|
129
|
+
|
|
130
|
+
If the login asks for a 6-digit authenticator code, check whether a TOTP seed was provided for this
|
|
131
|
+
account — it appears as an extra secret field on the credential and as a matching environment variable
|
|
132
|
+
(look for a name containing TOTP, MFA, OTP, or 2FA). If one exists, do NOT report an MFA barrier —
|
|
133
|
+
compute the code yourself:
|
|
134
|
+
|
|
135
|
+
\`\`\`
|
|
136
|
+
python3 -c "import base64,hmac,hashlib,struct,time,os;s=os.environ['<ENV_VAR>'].replace(' ','').upper();k=base64.b32decode(s+'='*(-len(s)%8));d=hmac.new(k,struct.pack('>Q',int(time.time())//30),hashlib.sha1).digest();o=d[-1]&15;print('%06d'%((struct.unpack('>I',d[o:o+4])[0]&0x7fffffff)%1000000))"
|
|
137
|
+
\`\`\`
|
|
138
|
+
|
|
139
|
+
Read the seed from the environment variable — never paste a seed literal into a command. Codes rotate
|
|
140
|
+
every 30 seconds, so run this immediately before filling the field. If the code is rejected, re-run and
|
|
141
|
+
retry once (you may have crossed a period boundary). Only report an MFA barrier if no seed is available
|
|
142
|
+
or two fresh codes are both rejected.
|
|
143
|
+
|
|
128
144
|
# Error Recovery
|
|
129
145
|
|
|
130
146
|
If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
|
|
@@ -136,7 +152,8 @@ If authentication fails, try these mechanical fixes (they are login mechanics, n
|
|
|
136
152
|
|
|
137
153
|
If credentials were provided to you, they are already verified and SHARED — do not modify them or their
|
|
138
154
|
account settings. When such provided credentials are genuinely rejected — wrong password, account locked, a
|
|
139
|
-
forced password change is required, MFA is required, or the email is not
|
|
155
|
+
forced password change is required, MFA is required and no TOTP seed was provided, or the email is not
|
|
156
|
+
confirmed — do NOT try to recover by resetting or changing
|
|
140
157
|
the password, modifying MFA/2FA settings, or running any account-recovery flow. Fail fast: call
|
|
141
158
|
\`complete_authentication\` with success=false and a summary naming the reason. Do NOT register a new account
|
|
142
159
|
or self-sign-up to get around a rejected provided credential — that is a different account than the one
|
|
@@ -194,7 +211,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
194
211
|
const cm = session.credentialManager;
|
|
195
212
|
super({
|
|
196
213
|
system: detectOSAndEnhancePrompt(AUTH_SUBAGENT_SYSTEM_PROMPT),
|
|
197
|
-
prompt: buildAuthPrompt(target, authHints, cm, context),
|
|
214
|
+
prompt: buildAuthPrompt(target, authHints, cm, context, environmentVariables ? Object.keys(environmentVariables) : undefined),
|
|
198
215
|
model,
|
|
199
216
|
session,
|
|
200
217
|
target,
|
|
@@ -272,7 +289,7 @@ function loadAuthResult(authDataPath) {
|
|
|
272
289
|
};
|
|
273
290
|
}
|
|
274
291
|
}
|
|
275
|
-
function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
292
|
+
function buildAuthPrompt(target, authHints, credentialManager, context, envVarNames) {
|
|
276
293
|
const parts = [`TARGET: ${target}
|
|
277
294
|
`];
|
|
278
295
|
if (context) {
|
|
@@ -290,6 +307,13 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
|
290
307
|
parts.push(`No credentials provided. Probe the target to discover auth requirements.
|
|
291
308
|
`);
|
|
292
309
|
}
|
|
310
|
+
if (envVarNames?.length) {
|
|
311
|
+
parts.push("ENVIRONMENT VARIABLES:");
|
|
312
|
+
parts.push(`These are pre-loaded in your shell and available in every execute_command call. Reference them (e.g. $${envVarNames[0]}) — their values are hidden from you and redacted from command output, so never try to print one.`);
|
|
313
|
+
parts.push(envVarNames.map((n) => `- ${n}`).join(`
|
|
314
|
+
`));
|
|
315
|
+
parts.push("");
|
|
316
|
+
}
|
|
293
317
|
if (authHints) {
|
|
294
318
|
parts.push("AUTH HINTS:");
|
|
295
319
|
if (authHints.authScheme)
|
|
@@ -316,8 +340,9 @@ The credentials above were provided to you and have already been verified — th
|
|
|
316
340
|
do not modify them or their account settings. NEVER change the password, complete a password reset /
|
|
317
341
|
forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
|
|
318
342
|
resetting a second factor) for this account. If they do not authenticate (rejected, locked out, forced
|
|
319
|
-
password change required,
|
|
320
|
-
success=false and a clear summary of why — do not attempt to recover, reset,
|
|
343
|
+
password change required, email not confirmed, or an MFA prompt with no TOTP seed available), call
|
|
344
|
+
complete_authentication with success=false and a clear summary of why — do not attempt to recover, reset,
|
|
345
|
+
or rotate them. When a TOTP seed IS available, generate the code and continue; that is not a barrier. Do NOT
|
|
321
346
|
register a new account or self-sign-up to work around a failed login: that is not the credential under test
|
|
322
347
|
and only pollutes results — fail fast with success=false instead.`);
|
|
323
348
|
} else {
|
package/build/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import"./cli-
|
|
3
|
+
import"./cli-dm0fc0bm.js";
|
|
4
4
|
import {
|
|
5
5
|
createThreatModelPrompt
|
|
6
6
|
} from "./cli-fw5r7pfj.js";
|
|
@@ -14,20 +14,20 @@ import {
|
|
|
14
14
|
init_toolset,
|
|
15
15
|
init_utils,
|
|
16
16
|
logger
|
|
17
|
-
} from "./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
17
|
+
} from "./cli-tkc598ey.js";
|
|
18
|
+
import"./cli-0n4r54hq.js";
|
|
19
|
+
import"./cli-swpbx60z.js";
|
|
20
|
+
import"./cli-j54qa6tm.js";
|
|
21
|
+
import"./cli-72cvcqhg.js";
|
|
22
|
+
import"./cli-9rhzhgx2.js";
|
|
23
23
|
import {
|
|
24
24
|
init_package,
|
|
25
25
|
package_default
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-vnynf0js.js";
|
|
27
27
|
import {
|
|
28
28
|
__require,
|
|
29
29
|
__toESM
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-bc05qbss.js";
|
|
31
31
|
// package.json
|
|
32
32
|
var package_default2 = {
|
|
33
33
|
author: "Pensar",
|
|
@@ -144,7 +144,7 @@ var package_default2 = {
|
|
|
144
144
|
tsc: "tsc --noEmit"
|
|
145
145
|
},
|
|
146
146
|
type: "module",
|
|
147
|
-
version: "2.
|
|
147
|
+
version: "2.4.0"
|
|
148
148
|
};
|
|
149
149
|
|
|
150
150
|
// src/core/ai/index.ts
|
|
@@ -299,13 +299,18 @@ class AgentEventBus {
|
|
|
299
299
|
});
|
|
300
300
|
break;
|
|
301
301
|
case "reasoning-start":
|
|
302
|
-
this.emit("reasoning-start", { subagentId });
|
|
302
|
+
this.emit("reasoning-start", { subagentId, sessionId, messageId });
|
|
303
303
|
break;
|
|
304
304
|
case "reasoning-delta":
|
|
305
|
-
this.emit("reasoning-delta", {
|
|
305
|
+
this.emit("reasoning-delta", {
|
|
306
|
+
text: chunk.text,
|
|
307
|
+
subagentId,
|
|
308
|
+
sessionId,
|
|
309
|
+
messageId
|
|
310
|
+
});
|
|
306
311
|
break;
|
|
307
312
|
case "reasoning-end":
|
|
308
|
-
this.emit("reasoning-end", { subagentId });
|
|
313
|
+
this.emit("reasoning-end", { subagentId, sessionId, messageId });
|
|
309
314
|
break;
|
|
310
315
|
case "tool-input-start":
|
|
311
316
|
this.emit("tool-call-start", {
|
|
@@ -587,7 +592,7 @@ function attachCliAgentStreamListeners(bus) {
|
|
|
587
592
|
async function createInstrumentedBus(session) {
|
|
588
593
|
const bus = new AgentEventBus;
|
|
589
594
|
attachCliAgentStreamListeners(bus);
|
|
590
|
-
const { attachWandbToEventBus } = await import("./upload-
|
|
595
|
+
const { attachWandbToEventBus } = await import("./upload-7wdyyqmr.js");
|
|
591
596
|
const wandbCleanup = await attachWandbToEventBus(session, bus).catch((e) => {
|
|
592
597
|
console.warn("[wandb] Tracing disabled:", e.message);
|
|
593
598
|
return null;
|
|
@@ -601,10 +606,10 @@ async function resolveCliHeaders() {
|
|
|
601
606
|
if (headerArgs.length === 0 && !headersFromArg && !noGlobal) {
|
|
602
607
|
return;
|
|
603
608
|
}
|
|
604
|
-
const { parseHeaderLine: parseHeaderLine2, parseHeadersFromFile, formatParseError: formatParseError2 } = await import("./parse-
|
|
609
|
+
const { parseHeaderLine: parseHeaderLine2, parseHeadersFromFile, formatParseError: formatParseError2 } = await import("./parse-rtccymzn.js");
|
|
605
610
|
const merged = {};
|
|
606
611
|
if (!noGlobal) {
|
|
607
|
-
const { config: appConfig } = await import("./index-
|
|
612
|
+
const { config: appConfig } = await import("./index-y5w6n3tb.js");
|
|
608
613
|
const cfg = await appConfig.get();
|
|
609
614
|
if (cfg.defaultHeaders) {
|
|
610
615
|
Object.assign(merged, cfg.defaultHeaders);
|
|
@@ -638,8 +643,8 @@ async function resolveCliModel() {
|
|
|
638
643
|
const explicit = getArg("--model");
|
|
639
644
|
if (explicit)
|
|
640
645
|
return explicit;
|
|
641
|
-
const { config: appConfig } = await import("./index-
|
|
642
|
-
const { getDefaultModelForConfig } = await import("./utils-
|
|
646
|
+
const { config: appConfig } = await import("./index-y5w6n3tb.js");
|
|
647
|
+
const { getDefaultModelForConfig } = await import("./utils-7fwdkqk6.js");
|
|
643
648
|
const pensarConfig = await appConfig.get();
|
|
644
649
|
const defaultModel = getDefaultModelForConfig(pensarConfig);
|
|
645
650
|
if (!defaultModel) {
|
|
@@ -648,6 +653,7 @@ async function resolveCliModel() {
|
|
|
648
653
|
` + ` ANTHROPIC_API_KEY \u2014 Anthropic direct
|
|
649
654
|
` + ` OPENAI_API_KEY \u2014 OpenAI
|
|
650
655
|
` + ` OPENROUTER_API_KEY \u2014 OpenRouter
|
|
656
|
+
` + ` CONCENTRATE_API_KEY \u2014 Concentrate
|
|
651
657
|
` + `
|
|
652
658
|
Or run 'pensar login' to connect to Pensar Console.`);
|
|
653
659
|
process.exit(1);
|
|
@@ -725,11 +731,11 @@ Global options:
|
|
|
725
731
|
`);
|
|
726
732
|
}
|
|
727
733
|
async function runPentest() {
|
|
728
|
-
const { config } = await import("./main-
|
|
734
|
+
const { config } = await import("./main-mmjp338j.js").then((m)=>__toESM(m.default,1));
|
|
729
735
|
config();
|
|
730
|
-
const { runPentestAgent } = await import("./blackboxPentest-
|
|
731
|
-
const { sessions: sessions2 } = await import("./index-
|
|
732
|
-
const { config: appConfig } = await import("./index-
|
|
736
|
+
const { runPentestAgent } = await import("./blackboxPentest-44333zss.js");
|
|
737
|
+
const { sessions: sessions2 } = await import("./index-sf16jm0m.js");
|
|
738
|
+
const { config: appConfig } = await import("./index-y5w6n3tb.js");
|
|
733
739
|
const target = getArgRequired("--target");
|
|
734
740
|
const cwd = getArg("--cwd");
|
|
735
741
|
const mode = getArg("--mode");
|
|
@@ -803,11 +809,11 @@ Report: ${reportPath}` : ""}`);
|
|
|
803
809
|
process.exit(0);
|
|
804
810
|
}
|
|
805
811
|
async function runTargetedPentest() {
|
|
806
|
-
const { config } = await import("./main-
|
|
812
|
+
const { config } = await import("./main-mmjp338j.js").then((m)=>__toESM(m.default,1));
|
|
807
813
|
config();
|
|
808
|
-
const { runTargetedPentestAgent } = await import("./targetedPentest-
|
|
809
|
-
const { sessions: sessions2 } = await import("./index-
|
|
810
|
-
const { config: appConfig } = await import("./index-
|
|
814
|
+
const { runTargetedPentestAgent } = await import("./targetedPentest-s1ptvq8e.js");
|
|
815
|
+
const { sessions: sessions2 } = await import("./index-sf16jm0m.js");
|
|
816
|
+
const { config: appConfig } = await import("./index-y5w6n3tb.js");
|
|
811
817
|
const target = getArgRequired("--target");
|
|
812
818
|
const objectives = getAllArgs("--objective");
|
|
813
819
|
const pensarConfig = await appConfig.get();
|
|
@@ -857,10 +863,10 @@ POCs: ${pocsPath}`);
|
|
|
857
863
|
process.exit(0);
|
|
858
864
|
}
|
|
859
865
|
async function runThreatModel() {
|
|
860
|
-
const { config } = await import("./main-
|
|
866
|
+
const { config } = await import("./main-mmjp338j.js").then((m)=>__toESM(m.default,1));
|
|
861
867
|
config();
|
|
862
|
-
const { runThreatModelWorkflow } = await import("./threatModel-
|
|
863
|
-
const { config: appConfig } = await import("./index-
|
|
868
|
+
const { runThreatModelWorkflow } = await import("./threatModel-xsm6fwk5.js");
|
|
869
|
+
const { config: appConfig } = await import("./index-y5w6n3tb.js");
|
|
864
870
|
const path2 = await import("path");
|
|
865
871
|
const pensarConfig = await appConfig.get();
|
|
866
872
|
const model = await resolveCliModel();
|
|
@@ -894,16 +900,16 @@ ${sep}
|
|
|
894
900
|
Threat model written to: ${resolvedPath}`);
|
|
895
901
|
}
|
|
896
902
|
async function runOperator() {
|
|
897
|
-
const { config } = await import("./main-
|
|
903
|
+
const { config } = await import("./main-mmjp338j.js").then((m)=>__toESM(m.default,1));
|
|
898
904
|
config();
|
|
899
|
-
const { runOffensiveSecurityAgent } = await import("./offesecAgent-
|
|
900
|
-
const { sessions: sessions2, normalizeMessages, getResumeMessages } = await import("./index-
|
|
901
|
-
const { ALL_TOOL_NAMES, SKILL_TOOL_NAMES } = await import("./index-
|
|
902
|
-
const { config: appConfig } = await import("./index-
|
|
905
|
+
const { runOffensiveSecurityAgent } = await import("./offesecAgent-b9e2xm6v.js");
|
|
906
|
+
const { sessions: sessions2, normalizeMessages, getResumeMessages } = await import("./index-sf16jm0m.js");
|
|
907
|
+
const { ALL_TOOL_NAMES, SKILL_TOOL_NAMES } = await import("./index-hqjdg6fg.js");
|
|
908
|
+
const { config: appConfig } = await import("./index-y5w6n3tb.js");
|
|
903
909
|
const { createInterface } = await import("readline");
|
|
904
910
|
const { readFileSync: readFileSync2, existsSync } = await import("fs");
|
|
905
911
|
const path2 = await import("path");
|
|
906
|
-
const { stepCountIs } = await import("./index-
|
|
912
|
+
const { stepCountIs } = await import("./index-mtq7kmxz.js");
|
|
907
913
|
const promptRaw = getArg("-p") ?? getArg("--prompt");
|
|
908
914
|
if (!promptRaw) {
|
|
909
915
|
console.error("Error: -p <prompt> is required");
|
|
@@ -1013,35 +1019,35 @@ if (hasFlag("-p") || command === "--prompt") {
|
|
|
1013
1019
|
await runTargetedPentest();
|
|
1014
1020
|
} else if (command === "login" || command === "auth") {
|
|
1015
1021
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1016
|
-
await import("./auth-
|
|
1022
|
+
await import("./auth-z3h9859n.js");
|
|
1017
1023
|
} else if (command === "uninstall") {
|
|
1018
1024
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1019
|
-
await import("./uninstall-
|
|
1025
|
+
await import("./uninstall-tvsh81v8.js");
|
|
1020
1026
|
} else if (command === "apps") {
|
|
1021
1027
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1022
|
-
await import("./apps-
|
|
1028
|
+
await import("./apps-17wvz1d7.js");
|
|
1023
1029
|
} else if (command === "pentests") {
|
|
1024
1030
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1025
|
-
await import("./pentests-
|
|
1031
|
+
await import("./pentests-6ks3szc4.js");
|
|
1026
1032
|
} else if (command === "targets") {
|
|
1027
1033
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1028
|
-
await import("./targets-
|
|
1034
|
+
await import("./targets-sxygyj87.js");
|
|
1029
1035
|
} else if (command === "issues") {
|
|
1030
1036
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1031
|
-
await import("./issues-
|
|
1037
|
+
await import("./issues-xx5bs4md.js");
|
|
1032
1038
|
} else if (command === "fixes") {
|
|
1033
1039
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1034
|
-
await import("./fixes-
|
|
1040
|
+
await import("./fixes-b89s5haw.js");
|
|
1035
1041
|
} else if (command === "logs") {
|
|
1036
1042
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1037
|
-
await import("./logs-
|
|
1043
|
+
await import("./logs-qtxe51w2.js");
|
|
1038
1044
|
} else if (command === "config") {
|
|
1039
1045
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
1040
|
-
await import("./config-
|
|
1046
|
+
await import("./config-f1mj4nhd.js");
|
|
1041
1047
|
} else if (command === "threat-model") {
|
|
1042
1048
|
await runThreatModel();
|
|
1043
1049
|
} else if (command === "doctor") {
|
|
1044
|
-
const { runDoctor } = await import("./doctor-
|
|
1050
|
+
const { runDoctor } = await import("./doctor-ekneewa3.js");
|
|
1045
1051
|
await runDoctor();
|
|
1046
1052
|
} else if (args.length === 0) {
|
|
1047
1053
|
if (process.env.PENSAR_NO_TUI === "1") {
|
|
@@ -1049,7 +1055,7 @@ if (hasFlag("-p") || command === "--prompt") {
|
|
|
1049
1055
|
console.error("All other commands work with Node \u2014 run 'pensar --help'.");
|
|
1050
1056
|
process.exit(1);
|
|
1051
1057
|
}
|
|
1052
|
-
await import("./index-
|
|
1058
|
+
await import("./index-6d22pyxt.js");
|
|
1053
1059
|
} else {
|
|
1054
1060
|
console.error(`Error: Unknown command '${command}'`);
|
|
1055
1061
|
console.error();
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
formatParseError,
|
|
8
8
|
parseHeaderLine,
|
|
9
9
|
parseHeadersFromFile
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-dm0fc0bm.js";
|
|
11
11
|
import {
|
|
12
12
|
config,
|
|
13
13
|
init_config
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
14
|
+
} from "./cli-72cvcqhg.js";
|
|
15
|
+
import"./cli-9rhzhgx2.js";
|
|
16
|
+
import"./cli-vnynf0js.js";
|
|
17
|
+
import"./cli-bc05qbss.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/config.ts
|
|
20
20
|
init_config();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolExists
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
3
|
+
} from "./cli-tznv8pf1.js";
|
|
4
|
+
import"./cli-tkc598ey.js";
|
|
5
|
+
import"./cli-0n4r54hq.js";
|
|
6
|
+
import"./cli-swpbx60z.js";
|
|
7
|
+
import"./cli-j54qa6tm.js";
|
|
8
|
+
import"./cli-72cvcqhg.js";
|
|
9
|
+
import"./cli-9rhzhgx2.js";
|
|
10
|
+
import"./cli-vnynf0js.js";
|
|
11
|
+
import"./cli-bc05qbss.js";
|
|
12
12
|
|
|
13
13
|
// src/core/doctor.ts
|
|
14
14
|
import { execSync, spawnSync } from "node:child_process";
|
|
@@ -50,6 +50,7 @@ function checkApiKeys() {
|
|
|
50
50
|
{ provider: "OpenAI", env: "OPENAI_API_KEY" },
|
|
51
51
|
{ provider: "Google", env: "GOOGLE_GENERATIVE_AI_API_KEY" },
|
|
52
52
|
{ provider: "OpenRouter", env: "OPENROUTER_API_KEY" },
|
|
53
|
+
{ provider: "Concentrate", env: "CONCENTRATE_API_KEY" },
|
|
53
54
|
{ provider: "AWS Bedrock", env: "BEDROCK_API_KEY" },
|
|
54
55
|
{ provider: "AWS IAM", env: "AWS_ACCESS_KEY_ID" },
|
|
55
56
|
{ provider: "vLLM (local)", env: "LOCAL_MODEL_URL" }
|
|
@@ -4,29 +4,29 @@ import {
|
|
|
4
4
|
buildPentestReport,
|
|
5
5
|
renderJson,
|
|
6
6
|
renderMarkdown
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-b1adytsy.js";
|
|
8
8
|
import"./cli-9fsre5pt.js";
|
|
9
|
-
import"./cli-
|
|
9
|
+
import"./cli-qqt4gj1w.js";
|
|
10
10
|
import {
|
|
11
11
|
FindingsRegistry,
|
|
12
12
|
OffensiveSecurityAgent
|
|
13
|
-
} from "./cli-
|
|
14
|
-
import"./cli-
|
|
13
|
+
} from "./cli-repbyhkk.js";
|
|
14
|
+
import"./cli-tznv8pf1.js";
|
|
15
15
|
import {
|
|
16
16
|
createThreatModelPrompt
|
|
17
17
|
} from "./cli-fw5r7pfj.js";
|
|
18
18
|
import"./cli-c8131c4q.js";
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
19
|
+
import"./cli-tkc598ey.js";
|
|
20
|
+
import"./cli-0n4r54hq.js";
|
|
21
21
|
import {
|
|
22
22
|
exports_external,
|
|
23
23
|
init_zod
|
|
24
|
-
} from "./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
24
|
+
} from "./cli-swpbx60z.js";
|
|
25
|
+
import"./cli-j54qa6tm.js";
|
|
26
|
+
import"./cli-72cvcqhg.js";
|
|
27
|
+
import"./cli-9rhzhgx2.js";
|
|
28
|
+
import"./cli-vnynf0js.js";
|
|
29
|
+
import"./cli-bc05qbss.js";
|
|
30
30
|
|
|
31
31
|
// src/core/workflows/fastStrike.ts
|
|
32
32
|
init_zod();
|
|
@@ -42,14 +42,15 @@ Run this loop, tightly:
|
|
|
42
42
|
|
|
43
43
|
1. OBSERVE — Read every response for signal before you act. Note the stack, headers, cookies, tokens, form fields, error messages, redirects, disabled controls, ID patterns. State what you just learned in one line before the next move.
|
|
44
44
|
2. HYPOTHESIZE — From that signal and your deep knowledge of web/app vulnerability classes, name the single most likely vulnerability and why the evidence points to it. Rank leads by signal strength and go for the strongest first. A disabled form field, an ID in a URL or JWT, advertised demo creds, an exposed schema — these are tells; read them.
|
|
45
|
-
3. ACT — Test that one hypothesis with the
|
|
45
|
+
3. ACT — Test that one hypothesis with the strongest available technique. Use direct tools for quick probes, but treat the shell as a working environment rather than merely a way to issue one-off commands. When the work becomes stateful, repetitive, concurrent, protocol-heavy, or multi-stage, externalize it into an editable script in the session scratchpad directory identified in the workspace instructions. Never create a scratchpad/ directory inside the target repository. Run the script, inspect the results, modify it, and rerun it as the attack develops.
|
|
46
46
|
4. PRUNE — If the evidence disproves a lead, drop it and move to the next-strongest. Do NOT re-run a disproven approach or grind a dead end. Do NOT enumerate, brute-force, or run wordlists unless a specific signal demands it — choose techniques from evidence, not from a checklist.
|
|
47
|
-
5. EXPLOIT — When a vulnerability is confirmed, exploit it: capture the flag, extract the sensitive data, and pivot through it if the objective requires more.
|
|
48
|
-
6. DOCUMENT & FINISH — Record each confirmed vulnerability with the document_vulnerability tool as you go.
|
|
47
|
+
5. EXPLOIT — When a vulnerability is confirmed, exploit it: capture the flag, extract the sensitive data, and pivot through it if the objective requires more. Preserve viable primitives and build on them. Prefer extending a working script into an end-to-end exploit over rebuilding the chain with repeated one-off tool calls or stopping at the next network or protocol boundary.
|
|
48
|
+
6. DOCUMENT & FINISH — Record each confirmed vulnerability with the document_vulnerability tool as you go. Before concluding that every credible lead is exhausted, account for each viable primitive and pursue any concrete path that could still close the objective. After this check, whether the objective was met or every credible lead was genuinely exhausted, call the response tool with the correct solved value and a concise summary.
|
|
49
49
|
|
|
50
50
|
Rules:
|
|
51
51
|
- You are one operator. Plan in your head and in short text notes — never via planning tools, task lists, or sub-agents.
|
|
52
52
|
- Recon and exploitation are the same loop. Do just enough recon to form the first hypothesis, then start testing. Do not map the entire surface before acting.
|
|
53
|
+
- Spend your reasoning on choosing techniques and interpreting evidence; use scripts for deterministic mechanics, iteration, and chain execution.
|
|
53
54
|
- Bias toward the shortest path that proves impact. Speed comes from picking the right lead, not from skipping verification — always confirm a finding before you claim it.
|
|
54
55
|
- Stay in scope. Only touch the target you were given and hosts it legitimately depends on.`;
|
|
55
56
|
async function runFastStrike(input) {
|
|
@@ -121,7 +122,25 @@ ${combined}` : combined;
|
|
|
121
122
|
enableThinking,
|
|
122
123
|
openAIReasoningEffort
|
|
123
124
|
});
|
|
124
|
-
|
|
125
|
+
eventBus?.emit("subagent-spawn", {
|
|
126
|
+
subagentId: "fast-strike",
|
|
127
|
+
name: "Fast Strike",
|
|
128
|
+
input: { target }
|
|
129
|
+
});
|
|
130
|
+
let strikeResult;
|
|
131
|
+
try {
|
|
132
|
+
strikeResult = await agent.consume();
|
|
133
|
+
eventBus?.emit("subagent-complete", {
|
|
134
|
+
subagentId: "fast-strike",
|
|
135
|
+
status: "completed"
|
|
136
|
+
});
|
|
137
|
+
} catch (e) {
|
|
138
|
+
eventBus?.emit("subagent-complete", {
|
|
139
|
+
subagentId: "fast-strike",
|
|
140
|
+
status: "failed"
|
|
141
|
+
});
|
|
142
|
+
throw e;
|
|
143
|
+
}
|
|
125
144
|
if (abortSignal?.aborted) {
|
|
126
145
|
throw new DOMException("Pentest aborted by user", "AbortError");
|
|
127
146
|
}
|
|
@@ -152,5 +171,6 @@ ${combined}` : combined;
|
|
|
152
171
|
};
|
|
153
172
|
}
|
|
154
173
|
export {
|
|
174
|
+
FAST_STRIKE_SYSTEM_PROMPT,
|
|
155
175
|
runFastStrike
|
|
156
176
|
};
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getFix,
|
|
4
4
|
listFixes
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
5
|
+
} from "./cli-vq52kp7j.js";
|
|
6
|
+
import"./cli-5k33webc.js";
|
|
7
|
+
import"./cli-gq40s5b3.js";
|
|
8
|
+
import"./cli-b1adytsy.js";
|
|
9
|
+
import"./cli-mavved45.js";
|
|
10
|
+
import"./cli-xshasbwe.js";
|
|
11
|
+
import"./cli-32z0017y.js";
|
|
12
|
+
import"./cli-k8kc47pq.js";
|
|
13
13
|
import"./cli-9fsre5pt.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
14
|
+
import"./cli-qqt4gj1w.js";
|
|
15
|
+
import"./cli-repbyhkk.js";
|
|
16
|
+
import"./cli-tznv8pf1.js";
|
|
17
17
|
import"./cli-fw5r7pfj.js";
|
|
18
18
|
import"./cli-c8131c4q.js";
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
26
|
-
import"./cli-
|
|
19
|
+
import"./cli-tkc598ey.js";
|
|
20
|
+
import"./cli-0n4r54hq.js";
|
|
21
|
+
import"./cli-swpbx60z.js";
|
|
22
|
+
import"./cli-j54qa6tm.js";
|
|
23
|
+
import"./cli-72cvcqhg.js";
|
|
24
|
+
import"./cli-9rhzhgx2.js";
|
|
25
|
+
import"./cli-vnynf0js.js";
|
|
26
|
+
import"./cli-bc05qbss.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/fixes.ts
|
|
29
29
|
function showHelp() {
|
|
@@ -14,26 +14,26 @@ import {
|
|
|
14
14
|
signGatewayRequest,
|
|
15
15
|
startDeviceFlow,
|
|
16
16
|
validateGateway
|
|
17
|
-
} from "./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
17
|
+
} from "./cli-0n4r54hq.js";
|
|
18
|
+
import"./cli-72cvcqhg.js";
|
|
19
|
+
import"./cli-9rhzhgx2.js";
|
|
20
|
+
import"./cli-vnynf0js.js";
|
|
21
|
+
import"./cli-bc05qbss.js";
|
|
22
22
|
init_auth();
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
startDeviceFlow,
|
|
27
|
-
signGatewayRequest,
|
|
28
|
-
selectWorkspace,
|
|
29
|
-
pollWorkspaceSelection,
|
|
30
|
-
pollWorkOSToken,
|
|
31
|
-
pollLegacyToken,
|
|
32
|
-
pollForWorkspaceCreation,
|
|
33
|
-
isTokenExpired,
|
|
34
|
-
isConnected,
|
|
35
|
-
fetchWorkspaces,
|
|
36
|
-
ensureValidToken,
|
|
25
|
+
createWorkspaceSelection,
|
|
37
26
|
disconnect,
|
|
38
|
-
|
|
27
|
+
ensureValidToken,
|
|
28
|
+
fetchWorkspaces,
|
|
29
|
+
isConnected,
|
|
30
|
+
isTokenExpired,
|
|
31
|
+
pollForWorkspaceCreation,
|
|
32
|
+
pollLegacyToken,
|
|
33
|
+
pollWorkOSToken,
|
|
34
|
+
pollWorkspaceSelection,
|
|
35
|
+
selectWorkspace,
|
|
36
|
+
signGatewayRequest,
|
|
37
|
+
startDeviceFlow,
|
|
38
|
+
validateGateway
|
|
39
39
|
};
|