@pensar/apex 2.4.0 → 2.5.0-canary.c20fe7ed
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-nhs1w5w0.js → agent-1e2wj9z8.js} +11 -10
- package/build/agent-45hqpjke.js +20 -0
- package/build/{agent-5ejt5vpz.js → agent-6z92j5sh.js} +9 -8
- package/build/{apps-17wvz1d7.js → apps-ndg4qp8t.js} +72 -31
- package/build/{auth-z3h9859n.js → auth-z6emgx61.js} +25 -20
- package/build/authentication-gqmrgkqt.js +20 -0
- package/build/blackboxAgent-sg4gt9t9.js +20 -0
- package/build/blackboxPentest-0nr9742k.js +70 -0
- package/build/{cli-xshasbwe.js → cli-1hkxhyef.js} +30 -4
- package/build/{cli-tznv8pf1.js → cli-1q3vervd.js} +1 -1
- package/build/{cli-5k33webc.js → cli-3a5hy1r3.js} +45 -43
- package/build/{cli-0n4r54hq.js → cli-3b3teb1m.js} +1 -1
- package/build/{cli-qqt4gj1w.js → cli-3x1y9yk0.js} +5 -3
- package/build/{cli-b1adytsy.js → cli-4zm8sx6f.js} +28 -5
- package/build/cli-53rm0rrz.js +15 -0
- package/build/{cli-vnynf0js.js → cli-5ynht461.js} +10 -4
- package/build/cli-68260ckj.js +12136 -0
- package/build/{cli-repbyhkk.js → cli-6grv9k35.js} +1141 -525
- package/build/cli-7q3ae3ft.js +6 -0
- package/build/cli-9pbk8m32.js +32 -0
- package/build/{cli-swpbx60z.js → cli-avmhkjtv.js} +1 -1481
- package/build/{cli-tkc598ey.js → cli-bxhaqp8w.js} +388 -275
- package/build/{cli-mavved45.js → cli-cg3s2en9.js} +46 -25
- package/build/{cli-2cbwdk78.js → cli-d6r1rfde.js} +1 -1
- package/build/{cli-32z0017y.js → cli-jgd1gxnf.js} +2 -2
- package/build/{cli-9rhzhgx2.js → cli-jq2yh557.js} +1 -1
- package/build/cli-knd276ed.js +1485 -0
- package/build/{cli-gq40s5b3.js → cli-whyqn949.js} +5 -3
- package/build/{cli-72cvcqhg.js → cli-y9mjgfsd.js} +1 -1
- package/build/{cli-k8kc47pq.js → cli-ygm0ygzg.js} +3 -3
- package/build/{cli-vq52kp7j.js → cli-zgda61x2.js} +23 -5
- package/build/cli.js +641 -95
- package/build/{config-f1mj4nhd.js → config-rqdae6vq.js} +18 -15
- package/build/{doctor-ekneewa3.js → doctor-kqe55h5e.js} +8 -7
- package/build/{fastStrike-8zka43xs.js → fastStrike-0e8b4ghw.js} +13 -10
- package/build/{fixes-b89s5haw.js → fixes-x4f12cf3.js} +25 -20
- package/build/getMachineId-bsd-xj3bn2fv.js +36 -0
- package/build/getMachineId-darwin-07jzjcx6.js +36 -0
- package/build/getMachineId-linux-ahngynxd.js +29 -0
- package/build/getMachineId-unsupported-vy43b44z.js +19 -0
- package/build/getMachineId-win-8x66cynz.js +38 -0
- package/build/{index-ghwf5z3v.js → index-208mcw9a.js} +3 -3
- package/build/{index-mtq7kmxz.js → index-5wh7gq37.js} +4 -2
- package/build/{index-4ad3sdwk.js → index-8cr4w2bp.js} +4 -4
- package/build/{index-y5w6n3tb.js → index-e3x6d0hy.js} +2 -2
- package/build/{index-rbzhk712.js → index-qh7c3nbg.js} +11 -10
- package/build/{index-sf16jm0m.js → index-rvb8b0hh.js} +9 -7
- package/build/{index-6d22pyxt.js → index-tb06da9e.js} +1756 -1213
- package/build/{index-hqjdg6fg.js → index-xb71f7d3.js} +17 -9
- package/build/{issues-xx5bs4md.js → issues-jj265r5t.js} +82 -26
- package/build/{logs-qtxe51w2.js → logs-sbb23gj9.js} +25 -20
- package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-vzbv0qbm.js} +10 -9
- package/build/pentest-3qtct2r2.js +30 -0
- package/build/{pentests-6ks3szc4.js → pentests-411n0vfk.js} +26 -21
- package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-t1rw5cdc.js} +11 -10
- package/build/{targets-sxygyj87.js → targets-d8d0z2f8.js} +27 -22
- package/build/threatModel-qwmbj242.js +29 -0
- package/build/{uninstall-tvsh81v8.js → uninstall-65bc2d02.js} +6 -3
- package/build/{upload-7wdyyqmr.js → upload-52x1r3py.js} +8 -7
- package/build/{utils-7fwdkqk6.js → utils-cye50fn6.js} +7 -6
- package/package.json +8 -2
- package/build/agent-mvpgvgks.js +0 -19
- package/build/authentication-3s97cpk4.js +0 -19
- package/build/blackboxAgent-gw0a1ca4.js +0 -19
- package/build/blackboxPentest-44333zss.js +0 -37
- package/build/main-mmjp338j.js +0 -324
- package/build/pentest-xtc1sjdw.js +0 -29
- package/build/threatModel-xsm6fwk5.js +0 -27
|
@@ -5,19 +5,20 @@ import {
|
|
|
5
5
|
buildPentestPrompt,
|
|
6
6
|
buildPentestSystemPrompt,
|
|
7
7
|
resolvePentestAgentRole
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-cg3s2en9.js";
|
|
9
9
|
import"./cli-9fsre5pt.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
import"./cli-3x1y9yk0.js";
|
|
11
|
+
import"./cli-6grv9k35.js";
|
|
12
|
+
import"./cli-1q3vervd.js";
|
|
13
13
|
import"./cli-c8131c4q.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
14
|
+
import"./cli-bxhaqp8w.js";
|
|
15
|
+
import"./cli-3b3teb1m.js";
|
|
16
|
+
import"./cli-avmhkjtv.js";
|
|
17
17
|
import"./cli-j54qa6tm.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-y9mjgfsd.js";
|
|
19
|
+
import"./cli-jq2yh557.js";
|
|
20
|
+
import"./cli-5ynht461.js";
|
|
21
|
+
import"./cli-knd276ed.js";
|
|
21
22
|
import"./cli-bc05qbss.js";
|
|
22
23
|
export {
|
|
23
24
|
PentestResponseSchema,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent
|
|
3
|
+
} from "./cli-jgd1gxnf.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-3x1y9yk0.js";
|
|
6
|
+
import"./cli-6grv9k35.js";
|
|
7
|
+
import"./cli-1q3vervd.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-bxhaqp8w.js";
|
|
10
|
+
import"./cli-3b3teb1m.js";
|
|
11
|
+
import"./cli-avmhkjtv.js";
|
|
12
|
+
import"./cli-j54qa6tm.js";
|
|
13
|
+
import"./cli-y9mjgfsd.js";
|
|
14
|
+
import"./cli-jq2yh557.js";
|
|
15
|
+
import"./cli-5ynht461.js";
|
|
16
|
+
import"./cli-knd276ed.js";
|
|
17
|
+
import"./cli-bc05qbss.js";
|
|
18
|
+
export {
|
|
19
|
+
CodeAgent
|
|
20
|
+
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-6grv9k35.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-1q3vervd.js";
|
|
7
7
|
import"./cli-c8131c4q.js";
|
|
8
8
|
import {
|
|
9
9
|
init_dist,
|
|
10
10
|
stepCountIs
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-bxhaqp8w.js";
|
|
12
|
+
import"./cli-3b3teb1m.js";
|
|
13
13
|
import {
|
|
14
14
|
exports_external,
|
|
15
15
|
init_zod
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-avmhkjtv.js";
|
|
17
17
|
import"./cli-j54qa6tm.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-y9mjgfsd.js";
|
|
19
|
+
import"./cli-jq2yh557.js";
|
|
20
|
+
import"./cli-5ynht461.js";
|
|
21
|
+
import"./cli-knd276ed.js";
|
|
21
22
|
import"./cli-bc05qbss.js";
|
|
22
23
|
|
|
23
24
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
@@ -1,38 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
2
|
+
import {
|
|
3
|
+
markCommandFailed
|
|
4
|
+
} from "./cli-7q3ae3ft.js";
|
|
5
|
+
import"./cli-zgda61x2.js";
|
|
6
|
+
import"./cli-9pbk8m32.js";
|
|
7
|
+
import"./cli-3a5hy1r3.js";
|
|
8
|
+
import"./cli-ygm0ygzg.js";
|
|
9
|
+
import"./cli-whyqn949.js";
|
|
10
|
+
import"./cli-cg3s2en9.js";
|
|
11
|
+
import"./cli-4zm8sx6f.js";
|
|
12
|
+
import"./cli-1hkxhyef.js";
|
|
13
|
+
import"./cli-jgd1gxnf.js";
|
|
10
14
|
import"./cli-9fsre5pt.js";
|
|
11
|
-
import"./cli-
|
|
15
|
+
import"./cli-3x1y9yk0.js";
|
|
12
16
|
import {
|
|
17
|
+
ENDPOINT_TRANSPORTS,
|
|
13
18
|
createApp,
|
|
19
|
+
createDomain,
|
|
14
20
|
createEndpoint,
|
|
15
21
|
deleteApp,
|
|
16
22
|
deleteEndpoint,
|
|
17
23
|
getApp,
|
|
18
24
|
getEndpoint,
|
|
19
25
|
listApps,
|
|
26
|
+
listDomains,
|
|
20
27
|
listEndpoints,
|
|
21
28
|
searchApps,
|
|
22
29
|
searchEndpoints,
|
|
23
30
|
updateApp,
|
|
24
31
|
updateEndpoint
|
|
25
|
-
} from "./cli-
|
|
26
|
-
import"./cli-
|
|
32
|
+
} from "./cli-6grv9k35.js";
|
|
33
|
+
import"./cli-1q3vervd.js";
|
|
27
34
|
import"./cli-fw5r7pfj.js";
|
|
28
35
|
import"./cli-c8131c4q.js";
|
|
29
|
-
import"./cli-
|
|
30
|
-
import"./cli-
|
|
31
|
-
import"./cli-
|
|
36
|
+
import"./cli-bxhaqp8w.js";
|
|
37
|
+
import"./cli-3b3teb1m.js";
|
|
38
|
+
import"./cli-avmhkjtv.js";
|
|
32
39
|
import"./cli-j54qa6tm.js";
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
35
|
-
import"./cli-
|
|
40
|
+
import"./cli-y9mjgfsd.js";
|
|
41
|
+
import"./cli-jq2yh557.js";
|
|
42
|
+
import"./cli-5ynht461.js";
|
|
43
|
+
import"./cli-knd276ed.js";
|
|
36
44
|
import"./cli-bc05qbss.js";
|
|
37
45
|
|
|
38
46
|
// src/cli/apps.ts
|
|
@@ -88,6 +96,14 @@ function parseEndpointType(value) {
|
|
|
88
96
|
}
|
|
89
97
|
return value;
|
|
90
98
|
}
|
|
99
|
+
function parseTransport(value) {
|
|
100
|
+
if (value === undefined)
|
|
101
|
+
return;
|
|
102
|
+
if (!ENDPOINT_TRANSPORTS.includes(value)) {
|
|
103
|
+
throw new Error(`Invalid --transport "${value}". Must be one of: ${ENDPOINT_TRANSPORTS.join(", ")}`);
|
|
104
|
+
}
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
91
107
|
function parseInteger(flag, value) {
|
|
92
108
|
if (value === undefined)
|
|
93
109
|
return;
|
|
@@ -117,6 +133,8 @@ Usage:
|
|
|
117
133
|
pensar apps create [options] Create an app
|
|
118
134
|
pensar apps update <appId> [options] Update an app
|
|
119
135
|
pensar apps delete <appId> Delete an app
|
|
136
|
+
pensar apps domains List workspace domains
|
|
137
|
+
pensar apps domain-create <domain> Create/resolve a domain
|
|
120
138
|
pensar apps endpoints <appId> [filters] List endpoints
|
|
121
139
|
pensar apps endpoint <endpointId> Show endpoint details
|
|
122
140
|
pensar apps endpoint-create <appId> [options] Create an endpoint
|
|
@@ -130,9 +148,13 @@ App fields (create requires --name and --description):
|
|
|
130
148
|
--description <text> Application description
|
|
131
149
|
--type <type> One of: ${APPLICATION_TYPES.join(", ")}
|
|
132
150
|
--framework <text> Framework / runtime hint
|
|
133
|
-
--domain <id> Linked domain UUID
|
|
151
|
+
--domain <id> Linked domain UUID (see "apps domains")
|
|
134
152
|
--disallowed-actions <text> Free-form disallowed actions notes
|
|
135
153
|
|
|
154
|
+
Domains:
|
|
155
|
+
API-created domains are canonicalized and created idempotently by Console.
|
|
156
|
+
They stay unverified and do not start reconnaissance.
|
|
157
|
+
|
|
136
158
|
List pagination (for "apps" and "endpoints <appId>"):
|
|
137
159
|
--limit <n> Page size (default 100, max 200)
|
|
138
160
|
--offset <n> Page offset (default 0)
|
|
@@ -158,6 +180,8 @@ Endpoint fields (create requires --endpoint and --description):
|
|
|
158
180
|
--endpoint <text> Endpoint path / URL / route
|
|
159
181
|
--description <text> Endpoint description
|
|
160
182
|
--type <type> One of: ${ENDPOINT_TYPES.join(", ")}
|
|
183
|
+
--transport <transport> One of: ${ENDPOINT_TRANSPORTS.join(", ")}
|
|
184
|
+
(defaults to http when omitted)
|
|
161
185
|
--location <text> Source file (whitebox)
|
|
162
186
|
--start-line <n> Start line number
|
|
163
187
|
--end-line <n> End line number
|
|
@@ -235,6 +259,7 @@ function parseEndpointCreateOptions(argv) {
|
|
|
235
259
|
if (description === undefined)
|
|
236
260
|
throw new Error("--description is required");
|
|
237
261
|
const type = parseEndpointType(getFlag("--type", argv));
|
|
262
|
+
const transport = parseTransport(getFlag("--transport", argv));
|
|
238
263
|
const location = getFlag("--location", argv);
|
|
239
264
|
const startLineNumber = parseInteger("--start-line", getFlag("--start-line", argv));
|
|
240
265
|
const endLineNumber = parseInteger("--end-line", getFlag("--end-line", argv));
|
|
@@ -246,6 +271,7 @@ function parseEndpointCreateOptions(argv) {
|
|
|
246
271
|
endpoint,
|
|
247
272
|
description,
|
|
248
273
|
...type !== undefined ? { type } : {},
|
|
274
|
+
...transport !== undefined ? { transport } : {},
|
|
249
275
|
...location !== undefined ? { location } : {},
|
|
250
276
|
...startLineNumber !== undefined ? { startLineNumber } : {},
|
|
251
277
|
...endLineNumber !== undefined ? { endLineNumber } : {},
|
|
@@ -269,6 +295,9 @@ function parseEndpointUpdateOptions(argv) {
|
|
|
269
295
|
const type = parseEndpointType(getFlag("--type", argv));
|
|
270
296
|
if (type !== undefined)
|
|
271
297
|
update.type = type;
|
|
298
|
+
const transport = parseTransport(getFlag("--transport", argv));
|
|
299
|
+
if (transport !== undefined)
|
|
300
|
+
update.transport = transport;
|
|
272
301
|
const location = getFlag("--location", argv);
|
|
273
302
|
if (location !== undefined)
|
|
274
303
|
update.location = location;
|
|
@@ -305,7 +334,7 @@ async function main() {
|
|
|
305
334
|
if (!appId) {
|
|
306
335
|
console.error("Error: app ID is required");
|
|
307
336
|
console.error("Usage: pensar apps get <appId>");
|
|
308
|
-
|
|
337
|
+
return markCommandFailed();
|
|
309
338
|
}
|
|
310
339
|
const app = await getApp(appId);
|
|
311
340
|
console.log(JSON.stringify(app, null, 2));
|
|
@@ -318,7 +347,7 @@ async function main() {
|
|
|
318
347
|
if (!appId) {
|
|
319
348
|
console.error("Error: app ID is required");
|
|
320
349
|
console.error("Usage: pensar apps update <appId> [options]");
|
|
321
|
-
|
|
350
|
+
return markCommandFailed();
|
|
322
351
|
}
|
|
323
352
|
const opts = parseAppUpdateOptions(args);
|
|
324
353
|
const result = await updateApp(appId, opts);
|
|
@@ -328,16 +357,28 @@ async function main() {
|
|
|
328
357
|
if (!appId) {
|
|
329
358
|
console.error("Error: app ID is required");
|
|
330
359
|
console.error("Usage: pensar apps delete <appId>");
|
|
331
|
-
|
|
360
|
+
return markCommandFailed();
|
|
332
361
|
}
|
|
333
362
|
const result = await deleteApp(appId);
|
|
334
363
|
console.log(JSON.stringify(result, null, 2));
|
|
364
|
+
} else if (sub === "domains") {
|
|
365
|
+
const result = await listDomains();
|
|
366
|
+
console.log(JSON.stringify(result, null, 2));
|
|
367
|
+
} else if (sub === "domain-create") {
|
|
368
|
+
const url = args[1];
|
|
369
|
+
if (!url) {
|
|
370
|
+
console.error("Error: domain is required");
|
|
371
|
+
console.error("Usage: pensar apps domain-create <domain>");
|
|
372
|
+
return markCommandFailed();
|
|
373
|
+
}
|
|
374
|
+
const result = await createDomain({ url });
|
|
375
|
+
console.log(JSON.stringify(result, null, 2));
|
|
335
376
|
} else if (sub === "endpoints") {
|
|
336
377
|
const appId = args[1];
|
|
337
378
|
if (!appId) {
|
|
338
379
|
console.error("Error: app ID is required");
|
|
339
380
|
console.error("Usage: pensar apps endpoints <appId> [filters]");
|
|
340
|
-
|
|
381
|
+
return markCommandFailed();
|
|
341
382
|
}
|
|
342
383
|
const type = parseEndpointType(getFlag("--type", args));
|
|
343
384
|
const minRiskScore = parseNumber("--min-risk", getFlag("--min-risk", args));
|
|
@@ -356,7 +397,7 @@ async function main() {
|
|
|
356
397
|
if (!endpointId) {
|
|
357
398
|
console.error("Error: endpoint ID is required");
|
|
358
399
|
console.error("Usage: pensar apps endpoint <endpointId>");
|
|
359
|
-
|
|
400
|
+
return markCommandFailed();
|
|
360
401
|
}
|
|
361
402
|
const result = await getEndpoint(endpointId);
|
|
362
403
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -365,7 +406,7 @@ async function main() {
|
|
|
365
406
|
if (!appId) {
|
|
366
407
|
console.error("Error: app ID is required");
|
|
367
408
|
console.error("Usage: pensar apps endpoint-create <appId> --endpoint E --description D");
|
|
368
|
-
|
|
409
|
+
return markCommandFailed();
|
|
369
410
|
}
|
|
370
411
|
const opts = parseEndpointCreateOptions(args);
|
|
371
412
|
const result = await createEndpoint(appId, opts);
|
|
@@ -375,7 +416,7 @@ async function main() {
|
|
|
375
416
|
if (!endpointId) {
|
|
376
417
|
console.error("Error: endpoint ID is required");
|
|
377
418
|
console.error("Usage: pensar apps endpoint-update <endpointId> [options]");
|
|
378
|
-
|
|
419
|
+
return markCommandFailed();
|
|
379
420
|
}
|
|
380
421
|
const opts = parseEndpointUpdateOptions(args);
|
|
381
422
|
const result = await updateEndpoint(endpointId, opts);
|
|
@@ -385,7 +426,7 @@ async function main() {
|
|
|
385
426
|
if (!endpointId) {
|
|
386
427
|
console.error("Error: endpoint ID is required");
|
|
387
428
|
console.error("Usage: pensar apps endpoint-delete <endpointId>");
|
|
388
|
-
|
|
429
|
+
return markCommandFailed();
|
|
389
430
|
}
|
|
390
431
|
const result = await deleteEndpoint(endpointId);
|
|
391
432
|
console.log(JSON.stringify(result, null, 2));
|
|
@@ -394,7 +435,7 @@ async function main() {
|
|
|
394
435
|
if (!query || query.startsWith("--")) {
|
|
395
436
|
console.error("Error: search query is required");
|
|
396
437
|
console.error("Usage: pensar apps search <query> [options]");
|
|
397
|
-
|
|
438
|
+
return markCommandFailed();
|
|
398
439
|
}
|
|
399
440
|
const type = parseAppType(getFlag("--type", args));
|
|
400
441
|
const limit = parseInteger("--limit", getFlag("--limit", args));
|
|
@@ -410,7 +451,7 @@ async function main() {
|
|
|
410
451
|
if (!query || query.startsWith("--")) {
|
|
411
452
|
console.error("Error: search query is required");
|
|
412
453
|
console.error("Usage: pensar apps search-endpoints <query> [options]");
|
|
413
|
-
|
|
454
|
+
return markCommandFailed();
|
|
414
455
|
}
|
|
415
456
|
const applicationId = getFlag("--app", args);
|
|
416
457
|
const type = parseEndpointType(getFlag("--type", args));
|
|
@@ -438,12 +479,12 @@ async function main() {
|
|
|
438
479
|
} else {
|
|
439
480
|
console.error(`Error: Unknown subcommand "${sub}"`);
|
|
440
481
|
showHelp();
|
|
441
|
-
|
|
482
|
+
return markCommandFailed();
|
|
442
483
|
}
|
|
443
484
|
} catch (err) {
|
|
444
485
|
console.error(`
|
|
445
486
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
446
|
-
|
|
487
|
+
return markCommandFailed();
|
|
447
488
|
}
|
|
448
489
|
}
|
|
449
|
-
main();
|
|
490
|
+
await main();
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
2
|
+
import {
|
|
3
|
+
markCommandFailed
|
|
4
|
+
} from "./cli-7q3ae3ft.js";
|
|
5
|
+
import"./cli-zgda61x2.js";
|
|
6
|
+
import"./cli-9pbk8m32.js";
|
|
7
|
+
import"./cli-3a5hy1r3.js";
|
|
8
|
+
import"./cli-ygm0ygzg.js";
|
|
9
|
+
import"./cli-whyqn949.js";
|
|
10
|
+
import"./cli-cg3s2en9.js";
|
|
11
|
+
import"./cli-4zm8sx6f.js";
|
|
12
|
+
import"./cli-1hkxhyef.js";
|
|
13
|
+
import"./cli-jgd1gxnf.js";
|
|
10
14
|
import"./cli-9fsre5pt.js";
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
15
|
+
import"./cli-3x1y9yk0.js";
|
|
16
|
+
import"./cli-6grv9k35.js";
|
|
17
|
+
import"./cli-1q3vervd.js";
|
|
14
18
|
import"./cli-fw5r7pfj.js";
|
|
15
19
|
import"./cli-c8131c4q.js";
|
|
16
|
-
import"./cli-
|
|
20
|
+
import"./cli-bxhaqp8w.js";
|
|
17
21
|
import {
|
|
18
22
|
createWorkspaceSelection,
|
|
19
23
|
disconnect,
|
|
@@ -29,15 +33,16 @@ import {
|
|
|
29
33
|
pollWorkspaceSelection,
|
|
30
34
|
selectWorkspace,
|
|
31
35
|
startDeviceFlow
|
|
32
|
-
} from "./cli-
|
|
33
|
-
import"./cli-
|
|
36
|
+
} from "./cli-3b3teb1m.js";
|
|
37
|
+
import"./cli-avmhkjtv.js";
|
|
34
38
|
import"./cli-j54qa6tm.js";
|
|
35
39
|
import {
|
|
36
40
|
config,
|
|
37
41
|
init_config
|
|
38
|
-
} from "./cli-
|
|
39
|
-
import"./cli-
|
|
40
|
-
import"./cli-
|
|
42
|
+
} from "./cli-y9mjgfsd.js";
|
|
43
|
+
import"./cli-jq2yh557.js";
|
|
44
|
+
import"./cli-5ynht461.js";
|
|
45
|
+
import"./cli-knd276ed.js";
|
|
41
46
|
import {
|
|
42
47
|
__require
|
|
43
48
|
} from "./cli-bc05qbss.js";
|
|
@@ -300,12 +305,12 @@ async function main() {
|
|
|
300
305
|
} else {
|
|
301
306
|
console.error(`Unknown auth subcommand: ${subcommand}`);
|
|
302
307
|
console.error("Run 'pensar login --help' for usage information");
|
|
303
|
-
|
|
308
|
+
return markCommandFailed();
|
|
304
309
|
}
|
|
305
310
|
} catch (err) {
|
|
306
311
|
console.error(`
|
|
307
312
|
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
308
|
-
|
|
313
|
+
return markCommandFailed();
|
|
309
314
|
}
|
|
310
315
|
}
|
|
311
|
-
main();
|
|
316
|
+
await main();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAuthenticationAgent
|
|
3
|
+
} from "./cli-1hkxhyef.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-3x1y9yk0.js";
|
|
6
|
+
import"./cli-6grv9k35.js";
|
|
7
|
+
import"./cli-1q3vervd.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-bxhaqp8w.js";
|
|
10
|
+
import"./cli-3b3teb1m.js";
|
|
11
|
+
import"./cli-avmhkjtv.js";
|
|
12
|
+
import"./cli-j54qa6tm.js";
|
|
13
|
+
import"./cli-y9mjgfsd.js";
|
|
14
|
+
import"./cli-jq2yh557.js";
|
|
15
|
+
import"./cli-5ynht461.js";
|
|
16
|
+
import"./cli-knd276ed.js";
|
|
17
|
+
import"./cli-bc05qbss.js";
|
|
18
|
+
export {
|
|
19
|
+
runAuthenticationAgent
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent
|
|
3
|
+
} from "./cli-whyqn949.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-3x1y9yk0.js";
|
|
6
|
+
import"./cli-6grv9k35.js";
|
|
7
|
+
import"./cli-1q3vervd.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-bxhaqp8w.js";
|
|
10
|
+
import"./cli-3b3teb1m.js";
|
|
11
|
+
import"./cli-avmhkjtv.js";
|
|
12
|
+
import"./cli-j54qa6tm.js";
|
|
13
|
+
import"./cli-y9mjgfsd.js";
|
|
14
|
+
import"./cli-jq2yh557.js";
|
|
15
|
+
import"./cli-5ynht461.js";
|
|
16
|
+
import"./cli-knd276ed.js";
|
|
17
|
+
import"./cli-bc05qbss.js";
|
|
18
|
+
export {
|
|
19
|
+
BlackboxAttackSurfaceAgent
|
|
20
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EMPTY_SESSION_TOKEN_USAGE,
|
|
3
|
+
accumulateSessionTokens
|
|
4
|
+
} from "./cli-9pbk8m32.js";
|
|
5
|
+
import {
|
|
6
|
+
readExecutionMetrics,
|
|
7
|
+
runPentestWorkflow,
|
|
8
|
+
writeExecutionMetrics
|
|
9
|
+
} from "./cli-3a5hy1r3.js";
|
|
10
|
+
import"./cli-ygm0ygzg.js";
|
|
11
|
+
import"./cli-whyqn949.js";
|
|
12
|
+
import"./cli-cg3s2en9.js";
|
|
13
|
+
import"./cli-4zm8sx6f.js";
|
|
14
|
+
import"./cli-jgd1gxnf.js";
|
|
15
|
+
import"./cli-9fsre5pt.js";
|
|
16
|
+
import"./cli-3x1y9yk0.js";
|
|
17
|
+
import"./cli-6grv9k35.js";
|
|
18
|
+
import"./cli-1q3vervd.js";
|
|
19
|
+
import"./cli-fw5r7pfj.js";
|
|
20
|
+
import"./cli-c8131c4q.js";
|
|
21
|
+
import"./cli-bxhaqp8w.js";
|
|
22
|
+
import"./cli-3b3teb1m.js";
|
|
23
|
+
import"./cli-avmhkjtv.js";
|
|
24
|
+
import"./cli-j54qa6tm.js";
|
|
25
|
+
import"./cli-y9mjgfsd.js";
|
|
26
|
+
import"./cli-jq2yh557.js";
|
|
27
|
+
import"./cli-5ynht461.js";
|
|
28
|
+
import"./cli-knd276ed.js";
|
|
29
|
+
import"./cli-bc05qbss.js";
|
|
30
|
+
|
|
31
|
+
// src/core/api/blackboxPentest.ts
|
|
32
|
+
async function runPentestAgent(input) {
|
|
33
|
+
const persisted = readExecutionMetrics(input.session.rootPath)?.tokenUsage;
|
|
34
|
+
let tokenUsage = persisted ?? EMPTY_SESSION_TOKEN_USAGE;
|
|
35
|
+
const onStepFinish = async (event) => {
|
|
36
|
+
tokenUsage = accumulateSessionTokens(tokenUsage, event.usage ?? {});
|
|
37
|
+
await input.onStepFinish?.(event);
|
|
38
|
+
};
|
|
39
|
+
const onCacheMetrics = (metrics) => {
|
|
40
|
+
tokenUsage = accumulateSessionTokens(tokenUsage, {
|
|
41
|
+
cacheReadTokens: metrics.cacheReadInputTokens,
|
|
42
|
+
cacheWriteTokens: metrics.cacheCreationInputTokens
|
|
43
|
+
});
|
|
44
|
+
input.onCacheMetrics?.(metrics);
|
|
45
|
+
};
|
|
46
|
+
let result;
|
|
47
|
+
try {
|
|
48
|
+
result = await runPentestWorkflow({
|
|
49
|
+
...input,
|
|
50
|
+
onStepFinish,
|
|
51
|
+
onCacheMetrics
|
|
52
|
+
});
|
|
53
|
+
} finally {
|
|
54
|
+
writeExecutionMetrics({
|
|
55
|
+
sessionRootPath: input.session.rootPath,
|
|
56
|
+
tokenUsage
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const { findings, findingsPath, pocsPath, reportPath } = result;
|
|
60
|
+
console.log(`
|
|
61
|
+
Found ${findings.length} vulnerabilities`);
|
|
62
|
+
console.log(`Findings: ${findingsPath}`);
|
|
63
|
+
console.log(`POCs: ${pocsPath}`);
|
|
64
|
+
if (reportPath)
|
|
65
|
+
console.log(`Report: ${reportPath}`);
|
|
66
|
+
return { findings, findingsPath, pocsPath, reportPath };
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
runPentestAgent
|
|
70
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-6grv9k35.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-1q3vervd.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-bxhaqp8w.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
@@ -141,6 +141,23 @@ every 30 seconds, so run this immediately before filling the field. If the code
|
|
|
141
141
|
retry once (you may have crossed a period boundary). Only report an MFA barrier if no seed is available
|
|
142
142
|
or two fresh codes are both rejected.
|
|
143
143
|
|
|
144
|
+
# SMS passwordless (phone as login)
|
|
145
|
+
|
|
146
|
+
If a credential has a \`phoneNumber\` additional field, the phone number IS the login identifier — not MFA
|
|
147
|
+
after a password. Do **not** report \`phone_verification\` as a barrier for this flow.
|
|
148
|
+
|
|
149
|
+
1. \`browser_fill\` with \`credentialId\` and \`credentialField="phoneNumber"\` (never type the number).
|
|
150
|
+
2. Click the target's send-code / text-me control. Note \`Date.now()\` at that click as \`sinceMs\`.
|
|
151
|
+
3. \`execute_command\` \`sleep 5\`, then call \`sms_list_messages\` with that \`credentialId\` and \`sinceMs\`.
|
|
152
|
+
If the list is empty, sleep and list again a few times. If it stays empty or returns an error, stop
|
|
153
|
+
and report what you observed — do not hang in a wait loop. Set \`claim=true\` once a message is present
|
|
154
|
+
so other runs cannot reuse the OTP.
|
|
155
|
+
4. \`browser_fill\` the OTP from the claimed/listed result (\`code\`, or parse \`body\` if \`code\` is null).
|
|
156
|
+
5. Continue the login and call \`complete_authentication\`.
|
|
157
|
+
|
|
158
|
+
TOTP-via-environment-variable above is unchanged and still applies when the login asks for an authenticator
|
|
159
|
+
app code.
|
|
160
|
+
|
|
144
161
|
# Error Recovery
|
|
145
162
|
|
|
146
163
|
If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
|
|
@@ -243,6 +260,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
243
260
|
"email_search_messages",
|
|
244
261
|
"email_get_message",
|
|
245
262
|
"send_email",
|
|
263
|
+
"sms_list_messages",
|
|
246
264
|
"web_search",
|
|
247
265
|
"get_page"
|
|
248
266
|
],
|
|
@@ -328,6 +346,14 @@ function buildAuthPrompt(target, authHints, credentialManager, context, envVarNa
|
|
|
328
346
|
parts.push("");
|
|
329
347
|
}
|
|
330
348
|
if (credBlock) {
|
|
349
|
+
const hasSmsPasswordless = credentialManager?.listReferences().some((ref) => ref.additionalFieldKeys?.includes("phoneNumber"));
|
|
350
|
+
const smsInstructions = hasSmsPasswordless ? `
|
|
351
|
+
If a credential has a phoneNumber additional field (Mobile OTP / sms-passwordless), phone is the login
|
|
352
|
+
identifier — not MFA-after-password. browser_fill credentialField="phoneNumber", click send-code, then
|
|
353
|
+
execute_command \`sleep 5\` and call sms_list_messages with sinceMs = Date.now() at that click (claim=true
|
|
354
|
+
once a message is present). If the list is empty, sleep and list again; if it stays empty, fail with what
|
|
355
|
+
you observed — do not hang waiting. Then browser_fill the OTP. Do NOT report phone_verification as a
|
|
356
|
+
barrier for this flow. TOTP-via-env for authenticator MFA is unchanged.` : "";
|
|
331
357
|
parts.push(`INSTRUCTIONS:
|
|
332
358
|
You have credentials available via credential IDs — authenticate immediately.
|
|
333
359
|
1. For API/form logins, use execute_command (curl) to submit credentials and capture the Set-Cookie / token response
|
|
@@ -335,7 +361,7 @@ You have credentials available via credential IDs — authenticate immediately.
|
|
|
335
361
|
pass credentialId + credentialField (e.g. credentialField="password") instead of the raw value —
|
|
336
362
|
the secret is resolved securely at execution time. NEVER type a password directly.
|
|
337
363
|
3. Call complete_authentication with exported cookies/headers to persist credentials and end the run
|
|
338
|
-
|
|
364
|
+
${smsInstructions}
|
|
339
365
|
The credentials above were provided to you and have already been verified — they are SHARED across runs, so
|
|
340
366
|
do not modify them or their account settings. NEVER change the password, complete a password reset /
|
|
341
367
|
forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
|