dsh-pentester 0.1.0-alpha.2 → 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 +43 -44
- package/agents/impact/profile.yml +19 -0
- package/agents/recon/profile.yml +23 -0
- package/agents/reporting/REPORT_TEMPLATE.md +333 -0
- package/agents/reporting/profile.yml +45 -0
- package/agents/threat-model/profile.yml +19 -0
- package/agents/validation/profile.yml +20 -0
- package/agents/vulnerability/profile.yml +19 -0
- package/agents/web/profile.yml +19 -0
- package/docker/README.md +60 -0
- package/docker/kali/Dockerfile +881 -0
- package/docker/kali/README.md +104 -0
- package/docker/kali/REPORT_TEMPLATE.md +333 -0
- package/docker/kali/TOOL_PROMPT.md +361 -0
- package/docker/kali/bin/clone-kb +39 -0
- package/docker/kali/bin/entrypoint.sh +9 -0
- package/docker/kali/bin/gen-tools-json.sh +246 -0
- package/docker/kali/bin/record-traffic.sh +32 -0
- package/docker/kali/bin/tool-info +31 -0
- package/docker/kali/bin/tool-list +17 -0
- package/lib/build-id.json +1 -0
- package/lib/catalog-BmeOyr6n.js +231 -0
- package/lib/catalog-BmeOyr6n.js.map +1 -0
- package/lib/catalog-DhE_r18k.js +231 -0
- package/lib/catalog-DhE_r18k.js.map +1 -0
- package/lib/client.js +4916 -12596
- package/lib/client.js.map +4 -4
- package/lib/container-listing-BI6Xj8l2.js +56 -0
- package/lib/container-listing-BI6Xj8l2.js.map +1 -0
- package/lib/container-listing-BWZoBnN_.js +56 -0
- package/lib/container-listing-BWZoBnN_.js.map +1 -0
- package/lib/engagement-container-store-Cf-h0B4F.js +641 -0
- package/lib/engagement-container-store-Cf-h0B4F.js.map +1 -0
- package/lib/engagement-container-store-L_Gms-zi.js +632 -0
- package/lib/engagement-container-store-L_Gms-zi.js.map +1 -0
- package/lib/index.d.ts +11 -3920
- package/lib/index.js +4491 -15959
- package/lib/index.js.map +1 -1
- package/lib/model-CZoiogVs.js +149 -0
- package/lib/model-CZoiogVs.js.map +1 -0
- package/lib/model-DKZ5Rjik.js +145 -0
- package/lib/model-DKZ5Rjik.js.map +1 -0
- package/lib/worker-events-jFvaBp9x.js +351 -0
- package/lib/worker-events-jFvaBp9x.js.map +1 -0
- package/lib/worker-events-juSf0EDW.js +347 -0
- package/lib/worker-events-juSf0EDW.js.map +1 -0
- package/package.json +23 -14
- package/presets/pentester/agent.cordis.yml +221 -0
- package/presets/pentester/preset.yml +2 -0
- package/presets/pentester/run-state.mjs +219 -0
- package/presets/pentester-mode/agent.cordis.yml +0 -60
- package/presets/pentester-mode/preset.yml +0 -3
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { a as PENTESTER_RUNTIME_PROFILE_LABEL, n as PENTESTER_ENGAGEMENT_LABEL } from "./engagement-container-store-Cf-h0B4F.js";
|
|
2
|
+
//#region src/tools/container-listing.ts
|
|
3
|
+
/**
|
|
4
|
+
* Container listing helpers used by the P0-B GC. The engine's
|
|
5
|
+
* `listContainers` returns id + labels + name + image; filtering by the
|
|
6
|
+
* dsh.pentester.* labels is done here so the GC never parses container names
|
|
7
|
+
* for ownership (labels are the single source of truth).
|
|
8
|
+
*/
|
|
9
|
+
async function listContainersByLabel(engine, label, value) {
|
|
10
|
+
const containers = await engine.listContainers({
|
|
11
|
+
label: `${label}=${value}`,
|
|
12
|
+
all: true
|
|
13
|
+
});
|
|
14
|
+
const out = [];
|
|
15
|
+
for (const container of containers) {
|
|
16
|
+
const engagementId = container.labels?.[PENTESTER_ENGAGEMENT_LABEL];
|
|
17
|
+
const profile = container.labels?.[PENTESTER_RUNTIME_PROFILE_LABEL];
|
|
18
|
+
if (engagementId === void 0 || profile === void 0) continue;
|
|
19
|
+
out.push({
|
|
20
|
+
containerId: container.id,
|
|
21
|
+
engagementId,
|
|
22
|
+
profile,
|
|
23
|
+
name: container.name
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Legacy candidates from the OLD 1-AgentRun=1-container scheme:
|
|
30
|
+
* - image == dsh-pentester/kali:latest
|
|
31
|
+
* - name matches `dsh-<engagement>--<run>--<toolbox>` (no managed label)
|
|
32
|
+
* Ownership is confirmed only by the caller (engagement dir exists); anything
|
|
33
|
+
* ambiguous is reported, never deleted.
|
|
34
|
+
*/
|
|
35
|
+
const LEGACY_NAME = /^dsh-([a-zA-Z0-9_.-]{8,40})--[a-zA-Z0-9_.-]{8,40}--[a-zA-Z0-9_.-]{1,24}$/;
|
|
36
|
+
async function listLegacyPentesterContainers(engine) {
|
|
37
|
+
const containers = await engine.listContainers({ all: true });
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const container of containers) {
|
|
40
|
+
if (container.labels?.["dsh.pentester.managed"] === "true") continue;
|
|
41
|
+
if (!container.image.includes("dsh-pentester/kali")) continue;
|
|
42
|
+
const match = LEGACY_NAME.exec(container.name);
|
|
43
|
+
if (match === null) continue;
|
|
44
|
+
out.push({
|
|
45
|
+
containerId: container.id,
|
|
46
|
+
name: container.name,
|
|
47
|
+
image: container.image,
|
|
48
|
+
engagementId: match[1]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { listContainersByLabel, listLegacyPentesterContainers };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=container-listing-BI6Xj8l2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-listing-BI6Xj8l2.js","names":[],"sources":["../src/tools/container-listing.ts"],"sourcesContent":["import type { DockerEngineClient } from './docker-engine.js'\nimport {\n PENTESTER_ENGAGEMENT_LABEL,\n PENTESTER_MANAGED_LABEL,\n PENTESTER_MANAGED_TRUE,\n PENTESTER_RUNTIME_PROFILE_LABEL,\n} from './engagement-container-store.js'\nimport type { LegacyContainerCandidate, ManagedContainerEntry } from './container-gc.js'\n\n/**\n * Container listing helpers used by the P0-B GC. The engine's\n * `listContainers` returns id + labels + name + image; filtering by the\n * dsh.pentester.* labels is done here so the GC never parses container names\n * for ownership (labels are the single source of truth).\n */\n\nexport async function listContainersByLabel(\n engine: DockerEngineClient,\n label: string,\n value: string,\n): Promise<readonly ManagedContainerEntry[]> {\n const containers = await engine.listContainers({ label: `${label}=${value}`, all: true })\n const out: ManagedContainerEntry[] = []\n for (const container of containers) {\n const engagementId = container.labels?.[PENTESTER_ENGAGEMENT_LABEL]\n const profile = container.labels?.[PENTESTER_RUNTIME_PROFILE_LABEL]\n if (engagementId === undefined || profile === undefined) {\n continue\n }\n out.push({ containerId: container.id, engagementId, profile, name: container.name })\n }\n return out\n}\n\n/**\n * Legacy candidates from the OLD 1-AgentRun=1-container scheme:\n * - image == dsh-pentester/kali:latest\n * - name matches `dsh-<engagement>--<run>--<toolbox>` (no managed label)\n * Ownership is confirmed only by the caller (engagement dir exists); anything\n * ambiguous is reported, never deleted.\n */\nconst LEGACY_NAME = /^dsh-([a-zA-Z0-9_.-]{8,40})--[a-zA-Z0-9_.-]{8,40}--[a-zA-Z0-9_.-]{1,24}$/\n\nexport async function listLegacyPentesterContainers(\n engine: DockerEngineClient,\n): Promise<readonly LegacyContainerCandidate[]> {\n const containers = await engine.listContainers({ all: true })\n const out: LegacyContainerCandidate[] = []\n for (const container of containers) {\n if (container.labels?.[PENTESTER_MANAGED_LABEL] === PENTESTER_MANAGED_TRUE) {\n // Managed containers are handled by the new-scheme scan, never legacy.\n continue\n }\n if (!container.image.includes('dsh-pentester/kali')) {\n continue\n }\n const match = LEGACY_NAME.exec(container.name)\n if (match === null) {\n continue\n }\n out.push({\n containerId: container.id,\n name: container.name,\n image: container.image,\n engagementId: match[1],\n })\n }\n return out\n}\n"],"mappings":";;;;;;;;AAgBA,eAAsB,sBACpB,QACA,OACA,OAC2C;CAC3C,MAAM,aAAa,MAAM,OAAO,eAAe;EAAE,OAAO,GAAG,MAAM,GAAG;EAAS,KAAK;CAAK,CAAC;CACxF,MAAM,MAA+B,CAAC;CACtC,KAAK,MAAM,aAAa,YAAY;EAClC,MAAM,eAAe,UAAU,SAAS;EACxC,MAAM,UAAU,UAAU,SAAS;EACnC,IAAI,iBAAiB,KAAA,KAAa,YAAY,KAAA,GAC5C;EAEF,IAAI,KAAK;GAAE,aAAa,UAAU;GAAI;GAAc;GAAS,MAAM,UAAU;EAAK,CAAC;CACrF;CACA,OAAO;AACT;;;;;;;;AASA,MAAM,cAAc;AAEpB,eAAsB,8BACpB,QAC8C;CAC9C,MAAM,aAAa,MAAM,OAAO,eAAe,EAAE,KAAK,KAAK,CAAC;CAC5D,MAAM,MAAkC,CAAC;CACzC,KAAK,MAAM,aAAa,YAAY;EAClC,IAAI,UAAU,SAAA,6BAAA,QAEZ;EAEF,IAAI,CAAC,UAAU,MAAM,SAAS,oBAAoB,GAChD;EAEF,MAAM,QAAQ,YAAY,KAAK,UAAU,IAAI;EAC7C,IAAI,UAAU,MACZ;EAEF,IAAI,KAAK;GACP,aAAa,UAAU;GACvB,MAAM,UAAU;GAChB,OAAO,UAAU;GACjB,cAAc,MAAM;EACtB,CAAC;CACH;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { a as PENTESTER_RUNTIME_PROFILE_LABEL, n as PENTESTER_ENGAGEMENT_LABEL } from "./engagement-container-store-L_Gms-zi.js";
|
|
2
|
+
//#region src/tools/container-listing.ts
|
|
3
|
+
/**
|
|
4
|
+
* Container listing helpers used by the P0-B GC. The engine's
|
|
5
|
+
* `listContainers` returns id + labels + name + image; filtering by the
|
|
6
|
+
* dsh.pentester.* labels is done here so the GC never parses container names
|
|
7
|
+
* for ownership (labels are the single source of truth).
|
|
8
|
+
*/
|
|
9
|
+
async function listContainersByLabel(engine, label, value) {
|
|
10
|
+
const containers = await engine.listContainers({
|
|
11
|
+
label: `${label}=${value}`,
|
|
12
|
+
all: true
|
|
13
|
+
});
|
|
14
|
+
const out = [];
|
|
15
|
+
for (const container of containers) {
|
|
16
|
+
const engagementId = container.labels?.[PENTESTER_ENGAGEMENT_LABEL];
|
|
17
|
+
const profile = container.labels?.[PENTESTER_RUNTIME_PROFILE_LABEL];
|
|
18
|
+
if (engagementId === void 0 || profile === void 0) continue;
|
|
19
|
+
out.push({
|
|
20
|
+
containerId: container.id,
|
|
21
|
+
engagementId,
|
|
22
|
+
profile,
|
|
23
|
+
name: container.name
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Legacy candidates from the OLD 1-AgentRun=1-container scheme:
|
|
30
|
+
* - image == dsh-pentester/kali:latest
|
|
31
|
+
* - name matches `dsh-<engagement>--<run>--<toolbox>` (no managed label)
|
|
32
|
+
* Ownership is confirmed only by the caller (engagement dir exists); anything
|
|
33
|
+
* ambiguous is reported, never deleted.
|
|
34
|
+
*/
|
|
35
|
+
const LEGACY_NAME = /^dsh-([a-zA-Z0-9_.-]{8,40})--[a-zA-Z0-9_.-]{8,40}--[a-zA-Z0-9_.-]{1,24}$/;
|
|
36
|
+
async function listLegacyPentesterContainers(engine) {
|
|
37
|
+
const containers = await engine.listContainers({ all: true });
|
|
38
|
+
const out = [];
|
|
39
|
+
for (const container of containers) {
|
|
40
|
+
if (container.labels?.["dsh.pentester.managed"] === "true") continue;
|
|
41
|
+
if (!container.image.includes("dsh-pentester/kali")) continue;
|
|
42
|
+
const match = LEGACY_NAME.exec(container.name);
|
|
43
|
+
if (match === null) continue;
|
|
44
|
+
out.push({
|
|
45
|
+
containerId: container.id,
|
|
46
|
+
name: container.name,
|
|
47
|
+
image: container.image,
|
|
48
|
+
engagementId: match[1]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { listContainersByLabel, listLegacyPentesterContainers };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=container-listing-BWZoBnN_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-listing-BWZoBnN_.js","names":[],"sources":["../src/tools/container-listing.ts"],"sourcesContent":["import type { DockerEngineClient } from './docker-engine.js'\nimport {\n PENTESTER_ENGAGEMENT_LABEL,\n PENTESTER_MANAGED_LABEL,\n PENTESTER_MANAGED_TRUE,\n PENTESTER_RUNTIME_PROFILE_LABEL,\n} from './engagement-container-store.js'\nimport type { LegacyContainerCandidate, ManagedContainerEntry } from './container-gc.js'\n\n/**\n * Container listing helpers used by the P0-B GC. The engine's\n * `listContainers` returns id + labels + name + image; filtering by the\n * dsh.pentester.* labels is done here so the GC never parses container names\n * for ownership (labels are the single source of truth).\n */\n\nexport async function listContainersByLabel(\n engine: DockerEngineClient,\n label: string,\n value: string,\n): Promise<readonly ManagedContainerEntry[]> {\n const containers = await engine.listContainers({ label: `${label}=${value}`, all: true })\n const out: ManagedContainerEntry[] = []\n for (const container of containers) {\n const engagementId = container.labels?.[PENTESTER_ENGAGEMENT_LABEL]\n const profile = container.labels?.[PENTESTER_RUNTIME_PROFILE_LABEL]\n if (engagementId === undefined || profile === undefined) {\n continue\n }\n out.push({ containerId: container.id, engagementId, profile, name: container.name })\n }\n return out\n}\n\n/**\n * Legacy candidates from the OLD 1-AgentRun=1-container scheme:\n * - image == dsh-pentester/kali:latest\n * - name matches `dsh-<engagement>--<run>--<toolbox>` (no managed label)\n * Ownership is confirmed only by the caller (engagement dir exists); anything\n * ambiguous is reported, never deleted.\n */\nconst LEGACY_NAME = /^dsh-([a-zA-Z0-9_.-]{8,40})--[a-zA-Z0-9_.-]{8,40}--[a-zA-Z0-9_.-]{1,24}$/\n\nexport async function listLegacyPentesterContainers(\n engine: DockerEngineClient,\n): Promise<readonly LegacyContainerCandidate[]> {\n const containers = await engine.listContainers({ all: true })\n const out: LegacyContainerCandidate[] = []\n for (const container of containers) {\n if (container.labels?.[PENTESTER_MANAGED_LABEL] === PENTESTER_MANAGED_TRUE) {\n // Managed containers are handled by the new-scheme scan, never legacy.\n continue\n }\n if (!container.image.includes('dsh-pentester/kali')) {\n continue\n }\n const match = LEGACY_NAME.exec(container.name)\n if (match === null) {\n continue\n }\n out.push({\n containerId: container.id,\n name: container.name,\n image: container.image,\n engagementId: match[1],\n })\n }\n return out\n}\n"],"mappings":";;;;;;;;AAgBA,eAAsB,sBACpB,QACA,OACA,OAC2C;CAC3C,MAAM,aAAa,MAAM,OAAO,eAAe;EAAE,OAAO,GAAG,MAAM,GAAG;EAAS,KAAK;CAAK,CAAC;CACxF,MAAM,MAA+B,CAAC;CACtC,KAAK,MAAM,aAAa,YAAY;EAClC,MAAM,eAAe,UAAU,SAAS;EACxC,MAAM,UAAU,UAAU,SAAS;EACnC,IAAI,iBAAiB,KAAA,KAAa,YAAY,KAAA,GAC5C;EAEF,IAAI,KAAK;GAAE,aAAa,UAAU;GAAI;GAAc;GAAS,MAAM,UAAU;EAAK,CAAC;CACrF;CACA,OAAO;AACT;;;;;;;;AASA,MAAM,cAAc;AAEpB,eAAsB,8BACpB,QAC8C;CAC9C,MAAM,aAAa,MAAM,OAAO,eAAe,EAAE,KAAK,KAAK,CAAC;CAC5D,MAAM,MAAkC,CAAC;CACzC,KAAK,MAAM,aAAa,YAAY;EAClC,IAAI,UAAU,SAAA,6BAAA,QAEZ;EAEF,IAAI,CAAC,UAAU,MAAM,SAAS,oBAAoB,GAChD;EAEF,MAAM,QAAQ,YAAY,KAAK,UAAU,IAAI;EAC7C,IAAI,UAAU,MACZ;EAEF,IAAI,KAAK;GACP,aAAa,UAAU;GACvB,MAAM,UAAU;GAChB,OAAO,UAAU;GACjB,cAAc,MAAM;EACtB,CAAC;CACH;CACA,OAAO;AACT"}
|