@pensar/apex 2.4.0 → 2.5.0-canary.2512a649

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.
Files changed (70) hide show
  1. package/build/agent-1wk9ejrw.js +19 -0
  2. package/build/{agent-5ejt5vpz.js → agent-cqxw0kd9.js} +24 -23
  3. package/build/agent-nhfjk81t.js +22 -0
  4. package/build/{agent-nhs1w5w0.js → agent-za6meqyw.js} +11 -10
  5. package/build/{apps-17wvz1d7.js → apps-eqncpkp8.js} +72 -31
  6. package/build/{auth-z3h9859n.js → auth-jabyx925.js} +25 -20
  7. package/build/blackboxAgent-6yg06yq2.js +22 -0
  8. package/build/blackboxPentest-9ckcgmqc.js +70 -0
  9. package/build/{cli-tkc598ey.js → cli-0drqd790.js} +633 -344
  10. package/build/cli-0nrxvm0t.js +12 -0
  11. package/build/{cli-gq40s5b3.js → cli-13bx8fdg.js} +28 -41
  12. package/build/cli-53rm0rrz.js +15 -0
  13. package/build/{cli-b1adytsy.js → cli-5s6jqck2.js} +28 -7
  14. package/build/{cli-2cbwdk78.js → cli-5xh2zw52.js} +1 -1
  15. package/build/cli-68260ckj.js +12136 -0
  16. package/build/cli-7q3ae3ft.js +6 -0
  17. package/build/{cli-72cvcqhg.js → cli-8k8wam9m.js} +1 -1
  18. package/build/{cli-mavved45.js → cli-8r0ekwvh.js} +54 -65
  19. package/build/{cli-swpbx60z.js → cli-avmhkjtv.js} +1 -1481
  20. package/build/{cli-9rhzhgx2.js → cli-dkxwnmrz.js} +1 -1
  21. package/build/{cli-0n4r54hq.js → cli-ewxfjn4c.js} +1 -1
  22. package/build/{cli-k8kc47pq.js → cli-fa5wxr8x.js} +32 -60
  23. package/build/{cli-xshasbwe.js → cli-g9xm89jx.js} +24 -45
  24. package/build/{cli-vnynf0js.js → cli-h1xcrswb.js} +10 -4
  25. package/build/cli-knd276ed.js +1485 -0
  26. package/build/{cli-repbyhkk.js → cli-nt8jrt7c.js} +2131 -1371
  27. package/build/{cli-tznv8pf1.js → cli-q8zkbvsn.js} +1 -1
  28. package/build/{cli-vq52kp7j.js → cli-qqzsm7gd.js} +23 -5
  29. package/build/{cli-32z0017y.js → cli-vazvj17j.js} +32 -56
  30. package/build/cli-w329bvm0.js +32 -0
  31. package/build/{cli-5k33webc.js → cli-ypavpbzs.js} +77 -51
  32. package/build/cli.js +661 -99
  33. package/build/{config-f1mj4nhd.js → config-bmz74x9e.js} +18 -15
  34. package/build/{doctor-ekneewa3.js → doctor-qw9mawme.js} +8 -7
  35. package/build/{fastStrike-8zka43xs.js → fastStrike-jpwx6dtk.js} +13 -11
  36. package/build/{fixes-b89s5haw.js → fixes-53r1jxkp.js} +25 -20
  37. package/build/getMachineId-bsd-xj3bn2fv.js +36 -0
  38. package/build/getMachineId-darwin-07jzjcx6.js +36 -0
  39. package/build/getMachineId-linux-ahngynxd.js +29 -0
  40. package/build/getMachineId-unsupported-vy43b44z.js +19 -0
  41. package/build/getMachineId-win-8x66cynz.js +38 -0
  42. package/build/{index-hqjdg6fg.js → index-4cknw5gy.js} +17 -11
  43. package/build/index-4fbqdgby.js +109 -0
  44. package/build/{index-mtq7kmxz.js → index-5wh7gq37.js} +4 -2
  45. package/build/{index-rbzhk712.js → index-dshvnys5.js} +10 -10
  46. package/build/{index-6d22pyxt.js → index-k8ybkkp1.js} +1785 -1228
  47. package/build/{index-4ad3sdwk.js → index-kcqbaf72.js} +4 -4
  48. package/build/{index-sf16jm0m.js → index-mxqe1y58.js} +11 -8
  49. package/build/{index-ghwf5z3v.js → index-p01t9n89.js} +3 -3
  50. package/build/{index-y5w6n3tb.js → index-xcpavpbs.js} +2 -2
  51. package/build/{issues-xx5bs4md.js → issues-xesdtrg9.js} +82 -26
  52. package/build/{logs-qtxe51w2.js → logs-83wtsyha.js} +25 -20
  53. package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-efzhx1gf.js} +9 -9
  54. package/build/pentest-g1ma266m.js +30 -0
  55. package/build/{pentests-6ks3szc4.js → pentests-fcs7v2e9.js} +26 -21
  56. package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-6hq0hmys.js} +17 -12
  57. package/build/{targets-sxygyj87.js → targets-qh73k68m.js} +27 -22
  58. package/build/threatModel-nqx5mr0y.js +29 -0
  59. package/build/{uninstall-tvsh81v8.js → uninstall-rab8zrm4.js} +6 -3
  60. package/build/{upload-7wdyyqmr.js → upload-kser9ga1.js} +8 -7
  61. package/build/{utils-7fwdkqk6.js → utils-7ngtwza4.js} +7 -6
  62. package/package.json +8 -2
  63. package/build/agent-mvpgvgks.js +0 -19
  64. package/build/authentication-3s97cpk4.js +0 -19
  65. package/build/blackboxAgent-gw0a1ca4.js +0 -19
  66. package/build/blackboxPentest-44333zss.js +0 -37
  67. package/build/cli-qqt4gj1w.js +0 -53
  68. package/build/main-mmjp338j.js +0 -324
  69. package/build/pentest-xtc1sjdw.js +0 -29
  70. package/build/threatModel-xsm6fwk5.js +0 -27
