@pensar/apex 2.3.0 → 2.4.0-canary.09a8744f

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 (81) hide show
  1. package/build/{agent-9xna7jhw.js → agent-4gcavfr4.js} +12 -11
  2. package/build/agent-7x7b5hz1.js +30 -0
  3. package/build/agent-zx1cw89c.js +20 -0
  4. package/build/{apps-43pqbz7r.js → apps-xqecgcbn.js} +75 -34
  5. package/build/{auth-c1z670rx.js → auth-62z3kedh.js} +46 -23
  6. package/build/authentication-phbasmkj.js +20 -0
  7. package/build/blackboxAgent-3s34dabp.js +20 -0
  8. package/build/blackboxPentest-mg2p9s1m.js +70 -0
  9. package/build/{cli-zk1ch6qf.js → cli-4a1c4tkn.js} +61 -10
  10. package/build/{cli-zx8gk8xv.js → cli-51503njj.js} +661 -328
  11. package/build/cli-53rm0rrz.js +15 -0
  12. package/build/{cli-eveg9djy.js → cli-5tbg4dyb.js} +3 -2
  13. package/build/cli-68260ckj.js +12136 -0
  14. package/build/{cli-baqhqbe5.js → cli-7gcsfnw6.js} +3 -3
  15. package/build/cli-7q3ae3ft.js +6 -0
  16. package/build/{cli-72b18z0n.js → cli-8nj7pnew.js} +28 -5
  17. package/build/{cli-f7hanqbw.js → cli-9fds4ss0.js} +2 -2
  18. package/build/cli-9pbk8m32.js +32 -0
  19. package/build/{cli-3k1x5rn3.js → cli-avmhkjtv.js} +2970 -4450
  20. package/build/{cli-vckbhnyk.js → cli-b3d97zgc.js} +2 -2
  21. package/build/{cli-8rxa073f.js → cli-bc05qbss.js} +8 -6
  22. package/build/{cli-7tw4xfnw.js → cli-cdk877bx.js} +1 -1
  23. package/build/{cli-q24twygk.js → cli-dm0fc0bm.js} +1 -1
  24. package/build/{cli-barsn8br.js → cli-e1gmqsyh.js} +11 -5
  25. package/build/{cli-yz80qkzn.js → cli-ee3axgts.js} +7 -1
  26. package/build/{cli-f71s6kcw.js → cli-ex9r1x7c.js} +81 -215
  27. package/build/{cli-n2m2yy5b.js → cli-hc4w41as.js} +2105 -957
  28. package/build/{cli-gpnb45ck.js → cli-j54qa6tm.js} +7 -7
  29. package/build/{cli-j0n189ee.js → cli-j5p6jwm8.js} +2 -2
  30. package/build/{cli-wszshs5e.js → cli-k71t434r.js} +4 -4
  31. package/build/cli-knd276ed.js +1485 -0
  32. package/build/{cli-zm8tfpv7.js → cli-n36kxpcz.js} +62 -44
  33. package/build/{cli-bv2807tj.js → cli-n4cmzq79.js} +5 -3
  34. package/build/{cli-jyp2c6th.js → cli-nvqny4ej.js} +5 -3
  35. package/build/{cli-50906d27.js → cli-nw9ytp7z.js} +122 -43
  36. package/build/{cli-bnkgdywr.js → cli-ppj4c75j.js} +1 -1
  37. package/build/cli.js +546 -98
  38. package/build/{config-jzqjz606.js → config-7f07yemp.js} +20 -17
  39. package/build/{doctor-q3qws68e.js → doctor-gwvyn249.js} +11 -9
  40. package/build/{fastStrike-ebz1ph9a.js → fastStrike-zxsk2q40.js} +39 -16
  41. package/build/{fixes-86yebsj0.js → fixes-zqe8v8ye.js} +27 -22
  42. package/build/getMachineId-bsd-xj3bn2fv.js +36 -0
  43. package/build/getMachineId-darwin-07jzjcx6.js +36 -0
  44. package/build/getMachineId-linux-ahngynxd.js +29 -0
  45. package/build/getMachineId-unsupported-vy43b44z.js +19 -0
  46. package/build/getMachineId-win-8x66cynz.js +38 -0
  47. package/build/{index-32hn8rrw.js → index-4j14ssrg.js} +3 -3
  48. package/build/{index-gq9h8j5j.js → index-5wh7gq37.js} +135 -133
  49. package/build/{index-468j74f3.js → index-6s313ddp.js} +121 -97
  50. package/build/{index-e8c8zcrf.js → index-9j3pakz7.js} +32 -26
  51. package/build/{index-h2hj2hj9.js → index-cbwn03kz.js} +16 -16
  52. package/build/{index-8db1d2q3.js → index-cmvmnes1.js} +18 -18
  53. package/build/{index-tke6896d.js → index-psqjpw5m.js} +10 -10
  54. package/build/index-r4z6r7vf.js +12 -0
  55. package/build/{index-97vx1a24.js → index-rdqjtnp7.js} +2774 -2236
  56. package/build/{index-mr2cseg4.js → index-wddghhbd.js} +20 -19
  57. package/build/{issues-kh4wg8c5.js → issues-j7ybeaz9.js} +36 -28
  58. package/build/{logs-bj28xmbf.js → logs-qdceq54y.js} +27 -22
  59. package/build/{multipart-parser-6zd16497.js → multipart-parser-g2xxkezz.js} +2 -2
  60. package/build/{offesecAgent-8ky7gccp.js → offesecAgent-9tecezzm.js} +12 -11
  61. package/build/{parse-7djk9jyf.js → parse-rtccymzn.js} +3 -3
  62. package/build/pentest-qk82s64n.js +30 -0
  63. package/build/{pentests-62d6zw6p.js → pentests-97d3rwzr.js} +28 -23
  64. package/build/{targetedPentest-me4jnr3z.js → targetedPentest-g9x0g0zp.js} +15 -14
  65. package/build/{targets-e5k1mrky.js → targets-6m1cp1hx.js} +29 -24
  66. package/build/threatModel-a4gsw56r.js +29 -0
  67. package/build/{token-rdcbn380.js → token-3bbp59y6.js} +3 -3
  68. package/build/{token-util-sxb85ahn.js → token-util-6xjme11b.js} +2 -2
  69. package/build/{uninstall-jt1bca2p.js → uninstall-pkxkzt35.js} +7 -4
  70. package/build/{upload-krd8bnex.js → upload-w71jnkg0.js} +12 -11
  71. package/build/{utils-skmqhyfg.js → utils-846z7q2v.js} +18 -13
  72. package/package.json +8 -2
  73. package/build/agent-71z4e7jg.js +0 -19
  74. package/build/agent-ga5fecfs.js +0 -27
  75. package/build/authentication-hgs7ym0m.js +0 -19
  76. package/build/blackboxAgent-gem3mxa9.js +0 -19
  77. package/build/blackboxPentest-tgc2t3y6.js +0 -37
  78. package/build/index-ag14v3sg.js +0 -12
  79. package/build/main-3d7dfdvs.js +0 -324
  80. package/build/pentest-rs0181nf.js +0 -29
  81. package/build/threatModel-k4f3zgqd.js +0 -27
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-n2m2yy5b.js";
3
+ } from "./cli-hc4w41as.js";
4
4
  import {
5
5
  detectOSAndEnhancePrompt
6
- } from "./cli-7tw4xfnw.js";
6
+ } from "./cli-cdk877bx.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-zx8gk8xv.js";
14
+ } from "./cli-51503njj.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,39 @@ 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
+
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
+
128
161
  # Error Recovery
