@pensar/apex 2.4.0 → 2.5.0-canary.aa559068

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 (68) hide show
  1. package/build/agent-48xj79bj.js +20 -0
  2. package/build/{agent-nhs1w5w0.js → agent-7q3c9cjt.js} +11 -10
  3. package/build/{agent-5ejt5vpz.js → agent-ve8pkr6q.js} +9 -8
  4. package/build/{apps-17wvz1d7.js → apps-4rsrnftx.js} +72 -31
  5. package/build/{auth-z3h9859n.js → auth-0w07dbg2.js} +25 -20
  6. package/build/authentication-87zzmjdd.js +20 -0
  7. package/build/blackboxAgent-x0e1wqjx.js +20 -0
  8. package/build/blackboxPentest-0hwj49dr.js +70 -0
  9. package/build/{cli-32z0017y.js → cli-12ky98ey.js} +2 -2
  10. package/build/{cli-5k33webc.js → cli-2ar3m569.js} +45 -43
  11. package/build/cli-53rm0rrz.js +15 -0
  12. package/build/{cli-72cvcqhg.js → cli-54egv3xw.js} +1 -1
  13. package/build/cli-68260ckj.js +12136 -0
  14. package/build/{cli-gq40s5b3.js → cli-6cq67y5m.js} +5 -3
  15. package/build/{cli-mavved45.js → cli-7735d17s.js} +46 -25
  16. package/build/cli-7q3ae3ft.js +6 -0
  17. package/build/{cli-tznv8pf1.js → cli-8mws7sa5.js} +1 -1
  18. package/build/cli-9pbk8m32.js +32 -0
  19. package/build/{cli-swpbx60z.js → cli-avmhkjtv.js} +1 -1481
  20. package/build/{cli-9rhzhgx2.js → cli-eaaqeve1.js} +1 -1
  21. package/build/{cli-qqt4gj1w.js → cli-g0whajsq.js} +5 -3
  22. package/build/{cli-vq52kp7j.js → cli-gb1s7k3v.js} +17 -5
  23. package/build/{cli-2cbwdk78.js → cli-h8xsqggy.js} +1 -1
  24. package/build/{cli-0n4r54hq.js → cli-jsw8vt43.js} +1 -1
  25. package/build/cli-knd276ed.js +1485 -0
  26. package/build/{cli-repbyhkk.js → cli-kya26m6f.js} +1136 -525
  27. package/build/{cli-k8kc47pq.js → cli-mmyn6wmb.js} +3 -3
  28. package/build/{cli-tkc598ey.js → cli-qwv4jsj2.js} +371 -279
  29. package/build/{cli-xshasbwe.js → cli-r3w58pmq.js} +30 -4
  30. package/build/{cli-vnynf0js.js → cli-w51z9qjr.js} +10 -4
  31. package/build/{cli-b1adytsy.js → cli-whp0f8gp.js} +28 -5
  32. package/build/cli.js +553 -95
  33. package/build/{config-f1mj4nhd.js → config-z9k13rvy.js} +18 -15
  34. package/build/{doctor-ekneewa3.js → doctor-tc5zs6pn.js} +8 -7
  35. package/build/{fastStrike-8zka43xs.js → fastStrike-ssm7df42.js} +13 -10
  36. package/build/{fixes-b89s5haw.js → fixes-av9nq0hq.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-1ppbwgf9.js} +17 -9
  43. package/build/{index-mtq7kmxz.js → index-5wh7gq37.js} +4 -2
  44. package/build/{index-6d22pyxt.js → index-718m7jw9.js} +1669 -1193
  45. package/build/{index-rbzhk712.js → index-gng8ebqf.js} +11 -10
  46. package/build/{index-y5w6n3tb.js → index-hhcjyc6j.js} +2 -2
  47. package/build/{index-sf16jm0m.js → index-mffgf5hg.js} +9 -7
  48. package/build/{index-ghwf5z3v.js → index-p1atm3ha.js} +3 -3
  49. package/build/{index-4ad3sdwk.js → index-vvkvwmyr.js} +4 -4
  50. package/build/{issues-xx5bs4md.js → issues-hfg8jydv.js} +72 -26
  51. package/build/{logs-qtxe51w2.js → logs-0rd1z7ct.js} +25 -20
  52. package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-j4epj93p.js} +10 -9
  53. package/build/pentest-dp9w88pw.js +30 -0
  54. package/build/{pentests-6ks3szc4.js → pentests-enyxjtg6.js} +26 -21
  55. package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-kwabfy86.js} +11 -10
  56. package/build/{targets-sxygyj87.js → targets-7x0pcmws.js} +27 -22
  57. package/build/threatModel-zwk5eb6r.js +29 -0
  58. package/build/{uninstall-tvsh81v8.js → uninstall-psm9btpt.js} +6 -3
  59. package/build/{upload-7wdyyqmr.js → upload-dybnknjs.js} +8 -7
  60. package/build/{utils-7fwdkqk6.js → utils-dsfk965b.js} +7 -6
  61. package/package.json +8 -2
  62. package/build/agent-mvpgvgks.js +0 -19
  63. package/build/authentication-3s97cpk4.js +0 -19
  64. package/build/blackboxAgent-gw0a1ca4.js +0 -19
  65. package/build/blackboxPentest-44333zss.js +0 -37
  66. package/build/main-mmjp338j.js +0 -324
  67. package/build/pentest-xtc1sjdw.js +0 -29
  68. package/build/threatModel-xsm6fwk5.js +0 -27
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-repbyhkk.js";
3
+ } from "./cli-kya26m6f.js";
4
4
  import {
5
5
  detectOSAndEnhancePrompt
6
- } from "./cli-tznv8pf1.js";
6
+ } from "./cli-8mws7sa5.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-tkc598ey.js";
14
+ } from "./cli-qwv4jsj2.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
@@ -3,7 +3,7 @@ import {
3
3
  } from "./cli-bc05qbss.js";