@@ -0,0 +1,12 @@
1
+ // src/core/agents/specialized/mobileOtpPrompt.ts
2
+ var MOBILE_OTP_PROMPT_GUIDANCE = `## Mobile OTP credentials
3
+
4
+ Read each credential's \`Authentication method\` before starting:
5
+ - \`sms-passwordless\`: \`phoneNumber\` is the login identifier, not MFA after a password. Reserve immediately before filling that field, then request the code.
6
+ - \`sms-mfa\`: fill username and password first. If submitting the password triggers the SMS code, reserve immediately before submitting. If it reveals a separate send-code action, reserve immediately before that action. Fill a destination phone field only if the target asks, using \`credentialId\` + \`credentialField="phoneNumber"\`.
7
+
8
+ Never ask for, write, log, or pass a public phone number. Reserve with \`sms_list_messages\` and \`reserve=true\`; the Console chooses the shared number. A 429 means that number is busy: do not wait or poll inside the tool. Make at most two separate reservation attempts (with an \`execute_command\` sleep between them), then report the authentication block.
9
+
10
+ At the action that sends the code, record \`Date.now()\` as \`sinceMs\`. Run \`execute_command\` \`sleep 5\`, then call \`sms_list_messages\` with \`sinceMs\` and \`claim=true\`. If no message arrives, make one delayed list retry; otherwise report the result rather than waiting indefinitely. Fill the claimed OTP and continue. Do not report \`phone_verification\` as a barrier for either Mobile OTP flow. TOTP via an environment variable is unchanged.`;
11
+
12
+ export { MOBILE_OTP_PROMPT_GUIDANCE };
@@ -1,14 +1,17 @@
1
+ import {
2
+ MOBILE_OTP_PROMPT_GUIDANCE
3
+ } from "./cli-0nrxvm0t.js";
1
4
  import {
2
5
  OffensiveSecurityAgent
3
- } from "./cli-repbyhkk.js";
6
+ } from "./cli-nt8jrt7c.js";
4
7
  import {
5
8
  detectOSAndEnhancePrompt
6
- } from "./cli-tznv8pf1.js";
9
+ } from "./cli-q8zkbvsn.js";
7
10
  import {
8
11
  hasToolCall,
9
12
  init_dist,
10
13
  stepCountIs
11
- } from "./cli-tkc598ey.js";
14
+ } from "./cli-0drqd790.js";
12
15
 
13
16
  // src/core/agents/specialized/attackSurface/blackboxAgent.ts
14
17
  init_dist();
