windows-exe-decompiler-mcp-server 0.1.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/CODEX_INSTALLATION.md +69 -0
- package/COPILOT_INSTALLATION.md +77 -0
- package/LICENSE +21 -0
- package/README.md +314 -0
- package/bin/windows-exe-decompiler-mcp-server.js +3 -0
- package/dist/analysis-provenance.d.ts +184 -0
- package/dist/analysis-provenance.js +74 -0
- package/dist/analysis-task-runner.d.ts +31 -0
- package/dist/analysis-task-runner.js +160 -0
- package/dist/artifact-inventory.d.ts +23 -0
- package/dist/artifact-inventory.js +175 -0
- package/dist/cache-manager.d.ts +128 -0
- package/dist/cache-manager.js +454 -0
- package/dist/confidence-semantics.d.ts +66 -0
- package/dist/confidence-semantics.js +122 -0
- package/dist/config.d.ts +335 -0
- package/dist/config.js +193 -0
- package/dist/database.d.ts +227 -0
- package/dist/database.js +601 -0
- package/dist/decompiler-worker.d.ts +441 -0
- package/dist/decompiler-worker.js +1962 -0
- package/dist/dynamic-trace.d.ts +95 -0
- package/dist/dynamic-trace.js +629 -0
- package/dist/env-validator.d.ts +15 -0
- package/dist/env-validator.js +249 -0
- package/dist/error-handler.d.ts +28 -0
- package/dist/error-handler.example.d.ts +22 -0
- package/dist/error-handler.example.js +141 -0
- package/dist/error-handler.js +139 -0
- package/dist/ghidra-analysis-status.d.ts +49 -0
- package/dist/ghidra-analysis-status.js +178 -0
- package/dist/ghidra-config.d.ts +134 -0
- package/dist/ghidra-config.js +464 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +200 -0
- package/dist/job-queue.d.ts +169 -0
- package/dist/job-queue.js +407 -0
- package/dist/logger.d.ts +106 -0
- package/dist/logger.js +176 -0
- package/dist/policy-guard.d.ts +115 -0
- package/dist/policy-guard.js +243 -0
- package/dist/process-output.d.ts +15 -0
- package/dist/process-output.js +90 -0
- package/dist/prompts/function-explanation-review.d.ts +5 -0
- package/dist/prompts/function-explanation-review.js +64 -0
- package/dist/prompts/semantic-name-review.d.ts +5 -0
- package/dist/prompts/semantic-name-review.js +63 -0
- package/dist/runtime-correlation.d.ts +34 -0
- package/dist/runtime-correlation.js +279 -0
- package/dist/runtime-paths.d.ts +3 -0
- package/dist/runtime-paths.js +11 -0
- package/dist/selection-diff.d.ts +667 -0
- package/dist/selection-diff.js +53 -0
- package/dist/semantic-name-suggestion-artifacts.d.ts +116 -0
- package/dist/semantic-name-suggestion-artifacts.js +314 -0
- package/dist/server.d.ts +129 -0
- package/dist/server.js +578 -0
- package/dist/tools/artifact-read.d.ts +235 -0
- package/dist/tools/artifact-read.js +317 -0
- package/dist/tools/artifacts-diff.d.ts +728 -0
- package/dist/tools/artifacts-diff.js +304 -0
- package/dist/tools/artifacts-list.d.ts +515 -0
- package/dist/tools/artifacts-list.js +389 -0
- package/dist/tools/attack-map.d.ts +290 -0
- package/dist/tools/attack-map.js +519 -0
- package/dist/tools/cache-observability.d.ts +4 -0
- package/dist/tools/cache-observability.js +36 -0
- package/dist/tools/code-function-cfg.d.ts +50 -0
- package/dist/tools/code-function-cfg.js +102 -0
- package/dist/tools/code-function-decompile.d.ts +55 -0
- package/dist/tools/code-function-decompile.js +103 -0
- package/dist/tools/code-function-disassemble.d.ts +43 -0
- package/dist/tools/code-function-disassemble.js +185 -0
- package/dist/tools/code-function-explain-apply.d.ts +255 -0
- package/dist/tools/code-function-explain-apply.js +225 -0
- package/dist/tools/code-function-explain-prepare.d.ts +535 -0
- package/dist/tools/code-function-explain-prepare.js +276 -0
- package/dist/tools/code-function-explain-review.d.ts +397 -0
- package/dist/tools/code-function-explain-review.js +589 -0
- package/dist/tools/code-function-rename-apply.d.ts +248 -0
- package/dist/tools/code-function-rename-apply.js +220 -0
- package/dist/tools/code-function-rename-prepare.d.ts +506 -0
- package/dist/tools/code-function-rename-prepare.js +279 -0
- package/dist/tools/code-function-rename-review.d.ts +574 -0
- package/dist/tools/code-function-rename-review.js +761 -0
- package/dist/tools/code-functions-list.d.ts +37 -0
- package/dist/tools/code-functions-list.js +91 -0
- package/dist/tools/code-functions-rank.d.ts +34 -0
- package/dist/tools/code-functions-rank.js +90 -0
- package/dist/tools/code-functions-reconstruct.d.ts +2725 -0
- package/dist/tools/code-functions-reconstruct.js +2807 -0
- package/dist/tools/code-functions-search.d.ts +39 -0
- package/dist/tools/code-functions-search.js +90 -0
- package/dist/tools/code-reconstruct-export.d.ts +1212 -0
- package/dist/tools/code-reconstruct-export.js +4002 -0
- package/dist/tools/code-reconstruct-plan.d.ts +274 -0
- package/dist/tools/code-reconstruct-plan.js +342 -0
- package/dist/tools/dotnet-metadata-extract.d.ts +541 -0
- package/dist/tools/dotnet-metadata-extract.js +355 -0
- package/dist/tools/dotnet-reconstruct-export.d.ts +567 -0
- package/dist/tools/dotnet-reconstruct-export.js +1151 -0
- package/dist/tools/dotnet-types-list.d.ts +325 -0
- package/dist/tools/dotnet-types-list.js +201 -0
- package/dist/tools/dynamic-dependencies.d.ts +115 -0
- package/dist/tools/dynamic-dependencies.js +213 -0
- package/dist/tools/dynamic-memory-import.d.ts +10 -0
- package/dist/tools/dynamic-memory-import.js +567 -0
- package/dist/tools/dynamic-trace-import.d.ts +10 -0
- package/dist/tools/dynamic-trace-import.js +235 -0
- package/dist/tools/entrypoint-fallback-disasm.d.ts +30 -0
- package/dist/tools/entrypoint-fallback-disasm.js +89 -0
- package/dist/tools/ghidra-analyze.d.ts +88 -0
- package/dist/tools/ghidra-analyze.js +208 -0
- package/dist/tools/ghidra-health.d.ts +37 -0
- package/dist/tools/ghidra-health.js +212 -0
- package/dist/tools/ioc-export.d.ts +209 -0
- package/dist/tools/ioc-export.js +542 -0
- package/dist/tools/packer-detect.d.ts +165 -0
- package/dist/tools/packer-detect.js +284 -0
- package/dist/tools/pe-exports-extract.d.ts +175 -0
- package/dist/tools/pe-exports-extract.js +253 -0
- package/dist/tools/pe-fingerprint.d.ts +234 -0
- package/dist/tools/pe-fingerprint.js +269 -0
- package/dist/tools/pe-imports-extract.d.ts +105 -0
- package/dist/tools/pe-imports-extract.js +245 -0
- package/dist/tools/report-generate.d.ts +157 -0
- package/dist/tools/report-generate.js +457 -0
- package/dist/tools/report-summarize.d.ts +2131 -0
- package/dist/tools/report-summarize.js +596 -0
- package/dist/tools/runtime-detect.d.ts +135 -0
- package/dist/tools/runtime-detect.js +247 -0
- package/dist/tools/sample-ingest.d.ts +94 -0
- package/dist/tools/sample-ingest.js +327 -0
- package/dist/tools/sample-profile-get.d.ts +183 -0
- package/dist/tools/sample-profile-get.js +121 -0
- package/dist/tools/sandbox-execute.d.ts +441 -0
- package/dist/tools/sandbox-execute.js +392 -0
- package/dist/tools/strings-extract.d.ts +375 -0
- package/dist/tools/strings-extract.js +314 -0
- package/dist/tools/strings-floss-decode.d.ts +143 -0
- package/dist/tools/strings-floss-decode.js +259 -0
- package/dist/tools/system-health.d.ts +434 -0
- package/dist/tools/system-health.js +446 -0
- package/dist/tools/task-cancel.d.ts +21 -0
- package/dist/tools/task-cancel.js +70 -0
- package/dist/tools/task-status.d.ts +27 -0
- package/dist/tools/task-status.js +106 -0
- package/dist/tools/task-sweep.d.ts +22 -0
- package/dist/tools/task-sweep.js +77 -0
- package/dist/tools/tool-help.d.ts +340 -0
- package/dist/tools/tool-help.js +261 -0
- package/dist/tools/yara-scan.d.ts +554 -0
- package/dist/tools/yara-scan.js +313 -0
- package/dist/types.d.ts +266 -0
- package/dist/types.js +41 -0
- package/dist/worker-pool.d.ts +204 -0
- package/dist/worker-pool.js +650 -0
- package/dist/workflows/deep-static.d.ts +104 -0
- package/dist/workflows/deep-static.js +276 -0
- package/dist/workflows/function-explanation-review.d.ts +655 -0
- package/dist/workflows/function-explanation-review.js +440 -0
- package/dist/workflows/reconstruct.d.ts +2053 -0
- package/dist/workflows/reconstruct.js +666 -0
- package/dist/workflows/semantic-name-review.d.ts +2418 -0
- package/dist/workflows/semantic-name-review.js +521 -0
- package/dist/workflows/triage.d.ts +659 -0
- package/dist/workflows/triage.js +1374 -0
- package/dist/workspace-manager.d.ts +150 -0
- package/dist/workspace-manager.js +411 -0
- package/ghidra_scripts/DecompileFunction.java +487 -0
- package/ghidra_scripts/DecompileFunction.py +150 -0
- package/ghidra_scripts/ExtractCFG.java +256 -0
- package/ghidra_scripts/ExtractCFG.py +233 -0
- package/ghidra_scripts/ExtractFunctions.java +442 -0
- package/ghidra_scripts/ExtractFunctions.py +101 -0
- package/ghidra_scripts/README.md +125 -0
- package/ghidra_scripts/SearchFunctionReferences.java +380 -0
- package/helpers/DotNetMetadataProbe/DotNetMetadataProbe.csproj +9 -0
- package/helpers/DotNetMetadataProbe/Program.cs +566 -0
- package/install-to-codex.ps1 +178 -0
- package/install-to-copilot.ps1 +303 -0
- package/package.json +101 -0
- package/requirements.txt +9 -0
- package/workers/requirements-dynamic.txt +11 -0
- package/workers/requirements.txt +8 -0
- package/workers/speakeasy_compat.py +175 -0
- package/workers/static_worker.py +5183 -0
- package/workers/yara_rules/default.yar +33 -0
- package/workers/yara_rules/malware_families.yar +93 -0
- package/workers/yara_rules/packers.yar +80 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ghidra.health MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Performs both environment validation and an optional downstream live probe
|
|
5
|
+
* against a real analyzed sample/project to verify end-to-end usability.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { checkGhidraHealth, } from '../ghidra-config.js';
|
|
9
|
+
import { findBestGhidraAnalysis, getGhidraReadiness, parseGhidraAnalysisMetadata, } from '../ghidra-analysis-status.js';
|
|
10
|
+
import { DecompilerWorker } from '../decompiler-worker.js';
|
|
11
|
+
export const ghidraHealthInputSchema = z.object({
|
|
12
|
+
timeout_ms: z
|
|
13
|
+
.number()
|
|
14
|
+
.int()
|
|
15
|
+
.min(1000)
|
|
16
|
+
.max(60000)
|
|
17
|
+
.optional()
|
|
18
|
+
.default(8000)
|
|
19
|
+
.describe('Timeout for launch probe and downstream live probes in milliseconds'),
|
|
20
|
+
sample_id: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Optional sample ID to use for the end-to-end downstream probe'),
|
|
24
|
+
include_end_to_end: z
|
|
25
|
+
.boolean()
|
|
26
|
+
.optional()
|
|
27
|
+
.default(true)
|
|
28
|
+
.describe('Attempt decompile/CFG live probes against a reusable analyzed sample'),
|
|
29
|
+
stale_running_ms: z
|
|
30
|
+
.number()
|
|
31
|
+
.int()
|
|
32
|
+
.min(1000)
|
|
33
|
+
.nullable()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe('Optional stale-analysis reap threshold in milliseconds. Omit or null to disable auto-reaping.'),
|
|
36
|
+
});
|
|
37
|
+
export const ghidraHealthToolDefinition = {
|
|
38
|
+
name: 'ghidra.health',
|
|
39
|
+
description: 'Run a Ghidra environment health check plus optional end-to-end downstream probes using a real analyzed sample/project.',
|
|
40
|
+
inputSchema: ghidraHealthInputSchema,
|
|
41
|
+
};
|
|
42
|
+
function jsonResult(payload, isError) {
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: JSON.stringify(payload, null, 2),
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
isError,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function normalizeProbeError(error) {
|
|
54
|
+
return error instanceof Error ? error.message : String(error);
|
|
55
|
+
}
|
|
56
|
+
function selectProbeAnalysis(database, sampleId) {
|
|
57
|
+
if (!database) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
if (sampleId) {
|
|
61
|
+
const selected = findBestGhidraAnalysis(database.findAnalysesBySample(sampleId), 'function_index');
|
|
62
|
+
return selected ? { sampleId, analysis: selected } : null;
|
|
63
|
+
}
|
|
64
|
+
for (const sample of database.findRecentSamples(50)) {
|
|
65
|
+
const selected = findBestGhidraAnalysis(database.findAnalysesBySample(sample.id), 'function_index');
|
|
66
|
+
if (selected) {
|
|
67
|
+
return { sampleId: sample.id, analysis: selected };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function selectProbeTarget(database, sampleId, analysis) {
|
|
73
|
+
const readiness = getGhidraReadiness(analysis);
|
|
74
|
+
const metadata = parseGhidraAnalysisMetadata(analysis.output_json);
|
|
75
|
+
return (readiness.decompile.target ||
|
|
76
|
+
readiness.cfg.target ||
|
|
77
|
+
metadata.end_to_end_probe?.target ||
|
|
78
|
+
database.findFunctions(sampleId).find((func) => typeof func.address === 'string' && func.address.length > 0)
|
|
79
|
+
?.address);
|
|
80
|
+
}
|
|
81
|
+
export function createGhidraHealthHandler(workspaceManager, database, dependencies) {
|
|
82
|
+
const runHealthCheck = dependencies?.checkGhidra || checkGhidraHealth;
|
|
83
|
+
const decompilerWorker = dependencies?.decompilerWorker ||
|
|
84
|
+
(workspaceManager && database ? new DecompilerWorker(database, workspaceManager) : undefined);
|
|
85
|
+
return async (args) => {
|
|
86
|
+
try {
|
|
87
|
+
const input = ghidraHealthInputSchema.parse(args);
|
|
88
|
+
const result = runHealthCheck(input.timeout_ms);
|
|
89
|
+
const warnings = [...result.warnings];
|
|
90
|
+
const errors = [...result.errors];
|
|
91
|
+
let reapedAnalyses = [];
|
|
92
|
+
if (database && typeof input.stale_running_ms === 'number') {
|
|
93
|
+
reapedAnalyses = database
|
|
94
|
+
.reapStaleAnalyses(input.stale_running_ms, input.sample_id)
|
|
95
|
+
.map((analysis) => analysis.id);
|
|
96
|
+
if (reapedAnalyses.length > 0) {
|
|
97
|
+
warnings.push(`Reaped ${reapedAnalyses.length} stale persisted running analysis record(s) before probing downstream capabilities.`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const probeSelection = selectProbeAnalysis(database, input.sample_id);
|
|
101
|
+
let downstream;
|
|
102
|
+
let downstreamOk = true;
|
|
103
|
+
if (input.include_end_to_end) {
|
|
104
|
+
if (!database || !workspaceManager || !decompilerWorker) {
|
|
105
|
+
warnings.push('End-to-end probe skipped because workspace/database dependencies are unavailable in this handler.');
|
|
106
|
+
downstream = {
|
|
107
|
+
attempted: false,
|
|
108
|
+
available: false,
|
|
109
|
+
reason: 'missing_handler_dependencies',
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
else if (input.sample_id && !probeSelection) {
|
|
113
|
+
downstream = {
|
|
114
|
+
attempted: false,
|
|
115
|
+
available: false,
|
|
116
|
+
sample_id: input.sample_id,
|
|
117
|
+
reason: 'no_reusable_ghidra_analysis_for_sample',
|
|
118
|
+
};
|
|
119
|
+
warnings.push(`No reusable Ghidra analysis with function-index readiness was found for sample ${input.sample_id}.`);
|
|
120
|
+
}
|
|
121
|
+
else if (!probeSelection) {
|
|
122
|
+
downstream = {
|
|
123
|
+
attempted: false,
|
|
124
|
+
available: false,
|
|
125
|
+
reason: 'no_recent_analyzed_sample_available',
|
|
126
|
+
};
|
|
127
|
+
warnings.push('No recent analyzed sample was available for an end-to-end downstream probe. Environment-only status may overstate readiness.');
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const readiness = getGhidraReadiness(probeSelection.analysis);
|
|
131
|
+
const metadata = parseGhidraAnalysisMetadata(probeSelection.analysis.output_json);
|
|
132
|
+
const target = selectProbeTarget(database, probeSelection.sampleId, probeSelection.analysis);
|
|
133
|
+
downstream = {
|
|
134
|
+
attempted: true,
|
|
135
|
+
available: true,
|
|
136
|
+
sample_id: probeSelection.sampleId,
|
|
137
|
+
analysis_id: probeSelection.analysis.id,
|
|
138
|
+
analysis_status: probeSelection.analysis.status,
|
|
139
|
+
probe_target: target || null,
|
|
140
|
+
persisted_capabilities: readiness,
|
|
141
|
+
persisted_probe: metadata.end_to_end_probe || null,
|
|
142
|
+
};
|
|
143
|
+
if (!target) {
|
|
144
|
+
downstreamOk = false;
|
|
145
|
+
warnings.push(`No probe target function could be selected for sample ${probeSelection.sampleId}; downstream verification is incomplete.`);
|
|
146
|
+
downstream.live_probe = {
|
|
147
|
+
decompile: { ok: false, error: 'No probe target function available' },
|
|
148
|
+
cfg: { ok: false, error: 'No probe target function available' },
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
const liveProbe = {
|
|
153
|
+
decompile: { ok: false, error: undefined },
|
|
154
|
+
cfg: { ok: false, error: undefined },
|
|
155
|
+
};
|
|
156
|
+
try {
|
|
157
|
+
const decompiled = await decompilerWorker.decompileFunction(probeSelection.sampleId, target, false, input.timeout_ms);
|
|
158
|
+
liveProbe.decompile = {
|
|
159
|
+
ok: true,
|
|
160
|
+
pseudocode_length: decompiled.pseudocode.length,
|
|
161
|
+
callers: decompiled.callers.length,
|
|
162
|
+
callees: decompiled.callees.length,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
downstreamOk = false;
|
|
167
|
+
liveProbe.decompile = {
|
|
168
|
+
ok: false,
|
|
169
|
+
error: normalizeProbeError(error),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const cfg = await decompilerWorker.getFunctionCFG(probeSelection.sampleId, target, input.timeout_ms);
|
|
174
|
+
liveProbe.cfg = {
|
|
175
|
+
ok: true,
|
|
176
|
+
node_count: cfg.nodes.length,
|
|
177
|
+
edge_count: cfg.edges.length,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
downstreamOk = false;
|
|
182
|
+
liveProbe.cfg = {
|
|
183
|
+
ok: false,
|
|
184
|
+
error: normalizeProbeError(error),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
downstream.live_probe = liveProbe;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const ok = result.ok && (!input.include_end_to_end || downstreamOk);
|
|
192
|
+
return jsonResult({
|
|
193
|
+
ok,
|
|
194
|
+
data: {
|
|
195
|
+
environment: result,
|
|
196
|
+
downstream,
|
|
197
|
+
reaped_persisted_analysis_ids: reapedAnalyses,
|
|
198
|
+
reaped_persisted_analysis_count: reapedAnalyses.length,
|
|
199
|
+
},
|
|
200
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
201
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
202
|
+
}, !ok);
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
return jsonResult({
|
|
206
|
+
ok: false,
|
|
207
|
+
errors: [normalizeProbeError(error)],
|
|
208
|
+
}, true);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=ghidra-health.js.map
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ioc.export tool
|
|
3
|
+
* Export layered IOC data and optional ATT&CK mapping in JSON / CSV / STIX 2.1.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { ToolDefinition, ToolArgs, WorkerResult } from '../types.js';
|
|
7
|
+
import type { WorkspaceManager } from '../workspace-manager.js';
|
|
8
|
+
import type { DatabaseManager } from '../database.js';
|
|
9
|
+
import type { CacheManager } from '../cache-manager.js';
|
|
10
|
+
export declare const IOCExportInputSchema: z.ZodObject<{
|
|
11
|
+
sample_id: z.ZodString;
|
|
12
|
+
format: z.ZodDefault<z.ZodOptional<z.ZodEnum<["json", "csv", "stix2"]>>>;
|
|
13
|
+
include_attack_map: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
14
|
+
include_low_confidence: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
15
|
+
max_iocs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
16
|
+
persist_artifact: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
17
|
+
force_refresh: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
sample_id: string;
|
|
20
|
+
force_refresh: boolean;
|
|
21
|
+
persist_artifact: boolean;
|
|
22
|
+
format: "json" | "csv" | "stix2";
|
|
23
|
+
include_low_confidence: boolean;
|
|
24
|
+
include_attack_map: boolean;
|
|
25
|
+
max_iocs: number;
|
|
26
|
+
}, {
|
|
27
|
+
sample_id: string;
|
|
28
|
+
force_refresh?: boolean | undefined;
|
|
29
|
+
persist_artifact?: boolean | undefined;
|
|
30
|
+
format?: "json" | "csv" | "stix2" | undefined;
|
|
31
|
+
include_low_confidence?: boolean | undefined;
|
|
32
|
+
include_attack_map?: boolean | undefined;
|
|
33
|
+
max_iocs?: number | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export type IOCExportInput = z.infer<typeof IOCExportInputSchema>;
|
|
36
|
+
export declare const IOCExportOutputSchema: z.ZodObject<{
|
|
37
|
+
ok: z.ZodBoolean;
|
|
38
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
sample_id: z.ZodString;
|
|
40
|
+
format: z.ZodEnum<["json", "csv", "stix2"]>;
|
|
41
|
+
tool_version: z.ZodString;
|
|
42
|
+
ioc_count: z.ZodNumber;
|
|
43
|
+
iocs: z.ZodArray<z.ZodObject<{
|
|
44
|
+
type: z.ZodString;
|
|
45
|
+
value: z.ZodString;
|
|
46
|
+
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
47
|
+
source: z.ZodString;
|
|
48
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
value: string;
|
|
51
|
+
type: string;
|
|
52
|
+
tags: string[];
|
|
53
|
+
source: string;
|
|
54
|
+
confidence: "high" | "low" | "medium";
|
|
55
|
+
}, {
|
|
56
|
+
value: string;
|
|
57
|
+
type: string;
|
|
58
|
+
tags: string[];
|
|
59
|
+
source: string;
|
|
60
|
+
confidence: "high" | "low" | "medium";
|
|
61
|
+
}>, "many">;
|
|
62
|
+
content: z.ZodString;
|
|
63
|
+
mime_type: z.ZodString;
|
|
64
|
+
attack_technique_count: z.ZodNumber;
|
|
65
|
+
artifact: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
path: z.ZodString;
|
|
68
|
+
type: z.ZodString;
|
|
69
|
+
sha256: z.ZodString;
|
|
70
|
+
mime: z.ZodString;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
path: string;
|
|
73
|
+
type: string;
|
|
74
|
+
id: string;
|
|
75
|
+
sha256: string;
|
|
76
|
+
mime: string;
|
|
77
|
+
}, {
|
|
78
|
+
path: string;
|
|
79
|
+
type: string;
|
|
80
|
+
id: string;
|
|
81
|
+
sha256: string;
|
|
82
|
+
mime: string;
|
|
83
|
+
}>>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
sample_id: string;
|
|
86
|
+
tool_version: string;
|
|
87
|
+
iocs: {
|
|
88
|
+
value: string;
|
|
89
|
+
type: string;
|
|
90
|
+
tags: string[];
|
|
91
|
+
source: string;
|
|
92
|
+
confidence: "high" | "low" | "medium";
|
|
93
|
+
}[];
|
|
94
|
+
content: string;
|
|
95
|
+
format: "json" | "csv" | "stix2";
|
|
96
|
+
ioc_count: number;
|
|
97
|
+
mime_type: string;
|
|
98
|
+
attack_technique_count: number;
|
|
99
|
+
artifact?: {
|
|
100
|
+
path: string;
|
|
101
|
+
type: string;
|
|
102
|
+
id: string;
|
|
103
|
+
sha256: string;
|
|
104
|
+
mime: string;
|
|
105
|
+
} | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
sample_id: string;
|
|
108
|
+
tool_version: string;
|
|
109
|
+
iocs: {
|
|
110
|
+
value: string;
|
|
111
|
+
type: string;
|
|
112
|
+
tags: string[];
|
|
113
|
+
source: string;
|
|
114
|
+
confidence: "high" | "low" | "medium";
|
|
115
|
+
}[];
|
|
116
|
+
content: string;
|
|
117
|
+
format: "json" | "csv" | "stix2";
|
|
118
|
+
ioc_count: number;
|
|
119
|
+
mime_type: string;
|
|
120
|
+
attack_technique_count: number;
|
|
121
|
+
artifact?: {
|
|
122
|
+
path: string;
|
|
123
|
+
type: string;
|
|
124
|
+
id: string;
|
|
125
|
+
sha256: string;
|
|
126
|
+
mime: string;
|
|
127
|
+
} | undefined;
|
|
128
|
+
}>>;
|
|
129
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
130
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
131
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
132
|
+
metrics: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
elapsed_ms: z.ZodNumber;
|
|
134
|
+
tool: z.ZodString;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
elapsed_ms: number;
|
|
137
|
+
tool: string;
|
|
138
|
+
}, {
|
|
139
|
+
elapsed_ms: number;
|
|
140
|
+
tool: string;
|
|
141
|
+
}>>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
ok: boolean;
|
|
144
|
+
metrics?: {
|
|
145
|
+
elapsed_ms: number;
|
|
146
|
+
tool: string;
|
|
147
|
+
} | undefined;
|
|
148
|
+
data?: {
|
|
149
|
+
sample_id: string;
|
|
150
|
+
tool_version: string;
|
|
151
|
+
iocs: {
|
|
152
|
+
value: string;
|
|
153
|
+
type: string;
|
|
154
|
+
tags: string[];
|
|
155
|
+
source: string;
|
|
156
|
+
confidence: "high" | "low" | "medium";
|
|
157
|
+
}[];
|
|
158
|
+
content: string;
|
|
159
|
+
format: "json" | "csv" | "stix2";
|
|
160
|
+
ioc_count: number;
|
|
161
|
+
mime_type: string;
|
|
162
|
+
attack_technique_count: number;
|
|
163
|
+
artifact?: {
|
|
164
|
+
path: string;
|
|
165
|
+
type: string;
|
|
166
|
+
id: string;
|
|
167
|
+
sha256: string;
|
|
168
|
+
mime: string;
|
|
169
|
+
} | undefined;
|
|
170
|
+
} | undefined;
|
|
171
|
+
warnings?: string[] | undefined;
|
|
172
|
+
errors?: string[] | undefined;
|
|
173
|
+
artifacts?: any[] | undefined;
|
|
174
|
+
}, {
|
|
175
|
+
ok: boolean;
|
|
176
|
+
metrics?: {
|
|
177
|
+
elapsed_ms: number;
|
|
178
|
+
tool: string;
|
|
179
|
+
} | undefined;
|
|
180
|
+
data?: {
|
|
181
|
+
sample_id: string;
|
|
182
|
+
tool_version: string;
|
|
183
|
+
iocs: {
|
|
184
|
+
value: string;
|
|
185
|
+
type: string;
|
|
186
|
+
tags: string[];
|
|
187
|
+
source: string;
|
|
188
|
+
confidence: "high" | "low" | "medium";
|
|
189
|
+
}[];
|
|
190
|
+
content: string;
|
|
191
|
+
format: "json" | "csv" | "stix2";
|
|
192
|
+
ioc_count: number;
|
|
193
|
+
mime_type: string;
|
|
194
|
+
attack_technique_count: number;
|
|
195
|
+
artifact?: {
|
|
196
|
+
path: string;
|
|
197
|
+
type: string;
|
|
198
|
+
id: string;
|
|
199
|
+
sha256: string;
|
|
200
|
+
mime: string;
|
|
201
|
+
} | undefined;
|
|
202
|
+
} | undefined;
|
|
203
|
+
warnings?: string[] | undefined;
|
|
204
|
+
errors?: string[] | undefined;
|
|
205
|
+
artifacts?: any[] | undefined;
|
|
206
|
+
}>;
|
|
207
|
+
export declare const iocExportToolDefinition: ToolDefinition;
|
|
208
|
+
export declare function createIOCExportHandler(workspaceManager: WorkspaceManager, database: DatabaseManager, cacheManager: CacheManager): (args: ToolArgs) => Promise<WorkerResult>;
|
|
209
|
+
//# sourceMappingURL=ioc-export.d.ts.map
|