@pensar/apex 0.0.115-canary.60bf5fa4 → 0.0.115-canary.78d2d7dd
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/README.md +43 -0
- package/build/agent-bpxwmtxm.js +17 -0
- package/build/{agent-b6q8zg3g.js → agent-nm6c5ns8.js} +75 -21
- package/build/{auth-xavy7vhv.js → auth-skr2man1.js} +4 -4
- package/build/{authentication-6eh9a3zy.js → authentication-s0vvhxpa.js} +23 -21
- package/build/blackboxAgent-dvhet08t.js +18 -0
- package/build/blackboxPentest-r67jj0j1.js +36 -0
- package/build/{cli-4y02kfw6.js → cli-0wve372a.js} +2 -415
- package/build/{cli-yerz6636.js → cli-2jdpgtmk.js} +1 -1
- package/build/cli-3y0dgy56.js +48 -0
- package/build/{cli-8gbb67rt.js → cli-4fze1nfh.js} +27 -9
- package/build/{cli-9r0s6vp0.js → cli-867kbj0c.js} +222 -62
- package/build/{cli-6dxcgqj7.js → cli-9j8k95v4.js} +4 -3
- package/build/{cli-8d5b6tdt.js → cli-bksgzyyn.js} +18 -33
- package/build/{cli-170kbfjp.js → cli-fvpmqcde.js} +8578 -9110
- package/build/cli-fw5r7pfj.js +19 -0
- package/build/{cli-va4y0089.js → cli-gpnb45ck.js} +101 -18
- package/build/{cli-a9m7mz6r.js → cli-hdb9d7r0.js} +232 -283
- package/build/{cli-zcyjrmz1.js → cli-hy4qmtqq.js} +1 -1
- package/build/{cli-fjv700j4.js → cli-km6s27mj.js} +15178 -5274
- package/build/{cli-mb4vmv5r.js → cli-mg3bvqq9.js} +3 -2
- package/build/{cli-36wjhnfk.js → cli-n3ndwpgc.js} +1 -1
- package/build/{cli-m4g13900.js → cli-nw1pczc7.js} +1 -1
- package/build/cli-pkdjamer.js +100 -0
- package/build/cli-r8cerdwk.js +1423 -0
- package/build/{cli-mcdwx2m5.js → cli-ttar2ydd.js} +5 -3
- package/build/cli-yz80qkzn.js +60 -0
- package/build/{cli-w5aktny4.js → cli-zmgzw8jk.js} +265 -16
- package/build/cli.js +157 -56
- package/build/{fixes-d4aqn3r9.js → fixes-rq19qrch.js} +4 -4
- package/build/{index-1v91wn4w.js → index-8m4md3q3.js} +2 -2
- package/build/{index-nvm1q87n.js → index-af83er0y.js} +16 -13
- package/build/{index-2n1e9g8p.js → index-tsfgqzz5.js} +3188 -2238
- package/build/{issues-77m757jr.js → issues-3rp5hxxb.js} +4 -4
- package/build/{logs-jcp5bw0m.js → logs-s2a7mnkh.js} +4 -4
- package/build/{main-2483qzbq.js → main-3d7dfdvs.js} +17 -90
- package/build/pentest-c7k6xda1.js +28 -0
- package/build/{pentests-80mkryzz.js → pentests-vqj1te11.js} +4 -4
- package/build/{projects-2qx6zg5g.js → projects-w96qzpap.js} +4 -4
- package/build/{targetedPentest-cq47e8fv.js → targetedPentest-0bwfqj2j.js} +11 -10
- package/build/{threatModel-e7gm3vwj.js → threatModel-ay7pjt4k.js} +18 -12
- package/build/{token-6x6aavpc.js → token-rdcbn380.js} +21 -14
- package/build/{token-util-na95bqjj.js → token-util-sxb85ahn.js} +1 -2
- package/build/{uninstall-00qrczq0.js → uninstall-jjfp0cd8.js} +1 -1
- package/build/upload-7wtbr768.js +36 -0
- package/build/{utils-yk9q4q84.js → utils-zvr7bcyw.js} +8 -4
- package/package.json +3 -2
- package/build/agent-b16rs7tr.js +0 -16
- package/build/blackboxAgent-p56nvez7.js +0 -17
- package/build/blackboxPentest-z7tncbx5.js +0 -42
- package/build/cli-5d6cs4dq.js +0 -53
- package/build/cli-7ckctq7a.js +0 -45
- package/build/cli-z96s1mhh.js +0 -1364
- package/build/pentest-6accn24g.js +0 -26
package/README.md
CHANGED
|
@@ -54,6 +54,49 @@ Open the Apex TUI:
|
|
|
54
54
|
pensar
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
### Headless CLI
|
|
58
|
+
|
|
59
|
+
Run pentests without the TUI for scripting, CI, or evalgate integration:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Basic pentest
|
|
63
|
+
pensar pentest --target https://example.com
|
|
64
|
+
|
|
65
|
+
# With extended thinking and task-driven mode
|
|
66
|
+
pensar pentest --target https://example.com --extended-thinking --task-driven
|
|
67
|
+
|
|
68
|
+
# Whitebox (with source code access)
|
|
69
|
+
pensar pentest --target https://example.com --cwd ./my-app
|
|
70
|
+
|
|
71
|
+
# Targeted pentest with specific objectives
|
|
72
|
+
pensar targeted-pentest --target https://example.com --objective "Test authentication bypass"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
| Flag | Command | Description |
|
|
76
|
+
| ------------------------------ | ------------------------- | ---------------------------------------------- |
|
|
77
|
+
| `--target <url>` | pentest, targeted-pentest | Target URL (required) |
|
|
78
|
+
| `--cwd <path>` | pentest | Source code path for whitebox mode |
|
|
79
|
+
| `--mode <mode>` | pentest | `exfil` for pivoting and flag extraction |
|
|
80
|
+
| `--model <model>` | pentest, targeted-pentest | AI model (default: auto-selected) |
|
|
81
|
+
| `--extended-thinking` | pentest | Enable extended thinking for supported models |
|
|
82
|
+
| `--task-driven` | pentest | Enable task-driven architecture (experimental) |
|
|
83
|
+
| `--prompt <text\|@file>` | pentest | Custom guidance for the agent |
|
|
84
|
+
| `--threat-model <text\|@file>` | pentest | Threat model to guide testing |
|
|
85
|
+
| `--objective <text>` | targeted-pentest | Testing objective (repeatable) |
|
|
86
|
+
|
|
87
|
+
### W&B Weave Tracing
|
|
88
|
+
|
|
89
|
+
Stream step-level agent traces to Weights & Biases Weave for analysis and fine-tuning:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
export WANDB_API_KEY=your-key
|
|
93
|
+
export WANDB_ENTITY=your-entity
|
|
94
|
+
# WANDB_PROJECT defaults to "apex-traces"
|
|
95
|
+
pensar pentest --target https://example.com
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Traces include reasoning steps, tool calls, token usage, and state checkpoints. When credentials are not set, tracing is silently disabled.
|
|
99
|
+
|
|
57
100
|
## Kali Linux Container (Optional)
|
|
58
101
|
|
|
59
102
|
For **best performance**, run Apex in the included Kali Linux container with preconfigured pentest tools:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent
|
|
3
|
+
} from "./cli-ttar2ydd.js";
|
|
4
|
+
import"./cli-km6s27mj.js";
|
|
5
|
+
import"./cli-0wve372a.js";
|
|
6
|
+
import"./cli-3y0dgy56.js";
|
|
7
|
+
import"./cli-fvpmqcde.js";
|
|
8
|
+
import"./cli-r8cerdwk.js";
|
|
9
|
+
import"./cli-2jdpgtmk.js";
|
|
10
|
+
import"./cli-hy4qmtqq.js";
|
|
11
|
+
import"./cli-nw1pczc7.js";
|
|
12
|
+
import"./cli-mg3bvqq9.js";
|
|
13
|
+
import"./cli-gpnb45ck.js";
|
|
14
|
+
import"./cli-8rxa073f.js";
|
|
15
|
+
export {
|
|
16
|
+
CodeAgent
|
|
17
|
+
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WhiteboxAttackSurfaceResultSchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-9j8k95v4.js";
|
|
4
4
|
import {
|
|
5
5
|
OffensiveSecurityAgent
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-km6s27mj.js";
|
|
7
|
+
import"./cli-0wve372a.js";
|
|
8
|
+
import"./cli-3y0dgy56.js";
|
|
8
9
|
import {
|
|
9
10
|
hasToolCall,
|
|
10
11
|
tool
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
12
|
+
} from "./cli-fvpmqcde.js";
|
|
13
|
+
import"./cli-r8cerdwk.js";
|
|
14
|
+
import"./cli-2jdpgtmk.js";
|
|
15
|
+
import"./cli-hy4qmtqq.js";
|
|
16
|
+
import"./cli-nw1pczc7.js";
|
|
17
|
+
import"./cli-mg3bvqq9.js";
|
|
18
|
+
import"./cli-gpnb45ck.js";
|
|
18
19
|
import"./cli-8rxa073f.js";
|
|
19
20
|
|
|
20
21
|
// src/core/agents/specialized/whiteboxAttackSurface/prompts.ts
|
|
@@ -29,6 +30,7 @@ Given a codebase path, you must:
|
|
|
29
30
|
2. Discover every application/service defined in the repo
|
|
30
31
|
3. For each app, enumerate ALL web pages and ALL API endpoints defined in the source code
|
|
31
32
|
4. For each endpoint, generate specific pentest objectives
|
|
33
|
+
5. **Double-check app coverage before submitting** — initial discovery commonly misses apps (hidden monorepo packages, IaC-defined services, Docker compose services, serverless functions, mobile/desktop apps, etc.). A dedicated verification pass is mandatory before you submit results.
|
|
32
34
|
|
|
33
35
|
# Tools at Your Disposal
|
|
34
36
|
|
|
@@ -46,9 +48,9 @@ Your primary search tool. Use it to find route definitions, middleware, controll
|
|
|
46
48
|
- Each application/service you identify (appType: "web_application" or "api")
|
|
47
49
|
- Notable subdomains hosting distinct services (appType: "subdomain")
|
|
48
50
|
- Cloud resources like S3 buckets, cloud storage, CDN origins (appType: "cloud_resource" or "storage")
|
|
49
|
-
- For S3 buckets: set
|
|
50
|
-
- For other cloud resources: set
|
|
51
|
-
- If known domains are provided, set the \`domain\` field to associate the app with the correct domain
|
|
51
|
+
- For S3 buckets: set \`domain\` to the **canonical virtual-hosted-style** endpoint (e.g. "https://bucket-name.s3.amazonaws.com") and use appType "storage". Do NOT use path-style URLs (e.g. "https://s3.amazonaws.com/bucket-name").
|
|
52
|
+
- For other cloud resources: set \`domain\` to the primary/canonical resource endpoint and use appType "cloud_resource"
|
|
53
|
+
- If known domains are provided, set the \`domain\` field to associate the app with the correct domain. **Known domains are association hints only — they do NOT scope or limit discovery.** Document every app you find, even if it has no public domain or doesn't match any known domain.
|
|
52
54
|
|
|
53
55
|
## document_endpoint
|
|
54
56
|
**This is your primary output tool for endpoints.** Each call persists a JSON record to the session's endpoints directory, organized by app. Document:
|
|
@@ -85,7 +87,9 @@ Call this LAST with your complete structured results. This ends your run.
|
|
|
85
87
|
- S3 buckets, GCS buckets, Azure Blob Storage (search for bucket names, s3://, storage URLs)
|
|
86
88
|
- CDN distributions (CloudFront, Cloudflare)
|
|
87
89
|
- Infrastructure-as-code definitions (Terraform, CloudFormation, CDK, SST, Pulumi, serverless.yml)
|
|
88
|
-
- Document each as an app with appType "cloud_resource" or "storage" and set the
|
|
90
|
+
- Document each as an app with appType "cloud_resource" or "storage" and set the \`domain\` to the **canonical** resource endpoint
|
|
91
|
+
- **S3 canonical URL:** Always use virtual-hosted-style "https://bucket-name.s3.amazonaws.com" (or with region: "https://bucket-name.s3.us-east-1.amazonaws.com"). Never use path-style "https://s3.amazonaws.com/bucket-name".
|
|
92
|
+
- **Do NOT document alternative URL formats** as separate endpoints — only document the canonical/primary URL and any distinct functional paths under it
|
|
89
93
|
|
|
90
94
|
## Phase 2: APP ANALYSIS (delegate to coding agents)
|
|
91
95
|
For each app you identified, spawn a coding agent with a detailed objective. The objective should instruct the agent to:
|
|
@@ -101,11 +105,46 @@ For each app you identified, spawn a coding agent with a detailed objective. The
|
|
|
101
105
|
- Source-code file in \`file\` (e.g., \`src/routes/users.ts\`) — this is NOT the route
|
|
102
106
|
- Line number in \`line\`
|
|
103
107
|
- Auth requirement in \`authRequired\`
|
|
104
|
-
- Specific pentest objectives in \`pentestObjectives\`
|
|
105
108
|
|
|
106
109
|
**IMPORTANT:** Tell each coding agent to set \`appName\` on every \`document_endpoint\` call so endpoints are organized by application.
|
|
107
110
|
|
|
108
|
-
## Phase 3:
|
|
111
|
+
## Phase 3: COVERAGE DOUBLE-CHECK (do this yourself — DO NOT SKIP)
|
|
112
|
+
|
|
113
|
+
**Initial app discovery almost always misses something.** Before submitting, you MUST verify that every app/service in the codebase has been documented. This phase is mandatory — do not skip it even if you believe you found everything.
|
|
114
|
+
|
|
115
|
+
1. **Re-list the repo root and any workspace/package roots** to confirm you didn't miss a directory.
|
|
116
|
+
2. **Check monorepo workspace declarations** against your documented apps:
|
|
117
|
+
- \`package.json\` \`workspaces\` field, \`pnpm-workspace.yaml\`, \`lerna.json\`, \`nx.json\`, \`turbo.json\`, \`rush.json\`
|
|
118
|
+
- \`Cargo.toml\` \`[workspace]\` members, \`go.work\` use directives
|
|
119
|
+
- Any top-level \`apps/\`, \`packages/\`, \`services/\`, \`cmd/\`, \`functions/\`, \`lambdas/\`, \`workers/\` directories
|
|
120
|
+
3. **Search for additional entry points** you may have missed. Run targeted greps such as:
|
|
121
|
+
- Framework manifests: \`next.config.*\`, \`vite.config.*\`, \`remix.config.*\`, \`nuxt.config.*\`, \`astro.config.*\`, \`svelte.config.*\`, \`angular.json\`, \`gatsby-config.*\`, \`expo.json\`, \`app.json\`
|
|
122
|
+
- Backend entry points: \`main.py\`, \`app.py\`, \`manage.py\`, \`wsgi.py\`, \`asgi.py\`, \`server.{ts,js,go,rs}\`, \`main.{go,rs}\`, \`Program.cs\`, \`Startup.cs\`
|
|
123
|
+
- Dockerfiles and \`docker-compose.y*ml\` services — each service may be a separate app
|
|
124
|
+
- IaC definitions: \`serverless.y*ml\`, \`sam.y*ml\`, \`template.y*ml\`, \`*.tf\`, \`cdk.json\`, \`sst.config.*\`, \`pulumi.yaml\`
|
|
125
|
+
- CI/CD deployment configs: \`.github/workflows/\`, \`vercel.json\`, \`netlify.toml\`, \`fly.toml\`, \`railway.toml\`, \`app.yaml\`, \`Procfile\`
|
|
126
|
+
- Mobile apps: \`ios/\`, \`android/\`, \`*.xcodeproj\`, \`AndroidManifest.xml\`
|
|
127
|
+
- Browser extensions / desktop apps: \`manifest.json\` (MV2/MV3), \`electron\`, \`tauri.conf.*\`
|
|
128
|
+
- Background jobs / workers: search for \`worker\`, \`queue\`, \`cron\`, \`scheduler\`, \`BullMQ\`, \`Celery\`, \`Sidekiq\`
|
|
129
|
+
4. **Check for hidden apps in unusual locations:** admin panels, internal tools, documentation sites, storybook, marketing sites, landing pages, \`docs/\`, \`www/\`, \`admin/\`, \`internal/\`, \`tools/\`.
|
|
130
|
+
5. **Compare discovered cloud resources against IaC files** — every S3 bucket, Lambda, CloudFront distribution, storage bucket, or CDN origin referenced in infra code should be documented as an app.
|
|
131
|
+
|
|
132
|
+
For every candidate you identify in this phase:
|
|
133
|
+
- If it's **already documented** — good, move on.
|
|
134
|
+
- If it's **NOT documented** — spawn another coding agent to analyze it, or document it yourself with \`document_app\` / \`document_endpoint\`. Do not simply note it in the final summary; it must be in the apps list.
|
|
135
|
+
|
|
136
|
+
Only proceed to Phase 4 once you have explicitly walked through the checks above and confirmed coverage is complete.
|
|
137
|
+
|
|
138
|
+
## Phase 4: COLLECT AND SUBMIT (do this yourself)
|
|
139
|
+
|
|
140
|
+
Before calling \`submit_results\`, verify the final coverage checklist:
|
|
141
|
+
- [ ] Every workspace package / service directory is represented by a documented app
|
|
142
|
+
- [ ] Every framework entry point discovered in Phase 3 maps to a documented app
|
|
143
|
+
- [ ] Every Dockerfile / compose service / IaC resource maps to a documented app or cloud resource
|
|
144
|
+
- [ ] Every known domain (if provided) that maps to an app in the repo has been associated via the \`domain\` field — but apps that don't map to a known domain are still documented (known domains are hints, not a scope filter)
|
|
145
|
+
- [ ] Each documented app has its endpoints/pages enumerated (or an explicit note in \`pentestObjectives\` if it is a non-HTTP service)
|
|
146
|
+
|
|
147
|
+
Then:
|
|
109
148
|
1. Parse the output from all coding agents
|
|
110
149
|
2. Assemble the complete structured result
|
|
111
150
|
3. Call \`submit_results\` with the full data
|
|
@@ -116,6 +155,8 @@ For each app you identified, spawn a coding agent with a detailed objective. The
|
|
|
116
155
|
- Give coding agents VERY detailed objectives — they work best with specific instructions about what to search for and how to report it.
|
|
117
156
|
- Don't duplicate work — let the coding agents do the deep file-by-file analysis.
|
|
118
157
|
- When in doubt about repo structure, read more config files before deciding.
|
|
158
|
+
- **Never skip the Phase 3 coverage double-check** — initial discovery routinely misses apps, and a second pass is the cheapest way to catch them.
|
|
159
|
+
- **Known domains are association hints, not a scope filter.** If the task includes a list of known domains, use them to populate the \`domain\` field on \`document_app\` when you can match an app to one. Do NOT use them to decide which apps, packages, services, endpoints, or cloud resources are worth documenting — document everything found in the codebase.
|
|
119
160
|
`;
|
|
120
161
|
|
|
121
162
|
// src/core/agents/specialized/whiteboxAttackSurface/agent.ts
|
|
@@ -148,7 +189,7 @@ This ends the agent run — make sure all data is included.`,
|
|
|
148
189
|
});
|
|
149
190
|
super({
|
|
150
191
|
system: WHITEBOX_ATTACK_SURFACE_SYSTEM_PROMPT,
|
|
151
|
-
prompt: buildPrompt(codebasePath, domains),
|
|
192
|
+
prompt: buildPrompt(codebasePath, domains, session.config?.prompt),
|
|
152
193
|
model,
|
|
153
194
|
session,
|
|
154
195
|
authConfig,
|
|
@@ -190,18 +231,30 @@ This ends the agent run — make sure all data is included.`,
|
|
|
190
231
|
});
|
|
191
232
|
}
|
|
192
233
|
}
|
|
193
|
-
function buildPrompt(codebasePath, domains) {
|
|
234
|
+
function buildPrompt(codebasePath, domains, operatorPrompt) {
|
|
194
235
|
const domainSection = domains?.length ? `
|
|
195
236
|
## Known Domains
|
|
196
|
-
The following domains are
|
|
237
|
+
The following domains are **hints for association only** — they are known to be operated by the target and should be set on the \`domain\` field of \`document_app\` when you can determine which domain serves a given app.
|
|
238
|
+
|
|
239
|
+
**IMPORTANT — these domains DO NOT define the scope of discovery:**
|
|
240
|
+
- Discover and document **every** app/service/cloud resource defined in the codebase, regardless of whether it maps to one of these domains.
|
|
241
|
+
- Apps with no known public domain (internal services, background workers, staging-only apps, functions, admin tools, etc.) MUST still be documented. Leave \`domain\` unset or use the canonical resource URL for cloud resources.
|
|
242
|
+
- Do NOT filter out apps, endpoints, subdomains, or cloud resources because they don't appear to belong to one of these domains.
|
|
243
|
+
- Do NOT skip directories, packages, or services because they "look unrelated" to the listed domains.
|
|
244
|
+
|
|
245
|
+
Known domains:
|
|
197
246
|
${domains.map((d) => `- ${d}`).join(`
|
|
198
247
|
`)}
|
|
248
|
+
` : "";
|
|
249
|
+
const operatorGuidanceBlock = operatorPrompt ? `
|
|
250
|
+
## Operator Guidance
|
|
251
|
+
${operatorPrompt}
|
|
199
252
|
` : "";
|
|
200
253
|
return `# Whitebox Attack Surface Analysis
|
|
201
254
|
|
|
202
255
|
## Codebase
|
|
203
256
|
- **Path:** ${codebasePath}
|
|
204
|
-
${domainSection}
|
|
257
|
+
${domainSection}${operatorGuidanceBlock}
|
|
205
258
|
## Task
|
|
206
259
|
Analyze this codebase and produce a complete attack surface map:
|
|
207
260
|
1. Identify the repo type and package manager
|
|
@@ -209,10 +262,11 @@ Analyze this codebase and produce a complete attack surface map:
|
|
|
209
262
|
3. Discover cloud resources and external infrastructure referenced in the code (S3 buckets, cloud storage, CDN origins, etc.) — document these as apps with the appropriate type
|
|
210
263
|
4. For each app, find all web pages and API endpoints
|
|
211
264
|
5. For each endpoint, generate pentest objectives
|
|
265
|
+
6. **Before submitting**, perform the Phase 3 coverage double-check from the system prompt — re-scan workspace roots, framework configs, Dockerfiles, IaC, and CI/deploy configs for apps you may have missed on the first pass, and document any that were missed.
|
|
212
266
|
|
|
213
267
|
Use \`spawn_coding_agent\` to delegate app-level analysis for higher fidelity.
|
|
214
268
|
|
|
215
|
-
When finished, call \`submit_results\` with the complete structured output.
|
|
269
|
+
When finished, call \`submit_results\` with the complete structured output. Do NOT call \`submit_results\` until you have explicitly completed the coverage double-check.
|
|
216
270
|
|
|
217
271
|
Begin now.`;
|
|
218
272
|
}
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
pollWorkOSToken,
|
|
9
9
|
selectWorkspace,
|
|
10
10
|
startDeviceFlow
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-2jdpgtmk.js";
|
|
12
12
|
import {
|
|
13
13
|
config,
|
|
14
14
|
getPensarApiUrl,
|
|
15
15
|
getPensarConsoleUrl
|
|
16
|
-
} from "./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
16
|
+
} from "./cli-hy4qmtqq.js";
|
|
17
|
+
import"./cli-nw1pczc7.js";
|
|
18
|
+
import"./cli-mg3bvqq9.js";
|
|
19
19
|
import {
|
|
20
20
|
__require
|
|
21
21
|
} from "./cli-8rxa073f.js";
|
|
@@ -3,17 +3,18 @@ import {
|
|
|
3
3
|
} from "./cli-6gtnyaqf.js";
|
|
4
4
|
import {
|
|
5
5
|
OffensiveSecurityAgent
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-km6s27mj.js";
|
|
7
|
+
import"./cli-0wve372a.js";
|
|
8
|
+
import"./cli-3y0dgy56.js";
|
|
8
9
|
import {
|
|
9
10
|
hasToolCall
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
11
|
+
} from "./cli-fvpmqcde.js";
|
|
12
|
+
import"./cli-r8cerdwk.js";
|
|
13
|
+
import"./cli-2jdpgtmk.js";
|
|
14
|
+
import"./cli-hy4qmtqq.js";
|
|
15
|
+
import"./cli-nw1pczc7.js";
|
|
16
|
+
import"./cli-mg3bvqq9.js";
|
|
17
|
+
import"./cli-gpnb45ck.js";
|
|
17
18
|
import"./cli-8rxa073f.js";
|
|
18
19
|
|
|
19
20
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
@@ -86,13 +87,14 @@ Look for:
|
|
|
86
87
|
### Browser path (use for SPAs, OAuth, JS-rendered forms):
|
|
87
88
|
1. \`browser_navigate\` to the login URL
|
|
88
89
|
2. \`browser_snapshot\` to find form fields and their refs
|
|
89
|
-
3. \`
|
|
90
|
-
4. \`
|
|
91
|
-
5. \`
|
|
92
|
-
6. \`
|
|
93
|
-
7. \`
|
|
94
|
-
8. \`
|
|
95
|
-
9.
|
|
90
|
+
3. \`browser_screenshot\` to capture the login page before filling credentials
|
|
91
|
+
4. \`browser_fill\` the username/email field (use ref from snapshot)
|
|
92
|
+
5. \`browser_snapshot\` again (page may update after input)
|
|
93
|
+
6. \`browser_fill\` the password field
|
|
94
|
+
7. \`browser_click\` the submit/login button
|
|
95
|
+
8. \`browser_snapshot\` AND \`browser_screenshot\` to verify and document the post-submit state
|
|
96
|
+
9. \`browser_get_cookies\` to extract session cookies
|
|
97
|
+
10. Optionally \`browser_evaluate\` to extract tokens from localStorage/sessionStorage:
|
|
96
98
|
\`\`\`javascript
|
|
97
99
|
(() => {
|
|
98
100
|
const tokens = {};
|
|
@@ -153,11 +155,11 @@ If you encounter rate-limiting errors (e.g. "Rate limit exceeded", HTTP 429, "to
|
|
|
153
155
|
|
|
154
156
|
# Screenshot Evidence
|
|
155
157
|
|
|
156
|
-
-
|
|
157
|
-
- **Always screenshot after login attempt** to document success (dashboard/welcome page) or failure (error message)
|
|
158
|
-
- Screenshot any error pages, CAPTCHA challenges, MFA prompts, or unexpected barriers
|
|
159
|
-
- Use descriptive filenames: "login-form", "auth-success", "auth-error", "mfa-prompt", "captcha-detected"
|
|
160
|
-
- Screenshots are automatically stored and displayed in the console logs for debugging
|
|
158
|
+
- **Screenshot liberally.** A human reviews your run after it completes and relies on screenshots to follow along with what the browser actually did. Every time you navigate to a new page, fill a form field, click a button, or observe a state change, call \`browser_screenshot\` so the reviewer can see exactly what you saw. Aim for at least one screenshot per distinct page or state change — screenshots are cheap, missing visual context is not.
|
|
159
|
+
- **Always screenshot after login attempt** to document success (dashboard/welcome page) or failure (error message).
|
|
160
|
+
- Screenshot any error pages, CAPTCHA challenges, MFA prompts, or unexpected barriers.
|
|
161
|
+
- Use descriptive filenames: "login-form", "username-filled", "password-filled", "auth-success", "auth-error", "mfa-prompt", "captcha-detected".
|
|
162
|
+
- Screenshots are automatically stored and displayed in the console logs for debugging and human review.
|
|
161
163
|
`;
|
|
162
164
|
|
|
163
165
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent
|
|
3
|
+
} from "./cli-bksgzyyn.js";
|
|
4
|
+
import"./cli-6gtnyaqf.js";
|
|
5
|
+
import"./cli-km6s27mj.js";
|
|
6
|
+
import"./cli-0wve372a.js";
|
|
7
|
+
import"./cli-3y0dgy56.js";
|
|
8
|
+
import"./cli-fvpmqcde.js";
|
|
9
|
+
import"./cli-r8cerdwk.js";
|
|
10
|
+
import"./cli-2jdpgtmk.js";
|
|
11
|
+
import"./cli-hy4qmtqq.js";
|
|
12
|
+
import"./cli-nw1pczc7.js";
|
|
13
|
+
import"./cli-mg3bvqq9.js";
|
|
14
|
+
import"./cli-gpnb45ck.js";
|
|
15
|
+
import"./cli-8rxa073f.js";
|
|
16
|
+
export {
|
|
17
|
+
BlackboxAttackSurfaceAgent
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runPentestWorkflow
|
|
3
|
+
} from "./cli-hdb9d7r0.js";
|
|
4
|
+
import"./cli-zmgzw8jk.js";
|
|
5
|
+
import"./cli-867kbj0c.js";
|
|
6
|
+
import"./cli-bksgzyyn.js";
|
|
7
|
+
import"./cli-fw5r7pfj.js";
|
|
8
|
+
import"./cli-ttar2ydd.js";
|
|
9
|
+
import"./cli-6gtnyaqf.js";
|
|
10
|
+
import"./cli-9j8k95v4.js";
|
|
11
|
+
import"./cli-km6s27mj.js";
|
|
12
|
+
import"./cli-0wve372a.js";
|
|
13
|
+
import"./cli-3y0dgy56.js";
|
|
14
|
+
import"./cli-fvpmqcde.js";
|
|
15
|
+
import"./cli-r8cerdwk.js";
|
|
16
|
+
import"./cli-2jdpgtmk.js";
|
|
17
|
+
import"./cli-hy4qmtqq.js";
|
|
18
|
+
import"./cli-nw1pczc7.js";
|
|
19
|
+
import"./cli-mg3bvqq9.js";
|
|
20
|
+
import"./cli-gpnb45ck.js";
|
|
21
|
+
import"./cli-8rxa073f.js";
|
|
22
|
+
|
|
23
|
+
// src/core/api/blackboxPentest.ts
|
|
24
|
+
async function runPentestAgent(input) {
|
|
25
|
+
const { findings, findingsPath, pocsPath, reportPath } = await runPentestWorkflow(input);
|
|
26
|
+
console.log(`
|
|
27
|
+
Found ${findings.length} vulnerabilities`);
|
|
28
|
+
console.log(`Findings: ${findingsPath}`);
|
|
29
|
+
console.log(`POCs: ${pocsPath}`);
|
|
30
|
+
if (reportPath)
|
|
31
|
+
console.log(`Report: ${reportPath}`);
|
|
32
|
+
return { findings, findingsPath, pocsPath, reportPath };
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
runPentestAgent
|
|
36
|
+
};
|