129
162
 
130
163
  If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
@@ -136,7 +169,8 @@ If authentication fails, try these mechanical fixes (they are login mechanics, n
136
169
 
137
170
  If credentials were provided to you, they are already verified and SHARED — do not modify them or their
138
171
  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 confirmed — do NOT try to recover by resetting or changing
172
+ forced password change is required, MFA is required and no TOTP seed was provided, or the email is not
173
+ confirmed — do NOT try to recover by resetting or changing
140
174
  the password, modifying MFA/2FA settings, or running any account-recovery flow. Fail fast: call
141
175
  \`complete_authentication\` with success=false and a summary naming the reason. Do NOT register a new account
142
176
  or self-sign-up to get around a rejected provided credential — that is a different account than the one
@@ -194,7 +228,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
194
228
  const cm = session.credentialManager;
195
229
  super({
196
230
  system: detectOSAndEnhancePrompt(AUTH_SUBAGENT_SYSTEM_PROMPT),
197
- prompt: buildAuthPrompt(target, authHints, cm, context),
231
+ prompt: buildAuthPrompt(target, authHints, cm, context, environmentVariables ? Object.keys(environmentVariables) : undefined),
198
232
  model,
199
233
  session,
200
234
  target,
@@ -226,6 +260,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
226
260
  "email_search_messages",
227
261
  "email_get_message",
228
262
  "send_email",
263
+ "sms_list_messages",
229
264
  "web_search",
230
265
  "get_page"
231
266
  ],
@@ -272,7 +307,7 @@ function loadAuthResult(authDataPath) {
272
307
  };
273
308
  }
274
309
  }
275
- function buildAuthPrompt(target, authHints, credentialManager, context) {
310
+ function buildAuthPrompt(target, authHints, credentialManager, context, envVarNames) {
276
311
  const parts = [`TARGET: ${target}
277
312
  `];
278
313
  if (context) {
@@ -290,6 +325,13 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
290
325
  parts.push(`No credentials provided. Probe the target to discover auth requirements.
291
326
  `);
292
327
  }
328
+ if (envVarNames?.length) {
329
+ parts.push("ENVIRONMENT VARIABLES:");
330
+ 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.`);
331
+ parts.push(envVarNames.map((n) => `- ${n}`).join(`
332
+ `));
333
+ parts.push("");
334
+ }
293
335
  if (authHints) {
294
336
  parts.push("AUTH HINTS:");
295
337
  if (authHints.authScheme)
@@ -304,6 +346,14 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
304
346
  parts.push("");
305
347
  }
