@pensar/apex 2.1.3-canary.06f4c3eb → 2.1.3-canary.15e34bf1
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-3ktj43z9.js +19 -0
- package/build/{agent-sn33s7wa.js → agent-3s7c1qrd.js} +9 -9
- package/build/{agent-ts46he50.js → agent-v3d0ssgy.js} +7 -7
- package/build/{apps-6egm0mw2.js → apps-rk071a9p.js} +15 -15
- package/build/{auth-qd4f8hgn.js → auth-cnc8b1tj.js} +15 -15
- package/build/authentication-hrwp9bw8.js +19 -0
- package/build/blackboxAgent-fzp5cyvr.js +19 -0
- package/build/{blackboxPentest-fe56bfc1.js → blackboxPentest-b6cpqtkh.js} +13 -13
- package/build/{cli-gta3gsva.js → cli-1kgqgq0a.js} +29 -16
- package/build/{cli-epra15kv.js → cli-2zbvtnrx.js} +16 -18
- package/build/{cli-adgyv55h.js → cli-49kwknjj.js} +2 -2
- package/build/{cli-99a9aq3w.js → cli-4xz6rqg5.js} +4655 -4252
- package/build/{cli-5vvb8cby.js → cli-7y6dwmn8.js} +1 -1
- package/build/{cli-8p3trjtv.js → cli-84pr5q33.js} +4 -4
- package/build/{cli-jn2sxf89.js → cli-8vaa0frx.js} +4 -4
- package/build/{cli-tt8k9pka.js → cli-9m9d9vtm.js} +1 -1
- package/build/{cli-80sehbtt.js → cli-dh7tfkre.js} +1 -1
- package/build/{cli-mt0f9tte.js → cli-eh6nrt6s.js} +2 -2
- package/build/{cli-pgsqvjqw.js → cli-h7w8nj1x.js} +1 -1
- package/build/{cli-ja43jscc.js → cli-nm2jskqg.js} +170 -39
- package/build/{cli-sganpfnr.js → cli-r5n86ej6.js} +1 -1
- package/build/{cli-h28cfavt.js → cli-td2vwxvv.js} +1 -1
- package/build/{cli-952bzt8m.js → cli-xe08y0nv.js} +27 -7
- package/build/{cli-r2z98y59.js → cli-yqtxtvg8.js} +1 -1
- package/build/cli.js +74 -53
- package/build/{config-vw2z82v6.js → config-nvgzsffk.js} +3 -3
- package/build/{doctor-7r8hgya4.js → doctor-785qvedj.js} +6 -6
- package/build/{fixes-r8f01knx.js → fixes-xhr8ghx7.js} +15 -15
- package/build/{index-0xxbqssd.js → index-2edcw64j.js} +16 -10
- package/build/{index-mby0pdzs.js → index-e9rxwzqv.js} +2 -2
- package/build/{index-a2tc7bxh.js → index-kx3w10s2.js} +17 -17
- package/build/{index-rf5j27d4.js → index-ng1a7q8g.js} +4 -4
- package/build/{index-9njkp18t.js → index-qcf9f2n7.js} +3 -3
- package/build/{index-8571kb3t.js → index-y5bdx5j1.js} +9 -9
- package/build/{index-syzey1rc.js → index-z35ctxx8.js} +6 -6
- package/build/{issues-9743wnvm.js → issues-jwfdctks.js} +15 -15
- package/build/{logs-p3z7vg6z.js → logs-8h7pwx7s.js} +15 -15
- package/build/{offesecAgent-1rq9r9bd.js → offesecAgent-yxaxnxwk.js} +8 -8
- package/build/pentest-a87kxj2v.js +28 -0
- package/build/{pentests-4hd2gzns.js → pentests-6nhr9rdv.js} +15 -15
- package/build/{targetedPentest-kdxkpwmh.js → targetedPentest-jyzcm9cx.js} +17 -10
- package/build/{targets-6ge81tt0.js → targets-wbxhcpb8.js} +15 -15
- package/build/threatModel-0qpzh1jb.js +26 -0
- package/build/{uninstall-gvb6d633.js → uninstall-57tdyecc.js} +1 -1
- package/build/{upload-7t35h330.js → upload-tvad5wre.js} +6 -6
- package/build/{utils-tss3j3eb.js → utils-e14mz7h9.js} +5 -5
- package/package.json +1 -1
- package/build/agent-y9a30306.js +0 -19
- package/build/authentication-jrgrm5xj.js +0 -19
- package/build/blackboxAgent-dtv2q4q1.js +0 -19
- package/build/pentest-48z4y1kj.js +0 -28
- package/build/threatModel-ydyxbxvk.js +0 -26
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent
|
|
3
|
+
} from "./cli-eh6nrt6s.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-yqtxtvg8.js";
|
|
6
|
+
import"./cli-4xz6rqg5.js";
|
|
7
|
+
import"./cli-r5n86ej6.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-nm2jskqg.js";
|
|
10
|
+
import"./cli-dh7tfkre.js";
|
|
11
|
+
import"./cli-29yqhrjq.js";
|
|
12
|
+
import"./cli-gpnb45ck.js";
|
|
13
|
+
import"./cli-h7w8nj1x.js";
|
|
14
|
+
import"./cli-td2vwxvv.js";
|
|
15
|
+
import"./cli-7y6dwmn8.js";
|
|
16
|
+
import"./cli-8rxa073f.js";
|
|
17
|
+
export {
|
|
18
|
+
CodeAgent
|
|
19
|
+
};
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
buildPentestActiveTools,
|
|
4
4
|
buildPentestPrompt,
|
|
5
5
|
buildPentestSystemPrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-xe08y0nv.js";
|
|
7
7
|
import"./cli-9fsre5pt.js";
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
8
|
+
import"./cli-yqtxtvg8.js";
|
|
9
|
+
import"./cli-4xz6rqg5.js";
|
|
10
|
+
import"./cli-r5n86ej6.js";
|
|
11
11
|
import"./cli-c8131c4q.js";
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
import"./cli-nm2jskqg.js";
|
|
13
|
+
import"./cli-dh7tfkre.js";
|
|
14
14
|
import"./cli-29yqhrjq.js";
|
|
15
15
|
import"./cli-gpnb45ck.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
16
|
+
import"./cli-h7w8nj1x.js";
|
|
17
|
+
import"./cli-td2vwxvv.js";
|
|
18
|
+
import"./cli-7y6dwmn8.js";
|
|
19
19
|
import"./cli-8rxa073f.js";
|
|
20
20
|
export {
|
|
21
21
|
buildPentestSystemPrompt,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-4xz6rqg5.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-r5n86ej6.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-nm2jskqg.js";
|
|
12
|
+
import"./cli-dh7tfkre.js";
|
|
13
13
|
import {
|
|
14
14
|
exports_external,
|
|
15
15
|
init_zod
|
|
16
16
|
} from "./cli-29yqhrjq.js";
|
|
17
17
|
import"./cli-gpnb45ck.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-h7w8nj1x.js";
|
|
19
|
+
import"./cli-td2vwxvv.js";
|
|
20
|
+
import"./cli-7y6dwmn8.js";
|
|
21
21
|
import"./cli-8rxa073f.js";
|
|
22
22
|
|
|
23
23
|
// src/core/agents/specialized/findingJudge/agent.ts
|
|
@@ -12,26 +12,26 @@ import {
|
|
|
12
12
|
searchEndpoints,
|
|
13
13
|
updateApp,
|
|
14
14
|
updateEndpoint
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
15
|
+
} from "./cli-8vaa0frx.js";
|
|
16
|
+
import"./cli-1kgqgq0a.js";
|
|
17
|
+
import"./cli-84pr5q33.js";
|
|
18
|
+
import"./cli-xe08y0nv.js";
|
|
19
|
+
import"./cli-2zbvtnrx.js";
|
|
20
|
+
import"./cli-eh6nrt6s.js";
|
|
21
|
+
import"./cli-49kwknjj.js";
|
|
22
22
|
import"./cli-9fsre5pt.js";
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
23
|
+
import"./cli-yqtxtvg8.js";
|
|
24
|
+
import"./cli-4xz6rqg5.js";
|
|
25
|
+
import"./cli-r5n86ej6.js";
|
|
26
26
|
import"./cli-fw5r7pfj.js";
|
|
27
27
|
import"./cli-c8131c4q.js";
|
|
28
|
-
import"./cli-
|
|
29
|
-
import"./cli-
|
|
28
|
+
import"./cli-nm2jskqg.js";
|
|
29
|
+
import"./cli-dh7tfkre.js";
|
|
30
30
|
import"./cli-29yqhrjq.js";
|
|
31
31
|
import"./cli-gpnb45ck.js";
|
|
32
|
-
import"./cli-
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-
|
|
32
|
+
import"./cli-h7w8nj1x.js";
|
|
33
|
+
import"./cli-td2vwxvv.js";
|
|
34
|
+
import"./cli-7y6dwmn8.js";
|
|
35
35
|
import"./cli-8rxa073f.js";
|
|
36
36
|
|
|
37
37
|
// src/cli/apps.ts
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import"./cli-
|
|
3
|
-
import"./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
2
|
+
import"./cli-8vaa0frx.js";
|
|
3
|
+
import"./cli-1kgqgq0a.js";
|
|
4
|
+
import"./cli-84pr5q33.js";
|
|
5
|
+
import"./cli-xe08y0nv.js";
|
|
6
|
+
import"./cli-2zbvtnrx.js";
|
|
7
|
+
import"./cli-eh6nrt6s.js";
|
|
8
|
+
import"./cli-49kwknjj.js";
|
|
9
9
|
import"./cli-9fsre5pt.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
10
|
+
import"./cli-yqtxtvg8.js";
|
|
11
|
+
import"./cli-4xz6rqg5.js";
|
|
12
|
+
import"./cli-r5n86ej6.js";
|
|
13
13
|
import"./cli-fw5r7pfj.js";
|
|
14
14
|
import"./cli-c8131c4q.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-nm2jskqg.js";
|
|
16
16
|
import {
|
|
17
17
|
disconnect,
|
|
18
18
|
fetchWorkspaces,
|
|
@@ -25,15 +25,15 @@ import {
|
|
|
25
25
|
pollWorkOSToken,
|
|
26
26
|
selectWorkspace,
|
|
27
27
|
startDeviceFlow
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-dh7tfkre.js";
|
|
29
29
|
import"./cli-29yqhrjq.js";
|
|
30
30
|
import"./cli-gpnb45ck.js";
|
|
31
31
|
import {
|
|
32
32
|
config,
|
|
33
33
|
init_config
|
|
34
|
-
} from "./cli-
|
|
35
|
-
import"./cli-
|
|
36
|
-
import"./cli-
|
|
34
|
+
} from "./cli-h7w8nj1x.js";
|
|
35
|
+
import"./cli-td2vwxvv.js";
|
|
36
|
+
import"./cli-7y6dwmn8.js";
|
|
37
37
|
import {
|
|
38
38
|
__require
|
|
39
39
|
} from "./cli-8rxa073f.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runAuthenticationAgent
|
|
3
|
+
} from "./cli-2zbvtnrx.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-yqtxtvg8.js";
|
|
6
|
+
import"./cli-4xz6rqg5.js";
|
|
7
|
+
import"./cli-r5n86ej6.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-nm2jskqg.js";
|
|
10
|
+
import"./cli-dh7tfkre.js";
|
|
11
|
+
import"./cli-29yqhrjq.js";
|
|
12
|
+
import"./cli-gpnb45ck.js";
|
|
13
|
+
import"./cli-h7w8nj1x.js";
|
|
14
|
+
import"./cli-td2vwxvv.js";
|
|
15
|
+
import"./cli-7y6dwmn8.js";
|
|
16
|
+
import"./cli-8rxa073f.js";
|
|
17
|
+
export {
|
|
18
|
+
runAuthenticationAgent
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent
|
|
3
|
+
} from "./cli-84pr5q33.js";
|
|
4
|
+
import"./cli-9fsre5pt.js";
|
|
5
|
+
import"./cli-yqtxtvg8.js";
|
|
6
|
+
import"./cli-4xz6rqg5.js";
|
|
7
|
+
import"./cli-r5n86ej6.js";
|
|
8
|
+
import"./cli-c8131c4q.js";
|
|
9
|
+
import"./cli-nm2jskqg.js";
|
|
10
|
+
import"./cli-dh7tfkre.js";
|
|
11
|
+
import"./cli-29yqhrjq.js";
|
|
12
|
+
import"./cli-gpnb45ck.js";
|
|
13
|
+
import"./cli-h7w8nj1x.js";
|
|
14
|
+
import"./cli-td2vwxvv.js";
|
|
15
|
+
import"./cli-7y6dwmn8.js";
|
|
16
|
+
import"./cli-8rxa073f.js";
|
|
17
|
+
export {
|
|
18
|
+
BlackboxAttackSurfaceAgent
|
|
19
|
+
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPentestWorkflow
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
3
|
+
} from "./cli-1kgqgq0a.js";
|
|
4
|
+
import"./cli-84pr5q33.js";
|
|
5
|
+
import"./cli-xe08y0nv.js";
|
|
6
|
+
import"./cli-eh6nrt6s.js";
|
|
7
|
+
import"./cli-49kwknjj.js";
|
|
8
8
|
import"./cli-9fsre5pt.js";
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
9
|
+
import"./cli-yqtxtvg8.js";
|
|
10
|
+
import"./cli-4xz6rqg5.js";
|
|
11
|
+
import"./cli-r5n86ej6.js";
|
|
12
12
|
import"./cli-fw5r7pfj.js";
|
|
13
13
|
import"./cli-c8131c4q.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
14
|
+
import"./cli-nm2jskqg.js";
|
|
15
|
+
import"./cli-dh7tfkre.js";
|
|
16
16
|
import"./cli-29yqhrjq.js";
|
|
17
17
|
import"./cli-gpnb45ck.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-h7w8nj1x.js";
|
|
19
|
+
import"./cli-td2vwxvv.js";
|
|
20
|
+
import"./cli-7y6dwmn8.js";
|
|
21
21
|
import"./cli-8rxa073f.js";
|
|
22
22
|
|
|
23
23
|
// src/core/api/blackboxPentest.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-84pr5q33.js";
|
|
4
4
|
import {
|
|
5
5
|
TargetedPentestAgent,
|
|
6
6
|
buildPentestSystemPrompt
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-xe08y0nv.js";
|
|
8
8
|
import {
|
|
9
9
|
CodeAgent
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-eh6nrt6s.js";
|
|
11
11
|
import {
|
|
12
12
|
AppsDiscoveryResultSchema,
|
|
13
13
|
DiscoverySummarySchema,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT,
|
|
16
16
|
WHITEBOX_DISCOVERY_SYSTEM_PROMPT,
|
|
17
17
|
WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-49kwknjj.js";
|
|
19
19
|
import {
|
|
20
20
|
EvidenceFileEntrySchema
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-yqtxtvg8.js";
|
|
22
22
|
import {
|
|
23
23
|
CweEntrySchema,
|
|
24
24
|
FindingsRegistry,
|
|
@@ -26,8 +26,9 @@ import {
|
|
|
26
26
|
PLAN_MODE_TOOL_NAMES,
|
|
27
27
|
ValidatedCweEntrySchema,
|
|
28
28
|
hasCanonicalName,
|
|
29
|
+
pLimit,
|
|
29
30
|
runWithBoundedConcurrency
|
|
30
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-4xz6rqg5.js";
|
|
31
32
|
import {
|
|
32
33
|
createThreatModelPrompt
|
|
33
34
|
} from "./cli-fw5r7pfj.js";
|
|
@@ -36,9 +37,10 @@ import {
|
|
|
36
37
|
hasToolCall,
|
|
37
38
|
init_dist,
|
|
38
39
|
init_lazyLogger,
|
|
40
|
+
init_session,
|
|
39
41
|
init_structured,
|
|
40
42
|
scopedLogger
|
|
41
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-nm2jskqg.js";
|
|
42
44
|
import {
|
|
43
45
|
exports_external,
|
|
44
46
|
init_zod
|
|
@@ -360,11 +362,13 @@ init_lazyLogger();
|
|
|
360
362
|
// src/core/session/persistence.ts
|
|
361
363
|
init_structured();
|
|
362
364
|
init_lazyLogger();
|
|
365
|
+
init_session();
|
|
363
366
|
import {
|
|
364
367
|
existsSync as existsSync2,
|
|
365
368
|
mkdirSync,
|
|
366
369
|
readdirSync,
|
|
367
370
|
readFileSync as readFileSync2,
|
|
371
|
+
renameSync,
|
|
368
372
|
statSync,
|
|
369
373
|
writeFileSync as writeFileSync2
|
|
370
374
|
} from "node:fs";
|
|
@@ -372,14 +376,14 @@ import { join as join2 } from "node:path";
|
|
|
372
376
|
var log = scopedLogger(() => createLogger("session:persistence"));
|
|
373
377
|
var SUBAGENTS_DIR = "subagents";
|
|
374
378
|
var MANIFEST_FILE = "agent-manifest.json";
|
|
375
|
-
function loadSubagentMessages(session,
|
|
376
|
-
const stepPath = join2(session.rootPath, SUBAGENTS_DIR,
|
|
379
|
+
function loadSubagentMessages(session, key) {
|
|
380
|
+
const stepPath = join2(session.rootPath, SUBAGENTS_DIR, key, "messages.json");
|
|
377
381
|
if (existsSync2(stepPath)) {
|
|
378
382
|
try {
|
|
379
383
|
return JSON.parse(readFileSync2(stepPath, "utf-8"));
|
|
380
384
|
} catch {}
|
|
381
385
|
}
|
|
382
|
-
const snapshotPath = join2(session.rootPath, SUBAGENTS_DIR, `${
|
|
386
|
+
const snapshotPath = join2(session.rootPath, SUBAGENTS_DIR, `${key}.json`);
|
|
383
387
|
if (!existsSync2(snapshotPath))
|
|
384
388
|
return [];
|
|
385
389
|
try {
|
|
@@ -523,6 +527,9 @@ function parseSubagentFilename(filename) {
|
|
|
523
527
|
if (filename.startsWith("orchestrator-")) {
|
|
524
528
|
return { agentType: "pentest", name: "Orchestrator Summary" };
|
|
525
529
|
}
|
|
530
|
+
if (filename.startsWith("ses_")) {
|
|
531
|
+
return { agentType: "pentest", name: "Pentest Worker" };
|
|
532
|
+
}
|
|
526
533
|
return { agentType: "pentest", name: filename.split("-")[0] || "Unknown" };
|
|
527
534
|
}
|
|
528
535
|
function unwrapAiSdkToolOutput(output) {
|
|
@@ -834,7 +841,8 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
834
841
|
openAIReasoningEffort,
|
|
835
842
|
enableThinking,
|
|
836
843
|
projectThreatModel,
|
|
837
|
-
parentSubagentId
|
|
844
|
+
parentSubagentId,
|
|
845
|
+
agentLimiter
|
|
838
846
|
} = opts;
|
|
839
847
|
const subagentId = `endpoint-doc-${slug(app.name)}-${slug(endpoint.path)}`;
|
|
840
848
|
const displayMethod = getDocumentMethod(endpoint);
|
|
@@ -876,7 +884,7 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
876
884
|
projectThreatModel
|
|
877
885
|
});
|
|
878
886
|
try {
|
|
879
|
-
await agent.consume();
|
|
887
|
+
await (agentLimiter ? agentLimiter(() => agent.consume()) : agent.consume());
|
|
880
888
|
eventBus?.emit("subagent-complete", {
|
|
881
889
|
subagentId,
|
|
882
890
|
status: "completed",
|
|
@@ -6195,6 +6203,7 @@ init_structured();
|
|
|
6195
6203
|
init_lazyLogger();
|
|
6196
6204
|
var log4 = scopedLogger(() => createLogger("whitebox-workflow"));
|
|
6197
6205
|
var DEFAULT_CONCURRENCY = 5;
|
|
6206
|
+
var MAX_CONCURRENT_AGENTS = 12;
|
|
6198
6207
|
var TASK_TYPE_LABELS = {
|
|
6199
6208
|
pages: "Pages",
|
|
6200
6209
|
apiEndpoints: "API Endpoints",
|
|
@@ -6228,8 +6237,11 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6228
6237
|
domains,
|
|
6229
6238
|
projectThreatModel,
|
|
6230
6239
|
environments,
|
|
6231
|
-
surfaceIntegrationEnabled = true
|
|
6240
|
+
surfaceIntegrationEnabled = true,
|
|
6241
|
+
maxConcurrentAgents = MAX_CONCURRENT_AGENTS
|
|
6232
6242
|
} = input;
|
|
6243
|
+
const agentSlots = pLimit(Math.max(1, maxConcurrentAgents));
|
|
6244
|
+
const agentLimiter = (fn) => agentSlots(fn);
|
|
6233
6245
|
const appsAgent = new CodeAgent({
|
|
6234
6246
|
codebasePath,
|
|
6235
6247
|
objective: buildAppsDiscoveryObjective(codebasePath, domains, environments),
|
|
@@ -6256,7 +6268,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6256
6268
|
name: "Whitebox Apps Discovery",
|
|
6257
6269
|
input: { codebasePath }
|
|
6258
6270
|
});
|
|
6259
|
-
const appsResult = await appsAgent.consume();
|
|
6271
|
+
const appsResult = await agentLimiter(() => appsAgent.consume());
|
|
6260
6272
|
log4.info(`Phase 1 complete: ${appsResult?.apps.length ?? 0} apps discovered` + (appsResult ? ` (repoType=${appsResult.repoType}, packageManager=${appsResult.packageManager})` : " (no result returned)"));
|
|
6261
6273
|
if (appsResult?.apps.length) {
|
|
6262
6274
|
for (const app of appsResult.apps) {
|
|
@@ -6340,7 +6352,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6340
6352
|
projectThreatModel
|
|
6341
6353
|
});
|
|
6342
6354
|
try {
|
|
6343
|
-
await agent.consume();
|
|
6355
|
+
await agentLimiter(() => agent.consume());
|
|
6344
6356
|
log4.debug(`Phase 2: agent "${subagentId}" completed`);
|
|
6345
6357
|
eventBus?.emit("subagent-complete", {
|
|
6346
6358
|
subagentId,
|
|
@@ -6391,7 +6403,8 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6391
6403
|
openAIReasoningEffort,
|
|
6392
6404
|
enableThinking,
|
|
6393
6405
|
projectThreatModel,
|
|
6394
|
-
parentSubagentId: appNodeId
|
|
6406
|
+
parentSubagentId: appNodeId,
|
|
6407
|
+
agentLimiter
|
|
6395
6408
|
});
|
|
6396
6409
|
} else {
|
|
6397
6410
|
log4.debug(`${app.name}: fallback (${surfaceResult.reason})`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-4xz6rqg5.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-r5n86ej6.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-nm2jskqg.js";
|
|
15
15
|
|
|
16
16
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
17
|
init_dist();
|
|
@@ -37,9 +37,9 @@ Obtain valid credentials/sessions that other agents can use for authenticated te
|
|
|
37
37
|
# Available Tools
|
|
38
38
|
|
|
39
39
|
## API Authentication
|
|
40
|
-
- \`
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
- \`execute_command\` — Run curl (or other shell commands) to submit credentials via form POST,
|
|
41
|
+
JSON POST, or HTTP Basic auth, and to capture the Set-Cookie / token response. Use this for all
|
|
42
|
+
custom and complex API auth flows.
|
|
43
43
|
|
|
44
44
|
## Browser Authentication
|
|
45
45
|
- \`browser_navigate\` — Navigate to login page
|
|
@@ -77,11 +77,11 @@ Look for:
|
|
|
77
77
|
## Step 2: Authenticate
|
|
78
78
|
|
|
79
79
|
### API path (use when target is an API or has a simple form):
|
|
80
|
-
1.
|
|
81
|
-
- \`
|
|
82
|
-
- \`
|
|
83
|
-
- \`
|
|
84
|
-
2.
|
|
80
|
+
1. Use \`execute_command\` with curl to submit the credentials, matching the target's scheme:
|
|
81
|
+
- \`curl -i -d 'username=...&password=...' <loginUrl>\` for HTML form POST
|
|
82
|
+
- \`curl -i -H 'Content-Type: application/json' -d '{"username":"...","password":"..."}' <loginUrl>\` for JSON APIs
|
|
83
|
+
- \`curl -i -u '<user>:<pass>' <url>\` for HTTP Basic
|
|
84
|
+
2. Inspect the response (\`-i\` shows headers) — capture any \`Set-Cookie\` value or token to use as the session credential.
|
|
85
85
|
|
|
86
86
|
### Browser path (use for SPAs, OAuth, JS-rendered forms):
|
|
87
87
|
1. \`browser_navigate\` to the login URL
|
|
@@ -113,7 +113,7 @@ If both API and browser approaches fail, use \`delegate_to_auth_subagent\` for c
|
|
|
113
113
|
**First**, call \`complete_authentication\` with:
|
|
114
114
|
- \`success\`: whether auth succeeded
|
|
115
115
|
- \`summary\`: what happened and what credentials/cookies were obtained
|
|
116
|
-
- \`exportedCookies\`: the cookie string for downstream HTTP requests (from browser_get_cookies cookieHeader or
|
|
116
|
+
- \`exportedCookies\`: the cookie string for downstream HTTP requests (from browser_get_cookies cookieHeader or the Set-Cookie header in the curl response)
|
|
117
117
|
- \`exportedHeaders\`: auth headers map, e.g. {"Authorization": "Bearer <token>"} (from browser_evaluate localStorage tokens or API response)
|
|
118
118
|
- \`strategy\`: method used ("browser", "form_post", "json_post", "basic_auth", "bearer")
|
|
119
119
|
- \`authBarrier\`: if a barrier was encountered (captcha, mfa, etc.)
|
|
@@ -199,7 +199,6 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
199
199
|
toolChoice: "auto",
|
|
200
200
|
activeTools: [
|
|
201
201
|
"execute_command",
|
|
202
|
-
"authenticate_session",
|
|
203
202
|
"complete_authentication",
|
|
204
203
|
"browser_navigate",
|
|
205
204
|
"browser_snapshot",
|
|
@@ -294,17 +293,16 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
|
294
293
|
if (credBlock) {
|
|
295
294
|
parts.push(`INSTRUCTIONS:
|
|
296
295
|
You have credentials available via credential IDs — authenticate immediately.
|
|
297
|
-
1.
|
|
298
|
-
2.
|
|
296
|
+
1. For API/form logins, use execute_command (curl) to submit credentials and capture the Set-Cookie / token response
|
|
297
|
+
2. For browser-based logins, use the browser tools. For browser_fill on password/secret fields,
|
|
299
298
|
pass credentialId + credentialField (e.g. credentialField="password") instead of the raw value —
|
|
300
299
|
the secret is resolved securely at execution time. NEVER type a password directly.
|
|
301
300
|
3. Call complete_authentication with exported cookies/headers to persist credentials and end the run`);
|
|
302
301
|
} else {
|
|
303
302
|
parts.push(`INSTRUCTIONS:
|
|
304
303
|
1. Probe the target with execute_command (curl) to determine the auth mechanism
|
|
305
|
-
2. Attempt authentication with
|
|
306
|
-
3.
|
|
307
|
-
4. Call complete_authentication with exported cookies/headers to persist credentials and end the run`);
|
|
304
|
+
2. Attempt authentication with execute_command (curl) or the browser tools
|
|
305
|
+
3. Call complete_authentication with exported cookies/headers to persist credentials and end the run`);
|
|
308
306
|
}
|
|
309
307
|
return parts.join(`
|
|
310
308
|
`);
|