@pensar/apex 2.0.1 → 2.0.2-canary.1de5ff5b
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/build/{agent-x7n47c84.js → agent-0xj95pts.js} +10 -10
- package/build/{agent-6nhperp2.js → agent-e7a8ecyn.js} +12 -10
- package/build/agent-tcrb50te.js +19 -0
- package/build/{apps-2ac4vt09.js → apps-p91cynx1.js} +21 -16
- package/build/{auth-bmt98hz0.js → auth-snffaqnn.js} +16 -16
- package/build/authentication-8q9a1cpf.js +19 -0
- package/build/blackboxAgent-mwbcawfn.js +19 -0
- package/build/{blackboxPentest-xngbtdxb.js → blackboxPentest-2v0856w0.js} +14 -14
- package/build/{cli-hk03x6fq.js → cli-4x7k2s16.js} +4 -3
- package/build/{cli-w2st266h.js → cli-5c0rvt4t.js} +35 -6
- package/build/{cli-1f5zzrxj.js → cli-bcd6032f.js} +1 -1
- package/build/{cli-z1dapp7v.js → cli-bxtz3bdv.js} +78 -41
- package/build/{cli-fa7nrded.js → cli-cbhsy5x3.js} +5 -5
- package/build/{cli-zpdmnz8c.js → cli-d5vz4kyn.js} +6267 -1978
- package/build/{cli-e6rgwtpb.js → cli-f7d23ded.js} +6317 -3211
- package/build/{cli-88bhxzr1.js → cli-hkegr688.js} +4 -4
- package/build/{cli-mfzkhttr.js → cli-jzkfbrnx.js} +30 -22
- package/build/{cli-eptabm2j.js → cli-kn9tst6t.js} +1 -1
- package/build/{cli-ddtmgbqv.js → cli-mep0ck1r.js} +4 -4
- package/build/{cli-cc13ydyx.js → cli-p4aht9hv.js} +9 -9
- package/build/{cli-pyzw545d.js → cli-pevzp7nj.js} +78 -13
- package/build/{cli-8xknm7d9.js → cli-q24twygk.js} +1 -1
- package/build/{cli-fxtbkw2f.js → cli-r9v48v8g.js} +6 -6
- package/build/{cli-0yptvbbm.js → cli-w55v1bht.js} +11 -10
- package/build/{cli-f93g10xk.js → cli-wgqxjhky.js} +2 -2
- package/build/{cli-8g5cwvbm.js → cli-zgpj2mv1.js} +2 -2
- package/build/cli.js +67 -50
- package/build/{config-j0gfjhrm.js → config-rb760dgz.js} +4 -4
- package/build/{doctor-zn8ms7gs.js → doctor-2m2xy88h.js} +9 -9
- package/build/{fixes-d8ytvyzn.js → fixes-y8qx2ps5.js} +16 -16
- package/build/{index-2t2cg8x0.js → index-27fhky9b.js} +9 -9
- package/build/{index-528cyewc.js → index-5eb4pewb.js} +117 -71
- package/build/{index-hjvqqkem.js → index-cnd7y4g5.js} +4 -4
- package/build/{index-a1sy2zak.js → index-cwtb1k9c.js} +2 -2
- package/build/{index-9d2es97h.js → index-jhrbdyka.js} +3 -3
- package/build/{index-vc29b21w.js → index-mgng15va.js} +1 -1
- package/build/{index-3cbcjqw1.js → index-n04xcmzx.js} +10 -10
- package/build/{index-k6ttkac6.js → index-pkq9jjgj.js} +14 -13
- package/build/{issues-17kdjtdg.js → issues-hzqc762k.js} +16 -16
- package/build/{logs-r4rjar4m.js → logs-wmqhnyfa.js} +16 -16
- package/build/{offesecAgent-azd8ahkm.js → offesecAgent-6m7300st.js} +9 -9
- package/build/{parse-15kqmy2v.js → parse-7djk9jyf.js} +1 -1
- package/build/pentest-8b0ttsjk.js +28 -0
- package/build/{pentests-npjb5q1h.js → pentests-y3gqyam1.js} +16 -16
- package/build/{targetedPentest-m24wvscc.js → targetedPentest-yrs8xwvg.js} +10 -10
- package/build/targets-439kemyk.js +113 -0
- package/build/threatModel-zr6dmn2t.js +26 -0
- package/build/{uninstall-7pm6zcah.js → uninstall-p8d3kg6p.js} +9 -9
- package/build/{upload-wg0vxmk0.js → upload-5e7pkj1n.js} +7 -7
- package/build/{utils-gd1y4t26.js → utils-amj862q8.js} +6 -6
- package/package.json +10 -9
- package/build/agent-4g69jwmq.js +0 -19
- package/build/authentication-c0aj9zaz.js +0 -19
- package/build/blackboxAgent-sgph70e4.js +0 -19
- package/build/pentest-2vsjf0j8.js +0 -28
- package/build/threatModel-7akmfzzm.js +0 -26
|
@@ -17,19 +17,19 @@ import {
|
|
|
17
17
|
update,
|
|
18
18
|
write,
|
|
19
19
|
writeRaw
|
|
20
|
-
} from "./cli-
|
|
21
|
-
import"./cli-
|
|
20
|
+
} from "./cli-bxtz3bdv.js";
|
|
21
|
+
import"./cli-zgpj2mv1.js";
|
|
22
22
|
import {
|
|
23
23
|
init_zod,
|
|
24
24
|
zod_default
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-f7d23ded.js";
|
|
26
26
|
import"./cli-gpnb45ck.js";
|
|
27
|
-
import"./cli-
|
|
28
|
-
import"./cli-
|
|
27
|
+
import"./cli-kn9tst6t.js";
|
|
28
|
+
import"./cli-hkegr688.js";
|
|
29
29
|
import {
|
|
30
30
|
getCurrentVersion,
|
|
31
31
|
init_installation
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-w55v1bht.js";
|
|
33
33
|
import {
|
|
34
34
|
__require
|
|
35
35
|
} from "./cli-8rxa073f.js";
|
|
@@ -43,9 +43,9 @@ init_installation();
|
|
|
43
43
|
init_rateLimiter();
|
|
44
44
|
init_storage();
|
|
45
45
|
init_toolset();
|
|
46
|
-
import { existsSync, readFileSync } from "fs";
|
|
47
|
-
import os from "os";
|
|
48
|
-
import path from "path";
|
|
46
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
47
|
+
import os from "node:os";
|
|
48
|
+
import path from "node:path";
|
|
49
49
|
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
50
|
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
51
|
var DEFAULT_HEADER_RECORD = {
|
|
@@ -178,7 +178,8 @@ var SessionConfigObject = zod_default.object({
|
|
|
178
178
|
agentCwd: zod_default.string().optional(),
|
|
179
179
|
prompt: zod_default.string().optional(),
|
|
180
180
|
taskDriven: zod_default.boolean().optional(),
|
|
181
|
-
requirePlan: zod_default.boolean().optional()
|
|
181
|
+
requirePlan: zod_default.boolean().optional(),
|
|
182
|
+
promptInjectionLibrarySource: zod_default.string().optional()
|
|
182
183
|
});
|
|
183
184
|
function getPensarDir() {
|
|
184
185
|
return path.join(os.homedir(), ".pensar");
|
|
@@ -302,7 +303,7 @@ async function create(input) {
|
|
|
302
303
|
if (normalizedConfig?.headers !== undefined) {
|
|
303
304
|
snapshotHeaders = { ...normalizedConfig.headers };
|
|
304
305
|
} else {
|
|
305
|
-
const { config: appConfig } = await import("./index-
|
|
306
|
+
const { config: appConfig } = await import("./index-jhrbdyka.js");
|
|
306
307
|
const cfg = await appConfig.get();
|
|
307
308
|
snapshotHeaders = cfg.defaultHeaders ? { ...cfg.defaultHeaders } : { ...DEFAULT_HEADER_RECORD };
|
|
308
309
|
}
|
|
@@ -374,7 +375,7 @@ async function* list() {
|
|
|
374
375
|
const sessionsDir = getSessionsDir();
|
|
375
376
|
let entries;
|
|
376
377
|
try {
|
|
377
|
-
entries = await import("fs/promises").then((fsp) => fsp.readdir(sessionsDir, { withFileTypes: true }));
|
|
378
|
+
entries = await import("node:fs/promises").then((fsp) => fsp.readdir(sessionsDir, { withFileTypes: true }));
|
|
378
379
|
} catch {
|
|
379
380
|
return;
|
|
380
381
|
}
|
|
@@ -396,7 +397,7 @@ var RemoveInput = zod_default.object({
|
|
|
396
397
|
var remove2 = async (input) => {
|
|
397
398
|
try {
|
|
398
399
|
const sessionDir = getSessionRoot(input.sessionId);
|
|
399
|
-
const fsp = await import("fs/promises");
|
|
400
|
+
const fsp = await import("node:fs/promises");
|
|
400
401
|
await fsp.rm(sessionDir, { recursive: true, force: true });
|
|
401
402
|
} catch (e) {
|
|
402
403
|
console.error(e);
|
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
getIssue,
|
|
4
4
|
listIssues,
|
|
5
5
|
updateIssue
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
6
|
+
} from "./cli-pevzp7nj.js";
|
|
7
|
+
import"./cli-jzkfbrnx.js";
|
|
8
|
+
import"./cli-r9v48v8g.js";
|
|
9
|
+
import"./cli-5c0rvt4t.js";
|
|
10
|
+
import"./cli-cbhsy5x3.js";
|
|
11
|
+
import"./cli-wgqxjhky.js";
|
|
12
|
+
import"./cli-mep0ck1r.js";
|
|
13
13
|
import"./cli-9fsre5pt.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
14
|
+
import"./cli-4x7k2s16.js";
|
|
15
|
+
import"./cli-d5vz4kyn.js";
|
|
16
|
+
import"./cli-p4aht9hv.js";
|
|
17
17
|
import"./cli-fw5r7pfj.js";
|
|
18
18
|
import"./cli-c8131c4q.js";
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
19
|
+
import"./cli-bxtz3bdv.js";
|
|
20
|
+
import"./cli-zgpj2mv1.js";
|
|
21
|
+
import"./cli-f7d23ded.js";
|
|
22
22
|
import"./cli-gpnb45ck.js";
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
23
|
+
import"./cli-kn9tst6t.js";
|
|
24
|
+
import"./cli-hkegr688.js";
|
|
25
|
+
import"./cli-w55v1bht.js";
|
|
26
26
|
import"./cli-8rxa073f.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/issues.ts
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
import {
|
|
3
3
|
listAgentLogs,
|
|
4
4
|
searchAgentLogs
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
5
|
+
} from "./cli-pevzp7nj.js";
|
|
6
|
+
import"./cli-jzkfbrnx.js";
|
|
7
|
+
import"./cli-r9v48v8g.js";
|
|
8
|
+
import"./cli-5c0rvt4t.js";
|
|
9
|
+
import"./cli-cbhsy5x3.js";
|
|
10
|
+
import"./cli-wgqxjhky.js";
|
|
11
|
+
import"./cli-mep0ck1r.js";
|
|
12
12
|
import"./cli-9fsre5pt.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
13
|
+
import"./cli-4x7k2s16.js";
|
|
14
|
+
import"./cli-d5vz4kyn.js";
|
|
15
|
+
import"./cli-p4aht9hv.js";
|
|
16
16
|
import"./cli-fw5r7pfj.js";
|
|
17
17
|
import"./cli-c8131c4q.js";
|
|
18
|
-
import"./cli-
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
18
|
+
import"./cli-bxtz3bdv.js";
|
|
19
|
+
import"./cli-zgpj2mv1.js";
|
|
20
|
+
import"./cli-f7d23ded.js";
|
|
21
21
|
import"./cli-gpnb45ck.js";
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
22
|
+
import"./cli-kn9tst6t.js";
|
|
23
|
+
import"./cli-hkegr688.js";
|
|
24
|
+
import"./cli-w55v1bht.js";
|
|
25
25
|
import"./cli-8rxa073f.js";
|
|
26
26
|
|
|
27
27
|
// src/cli/logs.ts
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import"./cli-9fsre5pt.js";
|
|
2
|
-
import"./cli-
|
|
2
|
+
import"./cli-4x7k2s16.js";
|
|
3
3
|
import {
|
|
4
4
|
OffensiveSecurityAgent
|
|
5
|
-
} from "./cli-
|
|
6
|
-
import"./cli-
|
|
5
|
+
} from "./cli-d5vz4kyn.js";
|
|
6
|
+
import"./cli-p4aht9hv.js";
|
|
7
7
|
import"./cli-c8131c4q.js";
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
8
|
+
import"./cli-bxtz3bdv.js";
|
|
9
|
+
import"./cli-zgpj2mv1.js";
|
|
10
|
+
import"./cli-f7d23ded.js";
|
|
11
11
|
import"./cli-gpnb45ck.js";
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
12
|
+
import"./cli-kn9tst6t.js";
|
|
13
|
+
import"./cli-hkegr688.js";
|
|
14
|
+
import"./cli-w55v1bht.js";
|
|
15
15
|
import"./cli-8rxa073f.js";
|
|
16
16
|
|
|
17
17
|
// src/core/api/offesecAgent.ts
|
|
@@ -114,7 +114,7 @@ function parseHeaderRecord(record) {
|
|
|
114
114
|
`));
|
|
115
115
|
}
|
|
116
116
|
async function parseHeadersFromFile(filePath) {
|
|
117
|
-
const fs = await import("fs/promises");
|
|
117
|
+
const fs = await import("node:fs/promises");
|
|
118
118
|
let raw;
|
|
119
119
|
try {
|
|
120
120
|
raw = await fs.readFile(filePath, "utf-8");
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_CONCURRENCY,
|
|
3
|
+
runPentestSwarm,
|
|
4
|
+
runPentestWorkflow
|
|
5
|
+
} from "./cli-jzkfbrnx.js";
|
|
6
|
+
import"./cli-r9v48v8g.js";
|
|
7
|
+
import"./cli-5c0rvt4t.js";
|
|
8
|
+
import"./cli-wgqxjhky.js";
|
|
9
|
+
import"./cli-mep0ck1r.js";
|
|
10
|
+
import"./cli-9fsre5pt.js";
|
|
11
|
+
import"./cli-4x7k2s16.js";
|
|
12
|
+
import"./cli-d5vz4kyn.js";
|
|
13
|
+
import"./cli-p4aht9hv.js";
|
|
14
|
+
import"./cli-fw5r7pfj.js";
|
|
15
|
+
import"./cli-c8131c4q.js";
|
|
16
|
+
import"./cli-bxtz3bdv.js";
|
|
17
|
+
import"./cli-zgpj2mv1.js";
|
|
18
|
+
import"./cli-f7d23ded.js";
|
|
19
|
+
import"./cli-gpnb45ck.js";
|
|
20
|
+
import"./cli-kn9tst6t.js";
|
|
21
|
+
import"./cli-hkegr688.js";
|
|
22
|
+
import"./cli-w55v1bht.js";
|
|
23
|
+
import"./cli-8rxa073f.js";
|
|
24
|
+
export {
|
|
25
|
+
runPentestWorkflow,
|
|
26
|
+
runPentestSwarm,
|
|
27
|
+
DEFAULT_CONCURRENCY
|
|
28
|
+
};
|
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
dispatchPentest,
|
|
4
4
|
getScan,
|
|
5
5
|
listScans
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
8
|
-
import"./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
12
|
-
import"./cli-
|
|
6
|
+
} from "./cli-pevzp7nj.js";
|
|
7
|
+
import"./cli-jzkfbrnx.js";
|
|
8
|
+
import"./cli-r9v48v8g.js";
|
|
9
|
+
import"./cli-5c0rvt4t.js";
|
|
10
|
+
import"./cli-cbhsy5x3.js";
|
|
11
|
+
import"./cli-wgqxjhky.js";
|
|
12
|
+
import"./cli-mep0ck1r.js";
|
|
13
13
|
import"./cli-9fsre5pt.js";
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
16
|
-
import"./cli-
|
|
14
|
+
import"./cli-4x7k2s16.js";
|
|
15
|
+
import"./cli-d5vz4kyn.js";
|
|
16
|
+
import"./cli-p4aht9hv.js";
|
|
17
17
|
import"./cli-fw5r7pfj.js";
|
|
18
18
|
import"./cli-c8131c4q.js";
|
|
19
|
-
import"./cli-
|
|
20
|
-
import"./cli-
|
|
21
|
-
import"./cli-
|
|
19
|
+
import"./cli-bxtz3bdv.js";
|
|
20
|
+
import"./cli-zgpj2mv1.js";
|
|
21
|
+
import"./cli-f7d23ded.js";
|
|
22
22
|
import"./cli-gpnb45ck.js";
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
25
|
-
import"./cli-
|
|
23
|
+
import"./cli-kn9tst6t.js";
|
|
24
|
+
import"./cli-hkegr688.js";
|
|
25
|
+
import"./cli-w55v1bht.js";
|
|
26
26
|
import"./cli-8rxa073f.js";
|
|
27
27
|
|
|
28
28
|
// src/cli/pentests.ts
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TargetedPentestAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-5c0rvt4t.js";
|
|
4
4
|
import"./cli-9fsre5pt.js";
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
5
|
+
import"./cli-4x7k2s16.js";
|
|
6
|
+
import"./cli-d5vz4kyn.js";
|
|
7
|
+
import"./cli-p4aht9hv.js";
|
|
8
8
|
import"./cli-c8131c4q.js";
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
9
|
+
import"./cli-bxtz3bdv.js";
|
|
10
|
+
import"./cli-zgpj2mv1.js";
|
|
11
|
+
import"./cli-f7d23ded.js";
|
|
12
12
|
import"./cli-gpnb45ck.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
15
|
-
import"./cli-
|
|
13
|
+
import"./cli-kn9tst6t.js";
|
|
14
|
+
import"./cli-hkegr688.js";
|
|
15
|
+
import"./cli-w55v1bht.js";
|
|
16
16
|
import"./cli-8rxa073f.js";
|
|
17
17
|
|
|
18
18
|
// src/core/api/targetedPentest.ts
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import {
|
|
3
|
+
listPentestTargets,
|
|
4
|
+
listTargetLogs,
|
|
5
|
+
searchTargetLogs
|
|
6
|
+
} from "./cli-pevzp7nj.js";
|
|
7
|
+
import"./cli-jzkfbrnx.js";
|
|
8
|
+
import"./cli-r9v48v8g.js";
|
|
9
|
+
import"./cli-5c0rvt4t.js";
|
|
10
|
+
import"./cli-cbhsy5x3.js";
|
|
11
|
+
import"./cli-wgqxjhky.js";
|
|
12
|
+
import"./cli-mep0ck1r.js";
|
|
13
|
+
import"./cli-9fsre5pt.js";
|
|
14
|
+
import"./cli-4x7k2s16.js";
|
|
15
|
+
import"./cli-d5vz4kyn.js";
|
|
16
|
+
import"./cli-p4aht9hv.js";
|
|
17
|
+
import"./cli-fw5r7pfj.js";
|
|
18
|
+
import"./cli-c8131c4q.js";
|
|
19
|
+
import"./cli-bxtz3bdv.js";
|
|
20
|
+
import"./cli-zgpj2mv1.js";
|
|
21
|
+
import"./cli-f7d23ded.js";
|
|
22
|
+
import"./cli-gpnb45ck.js";
|
|
23
|
+
import"./cli-kn9tst6t.js";
|
|
24
|
+
import"./cli-hkegr688.js";
|
|
25
|
+
import"./cli-w55v1bht.js";
|
|
26
|
+
import"./cli-8rxa073f.js";
|
|
27
|
+
|
|
28
|
+
// src/cli/targets.ts
|
|
29
|
+
function getFlag(flag, argv) {
|
|
30
|
+
const idx = argv.indexOf(flag);
|
|
31
|
+
return idx !== -1 && idx + 1 < argv.length ? argv[idx + 1] : undefined;
|
|
32
|
+
}
|
|
33
|
+
function showHelp() {
|
|
34
|
+
console.log(`pensar targets — View pentest targets and their agent logs
|
|
35
|
+
|
|
36
|
+
A target is a single endpoint tested during a pentest. Pentest logs are stored
|
|
37
|
+
per target, so this is how you query the full activity for an endpoint.
|
|
38
|
+
|
|
39
|
+
All commands operate on the selected workspace (set via \`pensar login\`).
|
|
40
|
+
|
|
41
|
+
Usage:
|
|
42
|
+
pensar targets <pentestId> List targets for a pentest
|
|
43
|
+
pensar targets logs <targetId> [filters] List agent logs for a target
|
|
44
|
+
pensar targets search <targetId> <query> [opts] Search agent logs for a target
|
|
45
|
+
|
|
46
|
+
Logs filters:
|
|
47
|
+
--level <level> Filter: debug, info, warn, error
|
|
48
|
+
--role <role> Filter: assistant, user, system, tool-call, tool-result
|
|
49
|
+
--limit <n> Max entries (default: 100, max: 500)
|
|
50
|
+
|
|
51
|
+
Search options:
|
|
52
|
+
--level <level> Filter: debug, info, warn, error
|
|
53
|
+
--role <role> Filter: assistant, user, system, tool-call, tool-result
|
|
54
|
+
--context <n> Context lines around matches (default: 3)
|
|
55
|
+
|
|
56
|
+
Options:
|
|
57
|
+
-h, --help Show this help message`);
|
|
58
|
+
}
|
|
59
|
+
async function main() {
|
|
60
|
+
const args = process.argv.slice(2);
|
|
61
|
+
const sub = args[0];
|
|
62
|
+
if (!sub || sub === "--help" || sub === "-h" || sub === "help") {
|
|
63
|
+
showHelp();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
if (sub === "logs") {
|
|
68
|
+
const targetId = args[1];
|
|
69
|
+
if (!targetId) {
|
|
70
|
+
console.error("Error: target ID is required");
|
|
71
|
+
console.error("Usage: pensar targets logs <targetId> [--level <level>] [--role <role>] [--limit <n>]");
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
const level = getFlag("--level", args);
|
|
75
|
+
const role = getFlag("--role", args);
|
|
76
|
+
const limitStr = getFlag("--limit", args);
|
|
77
|
+
const limit = limitStr ? parseInt(limitStr, 10) : undefined;
|
|
78
|
+
const result = await listTargetLogs(targetId, { level, role, limit });
|
|
79
|
+
console.log(JSON.stringify(result, null, 2));
|
|
80
|
+
} else if (sub === "search") {
|
|
81
|
+
const targetId = args[1];
|
|
82
|
+
const query = args[2];
|
|
83
|
+
if (!targetId || !query) {
|
|
84
|
+
console.error("Error: target ID and query are required");
|
|
85
|
+
console.error("Usage: pensar targets search <targetId> <query> [--level <level>] [--role <role>] [--context <n>]");
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
const level = getFlag("--level", args);
|
|
89
|
+
const role = getFlag("--role", args);
|
|
90
|
+
const contextStr = getFlag("--context", args);
|
|
91
|
+
const contextLines = contextStr ? parseInt(contextStr, 10) : undefined;
|
|
92
|
+
const result = await searchTargetLogs(targetId, query, {
|
|
93
|
+
level,
|
|
94
|
+
role,
|
|
95
|
+
contextLines
|
|
96
|
+
});
|
|
97
|
+
console.log(JSON.stringify(result, null, 2));
|
|
98
|
+
} else if (sub.startsWith("--")) {
|
|
99
|
+
console.error("Error: pentest ID is required");
|
|
100
|
+
console.error("Usage: pensar targets <pentestId>");
|
|
101
|
+
process.exit(1);
|
|
102
|
+
} else {
|
|
103
|
+
const pentestId = sub;
|
|
104
|
+
const targets = await listPentestTargets(pentestId);
|
|
105
|
+
console.log(JSON.stringify(targets, null, 2));
|
|
106
|
+
}
|
|
107
|
+
} catch (err) {
|
|
108
|
+
console.error(`
|
|
109
|
+
Error: ${err instanceof Error ? err.message : String(err)}`);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
main();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runThreatModelWorkflow
|
|
3
|
+
} from "./cli-pevzp7nj.js";
|
|
4
|
+
import"./cli-jzkfbrnx.js";
|
|
5
|
+
import"./cli-r9v48v8g.js";
|
|
6
|
+
import"./cli-5c0rvt4t.js";
|
|
7
|
+
import"./cli-cbhsy5x3.js";
|
|
8
|
+
import"./cli-wgqxjhky.js";
|
|
9
|
+
import"./cli-mep0ck1r.js";
|
|
10
|
+
import"./cli-9fsre5pt.js";
|
|
11
|
+
import"./cli-4x7k2s16.js";
|
|
12
|
+
import"./cli-d5vz4kyn.js";
|
|
13
|
+
import"./cli-p4aht9hv.js";
|
|
14
|
+
import"./cli-fw5r7pfj.js";
|
|
15
|
+
import"./cli-c8131c4q.js";
|
|
16
|
+
import"./cli-bxtz3bdv.js";
|
|
17
|
+
import"./cli-zgpj2mv1.js";
|
|
18
|
+
import"./cli-f7d23ded.js";
|
|
19
|
+
import"./cli-gpnb45ck.js";
|
|
20
|
+
import"./cli-kn9tst6t.js";
|
|
21
|
+
import"./cli-hkegr688.js";
|
|
22
|
+
import"./cli-w55v1bht.js";
|
|
23
|
+
import"./cli-8rxa073f.js";
|
|
24
|
+
export {
|
|
25
|
+
runThreatModelWorkflow
|
|
26
|
+
};
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
detectInstallMethod,
|
|
4
4
|
init_installation
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-w55v1bht.js";
|
|
6
6
|
import {
|
|
7
7
|
__require
|
|
8
8
|
} from "./cli-8rxa073f.js";
|
|
9
9
|
|
|
10
10
|
// src/cli/uninstall.ts
|
|
11
11
|
init_installation();
|
|
12
|
-
import { spawnSync } from "child_process";
|
|
13
|
-
import fs from "fs/promises";
|
|
14
|
-
import os from "os";
|
|
15
|
-
import path from "path";
|
|
16
|
-
import * as readline from "readline";
|
|
12
|
+
import { spawnSync } from "node:child_process";
|
|
13
|
+
import fs from "node:fs/promises";
|
|
14
|
+
import os from "node:os";
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import * as readline from "node:readline";
|
|
17
17
|
var PRESERVED_DIRS = new Set(["sessions", "memories", "skills"]);
|
|
18
18
|
function getPensarDir() {
|
|
19
19
|
return process.env.PENSAR_DATA_DIR ?? path.join(os.homedir(), ".pensar");
|
|
@@ -33,7 +33,7 @@ function prompt(question) {
|
|
|
33
33
|
function findBinaryPath() {
|
|
34
34
|
const execName = process.execPath.split("/").pop()?.replace(/\.exe$/, "") ?? "";
|
|
35
35
|
const isCompiledBinary = execName !== "bun" && execName !== "node" && execName !== "bun-debug";
|
|
36
|
-
if (isCompiledBinary && __require("fs").existsSync(process.execPath)) {
|
|
36
|
+
if (isCompiledBinary && __require("node:fs").existsSync(process.execPath)) {
|
|
37
37
|
return process.execPath;
|
|
38
38
|
}
|
|
39
39
|
const result = spawnSync("which", ["pensar"], {
|
|
@@ -45,7 +45,7 @@ function findBinaryPath() {
|
|
|
45
45
|
}
|
|
46
46
|
const defaultPath = path.join(os.homedir(), ".local", "bin", "pensar");
|
|
47
47
|
try {
|
|
48
|
-
const stat = __require("fs").statSync(defaultPath);
|
|
48
|
+
const stat = __require("node:fs").statSync(defaultPath);
|
|
49
49
|
if (stat)
|
|
50
50
|
return defaultPath;
|
|
51
51
|
} catch {}
|
|
@@ -99,7 +99,7 @@ function removeBinary(method) {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
try {
|
|
102
|
-
__require("fs").unlinkSync(binPath);
|
|
102
|
+
__require("node:fs").unlinkSync(binPath);
|
|
103
103
|
return { success: true, message: `Removed binary at ${binPath}` };
|
|
104
104
|
} catch (err) {
|
|
105
105
|
return {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWeaveTracer,
|
|
3
3
|
resolveConfig
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
7
|
-
import"./cli-
|
|
4
|
+
} from "./cli-bcd6032f.js";
|
|
5
|
+
import"./cli-bxtz3bdv.js";
|
|
6
|
+
import"./cli-zgpj2mv1.js";
|
|
7
|
+
import"./cli-f7d23ded.js";
|
|
8
8
|
import"./cli-gpnb45ck.js";
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
9
|
+
import"./cli-kn9tst6t.js";
|
|
10
|
+
import"./cli-hkegr688.js";
|
|
11
|
+
import"./cli-w55v1bht.js";
|
|
12
12
|
import"./cli-8rxa073f.js";
|
|
13
13
|
|
|
14
14
|
// src/core/integrations/wandb/upload.ts
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
AVAILABLE_MODELS,
|
|
7
7
|
init_ai
|
|
8
|
-
} from "./cli-
|
|
9
|
-
import"./cli-
|
|
10
|
-
import"./cli-
|
|
8
|
+
} from "./cli-bxtz3bdv.js";
|
|
9
|
+
import"./cli-zgpj2mv1.js";
|
|
10
|
+
import"./cli-f7d23ded.js";
|
|
11
11
|
import"./cli-gpnb45ck.js";
|
|
12
|
-
import"./cli-
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-
|
|
12
|
+
import"./cli-kn9tst6t.js";
|
|
13
|
+
import"./cli-hkegr688.js";
|
|
14
|
+
import"./cli-w55v1bht.js";
|
|
15
15
|
import"./cli-8rxa073f.js";
|
|
16
16
|
|
|
17
17
|
// src/core/providers/utils.ts
|
package/package.json
CHANGED
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
"@opentelemetry/api": "^1.9.0",
|
|
19
19
|
"@opentui/core": "^0.1.107",
|
|
20
20
|
"@opentui/react": "^0.1.107",
|
|
21
|
-
"@pensar/surface": "0.2.
|
|
21
|
+
"@pensar/surface": "0.2.2",
|
|
22
22
|
"@playwright/mcp": "^0.0.54",
|
|
23
23
|
"ai": "^6.0.105",
|
|
24
|
+
"camoufox-js": "^0.11.1",
|
|
24
25
|
"glob": "^13.0.0",
|
|
25
26
|
"highlight.js": "^11.11.1",
|
|
26
27
|
"imapflow": "^1.2.10",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"sharp": "^0.34.4",
|
|
34
35
|
"tldts": "^7.0.28",
|
|
35
36
|
"yaml": "^2.8.2",
|
|
36
|
-
"zod": "^
|
|
37
|
+
"zod": "^4.1.12"
|
|
37
38
|
},
|
|
38
39
|
"description": "AI-powered penetration testing CLI tool with terminal UI",
|
|
39
40
|
"devDependencies": {
|
|
@@ -84,13 +85,13 @@
|
|
|
84
85
|
"url": "https://github.com/pensarai/apex.git"
|
|
85
86
|
},
|
|
86
87
|
"scripts": {
|
|
87
|
-
"build": "bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave",
|
|
88
|
+
"build": "bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
|
|
88
89
|
"build:binaries": "bun run generate:ascii && mkdir -p dist && bun run build:binary:macos-arm64 && bun run build:binary:macos-x64 && bun run build:binary:linux-x64 && bun run build:binary:linux-arm64",
|
|
89
|
-
"build:binary": "bun run generate:ascii && bun build src/cli.ts --compile --outfile pensar",
|
|
90
|
-
"build:binary:linux-arm64": "bun build src/cli.ts --compile --target=bun-linux-arm64 --outfile dist/pensar-linux-arm64",
|
|
91
|
-
"build:binary:linux-x64": "bun build src/cli.ts --compile --target=bun-linux-x64 --outfile dist/pensar-linux-x64",
|
|
92
|
-
"build:binary:macos-arm64": "bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile dist/pensar-darwin-arm64",
|
|
93
|
-
"build:binary:macos-x64": "bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile dist/pensar-darwin-x64",
|
|
90
|
+
"build:binary": "bun run generate:ascii && bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --outfile pensar",
|
|
91
|
+
"build:binary:linux-arm64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-linux-arm64 --outfile dist/pensar-linux-arm64",
|
|
92
|
+
"build:binary:linux-x64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-linux-x64 --outfile dist/pensar-linux-x64",
|
|
93
|
+
"build:binary:macos-arm64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-darwin-arm64 --outfile dist/pensar-darwin-arm64",
|
|
94
|
+
"build:binary:macos-x64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-darwin-x64 --outfile dist/pensar-darwin-x64",
|
|
94
95
|
"check": "biome check --write",
|
|
95
96
|
"check:ci": "biome check",
|
|
96
97
|
"daytona-benchmark": "bun run scripts/daytona-benchmark.ts",
|
|
@@ -112,5 +113,5 @@
|
|
|
112
113
|
"tsc": "tsc --noEmit"
|
|
113
114
|
},
|
|
114
115
|
"type": "module",
|
|
115
|
-
"version": "2.0.
|
|
116
|
+
"version": "2.0.2-canary.1de5ff5b"
|
|
116
117
|
}
|
package/build/agent-4g69jwmq.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CodeAgent
|
|
3
|
-
} from "./cli-f93g10xk.js";
|
|
4
|
-
import"./cli-9fsre5pt.js";
|
|
5
|
-
import"./cli-hk03x6fq.js";
|
|
6
|
-
import"./cli-zpdmnz8c.js";
|
|
7
|
-
import"./cli-cc13ydyx.js";
|
|
8
|
-
import"./cli-c8131c4q.js";
|
|
9
|
-
import"./cli-z1dapp7v.js";
|
|
10
|
-
import"./cli-8g5cwvbm.js";
|
|
11
|
-
import"./cli-e6rgwtpb.js";
|
|
12
|
-
import"./cli-gpnb45ck.js";
|
|
13
|
-
import"./cli-eptabm2j.js";
|
|
14
|
-
import"./cli-88bhxzr1.js";
|
|
15
|
-
import"./cli-0yptvbbm.js";
|
|
16
|
-
import"./cli-8rxa073f.js";
|
|
17
|
-
export {
|
|
18
|
-
CodeAgent
|
|
19
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
runAuthenticationAgent
|
|
3
|
-
} from "./cli-fa7nrded.js";
|
|
4
|
-
import"./cli-9fsre5pt.js";
|
|
5
|
-
import"./cli-hk03x6fq.js";
|
|
6
|
-
import"./cli-zpdmnz8c.js";
|
|
7
|
-
import"./cli-cc13ydyx.js";
|
|
8
|
-
import"./cli-c8131c4q.js";
|
|
9
|
-
import"./cli-z1dapp7v.js";
|
|
10
|
-
import"./cli-8g5cwvbm.js";
|
|
11
|
-
import"./cli-e6rgwtpb.js";
|
|
12
|
-
import"./cli-gpnb45ck.js";
|
|
13
|
-
import"./cli-eptabm2j.js";
|
|
14
|
-
import"./cli-88bhxzr1.js";
|
|
15
|
-
import"./cli-0yptvbbm.js";
|
|
16
|
-
import"./cli-8rxa073f.js";
|
|
17
|
-
export {
|
|
18
|
-
runAuthenticationAgent
|
|
19
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-fxtbkw2f.js";
|
|
4
|
-
import"./cli-9fsre5pt.js";
|
|
5
|
-
import"./cli-hk03x6fq.js";
|
|
6
|
-
import"./cli-zpdmnz8c.js";
|
|
7
|
-
import"./cli-cc13ydyx.js";
|
|
8
|
-
import"./cli-c8131c4q.js";
|
|
9
|
-
import"./cli-z1dapp7v.js";
|
|
10
|
-
import"./cli-8g5cwvbm.js";
|
|
11
|
-
import"./cli-e6rgwtpb.js";
|
|
12
|
-
import"./cli-gpnb45ck.js";
|
|
13
|
-
import"./cli-eptabm2j.js";
|
|
14
|
-
import"./cli-88bhxzr1.js";
|
|
15
|
-
import"./cli-0yptvbbm.js";
|
|
16
|
-
import"./cli-8rxa073f.js";
|
|
17
|
-
export {
|
|
18
|
-
BlackboxAttackSurfaceAgent
|
|
19
|
-
};
|