306
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.` : "";
307
357
  parts.push(`INSTRUCTIONS:
308
358
  You have credentials available via credential IDs — authenticate immediately.
309
359
  1. For API/form logins, use execute_command (curl) to submit credentials and capture the Set-Cookie / token response
@@ -311,13 +361,14 @@ You have credentials available via credential IDs — authenticate immediately.
311
361
  pass credentialId + credentialField (e.g. credentialField="password") instead of the raw value —
312
362
  the secret is resolved securely at execution time. NEVER type a password directly.
313
363
  3. Call complete_authentication with exported cookies/headers to persist credentials and end the run
314
-
364
+ ${smsInstructions}
315
365
  The credentials above were provided to you and have already been verified — they are SHARED across runs, so
316
366
  do not modify them or their account settings. NEVER change the password, complete a password reset /
317
367
  forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
318
368
  resetting a second factor) for this account. If they do not authenticate (rejected, locked out, forced
319
- password change required, MFA required, email not confirmed), call complete_authentication with
320
- success=false and a clear summary of why — do not attempt to recover, reset, or rotate them. Do NOT
369
+ password change required, email not confirmed, or an MFA prompt with no TOTP seed available), call
370
+ complete_authentication with success=false and a clear summary of why — do not attempt to recover, reset,
371
+ or rotate them. When a TOTP seed IS available, generate the code and continue; that is not a barrier. Do NOT
321
372
  register a new account or self-sign-up to work around a failed login: that is not the credential under test
322
373
  and only pollutes results — fail fast with success=false instead.`);
323
374
  } else {