@pensar/apex 2.0.0-canary.241920ad → 2.0.0
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 +0 -20
- package/build/agent-84enr6xn.js +22 -0
- package/build/{agent-7866ka7b.js → agent-x1tnsg7n.js} +10 -7
- package/build/{agent-aj7jpehp.js → agent-z8043nrm.js} +12 -9
- package/build/{apps-hse35c2d.js → apps-gdze0s68.js} +18 -15
- package/build/{auth-15rkvgam.js → auth-24ca1qwx.js} +19 -16
- package/build/authentication-0k43jay4.js +22 -0
- package/build/blackboxAgent-76tnwwg7.js +22 -0
- package/build/{blackboxPentest-vmtnnp5d.js → blackboxPentest-xwc031xm.js} +16 -13
- package/build/{cli-23xtyah8.js → cli-0v9x0eby.js} +1 -1
- package/build/cli-1yavz2pb.js +17 -0
- package/build/{cli-6gge86w5.js → cli-31cara07.js} +6 -8
- package/build/cli-3knnkdps.js +666 -0
- package/build/{cli-cbw2rmv7.js → cli-5fr9k6m4.js} +35 -58
- package/build/{cli-78s9w64j.js → cli-948dk60p.js} +1 -1
- package/build/{cli-k1vsv3qh.js → cli-a20jcpmp.js} +1 -1
- package/build/{cli-0svsmc2c.js → cli-cb5va0cs.js} +1 -10
- package/build/{cli-rtbry75t.js → cli-h6nw89zf.js} +1 -1
- package/build/{cli-5h1kv0v4.js → cli-h825qzmd.js} +53 -1492
- package/build/{cli-gtepvg8s.js → cli-k8mvghe1.js} +921 -444
- package/build/{cli-4dpc999m.js → cli-mswm4k81.js} +1 -11
- package/build/{cli-zyk3xsth.js → cli-ntd42071.js} +1 -1
- package/build/{cli-mb837pv4.js → cli-pkdjamer.js} +5 -15
- package/build/cli-s1nckt4k.js +20 -0
- package/build/{cli-4ez6yssj.js → cli-sw5swz40.js} +3 -3
- package/build/{cli-ft17f9nh.js → cli-wdmqkshz.js} +2 -2
- package/build/{cli-demg7sj2.js → cli-zpvmaxem.js} +2 -2
- package/build/{cli-r0s5br0a.js → cli-zvq4gy61.js} +6 -13
- package/build/cli.js +45 -105
- package/build/{config-bb6q79q0.js → config-cmq1cxz3.js} +3 -3
- package/build/{doctor-tkz0a0g4.js → doctor-2bkpddws.js} +1 -8
- package/build/{fixes-krvbkbey.js → fixes-a4qscvkx.js} +18 -15
- package/build/{index-pamhzcx3.js → index-0fnbx38r.js} +14 -20
- package/build/{index-ah3cm7hf.js → index-2a1x5nnv.js} +3 -3
- package/build/{index-v4sz6cee.js → index-48pjf9d2.js} +124 -76
- package/build/{index-tknvj68q.js → index-54ep0ery.js} +12 -9
- package/build/{index-wsp4kqtm.js → index-aymt8k9w.js} +2 -2
- package/build/{index-a9ea9c1q.js → index-hfhkjj2g.js} +11 -8
- package/build/{index-4gk224ac.js → index-s17r2akv.js} +4 -4
- package/build/{issues-m2me70rs.js → issues-5pnrspt7.js} +18 -15
- package/build/{logs-rxf1a0be.js → logs-1mfm901x.js} +18 -15
- package/build/{offesecAgent-hmxcpch7.js → offesecAgent-mrbyc93d.js} +11 -8
- package/build/pentest-wy4eeagc.js +31 -0
- package/build/{pentests-201vfsn6.js → pentests-htmtq66d.js} +18 -15
- package/build/{targetedPentest-85b1dndy.js → targetedPentest-cpbd87rc.js} +12 -9
- package/build/threatModel-9n56z6a6.js +29 -0
- package/build/{uninstall-qa8jvrj1.js → uninstall-6y9dkgyt.js} +1 -1
- package/build/{upload-p58nxxvf.js → upload-7wtbr768.js} +1 -8
- package/build/{utils-hsde107p.js → utils-trqnyj77.js} +8 -6
- package/package.json +1 -1
- package/build/agent-mjyx1amj.js +0 -19
- package/build/authentication-b8p1afqq.js +0 -19
- package/build/blackboxAgent-z1h2cgyg.js +0 -19
- package/build/pentest-r6hfzf8n.js +0 -28
- package/build/threatModel-hbpz15y7.js +0 -26
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createLogger,
|
|
3
|
-
init_lazyLogger,
|
|
4
|
-
init_structured,
|
|
5
|
-
scopedLogger
|
|
6
|
-
} from "./cli-5h1kv0v4.js";
|
|
7
|
-
|
|
8
1
|
// src/core/agents/specialized/utils.ts
|
|
9
2
|
import { execSync } from "child_process";
|
|
10
3
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
@@ -62,9 +55,6 @@ function getBundledWordlists() {
|
|
|
62
55
|
}
|
|
63
56
|
|
|
64
57
|
// src/core/agents/specialized/utils.ts
|
|
65
|
-
init_structured();
|
|
66
|
-
init_lazyLogger();
|
|
67
|
-
var log = scopedLogger(() => createLogger("specialized:utils"));
|
|
68
58
|
function readOsRelease() {
|
|
69
59
|
try {
|
|
70
60
|
const content = readFileSync2("/etc/os-release", "utf8");
|
|
@@ -186,7 +176,7 @@ function detectOSAndEnhancePrompt(prompt) {
|
|
|
186
176
|
`)}
|
|
187
177
|
${prompt}`;
|
|
188
178
|
} catch (error) {
|
|
189
|
-
|
|
179
|
+
console.error("Error detecting environment:", error);
|
|
190
180
|
return prompt;
|
|
191
181
|
}
|
|
192
182
|
}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createLogger,
|
|
3
|
-
init_lazyLogger,
|
|
4
|
-
init_structured,
|
|
5
|
-
scopedLogger
|
|
6
|
-
} from "./cli-5h1kv0v4.js";
|
|
7
|
-
|
|
8
1
|
// src/core/integrations/wandb/client.ts
|
|
9
|
-
init_structured();
|
|
10
|
-
init_lazyLogger();
|
|
11
|
-
var log = scopedLogger(() => createLogger("wandb"));
|
|
12
2
|
function resolveConfig(overrides) {
|
|
13
3
|
const apiKey = overrides?.apiKey ?? process.env.WANDB_API_KEY;
|
|
14
4
|
const entity = overrides?.entity ?? process.env.WANDB_ENTITY;
|
|
@@ -23,7 +13,7 @@ async function initWeave(config) {
|
|
|
23
13
|
const configKey = `${config.entity}/${config.project}`;
|
|
24
14
|
if (weaveReady) {
|
|
25
15
|
if (cachedConfigKey && cachedConfigKey !== configKey) {
|
|
26
|
-
|
|
16
|
+
console.warn(`[wandb] initWeave called with ${configKey} but already initialized with ${cachedConfigKey}. Weave supports one project per process.`);
|
|
27
17
|
}
|
|
28
18
|
return weaveReady;
|
|
29
19
|
}
|
|
@@ -43,7 +33,7 @@ async function initWeave(config) {
|
|
|
43
33
|
await weave.init(configKey);
|
|
44
34
|
return weave;
|
|
45
35
|
} catch (e) {
|
|
46
|
-
|
|
36
|
+
console.error("[wandb] Weave init failed:", e);
|
|
47
37
|
weaveReady = null;
|
|
48
38
|
cachedConfigKey = null;
|
|
49
39
|
return null;
|
|
@@ -84,7 +74,7 @@ async function createWeaveTracer(config) {
|
|
|
84
74
|
logRecord: (record, sessionId) => {
|
|
85
75
|
logTraceRecord({ record, sessionId }).catch((e) => {
|
|
86
76
|
if (!logErrorLogged) {
|
|
87
|
-
|
|
77
|
+
console.error("[wandb] Record upload failed (suppressing future warnings):", e);
|
|
88
78
|
logErrorLogged = true;
|
|
89
79
|
}
|
|
90
80
|
});
|
|
@@ -93,7 +83,7 @@ async function createWeaveTracer(config) {
|
|
|
93
83
|
try {
|
|
94
84
|
const getClient = weave.getGlobalClient;
|
|
95
85
|
if (!getClient) {
|
|
96
|
-
|
|
86
|
+
console.warn("[wandb] getGlobalClient not found — flush skipped. Check weave SDK version.");
|
|
97
87
|
return;
|
|
98
88
|
}
|
|
99
89
|
const client = getClient();
|
|
@@ -101,7 +91,7 @@ async function createWeaveTracer(config) {
|
|
|
101
91
|
await client.waitForBatchProcessing();
|
|
102
92
|
}
|
|
103
93
|
} catch (e) {
|
|
104
|
-
|
|
94
|
+
console.error("[wandb] Flush failed:", e);
|
|
105
95
|
}
|
|
106
96
|
}
|
|
107
97
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exports_external1 as exports_external,
|
|
3
|
+
init_zod
|
|
4
|
+
} from "./cli-e6rgwtpb.js";
|
|
5
|
+
import {
|
|
6
|
+
__esm
|
|
7
|
+
} from "./cli-8rxa073f.js";
|
|
8
|
+
|
|
9
|
+
// src/core/toolset/index.ts
|
|
10
|
+
var ToolsetStateSchema;
|
|
11
|
+
var init_toolset = __esm(() => {
|
|
12
|
+
init_zod();
|
|
13
|
+
ToolsetStateSchema = exports_external.object({
|
|
14
|
+
baseToolsetId: exports_external.string(),
|
|
15
|
+
enabledTools: exports_external.record(exports_external.string(), exports_external.boolean()),
|
|
16
|
+
lastModified: exports_external.number()
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { ToolsetStateSchema, init_toolset };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-k8mvghe1.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-mswm4k81.js";
|
|
7
7
|
import {
|
|
8
8
|
hasToolCall,
|
|
9
9
|
init_dist,
|
|
10
10
|
stepCountIs
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-h825qzmd.js";
|
|
12
12
|
|
|
13
13
|
// src/core/agents/specialized/attackSurface/blackboxAgent.ts
|
|
14
14
|
init_dist();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-k8mvghe1.js";
|
|
4
4
|
import {
|
|
5
5
|
hasToolCall,
|
|
6
6
|
init_dist
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-h825qzmd.js";
|
|
8
8
|
import {
|
|
9
9
|
exports_external1 as exports_external,
|
|
10
10
|
init_zod,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-k8mvghe1.js";
|
|
4
4
|
import {
|
|
5
5
|
init_dist,
|
|
6
6
|
stepCountIs
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-h825qzmd.js";
|
|
8
8
|
|
|
9
9
|
// src/core/agents/specialized/codeAgent/agent.ts
|
|
10
10
|
init_dist();
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OffensiveSecurityAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-k8mvghe1.js";
|
|
4
4
|
import {
|
|
5
5
|
detectOSAndEnhancePrompt
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-mswm4k81.js";
|
|
7
7
|
import {
|
|
8
|
-
createLogger,
|
|
9
8
|
hasToolCall,
|
|
10
|
-
init_dist
|
|
11
|
-
|
|
12
|
-
init_structured,
|
|
13
|
-
scopedLogger
|
|
14
|
-
} from "./cli-5h1kv0v4.js";
|
|
9
|
+
init_dist
|
|
10
|
+
} from "./cli-h825qzmd.js";
|
|
15
11
|
|
|
16
12
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
17
13
|
init_dist();
|
|
18
|
-
init_structured();
|
|
19
|
-
init_lazyLogger();
|
|
20
14
|
import { existsSync, readFileSync } from "fs";
|
|
21
15
|
import { join } from "path";
|
|
22
16
|
|
|
@@ -162,8 +156,6 @@ If you encounter rate-limiting errors (e.g. "Rate limit exceeded", HTTP 429, "to
|
|
|
162
156
|
`;
|
|
163
157
|
|
|
164
158
|
// src/core/agents/specialized/authenticationAgent/agent.ts
|
|
165
|
-
var log = scopedLogger(() => createLogger("authentication-agent"));
|
|
166
|
-
|
|
167
159
|
class AuthenticationAgent extends OffensiveSecurityAgent {
|
|
168
160
|
constructor(opts) {
|
|
169
161
|
const {
|
|
@@ -312,7 +304,8 @@ You have credentials available via credential IDs — authenticate immediately.
|
|
|
312
304
|
async function runAuthenticationAgent(input) {
|
|
313
305
|
const agent = new AuthenticationAgent(input);
|
|
314
306
|
const result = await agent.consume();
|
|
315
|
-
log
|
|
307
|
+
console.log(`
|
|
308
|
+
Authentication ${result.success ? "succeeded" : "failed"}: ${result.summary}`);
|
|
316
309
|
return result;
|
|
317
310
|
}
|
|
318
311
|
|
package/build/cli.js
CHANGED
|
@@ -5,25 +5,24 @@ import {
|
|
|
5
5
|
createThreatModelPrompt
|
|
6
6
|
} from "./cli-fw5r7pfj.js";
|
|
7
7
|
import"./cli-c8131c4q.js";
|
|
8
|
+
import {
|
|
9
|
+
init_toolset
|
|
10
|
+
} from "./cli-s1nckt4k.js";
|
|
8
11
|
import {
|
|
9
12
|
buildAuthConfig,
|
|
10
|
-
|
|
13
|
+
init_ai,
|
|
11
14
|
init_models,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
init_utils,
|
|
16
|
-
logger
|
|
17
|
-
} from "./cli-5h1kv0v4.js";
|
|
18
|
-
import"./cli-78s9w64j.js";
|
|
15
|
+
init_utils
|
|
16
|
+
} from "./cli-h825qzmd.js";
|
|
17
|
+
import"./cli-948dk60p.js";
|
|
19
18
|
import"./cli-e6rgwtpb.js";
|
|
19
|
+
import"./cli-h6nw89zf.js";
|
|
20
20
|
import"./cli-gpnb45ck.js";
|
|
21
|
-
import"./cli-
|
|
22
|
-
import"./cli-23xtyah8.js";
|
|
21
|
+
import"./cli-0v9x0eby.js";
|
|
23
22
|
import {
|
|
24
23
|
init_package,
|
|
25
24
|
package_default
|
|
26
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-a20jcpmp.js";
|
|
27
26
|
import {
|
|
28
27
|
__require,
|
|
29
28
|
__toESM
|
|
@@ -143,7 +142,7 @@ var package_default2 = {
|
|
|
143
142
|
tsc: "tsc --noEmit"
|
|
144
143
|
},
|
|
145
144
|
type: "module",
|
|
146
|
-
version: "2.0.0
|
|
145
|
+
version: "2.0.0"
|
|
147
146
|
};
|
|
148
147
|
|
|
149
148
|
// src/core/ai/index.ts
|
|
@@ -151,45 +150,6 @@ init_ai();
|
|
|
151
150
|
init_models();
|
|
152
151
|
init_utils();
|
|
153
152
|
|
|
154
|
-
// src/core/cli/logLevelArgs.ts
|
|
155
|
-
var VALID_LOG_LEVELS = new Set([
|
|
156
|
-
"DEBUG",
|
|
157
|
-
"INFO",
|
|
158
|
-
"WARN",
|
|
159
|
-
"ERROR",
|
|
160
|
-
"SILENT"
|
|
161
|
-
]);
|
|
162
|
-
function resolveCliLogLevel(argv) {
|
|
163
|
-
let logLevelValue;
|
|
164
|
-
let shorthandLevel;
|
|
165
|
-
let sawLogLevel = false;
|
|
166
|
-
let invalid;
|
|
167
|
-
for (let i = argv.length - 1;i >= 0; i--) {
|
|
168
|
-
const a = argv[i];
|
|
169
|
-
if (a === "--verbose") {
|
|
170
|
-
shorthandLevel ??= "DEBUG";
|
|
171
|
-
argv.splice(i, 1);
|
|
172
|
-
} else if (a === "--quiet") {
|
|
173
|
-
shorthandLevel ??= "WARN";
|
|
174
|
-
argv.splice(i, 1);
|
|
175
|
-
} else if (a === "--log-level") {
|
|
176
|
-
const next = argv[i + 1];
|
|
177
|
-
const valueToken = next !== undefined && !next.startsWith("-") ? next : undefined;
|
|
178
|
-
if (!sawLogLevel) {
|
|
179
|
-
sawLogLevel = true;
|
|
180
|
-
const upper = valueToken?.toUpperCase();
|
|
181
|
-
if (upper && VALID_LOG_LEVELS.has(upper)) {
|
|
182
|
-
logLevelValue = upper;
|
|
183
|
-
} else {
|
|
184
|
-
invalid = valueToken ?? "(missing)";
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
argv.splice(i, valueToken !== undefined ? 2 : 1);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return { level: logLevelValue ?? shorthandLevel, invalid };
|
|
191
|
-
}
|
|
192
|
-
|
|
193
153
|
// src/core/cli/pentestMode.ts
|
|
194
154
|
var SUPPORTED_PENTEST_MODES = ["exfil"];
|
|
195
155
|
function resolvePentestMode(mode) {
|
|
@@ -461,13 +421,6 @@ You can upgrade manually by running:
|
|
|
461
421
|
};
|
|
462
422
|
}
|
|
463
423
|
|
|
464
|
-
// src/core/logger/index.ts
|
|
465
|
-
init_session();
|
|
466
|
-
init_structured();
|
|
467
|
-
import os from "os";
|
|
468
|
-
import path from "path";
|
|
469
|
-
var ERROR_LOG_PATH = path.join(os.homedir(), ".pensar", "error.log");
|
|
470
|
-
|
|
471
424
|
// src/tui/utils/command-flags.ts
|
|
472
425
|
import { readFileSync } from "fs";
|
|
473
426
|
import { isAbsolute, resolve } from "path";
|
|
@@ -497,6 +450,7 @@ function resolveThreatModelPrompt(value) {
|
|
|
497
450
|
|
|
498
451
|
// src/cli.ts
|
|
499
452
|
var args = process.argv.slice(2);
|
|
453
|
+
var command = args[0];
|
|
500
454
|
var version = package_default2.version;
|
|
501
455
|
var OBFUSCATE_FLAGS = new Set(["--obfuscate", "--redact", "-O"]);
|
|
502
456
|
var obfuscateRequested = args.some((a) => OBFUSCATE_FLAGS.has(a));
|
|
@@ -507,17 +461,6 @@ if (obfuscateRequested) {
|
|
|
507
461
|
args.splice(i, 1);
|
|
508
462
|
}
|
|
509
463
|
}
|
|
510
|
-
{
|
|
511
|
-
const { level, invalid } = resolveCliLogLevel(args);
|
|
512
|
-
if (invalid !== undefined) {
|
|
513
|
-
console.error(`Ignoring invalid --log-level "${invalid}" (expected DEBUG|INFO|WARN|ERROR|SILENT)`);
|
|
514
|
-
}
|
|
515
|
-
if (level) {
|
|
516
|
-
logger.setLevel(level);
|
|
517
|
-
process.env.PENSAR_LOG_LEVEL = level;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
var command = args[0];
|
|
521
464
|
function getArg(flag, argv = args) {
|
|
522
465
|
const idx = argv.indexOf(flag);
|
|
523
466
|
return idx !== -1 ? argv[idx + 1] : undefined;
|
|
@@ -552,7 +495,7 @@ function attachCliAgentStreamListeners(bus) {
|
|
|
552
495
|
async function createInstrumentedBus(session) {
|
|
553
496
|
const bus = new AgentEventBus;
|
|
554
497
|
attachCliAgentStreamListeners(bus);
|
|
555
|
-
const { attachWandbToEventBus } = await import("./upload-
|
|
498
|
+
const { attachWandbToEventBus } = await import("./upload-7wtbr768.js");
|
|
556
499
|
const wandbCleanup = await attachWandbToEventBus(session, bus).catch((e) => {
|
|
557
500
|
console.warn("[wandb] Tracing disabled:", e.message);
|
|
558
501
|
return null;
|
|
@@ -569,7 +512,7 @@ async function resolveCliHeaders() {
|
|
|
569
512
|
const { parseHeaderLine: parseHeaderLine2, parseHeadersFromFile, formatParseError: formatParseError2 } = await import("./parse-15kqmy2v.js");
|
|
570
513
|
const merged = {};
|
|
571
514
|
if (!noGlobal) {
|
|
572
|
-
const { config: appConfig } = await import("./index-
|
|
515
|
+
const { config: appConfig } = await import("./index-aymt8k9w.js");
|
|
573
516
|
const cfg = await appConfig.get();
|
|
574
517
|
if (cfg.defaultHeaders) {
|
|
575
518
|
Object.assign(merged, cfg.defaultHeaders);
|
|
@@ -603,8 +546,8 @@ async function resolveCliModel() {
|
|
|
603
546
|
const explicit = getArg("--model");
|
|
604
547
|
if (explicit)
|
|
605
548
|
return explicit;
|
|
606
|
-
const { config: appConfig } = await import("./index-
|
|
607
|
-
const { getDefaultModelForConfig } = await import("./utils-
|
|
549
|
+
const { config: appConfig } = await import("./index-aymt8k9w.js");
|
|
550
|
+
const { getDefaultModelForConfig } = await import("./utils-trqnyj77.js");
|
|
608
551
|
const pensarConfig = await appConfig.get();
|
|
609
552
|
const defaultModel = getDefaultModelForConfig(pensarConfig);
|
|
610
553
|
if (!defaultModel) {
|
|
@@ -678,9 +621,6 @@ threat-model options:
|
|
|
678
621
|
Global options:
|
|
679
622
|
-h, --help Show this help message
|
|
680
623
|
-v, --version Show version number
|
|
681
|
-
--log-level <lvl> Diagnostic log level: debug|info|warn|error|silent
|
|
682
|
-
--verbose Shorthand for --log-level debug
|
|
683
|
-
--quiet Shorthand for --log-level warn
|
|
684
624
|
--obfuscate Run the TUI in obfuscation mode \u2014 redacts hostnames,
|
|
685
625
|
IPs, UUIDs, emails, paths, tokens, and apparent
|
|
686
626
|
company names so screenshots are safe to share.
|
|
@@ -689,9 +629,9 @@ Global options:
|
|
|
689
629
|
async function runPentest() {
|
|
690
630
|
const { config } = await import("./main-3zneyg7p.js").then((m)=>__toESM(m.default,1));
|
|
691
631
|
config();
|
|
692
|
-
const { runPentestAgent } = await import("./blackboxPentest-
|
|
693
|
-
const { sessions
|
|
694
|
-
const { config: appConfig } = await import("./index-
|
|
632
|
+
const { runPentestAgent } = await import("./blackboxPentest-xwc031xm.js");
|
|
633
|
+
const { sessions } = await import("./index-0fnbx38r.js");
|
|
634
|
+
const { config: appConfig } = await import("./index-aymt8k9w.js");
|
|
695
635
|
const target = getArgRequired("--target");
|
|
696
636
|
const cwd = getArg("--cwd");
|
|
697
637
|
const mode = getArg("--mode");
|
|
@@ -721,7 +661,7 @@ Thinking: enabled` : ""}${taskDriven ? `
|
|
|
721
661
|
Task-driven: enabled` : ""}${headers ? `
|
|
722
662
|
Headers: ${Object.keys(headers).length} configured` : ""}
|
|
723
663
|
`);
|
|
724
|
-
const session = await
|
|
664
|
+
const session = await sessions.create({
|
|
725
665
|
name: cwd ? "Whitebox Pentest" : "Blackbox Pentest",
|
|
726
666
|
targets: [target],
|
|
727
667
|
config: {
|
|
@@ -761,9 +701,9 @@ Report: ${reportPath}` : ""}`);
|
|
|
761
701
|
async function runTargetedPentest() {
|
|
762
702
|
const { config } = await import("./main-3zneyg7p.js").then((m)=>__toESM(m.default,1));
|
|
763
703
|
config();
|
|
764
|
-
const { runTargetedPentestAgent } = await import("./targetedPentest-
|
|
765
|
-
const { sessions
|
|
766
|
-
const { config: appConfig } = await import("./index-
|
|
704
|
+
const { runTargetedPentestAgent } = await import("./targetedPentest-cpbd87rc.js");
|
|
705
|
+
const { sessions } = await import("./index-0fnbx38r.js");
|
|
706
|
+
const { config: appConfig } = await import("./index-aymt8k9w.js");
|
|
767
707
|
const target = getArgRequired("--target");
|
|
768
708
|
const objectives = getAllArgs("--objective");
|
|
769
709
|
const pensarConfig = await appConfig.get();
|
|
@@ -784,7 +724,7 @@ Objectives:
|
|
|
784
724
|
${objectivesList}
|
|
785
725
|
`);
|
|
786
726
|
const headers = await resolveCliHeaders();
|
|
787
|
-
const session = await
|
|
727
|
+
const session = await sessions.create({
|
|
788
728
|
name: "Targeted Pentest",
|
|
789
729
|
targets: [target],
|
|
790
730
|
...headers !== undefined ? { config: { headers } } : {}
|
|
@@ -815,13 +755,13 @@ POCs: ${pocsPath}`);
|
|
|
815
755
|
async function runThreatModel() {
|
|
816
756
|
const { config } = await import("./main-3zneyg7p.js").then((m)=>__toESM(m.default,1));
|
|
817
757
|
config();
|
|
818
|
-
const { runThreatModelWorkflow } = await import("./threatModel-
|
|
819
|
-
const { config: appConfig } = await import("./index-
|
|
820
|
-
const
|
|
758
|
+
const { runThreatModelWorkflow } = await import("./threatModel-9n56z6a6.js");
|
|
759
|
+
const { config: appConfig } = await import("./index-aymt8k9w.js");
|
|
760
|
+
const path = await import("path");
|
|
821
761
|
const pensarConfig = await appConfig.get();
|
|
822
762
|
const model = await resolveCliModel();
|
|
823
763
|
const outputArg = getArg("--output") ?? getArg("-o") ?? "threat-model.md";
|
|
824
|
-
const resolvedPath =
|
|
764
|
+
const resolvedPath = path.isAbsolute(outputArg) ? outputArg : path.resolve(process.cwd(), outputArg);
|
|
825
765
|
const sep = "=".repeat(60);
|
|
826
766
|
console.log(`${sep}
|
|
827
767
|
THREAT MODEL GENERATION
|
|
@@ -852,13 +792,13 @@ Threat model written to: ${resolvedPath}`);
|
|
|
852
792
|
async function runOperator() {
|
|
853
793
|
const { config } = await import("./main-3zneyg7p.js").then((m)=>__toESM(m.default,1));
|
|
854
794
|
config();
|
|
855
|
-
const { runOffensiveSecurityAgent } = await import("./offesecAgent-
|
|
856
|
-
const { sessions
|
|
857
|
-
const { ALL_TOOL_NAMES, SKILL_TOOL_NAMES } = await import("./index-
|
|
858
|
-
const { config: appConfig } = await import("./index-
|
|
795
|
+
const { runOffensiveSecurityAgent } = await import("./offesecAgent-mrbyc93d.js");
|
|
796
|
+
const { sessions, normalizeMessages, getResumeMessages } = await import("./index-0fnbx38r.js");
|
|
797
|
+
const { ALL_TOOL_NAMES, SKILL_TOOL_NAMES } = await import("./index-hfhkjj2g.js");
|
|
798
|
+
const { config: appConfig } = await import("./index-aymt8k9w.js");
|
|
859
799
|
const { createInterface } = await import("readline");
|
|
860
800
|
const { readFileSync: readFileSync2, existsSync } = await import("fs");
|
|
861
|
-
const
|
|
801
|
+
const path = await import("path");
|
|
862
802
|
const { stepCountIs } = await import("./index-vc29b21w.js");
|
|
863
803
|
const promptRaw = getArg("-p") ?? getArg("--prompt");
|
|
864
804
|
if (!promptRaw) {
|
|
@@ -880,7 +820,7 @@ Target: ${target}` : ""}
|
|
|
880
820
|
${sep}
|
|
881
821
|
`);
|
|
882
822
|
const headers = await resolveCliHeaders();
|
|
883
|
-
const session = await
|
|
823
|
+
const session = await sessions.create({
|
|
884
824
|
name: "Operator Session",
|
|
885
825
|
targets: target ? [target] : [],
|
|
886
826
|
config: {
|
|
@@ -924,7 +864,7 @@ ${sep}
|
|
|
924
864
|
session,
|
|
925
865
|
messages
|
|
926
866
|
});
|
|
927
|
-
const messagesPath =
|
|
867
|
+
const messagesPath = path.join(session.rootPath, "messages.json");
|
|
928
868
|
if (existsSync(messagesPath)) {
|
|
929
869
|
const raw = JSON.parse(readFileSync2(messagesPath, "utf-8"));
|
|
930
870
|
const allMessages = Array.isArray(raw) ? raw : [];
|
|
@@ -969,32 +909,32 @@ if (hasFlag("-p") || command === "--prompt") {
|
|
|
969
909
|
await runTargetedPentest();
|
|
970
910
|
} else if (command === "login" || command === "auth") {
|
|
971
911
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
972
|
-
await import("./auth-
|
|
912
|
+
await import("./auth-24ca1qwx.js");
|
|
973
913
|
} else if (command === "uninstall") {
|
|
974
914
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
975
|
-
await import("./uninstall-
|
|
915
|
+
await import("./uninstall-6y9dkgyt.js");
|
|
976
916
|
} else if (command === "apps") {
|
|
977
917
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
978
|
-
await import("./apps-
|
|
918
|
+
await import("./apps-gdze0s68.js");
|
|
979
919
|
} else if (command === "pentests") {
|
|
980
920
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
981
|
-
await import("./pentests-
|
|
921
|
+
await import("./pentests-htmtq66d.js");
|
|
982
922
|
} else if (command === "issues") {
|
|
983
923
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
984
|
-
await import("./issues-
|
|
924
|
+
await import("./issues-5pnrspt7.js");
|
|
985
925
|
} else if (command === "fixes") {
|
|
986
926
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
987
|
-
await import("./fixes-
|
|
927
|
+
await import("./fixes-a4qscvkx.js");
|
|
988
928
|
} else if (command === "logs") {
|
|
989
929
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
990
|
-
await import("./logs-
|
|
930
|
+
await import("./logs-1mfm901x.js");
|
|
991
931
|
} else if (command === "config") {
|
|
992
932
|
process.argv = [process.argv[0], process.argv[1], ...args.slice(1)];
|
|
993
|
-
await import("./config-
|
|
933
|
+
await import("./config-cmq1cxz3.js");
|
|
994
934
|
} else if (command === "threat-model") {
|
|
995
935
|
await runThreatModel();
|
|
996
936
|
} else if (command === "doctor") {
|
|
997
|
-
const { runDoctor } = await import("./doctor-
|
|
937
|
+
const { runDoctor } = await import("./doctor-2bkpddws.js");
|
|
998
938
|
await runDoctor();
|
|
999
939
|
} else if (args.length === 0) {
|
|
1000
940
|
if (process.env.PENSAR_NO_TUI === "1") {
|
|
@@ -1002,7 +942,7 @@ if (hasFlag("-p") || command === "--prompt") {
|
|
|
1002
942
|
console.error("All other commands work with Node \u2014 run 'pensar --help'.");
|
|
1003
943
|
process.exit(1);
|
|
1004
944
|
}
|
|
1005
|
-
await import("./index-
|
|
945
|
+
await import("./index-48pjf9d2.js");
|
|
1006
946
|
} else {
|
|
1007
947
|
console.error(`Error: Unknown command '${command}'`);
|
|
1008
948
|
console.error();
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
config,
|
|
13
13
|
init_config
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
14
|
+
} from "./cli-h6nw89zf.js";
|
|
15
|
+
import"./cli-0v9x0eby.js";
|
|
16
|
+
import"./cli-a20jcpmp.js";
|
|
17
17
|
import"./cli-8rxa073f.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/config.ts
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toolExists
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-5h1kv0v4.js";
|
|
5
|
-
import"./cli-78s9w64j.js";
|
|
6
|
-
import"./cli-e6rgwtpb.js";
|
|
7
|
-
import"./cli-gpnb45ck.js";
|
|
8
|
-
import"./cli-rtbry75t.js";
|
|
9
|
-
import"./cli-23xtyah8.js";
|
|
10
|
-
import"./cli-k1vsv3qh.js";
|
|
3
|
+
} from "./cli-mswm4k81.js";
|
|
11
4
|
import"./cli-8rxa073f.js";
|
|
12
5
|
|
|
13
6
|
// src/core/doctor.ts
|
|
@@ -2,26 +2,29 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getFix,
|
|
4
4
|
listFixes
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
5
|
+
} from "./cli-31cara07.js";
|
|
6
|
+
import"./cli-5fr9k6m4.js";
|
|
7
|
+
import"./cli-sw5swz40.js";
|
|
8
|
+
import"./cli-cb5va0cs.js";
|
|
9
|
+
import"./cli-zvq4gy61.js";
|
|
10
|
+
import"./cli-zpvmaxem.js";
|
|
11
|
+
import"./cli-wdmqkshz.js";
|
|
12
12
|
import"./cli-9fsre5pt.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
13
|
+
import"./cli-ntd42071.js";
|
|
14
|
+
import"./cli-k8mvghe1.js";
|
|
15
|
+
import"./cli-mswm4k81.js";
|
|
16
|
+
import"./cli-3knnkdps.js";
|
|
16
17
|
import"./cli-fw5r7pfj.js";
|
|
17
18
|
import"./cli-c8131c4q.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-s1nckt4k.js";
|
|
20
|
+
import"./cli-1yavz2pb.js";
|
|
21
|
+
import"./cli-h825qzmd.js";
|
|
22
|
+
import"./cli-948dk60p.js";
|
|
20
23
|
import"./cli-e6rgwtpb.js";
|
|
24
|
+
import"./cli-h6nw89zf.js";
|
|
21
25
|
import"./cli-gpnb45ck.js";
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-k1vsv3qh.js";
|
|
26
|
+
import"./cli-0v9x0eby.js";
|
|
27
|
+
import"./cli-a20jcpmp.js";
|
|
25
28
|
import"./cli-8rxa073f.js";
|
|
26
29
|
|
|
27
30
|
// src/cli/fixes.ts
|
|
@@ -1,51 +1,45 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CredentialManager,
|
|
3
3
|
RateLimiter,
|
|
4
|
-
ToolsetStateSchema,
|
|
5
4
|
createDir,
|
|
6
5
|
descending,
|
|
7
6
|
generateRandomName,
|
|
8
7
|
generateSessionName,
|
|
9
|
-
init_credentials,
|
|
10
|
-
init_id,
|
|
11
|
-
init_name,
|
|
12
|
-
init_rateLimiter,
|
|
13
|
-
init_storage,
|
|
14
|
-
init_toolset,
|
|
15
8
|
read,
|
|
16
9
|
schema,
|
|
17
10
|
update,
|
|
18
11
|
write,
|
|
19
12
|
writeRaw
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import
|
|
13
|
+
} from "./cli-3knnkdps.js";
|
|
14
|
+
import {
|
|
15
|
+
ToolsetStateSchema,
|
|
16
|
+
init_toolset
|
|
17
|
+
} from "./cli-s1nckt4k.js";
|
|
18
|
+
import"./cli-1yavz2pb.js";
|
|
19
|
+
import"./cli-h825qzmd.js";
|
|
20
|
+
import"./cli-948dk60p.js";
|
|
22
21
|
import {
|
|
23
22
|
init_zod,
|
|
24
23
|
zod_default
|
|
25
24
|
} from "./cli-e6rgwtpb.js";
|
|
25
|
+
import"./cli-h6nw89zf.js";
|
|
26
26
|
import"./cli-gpnb45ck.js";
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-23xtyah8.js";
|
|
27
|
+
import"./cli-0v9x0eby.js";
|
|
29
28
|
import {
|
|
30
29
|
getCurrentVersion,
|
|
31
30
|
init_installation
|
|
32
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-a20jcpmp.js";
|
|
33
32
|
import {
|
|
34
33
|
__require
|
|
35
34
|
} from "./cli-8rxa073f.js";
|
|
36
35
|
|
|
37
36
|
// src/core/session/index.ts
|
|
38
37
|
init_zod();
|
|
39
|
-
init_name();
|
|
40
|
-
init_credentials();
|
|
41
|
-
init_id();
|
|
42
|
-
init_installation();
|
|
43
|
-
init_rateLimiter();
|
|
44
|
-
init_storage();
|
|
45
|
-
init_toolset();
|
|
46
38
|
import { existsSync, readFileSync } from "fs";
|
|
47
39
|
import os from "os";
|
|
48
40
|
import path from "path";
|
|
41
|
+
init_installation();
|
|
42
|
+
init_toolset();
|
|
49
43
|
var DEFAULT_OUTCOME_GUIDANCE = "Prove the exploit can be run but do not exfiltrate data or cause any harm to the system. " + "Create proof-of-concept exploits that demonstrate the vulnerability exists without causing damage.";
|
|
50
44
|
var EXFIL_OUTCOME_GUIDANCE = "Exfiltrate data to extract the flag value. " + "Create proof-of-concept exploits that successfully extract the flag from the target system.";
|
|
51
45
|
var DEFAULT_HEADER_RECORD = {
|
|
@@ -302,7 +296,7 @@ async function create(input) {
|
|
|
302
296
|
if (normalizedConfig?.headers !== undefined) {
|
|
303
297
|
snapshotHeaders = { ...normalizedConfig.headers };
|
|
304
298
|
} else {
|
|
305
|
-
const { config: appConfig } = await import("./index-
|
|
299
|
+
const { config: appConfig } = await import("./index-2a1x5nnv.js");
|
|
306
300
|
const cfg = await appConfig.get();
|
|
307
301
|
snapshotHeaders = cfg.defaultHeaders ? { ...cfg.defaultHeaders } : { ...DEFAULT_HEADER_RECORD };
|
|
308
302
|
}
|