4
4
 
5
5
  // package.json
6
- var package_default;
6
+ var version = "2.5.0-canary.aa559068", package_default;
7
7
  var init_package = __esm(() => {
8
8
  package_default = {
9
9
  author: "Pensar",
@@ -23,6 +23,10 @@ var init_package = __esm(() => {
23
23
  "@modelcontextprotocol/sdk": "^1.29.0",
24
24
  "@openrouter/ai-sdk-provider": "^2.9.1",
25
25
  "@opentelemetry/api": "^1.9.1",
26
+ "@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
27
+ "@opentelemetry/otlp-exporter-base": "^0.221.0",
28
+ "@opentelemetry/otlp-transformer": "^0.221.0",
29
+ "@opentelemetry/resources": "^2.10.0",
26
30
  "@opentui/core": "^0.1.107",
27
31
  "@opentui/react": "^0.1.107",
28
32
  "@pensar/surface": "0.3.0",
@@ -46,6 +50,8 @@ var init_package = __esm(() => {
46
50
  description: "AI-powered penetration testing CLI tool with terminal UI",
47
51
  devDependencies: {
48
52
  "@biomejs/biome": "2.4.14",
53
+ "@opentelemetry/context-async-hooks": "^2.10.0",
54
+ "@opentelemetry/sdk-trace-base": "^2.10.0",
49
55
  "@types/bun": "^1.3.14",
50
56
  "@types/mailparser": "^3.4.6",
51
57
  "@types/mime-types": "^3.0.1",
@@ -92,7 +98,7 @@ var init_package = __esm(() => {
92
98
  url: "https://github.com/pensarai/apex.git"
93
99
  },
94
100
  scripts: {
95
- build: "bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
101
+ build: "rm -rf build && bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
96
102
  "build:binaries": "bun run generate:ascii && mkdir -p dist && bun run build:binary:macos-arm64 && bun run build:binary:macos-x64 && bun run build:binary:linux-x64 && bun run build:binary:linux-arm64",
97
103
  "build:binary": "bun run generate:ascii && bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --outfile pensar",
98
104
  "build:binary:linux-arm64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-linux-arm64 --outfile dist/pensar-linux-arm64",
@@ -120,7 +126,7 @@ var init_package = __esm(() => {
120
126
  tsc: "tsc --noEmit"
121
127
  },
122
128
  type: "module",
123
- version: "2.4.0"
129
+ version
124
130
  };
125
131
  });
126
132
 
@@ -195,4 +201,4 @@ var init_installation = __esm(() => {
195
201
  init_package();
196
202
  });
197
203
 
198
- export { init_package, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };
204
+ export { init_package, version, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };
@@ -1,15 +1,16 @@
1
1
  import {
2
2
  EvidenceFileEntrySchema
3
- } from "./cli-qqt4gj1w.js";
3
+ } from "./cli-g0whajsq.js";
4
4
  import {
5
+ AttackPathSchema,
5
6
  CweEntrySchema,
6
7
  ValidatedCweEntrySchema,
7
8
  hasCanonicalName
8
- } from "./cli-repbyhkk.js";
9
+ } from "./cli-kya26m6f.js";
9
10
  import {
10
11
  exports_external,
11
12
  init_zod
12
- } from "./cli-swpbx60z.js";
13
+ } from "./cli-avmhkjtv.js";
13
14
 
14
15
  // src/core/report/schemas.ts
15
16
  init_zod();
@@ -27,7 +28,8 @@ var PentestReportFindingSchema = exports_external.object({
27
28
  rootCauseGroup: exports_external.string().optional(),
28
29
  relatedFindings: exports_external.array(exports_external.string()).optional(),
29
30
  rootCauseLead: exports_external.boolean().optional(),
30
- evidenceFiles: exports_external.array(EvidenceFileEntrySchema).optional()
31
+ evidenceFiles: exports_external.array(EvidenceFileEntrySchema).optional(),
32
+ attackPath: AttackPathSchema.optional()
31
33
  });
32
34
  var PentestReportSchema = exports_external.object({
33
35
  version: exports_external.string().regex(/^1\.\d+$/),
@@ -86,7 +88,8 @@ function buildPentestReport(findings, context) {
86
88
  rootCauseGroup: f.rootCauseGroup,
87
89
  relatedFindings: f.relatedFindings,
88
90
  rootCauseLead: f.rootCauseLead,
89
- evidenceFiles: f.evidenceFiles
91
+ evidenceFiles: f.evidenceFiles,
92
+ attackPath: f.attackPath
90
93
  }))
91
94
  };
92
95
  }
@@ -141,6 +144,12 @@ function renderFinding(finding, metadata) {
141
144
  "",
142
145
  finding.impact,
143
146
  "",
147
+ ...finding.attackPath?.length ? [
148
+ "## Attack Path",
149
+ "",
150
+ ...finding.attackPath.map(renderAttackPathHop),
151
+ ""
152
+ ] : [],
144
153
  "## Evidence",
145
154
  "",
146
155
  "```",
@@ -187,6 +196,20 @@ function renderFinding(finding, metadata) {
187
196
  return lines.join(`
188
197
  `);
189
198
  }
199
+ function renderAttackPathHop(hop, index) {
200
+ const parts = [];
201
+ if (hop.applicationName)
202
+ parts.push(`**${hop.applicationName}**`);
203
+ if (hop.applicationId)
204
+ parts.push(`(\`${hop.applicationId}\`)`);
205
+ if (hop.host)
206
+ parts.push(`host \`${hop.host}\``);
207
+ if (hop.relationshipType)
208
+ parts.push(`via ${hop.relationshipType}`);
209
+ if (hop.notes)
210
+ parts.push(`— ${hop.notes}`);
211
+ return `${index + 1}. ${parts.join(" ") || "Unspecified system member"}`;
212
+ }
190
213
 
191
214
  // src/core/report/index.ts
192
215
  var REPORT_FILENAME_MD = "pentest-report.md";