@pensar/apex 0.0.114 → 0.0.115-canary.3a244a59
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 +7 -55
- package/build/agent-n22nh2s8.js +16 -0
- package/build/{agent-jr0kf32x.js → agent-scs6hq61.js} +70 -57
- package/build/{auth-g7qfrmqn.js → auth-7gf402f3.js} +4 -4
- package/build/{authentication-h92927qz.js → authentication-xnygs3rq.js} +26 -20
- package/build/blackboxAgent-kc356rcy.js +17 -0
- package/build/{blackboxPentest-34sfsskq.js → blackboxPentest-mvwc0v1m.js} +15 -14
- package/build/{cli-xj88naps.js → cli-0gm6ya88.js} +1 -1
- package/build/{cli-0tpx8khk.js → cli-5gh0m3xb.js} +57 -57
- package/build/{cli-9hp2khjx.js → cli-7ms8v8dt.js} +18 -8
- package/build/{cli-vnydvy0r.js → cli-dbs6bfdd.js} +14 -14
- package/build/cli-e16p5ctw.js +396 -0
- package/build/cli-gp7p5tb8.js +7632 -0
- package/build/{cli-23qtjsce.js → cli-gq25zkyn.js} +1 -1
- package/build/{cli-tj25jvz6.js → cli-gvfy5xk2.js} +11 -1
- package/build/{cli-s1dd4n9x.js → cli-jrgcmjck.js} +6 -2
- package/build/{cli-27bnjky6.js → cli-q87kgwcy.js} +1 -1
- package/build/{cli-phajnhzs.js → cli-qv95srfs.js} +1431 -539
- package/build/cli-r9pch5gj.js +1215 -0
- package/build/{cli-z1s5njxn.js → cli-rx4g8yat.js} +123 -15
- package/build/{cli-zz9wwkqh.js → cli-te462405.js} +1 -1
- package/build/{cli-0r7qwt2h.js → cli-wctrm0ye.js} +93 -34
- package/build/{cli-49cd9yfk.js → cli-wszshs5e.js} +1 -1
- package/build/{cli-mx8pfb29.js → cli-y23vt1jv.js} +54 -28
- package/build/cli.js +164 -31
- package/build/{fixes-d3mb7zr3.js → fixes-z4dv0qyj.js} +4 -4
- package/build/{index-zyrn6ava.js → index-5vbfrkpq.js} +4759 -5963
- package/build/{index-mefzr77w.js → index-fhxstzkp.js} +14 -11
- package/build/{index-rd11fk7h.js → index-h2hj2hj9.js} +14 -14
- package/build/{index-gm4427rc.js → index-rjd60v26.js} +2 -2
- package/build/{issues-gsfpfmwx.js → issues-6cpa0zbb.js} +4 -4
- package/build/{logs-mgbbrr4b.js → logs-vy92hpm7.js} +4 -4
- package/build/{multipart-parser-r38qdp5v.js → multipart-parser-6zd16497.js} +2 -2
- package/build/pentest-8zp4dm80.js +26 -0
- package/build/{pentests-ey20zzez.js → pentests-s69mvncj.js} +4 -4
- package/build/{projects-1z5x1bxj.js → projects-ssc2f7sc.js} +4 -4
- package/build/targetedPentest-xaqy3cg4.js +33 -0
- package/build/threatModel-a9k48qga.js +59 -0
- package/build/{uninstall-b26ez5zf.js → uninstall-svvhr717.js} +1 -1
- package/build/{utils-9fhmzzzh.js → utils-7x4v0asf.js} +1 -1
- package/package.json +6 -2
- package/build/agent-q0mhy72n.js +0 -16
- package/build/blackboxAgent-bgqz7n74.js +0 -17
- package/build/cli-xtccf5qk.js +0 -1498
- package/build/pentest-1cntf5yv.js +0 -25
- package/build/targetedPentest-yatr7brn.js +0 -32
package/README.md
CHANGED
|
@@ -22,36 +22,6 @@ Want to run from the cloud or integrate it with your CI/CD? See <a href="https:/
|
|
|
22
22
|
<img src="screenshot.png" alt="Pensar Apex Screenshot" width="800">
|
|
23
23
|
</p> -->
|
|
24
24
|
|
|
25
|
-
## What is Apex?
|
|
26
|
-
|
|
27
|
-
Apex is an autonomous penetration testing agent that runs directly in your terminal.
|
|
28
|
-
|
|
29
|
-
It doesn't wrap existing scanners or chain shell scripts. Apex deploys a **swarm of specialized AI agents** — each with domain expertise in reconnaissance, authentication analysis, exploitation, and code review — that coordinate a real penetration test against your application. Every finding comes with CVSS 4.0 scoring, CWE classification, evidence, and a validated proof-of-concept.
|
|
30
|
-
|
|
31
|
-
The result is a pentest that runs like `npm test` — but thinks like a red team.
|
|
32
|
-
|
|
33
|
-
## Why Apex?
|
|
34
|
-
|
|
35
|
-
Traditional scanners execute signatures. Apex executes a methodology.
|
|
36
|
-
|
|
37
|
-
- **Swarm architecture** - Specialized agents run in parallel across your attack surface, the same way a real red team divides and conquers. Up to 10 concurrent agents, each scoped to a specific objective.
|
|
38
|
-
- **Structured, auditable output** - Every vulnerability is automatically scored (CVSS 4.0), classified (CWE), and documented with evidence and remediation steps. No raw tool dumps.
|
|
39
|
-
- **Real exploitation, not guesswork** - Apex writes, runs, and validates proof-of-concept scripts. If the PoC doesn't succeed, it pivots to a different technique.
|
|
40
|
-
- **Blackbox and whitebox** - Test a live target with no source access, or analyze your codebase to map endpoints and test them against a running instance.
|
|
41
|
-
- **30+ built-in tools** - Browser automation, shell execution, HTTP requests, file analysis, web search for CVE lookups, authenticated crawling, and more. Optional Kali Linux container adds 25+ offensive security tools (nmap, sqlmap, hydra, hashcat, gobuster, and others).
|
|
42
|
-
|
|
43
|
-
## Two Modes
|
|
44
|
-
|
|
45
|
-
### `/pentest` — Autonomous
|
|
46
|
-
|
|
47
|
-
Fire and forget. Apex runs a full engagement end-to-end: attack surface discovery, parallel swarm testing, and a structured report with findings in Markdown and JSON. No security expertise required.
|
|
48
|
-
|
|
49
|
-
### `/operator` — Interactive
|
|
50
|
-
|
|
51
|
-
Full control. Steer the agent step by step, approve each action, chain exploits manually, and dig deep into specific targets. Every tool is available. The approval gate holds until you say go.
|
|
52
|
-
|
|
53
|
-
Start with `/pentest` to get coverage, then reopen the session in `/operator` to investigate specific findings — all context carries over.
|
|
54
|
-
|
|
55
25
|
## Use Cases
|
|
56
26
|
|
|
57
27
|
### Developers
|
|
@@ -69,30 +39,12 @@ Start with `/pentest` to get coverage, then reopen the session in `/operator` to
|
|
|
69
39
|
|
|
70
40
|
## Installation
|
|
71
41
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
#### Homebrew
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
brew tap pensarai/tap
|
|
82
|
-
brew install apex
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
#### npm
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
npm install -g @pensar/apex
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### Windows (PowerShell)
|
|
92
|
-
|
|
93
|
-
```powershell
|
|
94
|
-
irm https://www.pensarai.com/apex.ps1 | iex
|
|
95
|
-
```
|
|
42
|
+
| Method | Command |
|
|
43
|
+
| ------------------------------- | ---------------------------------------------------- |
|
|
44
|
+
| **Quick Install** (macOS/Linux) | `curl -fsSL https://pensarai.com/install.sh \| bash` |
|
|
45
|
+
| **Homebrew** | `brew tap pensarai/tap && brew install apex` |
|
|
46
|
+
| **npm** | `npm install -g @pensar/apex` |
|
|
47
|
+
| **Windows** (PowerShell) | `irm https://www.pensarai.com/apex.ps1 \| iex` |
|
|
96
48
|
|
|
97
49
|
## Usage
|
|
98
50
|
|
|
@@ -123,5 +75,5 @@ pensar
|
|
|
123
75
|
|
|
124
76
|
### ⚠️ Responsible Use
|
|
125
77
|
|
|
126
|
-
This repository contains tools for **authorized security testing** only.
|
|
78
|
+
This repository contains tools for **authorized security testing** only.
|
|
127
79
|
Before use, please read and agree to the [Responsible Use Disclosure](./RESPONSIBLE_USE.md).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CodeAgent
|
|
3
|
+
} from "./cli-7ms8v8dt.js";
|
|
4
|
+
import"./cli-qv95srfs.js";
|
|
5
|
+
import"./cli-dbs6bfdd.js";
|
|
6
|
+
import"./cli-rx4g8yat.js";
|
|
7
|
+
import"./cli-te462405.js";
|
|
8
|
+
import"./cli-q87kgwcy.js";
|
|
9
|
+
import"./cli-0gm6ya88.js";
|
|
10
|
+
import"./cli-jrgcmjck.js";
|
|
11
|
+
import"./cli-5gh0m3xb.js";
|
|
12
|
+
import"./cli-7ckctq7a.js";
|
|
13
|
+
import"./cli-8rxa073f.js";
|
|
14
|
+
export {
|
|
15
|
+
CodeAgent
|
|
16
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WhiteboxAttackSurfaceResultSchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-gvfy5xk2.js";
|
|
4
4
|
import {
|
|
5
5
|
OffensiveSecurityAgent
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-qv95srfs.js";
|
|
7
|
+
import"./cli-dbs6bfdd.js";
|
|
8
8
|
import {
|
|
9
9
|
hasToolCall,
|
|
10
10
|
tool
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
11
|
+
} from "./cli-rx4g8yat.js";
|
|
12
|
+
import"./cli-te462405.js";
|
|
13
|
+
import"./cli-q87kgwcy.js";
|
|
14
|
+
import"./cli-0gm6ya88.js";
|
|
15
|
+
import"./cli-jrgcmjck.js";
|
|
16
|
+
import"./cli-5gh0m3xb.js";
|
|
17
17
|
import"./cli-7ckctq7a.js";
|
|
18
18
|
import"./cli-8rxa073f.js";
|
|
19
19
|
|
|
@@ -41,16 +41,31 @@ Read config files, entry points, route definitions, etc.
|
|
|
41
41
|
## grep
|
|
42
42
|
Your primary search tool. Use it to find route definitions, middleware, controllers, etc.
|
|
43
43
|
|
|
44
|
-
##
|
|
45
|
-
**Use this to document
|
|
46
|
-
- Each application/service you identify (
|
|
47
|
-
- Notable subdomains
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
## document_app
|
|
45
|
+
**Use this to document each application/service you identify.** Each call persists a JSON record to the session's apps directory. Document:
|
|
46
|
+
- Each application/service you identify (appType: "web_application" or "api")
|
|
47
|
+
- Notable subdomains hosting distinct services (appType: "subdomain")
|
|
48
|
+
- Cloud resources like S3 buckets, cloud storage, CDN origins (appType: "cloud_resource" or "storage")
|
|
49
|
+
- For S3 buckets: set url to the bucket endpoint (e.g. "https://bucket-name.s3.amazonaws.com") and use appType "storage"
|
|
50
|
+
- For other cloud resources: set url to the resource endpoint and use appType "cloud_resource"
|
|
51
|
+
- If known domains are provided, set the \`domain\` field to associate the app with the correct domain
|
|
52
|
+
|
|
53
|
+
## document_endpoint
|
|
54
|
+
**This is your primary output tool for endpoints.** Each call persists a JSON record to the session's endpoints directory, organized by app. Document:
|
|
55
|
+
- Individual API endpoints and web pages
|
|
56
|
+
|
|
57
|
+
**CRITICAL — endpoint documentation rules:**
|
|
58
|
+
- **ONE endpoint per unique route path.** Do NOT create separate entries for different HTTP methods on the same path. If \`/api/users\` supports GET, POST, and DELETE, that is ONE entry with \`method: ["GET", "POST", "DELETE"]\`.
|
|
59
|
+
- **Use \`method: "PAGE"\`** for web pages and views.
|
|
60
|
+
- **Always set \`appName\`** to group endpoints under the correct application.
|
|
61
|
+
- **Always set \`routePath\`** to the HTTP route (e.g., \`/api/users\`). This is the URL path a client requests — NOT a source-file path.
|
|
62
|
+
- **Always set \`file\`** to the source-code file (e.g., \`src/routes/users.ts\`). This is NOT the HTTP route.
|
|
63
|
+
- **Always set \`handler\`** to the function name, and \`authRequired\` to indicate auth requirements.
|
|
64
|
+
|
|
65
|
+
Call these tools throughout your analysis as you discover apps and endpoints — don't wait until the end.
|
|
51
66
|
|
|
52
67
|
## spawn_coding_agent
|
|
53
|
-
**This is your key tool for scaling out analysis.** Spawn coding sub-agents to analyze individual apps in parallel for higher fidelity. Each sub-agent has full filesystem access (read_file, list_files, grep, execute_command).
|
|
68
|
+
**This is your key tool for scaling out analysis.** Spawn coding sub-agents to analyze individual apps in parallel for higher fidelity. Each sub-agent has full filesystem access (read_file, list_files, grep, execute_command) and the document_app/document_endpoint tools.
|
|
54
69
|
|
|
55
70
|
## submit_results
|
|
56
71
|
Call this LAST with your complete structured results. This ends your run.
|
|
@@ -66,41 +81,29 @@ Call this LAST with your complete structured results. This ends your run.
|
|
|
66
81
|
- Monorepo workspace packages with their own entry points
|
|
67
82
|
- Separate service directories with their own configs
|
|
68
83
|
- A single app at the root
|
|
84
|
+
4. Discover cloud resources and external infrastructure referenced in the code:
|
|
85
|
+
- S3 buckets, GCS buckets, Azure Blob Storage (search for bucket names, s3://, storage URLs)
|
|
86
|
+
- CDN distributions (CloudFront, Cloudflare)
|
|
87
|
+
- 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 url to the resource endpoint
|
|
69
89
|
|
|
70
90
|
## Phase 2: APP ANALYSIS (delegate to coding agents)
|
|
71
91
|
For each app you identified, spawn a coding agent with a detailed objective. The objective should instruct the agent to:
|
|
72
92
|
|
|
73
93
|
1. **Identify the framework** — read the app's config/entry point to determine the web framework
|
|
74
|
-
2. **
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- Spring: @GetMapping, @PostMapping, @RequestMapping
|
|
88
|
-
- etc.
|
|
89
|
-
4. **For each endpoint, determine**:
|
|
90
|
-
- HTTP method and route path
|
|
91
|
-
- Handler function/component name
|
|
92
|
-
- File location and line number
|
|
93
|
-
- Whether auth appears to be required (middleware, decorators, guards)
|
|
94
|
-
- Brief description of what it does
|
|
95
|
-
5. **For each endpoint, generate pentest objectives** — specific, actionable testing goals like:
|
|
96
|
-
- "Test for SQL injection in the 'search' query parameter"
|
|
97
|
-
- "Test for IDOR by accessing /api/orders/{id} with other users' order IDs"
|
|
98
|
-
- "Test for XSS in the user profile name field"
|
|
99
|
-
- "Test for privilege escalation by accessing admin-only endpoint as regular user"
|
|
100
|
-
- "Test for CSRF on the password change endpoint"
|
|
101
|
-
- "Test for path traversal in the file download parameter"
|
|
102
|
-
|
|
103
|
-
**IMPORTANT:** Tell each coding agent to output its findings in a STRUCTURED FORMAT that you can parse. Instruct it to use clear delimiters or a consistent format for each endpoint (method, path, handler, file, line, auth, description, pentest objectives).
|
|
94
|
+
2. **Document the application** — call \`document_app\` with the app name, type, and framework
|
|
95
|
+
3. **Find ALL web pages** — search for page/view/route definitions and document each with \`document_endpoint\` using \`method: "PAGE"\`
|
|
96
|
+
4. **Find ALL API endpoints** — search for route/endpoint definitions and document each unique path with \`document_endpoint\`, listing ALL HTTP methods in \`method\`
|
|
97
|
+
5. **For each endpoint, include** in the document_endpoint call:
|
|
98
|
+
- HTTP route in \`routePath\` (e.g., \`/api/users\`) — this is the URL path, NOT a file path
|
|
99
|
+
- ALL HTTP methods in \`method\` (consolidated — one entry per path)
|
|
100
|
+
- Handler function in \`handler\`
|
|
101
|
+
- Source-code file in \`file\` (e.g., \`src/routes/users.ts\`) — this is NOT the route
|
|
102
|
+
- Line number in \`line\`
|
|
103
|
+
- Auth requirement in \`authRequired\`
|
|
104
|
+
- Specific pentest objectives in \`pentestObjectives\`
|
|
105
|
+
|
|
106
|
+
**IMPORTANT:** Tell each coding agent to set \`appName\` on every \`document_endpoint\` call so endpoints are organized by application.
|
|
104
107
|
|
|
105
108
|
## Phase 3: COLLECT AND SUBMIT (do this yourself)
|
|
106
109
|
1. Parse the output from all coding agents
|
|
@@ -125,8 +128,10 @@ class WhiteboxAttackSurfaceAgent extends OffensiveSecurityAgent {
|
|
|
125
128
|
authConfig,
|
|
126
129
|
onStepFinish,
|
|
127
130
|
abortSignal,
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
eventBus,
|
|
132
|
+
subagentId,
|
|
133
|
+
attackSurfaceRegistry,
|
|
134
|
+
domains
|
|
130
135
|
} = opts;
|
|
131
136
|
let capturedResult = null;
|
|
132
137
|
const submitResultsTool = tool({
|
|
@@ -142,20 +147,21 @@ This ends the agent run — make sure all data is included.`,
|
|
|
142
147
|
});
|
|
143
148
|
super({
|
|
144
149
|
system: WHITEBOX_ATTACK_SURFACE_SYSTEM_PROMPT,
|
|
145
|
-
prompt: buildPrompt(codebasePath),
|
|
150
|
+
prompt: buildPrompt(codebasePath, domains),
|
|
146
151
|
model,
|
|
147
152
|
session,
|
|
148
153
|
authConfig,
|
|
149
154
|
onStepFinish,
|
|
150
155
|
abortSignal,
|
|
156
|
+
eventBus,
|
|
157
|
+
subagentId,
|
|
151
158
|
attackSurfaceRegistry,
|
|
152
|
-
callbacks,
|
|
153
|
-
subagentCallbacks: callbacks?.subagentCallbacks,
|
|
154
159
|
activeTools: [
|
|
155
160
|
"read_file",
|
|
156
161
|
"list_files",
|
|
157
162
|
"grep",
|
|
158
|
-
"
|
|
163
|
+
"document_app",
|
|
164
|
+
"document_endpoint",
|
|
159
165
|
"spawn_coding_agent",
|
|
160
166
|
"submit_results"
|
|
161
167
|
],
|
|
@@ -182,18 +188,25 @@ This ends the agent run — make sure all data is included.`,
|
|
|
182
188
|
});
|
|
183
189
|
}
|
|
184
190
|
}
|
|
185
|
-
function buildPrompt(codebasePath) {
|
|
191
|
+
function buildPrompt(codebasePath, domains) {
|
|
192
|
+
const domainSection = domains?.length ? `
|
|
193
|
+
## Known Domains
|
|
194
|
+
The following domains are associated with this project. When documenting apps, set the \`domain\` field on \`document_app\` if you can determine which domain serves the app:
|
|
195
|
+
${domains.map((d) => `- ${d}`).join(`
|
|
196
|
+
`)}
|
|
197
|
+
` : "";
|
|
186
198
|
return `# Whitebox Attack Surface Analysis
|
|
187
199
|
|
|
188
200
|
## Codebase
|
|
189
201
|
- **Path:** ${codebasePath}
|
|
190
|
-
|
|
202
|
+
${domainSection}
|
|
191
203
|
## Task
|
|
192
204
|
Analyze this codebase and produce a complete attack surface map:
|
|
193
205
|
1. Identify the repo type and package manager
|
|
194
206
|
2. Discover all apps/services
|
|
195
|
-
3.
|
|
196
|
-
4. For each
|
|
207
|
+
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
|
|
208
|
+
4. For each app, find all web pages and API endpoints
|
|
209
|
+
5. For each endpoint, generate pentest objectives
|
|
197
210
|
|
|
198
211
|
Use \`spawn_coding_agent\` to delegate app-level analysis for higher fidelity.
|
|
199
212
|
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
pollWorkOSToken,
|
|
9
9
|
selectWorkspace,
|
|
10
10
|
startDeviceFlow
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-te462405.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-q87kgwcy.js";
|
|
17
|
+
import"./cli-0gm6ya88.js";
|
|
18
|
+
import"./cli-jrgcmjck.js";
|
|
19
19
|
import {
|
|
20
20
|
__require
|
|
21
21
|
} from "./cli-8rxa073f.js";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./cli-6gtnyaqf.js";
|
|
4
4
|
import {
|
|
5
5
|
OffensiveSecurityAgent
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-qv95srfs.js";
|
|
7
|
+
import"./cli-dbs6bfdd.js";
|
|
8
8
|
import {
|
|
9
9
|
hasToolCall
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
10
|
+
} from "./cli-rx4g8yat.js";
|
|
11
|
+
import"./cli-te462405.js";
|
|
12
|
+
import"./cli-q87kgwcy.js";
|
|
13
|
+
import"./cli-0gm6ya88.js";
|
|
14
|
+
import"./cli-jrgcmjck.js";
|
|
15
|
+
import"./cli-5gh0m3xb.js";
|
|
16
16
|
import"./cli-7ckctq7a.js";
|
|
17
17
|
import"./cli-8rxa073f.js";
|
|
18
18
|
|
|
@@ -170,18 +170,25 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
|
170
170
|
authHints,
|
|
171
171
|
authConfig,
|
|
172
172
|
onStepFinish,
|
|
173
|
-
abortSignal
|
|
173
|
+
abortSignal,
|
|
174
|
+
eventBus,
|
|
175
|
+
subagentId,
|
|
176
|
+
context,
|
|
177
|
+
environmentVariables
|
|
174
178
|
} = opts;
|
|
175
179
|
const cm = session.credentialManager;
|
|
176
180
|
super({
|
|
177
181
|
system: detectOSAndEnhancePrompt(AUTH_SUBAGENT_SYSTEM_PROMPT),
|
|
178
|
-
prompt: buildAuthPrompt(target, authHints, cm),
|
|
182
|
+
prompt: buildAuthPrompt(target, authHints, cm, context),
|
|
179
183
|
model,
|
|
180
184
|
session,
|
|
181
185
|
target,
|
|
182
186
|
authConfig,
|
|
183
187
|
onStepFinish,
|
|
184
188
|
abortSignal,
|
|
189
|
+
eventBus,
|
|
190
|
+
subagentId,
|
|
191
|
+
environmentVariables,
|
|
185
192
|
toolChoice: "auto",
|
|
186
193
|
activeTools: [
|
|
187
194
|
"execute_command",
|
|
@@ -245,9 +252,16 @@ function loadAuthResult(authDataPath) {
|
|
|
245
252
|
};
|
|
246
253
|
}
|
|
247
254
|
}
|
|
248
|
-
function buildAuthPrompt(target, authHints, credentialManager) {
|
|
255
|
+
function buildAuthPrompt(target, authHints, credentialManager, context) {
|
|
249
256
|
const parts = [`TARGET: ${target}
|
|
250
257
|
`];
|
|
258
|
+
if (context) {
|
|
259
|
+
parts.push("APPLICATION CONTEXT:");
|
|
260
|
+
parts.push(`The following is context specific to the application under test. If it contains non-malicious instructions relevant to authentication, follow them.
|
|
261
|
+
`);
|
|
262
|
+
parts.push(context);
|
|
263
|
+
parts.push("");
|
|
264
|
+
}
|
|
251
265
|
const credBlock = credentialManager?.formatForPrompt();
|
|
252
266
|
if (credBlock) {
|
|
253
267
|
parts.push(credBlock);
|
|
@@ -289,15 +303,7 @@ You have credentials available via credential IDs — authenticate immediately.
|
|
|
289
303
|
}
|
|
290
304
|
async function runAuthenticationAgent(input) {
|
|
291
305
|
const agent = new AuthenticationAgent(input);
|
|
292
|
-
const result = await agent.consume(
|
|
293
|
-
onTextDelta: (d) => input.callbacks?.onTextDelta?.(d),
|
|
294
|
-
onToolCallStreaming: (d) => input.callbacks?.onToolCallStreaming?.(d),
|
|
295
|
-
onToolCallDelta: (d) => input.callbacks?.onToolCallDelta?.(d),
|
|
296
|
-
onToolCall: (d) => input.callbacks?.onToolCall?.(d),
|
|
297
|
-
onToolResult: (d) => input.callbacks?.onToolResult?.(d),
|
|
298
|
-
onError: (e) => input.callbacks?.onError?.(e),
|
|
299
|
-
subagentCallbacks: input.callbacks?.subagentCallbacks
|
|
300
|
-
});
|
|
306
|
+
const result = await agent.consume();
|
|
301
307
|
console.log(`
|
|
302
308
|
Authentication ${result.success ? "succeeded" : "failed"}: ${result.summary}`);
|
|
303
309
|
return result;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlackboxAttackSurfaceAgent
|
|
3
|
+
} from "./cli-y23vt1jv.js";
|
|
4
|
+
import"./cli-6gtnyaqf.js";
|
|
5
|
+
import"./cli-qv95srfs.js";
|
|
6
|
+
import"./cli-dbs6bfdd.js";
|
|
7
|
+
import"./cli-rx4g8yat.js";
|
|
8
|
+
import"./cli-te462405.js";
|
|
9
|
+
import"./cli-q87kgwcy.js";
|
|
10
|
+
import"./cli-0gm6ya88.js";
|
|
11
|
+
import"./cli-jrgcmjck.js";
|
|
12
|
+
import"./cli-5gh0m3xb.js";
|
|
13
|
+
import"./cli-7ckctq7a.js";
|
|
14
|
+
import"./cli-8rxa073f.js";
|
|
15
|
+
export {
|
|
16
|
+
BlackboxAttackSurfaceAgent
|
|
17
|
+
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPentestWorkflow
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
3
|
+
} from "./cli-r9pch5gj.js";
|
|
4
|
+
import"./cli-e16p5ctw.js";
|
|
5
|
+
import"./cli-wctrm0ye.js";
|
|
6
|
+
import"./cli-7ms8v8dt.js";
|
|
7
|
+
import"./cli-gvfy5xk2.js";
|
|
8
|
+
import"./cli-y23vt1jv.js";
|
|
8
9
|
import"./cli-6gtnyaqf.js";
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
10
|
+
import"./cli-qv95srfs.js";
|
|
11
|
+
import"./cli-dbs6bfdd.js";
|
|
12
|
+
import"./cli-rx4g8yat.js";
|
|
13
|
+
import"./cli-te462405.js";
|
|
14
|
+
import"./cli-q87kgwcy.js";
|
|
15
|
+
import"./cli-0gm6ya88.js";
|
|
16
|
+
import"./cli-jrgcmjck.js";
|
|
17
|
+
import"./cli-5gh0m3xb.js";
|
|
17
18
|
import"./cli-7ckctq7a.js";
|
|
18
19
|
import"./cli-8rxa073f.js";
|
|
19
20
|
|
|
@@ -26,7 +27,7 @@ async function runPentestAgent(input) {
|
|
|
26
27
|
session: input.session,
|
|
27
28
|
authConfig: input.authConfig,
|
|
28
29
|
abortSignal: input.abortSignal,
|
|
29
|
-
|
|
30
|
+
eventBus: input.eventBus
|
|
30
31
|
});
|
|
31
32
|
console.log(`
|
|
32
33
|
Found ${findings.length} vulnerabilities`);
|