@@ -377,49 +380,22 @@ function loadAttackSurfaceResults(resultsPath) {
377
380
  class BlackboxAttackSurfaceAgent extends OffensiveSecurityAgent {
378
381
  constructor(opts) {
379
382
  const {
380
- model,
381
- session,
382
- authConfig,
383
+ target: targetOpt,
384
+ cwd,
385
+ surfaceIntegrationEnabled: _surfaceIntegrationEnabled,
383
386
  onStepFinish,
384
- onCacheMetrics,
385
- abortSignal,
386
- attackSurfaceRegistry,
387
- eventBus,
388
- subagentId,
389
- enableThinking,
390
- thinkingEffort,
391
- openAIReasoningEffort
387
+ ...base
392
388
  } = opts;
393
- const target = opts.target ?? opts.cwd;
394
- const resultsPath = join(session.rootPath, "attack-surface-results.json");
395
- const assetsPath = join(session.rootPath, "assets");
389
+ const target = targetOpt ?? cwd;
390
+ const { session } = base;
396
391
  const subagentFolder = join(session.rootPath, "subagents", "attack-surface-agent");
397
392
  if (!existsSync(subagentFolder)) {
398
393
  mkdirSync(subagentFolder, { recursive: true });
399
394
  }
400
395
  super({
401
- system: detectOSAndEnhancePrompt(SYSTEM),
402
- prompt: buildPrompt(target, session),
403
- model,
404
- session,
396
+ ...base,
405
397
  target,
406
- authConfig,
407
- onStepFinish: (e) => {
408
- onStepFinish?.(e);
409
- const messages = e.response.messages;
410
- if (messages !== undefined) {
411
- writeFileSync(join(subagentFolder, "attack-surface-agent.log"), JSON.stringify(messages, null, 2));
412
- }
413
- },
414
- onCacheMetrics,
415
- abortSignal,
416
- attackSurfaceRegistry,
417
- eventBus,
418
- subagentId,
419
- enableThinking,
420
- thinkingEffort,
421
- openAIReasoningEffort,
422
- messages: opts.messages,
398
+ system: detectOSAndEnhancePrompt(SYSTEM),
423
399
  activeTools: [
424
400
  "execute_command",
425
401
  "document_app",
@@ -438,6 +414,7 @@ class BlackboxAttackSurfaceAgent extends OffensiveSecurityAgent {
438
414
  "email_search_messages",
439
415
  "email_get_message",
440
416
  "send_email",
417
+ "sms_list_messages",
441
418
  "web_search",
442
419
  "get_page"
443
420
  ],
@@ -445,8 +422,9 @@ class BlackboxAttackSurfaceAgent extends OffensiveSecurityAgent {
445
422
  hasToolCall("create_attack_surface_report"),
446
423
  stepCountIs(1e4)
447
424
  ],
448
- toolChoice: "auto",
449
425
  resolveResult: () => {
426
+ const resultsPath = join(session.rootPath, "attack-surface-results.json");
427
+ const assetsPath = join(session.rootPath, "assets");
450
428
  let results = null;
451
429
  let targets = [];
452
430
  if (existsSync(resultsPath)) {
@@ -456,11 +434,19 @@ class BlackboxAttackSurfaceAgent extends OffensiveSecurityAgent {
456
434
  } catch {}
457
435
  }
458
436
  return { results, targets, resultsPath, assetsPath };
437
+ },
438
+ prompt: buildBlackboxPrompt(target, session),
439
+ onStepFinish: (e) => {
440
+ onStepFinish?.(e);
441
+ const messages = e.response.messages;
442
+ if (messages !== undefined) {
443
+ writeFileSync(join(subagentFolder, "attack-surface-agent.log"), JSON.stringify(messages, null, 2));
444
+ }
459
445
  }
460
446
  });
461
447
  }
462
448
  }
463
- function buildPrompt(target, session) {
449
+ function buildBlackboxPrompt(target, session) {
464
450
  const scopeConstraints = session.config?.scopeConstraints;
465
451
  const authenticationInstructions = session.config?.authenticationInstructions;
466
452
  const enumerateSubdomains = session.config?.enumerateSubdomains ?? false;
@@ -483,6 +469,7 @@ ${authenticationInstructions}
483
469
  Your FIRST tool call must be: browser_navigate to ${loginTarget}
484
470
  Then use browser tools to authenticate. Pass the credentialId to delegate_to_auth_subagent — secrets are resolved automatically.
485
471
  For browser_fill on password/secret fields, use credentialId + credentialField instead of raw values.
472
+ ${MOBILE_OTP_PROMPT_GUIDANCE}
486
473
 
487
474
  Do NOT run curl, nmap, dig, or any other command before completing login.
488
475
  Include authentication information with EVERY target that requires it in your final report.
@@ -527,4 +514,4 @@ ${operatorGuidanceBlock}
527
514
  ${startDirective}`;
528
515
  }
529
516
 
530
- export { BlackboxAttackSurfaceAgent };
517
+ export { BlackboxAttackSurfaceAgent, buildBlackboxPrompt };
@@ -0,0 +1,15 @@
1
+ import {
2
+ __commonJS,
3
+ __require
4
+ } from "./cli-bc05qbss.js";
5
+
6
+ // node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js
7
+ var require_execAsync = __commonJS(function(exports) {
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.execAsync = undefined;
10
+ var child_process = __require("child_process");
11
+ var util = __require("util");
12
+ exports.execAsync = util.promisify(child_process.exec);
13
+ });
14
+
15
+ export { require_execAsync };
@@ -1,15 +1,14 @@
1
1
  import {
2
- EvidenceFileEntrySchema
3
- } from "./cli-qqt4gj1w.js";
4
- import {
2
+ AttackPathSchema,
5
3
  CweEntrySchema,
4
+ EvidenceFileEntrySchema,
6
5
  ValidatedCweEntrySchema,
7
6
  hasCanonicalName
8
- } from "./cli-repbyhkk.js";
7
+ } from "./cli-nt8jrt7c.js";
9
8
  import {
10
9
  exports_external,
11
10
  init_zod
12
- } from "./cli-swpbx60z.js";
11
+ } from "./cli-avmhkjtv.js";
13
12
 
14
13
  // src/core/report/schemas.ts
15
14
  init_zod();
@@ -27,7 +26,8 @@ var PentestReportFindingSchema = exports_external.object({
27
26
  rootCauseGroup: exports_external.string().optional(),
28
27
  relatedFindings: exports_external.array(exports_external.string()).optional(),
29
28
  rootCauseLead: exports_external.boolean().optional(),
30
- evidenceFiles: exports_external.array(EvidenceFileEntrySchema).optional()
29
+ evidenceFiles: exports_external.array(EvidenceFileEntrySchema).optional(),
30
+ attackPath: AttackPathSchema.optional()
31
31
  });
32
32
  var PentestReportSchema = exports_external.object({
33
33
  version: exports_external.string().regex(/^1\.\d+$/),
@@ -86,7 +86,8 @@ function buildPentestReport(findings, context) {
86
86
  rootCauseGroup: f.rootCauseGroup,
87
87
  relatedFindings: f.relatedFindings,
88
88
  rootCauseLead: f.rootCauseLead,
89
- evidenceFiles: f.evidenceFiles
89
+ evidenceFiles: f.evidenceFiles,
90
+ attackPath: f.attackPath
90
91
  }))
91
92
  };
92
93
  }
@@ -141,6 +142,12 @@ function renderFinding(finding, metadata) {
141
142
  "",
142
143
  finding.impact,
143
144
  "",
145
+ ...finding.attackPath?.length ? [
146
+ "## Attack Path",
147
+ "",
148
+ ...finding.attackPath.map(renderAttackPathHop),
149
+ ""
150
+ ] : [],
144
151
  "## Evidence",
145
152
  "",
146
153
  "```",
@@ -187,6 +194,20 @@ function renderFinding(finding, metadata) {
187
194
  return lines.join(`
188
195
  `);
189
196
  }
197
+ function renderAttackPathHop(hop, index) {
198
+ const parts = [];
199
+ if (hop.applicationName)
200
+ parts.push(`**${hop.applicationName}**`);
201
+ if (hop.applicationId)
202
+ parts.push(`(\`${hop.applicationId}\`)`);
203
+ if (hop.host)
204
+ parts.push(`host \`${hop.host}\``);
205
+ if (hop.relationshipType)
206
+ parts.push(`via ${hop.relationshipType}`);
207
+ if (hop.notes)
208
+ parts.push(`— ${hop.notes}`);
209
+ return `${index + 1}. ${parts.join(" ") || "Unspecified system member"}`;
210
+ }
190
211
 
191
212
  // src/core/report/index.ts
192
213
  var REPORT_FILENAME_MD = "pentest-report.md";
@@ -3,7 +3,7 @@ import {
3
3
  init_lazyLogger,
4
4
  init_structured,
5
5
  scopedLogger
6
- } from "./cli-tkc598ey.js";
6
+ } from "./cli-0drqd790.js";
7
7
 
8
8
  // src/core/integrations/wandb/client.ts
9
9
  init_structured();