pompelmi 0.35.4 → 1.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.
Files changed (133) hide show
  1. package/.claude/settings.local.json +40 -0
  2. package/LICENSE +12 -18
  3. package/README.md +160 -143
  4. package/eslint.config.mjs +8 -0
  5. package/package.json +26 -251
  6. package/src/ClamAVDatabaseUpdater.js +48 -0
  7. package/src/ClamAVInstaller.js +49 -0
  8. package/src/ClamAVScanner.js +31 -0
  9. package/src/InstallerCommand.js +11 -0
  10. package/src/config.js +22 -0
  11. package/src/constants.js +3 -0
  12. package/src/favicon.ico +0 -0
  13. package/src/grapefruit.png +0 -0
  14. package/src/index.js +5 -0
  15. package/CHANGELOG.md +0 -71
  16. package/dist/pompelmi.audit.cjs +0 -128
  17. package/dist/pompelmi.audit.cjs.map +0 -1
  18. package/dist/pompelmi.audit.esm.js +0 -107
  19. package/dist/pompelmi.audit.esm.js.map +0 -1
  20. package/dist/pompelmi.browser.cjs +0 -1493
  21. package/dist/pompelmi.browser.cjs.map +0 -1
  22. package/dist/pompelmi.browser.esm.js +0 -1467
  23. package/dist/pompelmi.browser.esm.js.map +0 -1
  24. package/dist/pompelmi.cjs +0 -2535
  25. package/dist/pompelmi.cjs.map +0 -1
  26. package/dist/pompelmi.esm.js +0 -2469
  27. package/dist/pompelmi.esm.js.map +0 -1
  28. package/dist/pompelmi.hooks.cjs +0 -75
  29. package/dist/pompelmi.hooks.cjs.map +0 -1
  30. package/dist/pompelmi.hooks.esm.js +0 -72
  31. package/dist/pompelmi.hooks.esm.js.map +0 -1
  32. package/dist/pompelmi.policy-packs.cjs +0 -240
  33. package/dist/pompelmi.policy-packs.cjs.map +0 -1
  34. package/dist/pompelmi.policy-packs.esm.js +0 -232
  35. package/dist/pompelmi.policy-packs.esm.js.map +0 -1
  36. package/dist/pompelmi.quarantine.cjs +0 -317
  37. package/dist/pompelmi.quarantine.cjs.map +0 -1
  38. package/dist/pompelmi.quarantine.esm.js +0 -293
  39. package/dist/pompelmi.quarantine.esm.js.map +0 -1
  40. package/dist/pompelmi.react.cjs +0 -1524
  41. package/dist/pompelmi.react.cjs.map +0 -1
  42. package/dist/pompelmi.react.esm.js +0 -1497
  43. package/dist/pompelmi.react.esm.js.map +0 -1
  44. package/dist/types/audit.d.ts +0 -84
  45. package/dist/types/browser-index.d.ts +0 -29
  46. package/dist/types/config.d.ts +0 -143
  47. package/dist/types/engines/dynamic-taint.d.ts +0 -102
  48. package/dist/types/engines/hybrid-orchestrator.d.ts +0 -65
  49. package/dist/types/engines/hybrid-taint-integration.d.ts +0 -129
  50. package/dist/types/engines/taint-policies.d.ts +0 -84
  51. package/dist/types/hipaa-compliance.d.ts +0 -110
  52. package/dist/types/hooks.d.ts +0 -89
  53. package/dist/types/index.d.ts +0 -29
  54. package/dist/types/magic.d.ts +0 -7
  55. package/dist/types/node/scanDir.d.ts +0 -30
  56. package/dist/types/policy-packs.d.ts +0 -98
  57. package/dist/types/policy.d.ts +0 -12
  58. package/dist/types/presets.d.ts +0 -72
  59. package/dist/types/quarantine/index.d.ts +0 -18
  60. package/dist/types/quarantine/storage.d.ts +0 -77
  61. package/dist/types/quarantine/types.d.ts +0 -78
  62. package/dist/types/quarantine/workflow.d.ts +0 -97
  63. package/dist/types/react-index.d.ts +0 -13
  64. package/dist/types/risk.d.ts +0 -18
  65. package/dist/types/scan/remote.d.ts +0 -12
  66. package/dist/types/scan.d.ts +0 -17
  67. package/dist/types/scanners/common-heuristics.d.ts +0 -14
  68. package/dist/types/scanners/zip-bomb-guard.d.ts +0 -9
  69. package/dist/types/scanners/zipTraversalGuard.d.ts +0 -19
  70. package/dist/types/src/audit.d.ts +0 -84
  71. package/dist/types/src/browser-index.d.ts +0 -29
  72. package/dist/types/src/config.d.ts +0 -143
  73. package/dist/types/src/engines/dynamic-taint.d.ts +0 -102
  74. package/dist/types/src/engines/hybrid-orchestrator.d.ts +0 -65
  75. package/dist/types/src/engines/hybrid-taint-integration.d.ts +0 -129
  76. package/dist/types/src/engines/taint-policies.d.ts +0 -84
  77. package/dist/types/src/hipaa-compliance.d.ts +0 -110
  78. package/dist/types/src/hooks.d.ts +0 -89
  79. package/dist/types/src/index.d.ts +0 -29
  80. package/dist/types/src/magic.d.ts +0 -7
  81. package/dist/types/src/node/scanDir.d.ts +0 -30
  82. package/dist/types/src/policy-packs.d.ts +0 -98
  83. package/dist/types/src/policy.d.ts +0 -12
  84. package/dist/types/src/presets.d.ts +0 -72
  85. package/dist/types/src/quarantine/index.d.ts +0 -18
  86. package/dist/types/src/quarantine/storage.d.ts +0 -77
  87. package/dist/types/src/quarantine/types.d.ts +0 -78
  88. package/dist/types/src/quarantine/workflow.d.ts +0 -97
  89. package/dist/types/src/react-index.d.ts +0 -13
  90. package/dist/types/src/risk.d.ts +0 -18
  91. package/dist/types/src/scan/remote.d.ts +0 -12
  92. package/dist/types/src/scan.d.ts +0 -17
  93. package/dist/types/src/scanners/common-heuristics.d.ts +0 -14
  94. package/dist/types/src/scanners/zip-bomb-guard.d.ts +0 -9
  95. package/dist/types/src/scanners/zipTraversalGuard.d.ts +0 -19
  96. package/dist/types/src/stream.d.ts +0 -10
  97. package/dist/types/src/types/decompilation.d.ts +0 -96
  98. package/dist/types/src/types/taint-tracking.d.ts +0 -495
  99. package/dist/types/src/types.d.ts +0 -48
  100. package/dist/types/src/useFileScanner.d.ts +0 -15
  101. package/dist/types/src/utils/advanced-detection.d.ts +0 -21
  102. package/dist/types/src/utils/batch-scanner.d.ts +0 -62
  103. package/dist/types/src/utils/cache-manager.d.ts +0 -95
  104. package/dist/types/src/utils/export.d.ts +0 -51
  105. package/dist/types/src/utils/performance-metrics.d.ts +0 -68
  106. package/dist/types/src/utils/threat-intelligence.d.ts +0 -96
  107. package/dist/types/src/validate.d.ts +0 -7
  108. package/dist/types/src/verdict.d.ts +0 -2
  109. package/dist/types/src/yara/browser.d.ts +0 -7
  110. package/dist/types/src/yara/index.d.ts +0 -17
  111. package/dist/types/src/yara/node.d.ts +0 -2
  112. package/dist/types/src/yara/remote.d.ts +0 -10
  113. package/dist/types/src/yara-bridge.d.ts +0 -3
  114. package/dist/types/src/zip.d.ts +0 -13
  115. package/dist/types/stream.d.ts +0 -10
  116. package/dist/types/types/decompilation.d.ts +0 -96
  117. package/dist/types/types/taint-tracking.d.ts +0 -495
  118. package/dist/types/types.d.ts +0 -48
  119. package/dist/types/useFileScanner.d.ts +0 -15
  120. package/dist/types/utils/advanced-detection.d.ts +0 -21
  121. package/dist/types/utils/batch-scanner.d.ts +0 -62
  122. package/dist/types/utils/cache-manager.d.ts +0 -95
  123. package/dist/types/utils/export.d.ts +0 -51
  124. package/dist/types/utils/performance-metrics.d.ts +0 -68
  125. package/dist/types/utils/threat-intelligence.d.ts +0 -96
  126. package/dist/types/validate.d.ts +0 -7
  127. package/dist/types/verdict.d.ts +0 -2
  128. package/dist/types/yara/browser.d.ts +0 -7
  129. package/dist/types/yara/index.d.ts +0 -17
  130. package/dist/types/yara/node.d.ts +0 -2
  131. package/dist/types/yara/remote.d.ts +0 -10
  132. package/dist/types/yara-bridge.d.ts +0 -3
  133. package/dist/types/zip.d.ts +0 -13
@@ -1,495 +0,0 @@
1
- /**
2
- * Dynamic Taint Tracking Types
3
- *
4
- * Comprehensive type definitions for advanced taint analysis and hybrid orchestration
5
- * supporting multi-engine malware analysis with data flow tracking capabilities.
6
- */
7
- /**
8
- * Taint source types indicating where tainted data originates
9
- */
10
- export type TaintSource = "user_input" | "file_read" | "network_recv" | "registry_read" | "environment" | "crypto_weak" | "external_api" | "memory_leak" | "time_source" | "custom";
11
- /**
12
- * Taint sink types indicating where tainted data should not flow
13
- */
14
- export type TaintSink = "exec_function" | "file_write" | "network_send" | "registry_write" | "sql_query" | "format_string" | "memory_alloc" | "crypto_key" | "auth_check" | "log_output" | "custom";
15
- /**
16
- * Taint propagation operations that affect taint flow
17
- */
18
- export type TaintOperation = "copy" | "arithmetic" | "bitwise" | "comparison" | "concatenation" | "substring" | "conversion" | "encryption" | "hash" | "sanitization" | "validation" | "encoding" | "custom";
19
- /**
20
- * Taint label with metadata for tracking
21
- */
22
- export interface TaintLabel {
23
- /** Unique identifier for this taint */
24
- id: string;
25
- /** Source of the taint */
26
- source: TaintSource;
27
- /** Original location where taint was introduced */
28
- origin: {
29
- address: string;
30
- function?: string;
31
- instruction?: string;
32
- timestamp: number;
33
- };
34
- /** Confidence level of taint tracking (0.0 - 1.0) */
35
- confidence: number;
36
- /** Optional metadata for custom analysis */
37
- metadata?: {
38
- severity?: "low" | "medium" | "high" | "critical";
39
- description?: string;
40
- tags?: string[];
41
- [key: string]: unknown;
42
- };
43
- }
44
- /**
45
- * Memory location with taint information
46
- */
47
- export interface TaintedMemory {
48
- /** Memory address or symbolic location */
49
- address: string;
50
- /** Size of tainted region in bytes */
51
- size: number;
52
- /** Set of taint labels affecting this memory */
53
- taints: TaintLabel[];
54
- /** Last operation that affected this memory */
55
- lastOperation: {
56
- operation: TaintOperation;
57
- timestamp: number;
58
- instruction?: string;
59
- };
60
- }
61
- /**
62
- * Register state with taint information
63
- */
64
- export interface TaintedRegister {
65
- /** Register name (e.g., 'eax', 'rdi', 'r0') */
66
- name: string;
67
- /** Set of taint labels affecting this register */
68
- taints: TaintLabel[];
69
- /** Bit-level taint mask for partial register tainting */
70
- taintMask?: string;
71
- /** Last operation that affected this register */
72
- lastOperation: {
73
- operation: TaintOperation;
74
- timestamp: number;
75
- instruction?: string;
76
- };
77
- }
78
- /**
79
- * Taint propagation rule for specific operations
80
- */
81
- export interface TaintPropagationRule {
82
- /** Unique rule identifier */
83
- id: string;
84
- /** Rule name for debugging */
85
- name: string;
86
- /** Pattern to match instructions/operations */
87
- pattern: {
88
- /** Instruction mnemonic pattern (regex) */
89
- instruction?: string;
90
- /** Function name pattern (regex) */
91
- function?: string;
92
- /** API call pattern (regex) */
93
- api?: string;
94
- };
95
- /** How taint flows through this operation */
96
- propagation: {
97
- /** Source operands (0-based indices) */
98
- sources: number[];
99
- /** Destination operands (0-based indices) */
100
- destinations: number[];
101
- /** Operation type affecting taint */
102
- operation: TaintOperation;
103
- /** Whether operation removes taint */
104
- sanitizes?: boolean;
105
- /** Confidence adjustment factor */
106
- confidenceMultiplier?: number;
107
- };
108
- /** Whether this rule creates a taint sink */
109
- isSink?: boolean;
110
- /** Priority for rule matching (higher = more priority) */
111
- priority: number;
112
- }
113
- /**
114
- * Taint analysis configuration
115
- */
116
- export interface TaintConfig {
117
- /** Maximum number of instructions to analyze */
118
- maxInstructions?: number;
119
- /** Maximum analysis time in milliseconds */
120
- timeout?: number;
121
- /** Minimum confidence threshold for reporting */
122
- confidenceThreshold?: number;
123
- /** Sources to track */
124
- enabledSources: TaintSource[];
125
- /** Sinks to detect */
126
- enabledSinks: TaintSink[];
127
- /** Custom propagation rules */
128
- customRules?: TaintPropagationRule[];
129
- /** Whether to track implicit flows (control flow taint) */
130
- trackImplicitFlows?: boolean;
131
- /** Whether to perform path-sensitive analysis */
132
- pathSensitive?: boolean;
133
- /** Maximum call depth for interprocedural analysis */
134
- maxCallDepth?: number;
135
- /** HIPAA compliance settings */
136
- hipaaCompliance?: {
137
- enabled: boolean;
138
- sanitizeAddresses?: boolean;
139
- auditLevel?: "minimal" | "standard" | "comprehensive";
140
- };
141
- }
142
- /**
143
- * Taint flow path representing data flow from source to sink
144
- */
145
- export interface TaintFlow {
146
- /** Unique flow identifier */
147
- id: string;
148
- /** Source where taint originated */
149
- source: {
150
- label: TaintLabel;
151
- location: string;
152
- instruction?: string;
153
- };
154
- /** Sink where taint reaches */
155
- sink: {
156
- type: TaintSink;
157
- location: string;
158
- instruction?: string;
159
- function?: string;
160
- };
161
- /** Path through the program */
162
- path: Array<{
163
- address: string;
164
- instruction?: string;
165
- operation: TaintOperation;
166
- confidence: number;
167
- timestamp: number;
168
- }>;
169
- /** Overall confidence of this flow */
170
- confidence: number;
171
- /** Severity assessment */
172
- severity: "low" | "medium" | "high" | "critical";
173
- /** Whether this represents a security vulnerability */
174
- isVulnerability: boolean;
175
- /** Additional metadata */
176
- metadata?: {
177
- cwe?: string;
178
- description?: string;
179
- mitigations?: string[];
180
- [key: string]: unknown;
181
- };
182
- }
183
- /**
184
- * Taint analysis result
185
- */
186
- export interface TaintAnalysisResult {
187
- /** Analysis engine identifier */
188
- engine: "dynamic-taint" | "hybrid-taint";
189
- /** Analysis success status */
190
- success: boolean;
191
- /** Total analysis time in milliseconds */
192
- analysisTime: number;
193
- /** Number of instructions analyzed */
194
- instructionsAnalyzed: number;
195
- /** Detected taint flows */
196
- flows: TaintFlow[];
197
- /** Current memory taint state */
198
- memoryState: TaintedMemory[];
199
- /** Current register taint state */
200
- registerState: TaintedRegister[];
201
- /** Analysis statistics */
202
- statistics: {
203
- totalSources: number;
204
- totalSinks: number;
205
- vulnerableFlows: number;
206
- sanitizedFlows: number;
207
- highConfidenceFlows: number;
208
- uniqueTaints: number;
209
- };
210
- /** Any analysis errors or warnings */
211
- errors?: string[];
212
- warnings?: string[];
213
- /** Additional metadata */
214
- meta?: {
215
- configUsed?: TaintConfig;
216
- analysisMode?: string;
217
- [key: string]: unknown;
218
- };
219
- }
220
- /**
221
- * Analysis engine types supported by the orchestrator
222
- */
223
- export type AnalysisEngine = "binaryninja-hlil" | "ghidra-pcode" | "dynamic-taint" | "static-analysis" | "symbolic-execution" | "fuzzing" | "custom";
224
- /**
225
- * Analysis phase in the hybrid orchestration pipeline
226
- */
227
- export type AnalysisPhase = "preprocessing" | "static" | "dynamic" | "taint" | "correlation" | "postprocessing" | "reporting";
228
- /**
229
- * Engine capability descriptor
230
- */
231
- export interface EngineCapability {
232
- /** Engine identifier */
233
- engine: AnalysisEngine;
234
- /** Supported analysis types */
235
- capabilities: Array<"decompilation" | "disassembly" | "taint_tracking" | "control_flow" | "data_flow" | "symbolic_execution" | "vulnerability_detection" | "obfuscation_analysis" | "crypto_analysis" | "api_analysis">;
236
- /** Supported file formats */
237
- supportedFormats: string[];
238
- /** Supported architectures */
239
- supportedArchitectures: string[];
240
- /** Performance characteristics */
241
- performance: {
242
- speed: "fast" | "medium" | "slow";
243
- accuracy: "low" | "medium" | "high";
244
- memoryUsage: "low" | "medium" | "high";
245
- };
246
- /** Resource requirements */
247
- requirements: {
248
- minMemoryMB?: number;
249
- maxTimeoutMS?: number;
250
- externalDependencies?: string[];
251
- };
252
- }
253
- /**
254
- * Analysis task for orchestration
255
- */
256
- export interface AnalysisTask {
257
- /** Unique task identifier */
258
- id: string;
259
- /** Target engine for this task */
260
- engine: AnalysisEngine;
261
- /** Analysis phase this task belongs to */
262
- phase: AnalysisPhase;
263
- /** Task priority (higher = more urgent) */
264
- priority: number;
265
- /** Dependencies on other tasks */
266
- dependencies: string[];
267
- /** Input data for the task */
268
- input: {
269
- /** Binary data to analyze */
270
- data: Uint8Array;
271
- /** Previous analysis results to build upon */
272
- previousResults?: any[];
273
- /** Task-specific configuration */
274
- config?: any;
275
- };
276
- /** Task metadata */
277
- metadata: {
278
- description?: string;
279
- estimatedDuration?: number;
280
- maxRetries?: number;
281
- timeout?: number;
282
- };
283
- }
284
- /**
285
- * Task execution result
286
- */
287
- export interface TaskResult {
288
- /** Task identifier */
289
- taskId: string;
290
- /** Engine that executed the task */
291
- engine: AnalysisEngine;
292
- /** Execution status */
293
- status: "success" | "failed" | "timeout" | "cancelled";
294
- /** Result data */
295
- result?: any;
296
- /** Execution metrics */
297
- metrics: {
298
- startTime: number;
299
- endTime: number;
300
- memoryUsed?: number;
301
- cpuTime?: number;
302
- };
303
- /** Any errors that occurred */
304
- error?: string;
305
- /** Confidence in the result */
306
- confidence: number;
307
- }
308
- /**
309
- * Orchestration strategy for coordinating multiple engines
310
- */
311
- export interface OrchestrationStrategy {
312
- /** Strategy name */
313
- name: string;
314
- /** Strategy description */
315
- description: string;
316
- /** Phase execution order */
317
- phaseOrder: AnalysisPhase[];
318
- /** Engine selection rules for each phase */
319
- engineRules: {
320
- [phase in AnalysisPhase]?: {
321
- /** Preferred engines in order */
322
- preferred: AnalysisEngine[];
323
- /** Engines to avoid */
324
- exclude?: AnalysisEngine[];
325
- /** Conditional engine selection */
326
- conditions?: Array<{
327
- condition: string;
328
- engine: AnalysisEngine;
329
- priority: number;
330
- }>;
331
- };
332
- };
333
- /** Task scheduling configuration */
334
- scheduling: {
335
- /** Maximum concurrent tasks */
336
- maxConcurrency: number;
337
- /** Task timeout in milliseconds */
338
- defaultTimeout: number;
339
- /** Retry policy */
340
- retryPolicy: {
341
- maxRetries: number;
342
- retryDelay: number;
343
- backoffMultiplier: number;
344
- };
345
- };
346
- /** Result correlation rules */
347
- correlation: {
348
- /** Enable cross-engine result correlation */
349
- enabled: boolean;
350
- /** Correlation algorithms to use */
351
- algorithms: Array<"similarity" | "overlap" | "consensus" | "weighted">;
352
- /** Confidence weighting by engine */
353
- engineWeights: {
354
- [engine in AnalysisEngine]?: number;
355
- };
356
- };
357
- }
358
- /**
359
- * Hybrid orchestration configuration
360
- */
361
- export interface HybridConfig {
362
- /** Selected orchestration strategy */
363
- strategy: OrchestrationStrategy;
364
- /** Available engines and their configurations */
365
- engines: {
366
- [engine in AnalysisEngine]?: {
367
- enabled: boolean;
368
- config?: any;
369
- priority?: number;
370
- };
371
- };
372
- /** Global analysis settings */
373
- global: {
374
- /** Maximum total analysis time */
375
- maxAnalysisTime: number;
376
- /** Resource limits */
377
- resourceLimits: {
378
- maxMemoryMB: number;
379
- maxConcurrentEngines: number;
380
- maxTotalTasks: number;
381
- };
382
- /** HIPAA compliance settings */
383
- hipaaCompliance?: {
384
- enabled: boolean;
385
- auditAllTasks: boolean;
386
- sanitizeResults: boolean;
387
- };
388
- };
389
- /** Result aggregation settings */
390
- aggregation: {
391
- /** How to combine results from multiple engines */
392
- method: "union" | "intersection" | "weighted" | "consensus";
393
- /** Minimum confidence threshold for final results */
394
- confidenceThreshold: number;
395
- /** Whether to include intermediate results */
396
- includeIntermediateResults: boolean;
397
- };
398
- }
399
- /**
400
- * Hybrid analysis result aggregating multiple engines
401
- */
402
- export interface HybridAnalysisResult {
403
- /** Analysis session identifier */
404
- sessionId: string;
405
- /** Overall analysis success */
406
- success: boolean;
407
- /** Total analysis time */
408
- totalTime: number;
409
- /** Results from individual engines */
410
- engineResults: {
411
- [engine in AnalysisEngine]?: TaskResult[];
412
- };
413
- /** Aggregated findings */
414
- findings: {
415
- /** Static analysis results */
416
- static?: {
417
- functions: any[];
418
- matches: any[];
419
- metadata: any;
420
- };
421
- /** Dynamic taint analysis results */
422
- taint?: TaintAnalysisResult;
423
- /** Cross-engine correlations */
424
- correlations?: Array<{
425
- engines: AnalysisEngine[];
426
- finding: any;
427
- confidence: number;
428
- consensus: number;
429
- }>;
430
- };
431
- /** Analysis statistics */
432
- statistics: {
433
- enginesUsed: AnalysisEngine[];
434
- tasksExecuted: number;
435
- tasksSuccessful: number;
436
- tasksFailed: number;
437
- averageTaskTime: number;
438
- memoryPeak: number;
439
- };
440
- /** Recommendations based on analysis */
441
- recommendations?: Array<{
442
- type: "security" | "performance" | "analysis";
443
- severity: "info" | "warning" | "critical";
444
- message: string;
445
- evidence?: any;
446
- }>;
447
- /** Analysis metadata */
448
- meta: {
449
- configUsed: HybridConfig;
450
- strategyUsed: string;
451
- timestamp: number;
452
- version: string;
453
- };
454
- }
455
- /**
456
- * Interface for engines that support taint tracking
457
- */
458
- export interface TaintCapableEngine {
459
- /** Configure taint tracking */
460
- configureTaint(config: TaintConfig): Promise<void>;
461
- /** Perform taint analysis */
462
- performTaintAnalysis(data: Uint8Array): Promise<TaintAnalysisResult>;
463
- /** Get current taint state */
464
- getTaintState(): Promise<{
465
- memory: TaintedMemory[];
466
- registers: TaintedRegister[];
467
- }>;
468
- /** Add custom taint source */
469
- addTaintSource(address: string, source: TaintSource, label?: Partial<TaintLabel>): Promise<void>;
470
- /** Check if location is tainted */
471
- isTainted(address: string): Promise<boolean>;
472
- }
473
- /**
474
- * Interface for the hybrid orchestrator
475
- */
476
- export interface HybridOrchestrator {
477
- /** Configure the orchestrator */
478
- configure(config: HybridConfig): Promise<void>;
479
- /** Register an analysis engine */
480
- registerEngine(engine: AnalysisEngine, instance: any, capabilities: EngineCapability): Promise<void>;
481
- /** Execute hybrid analysis */
482
- analyze(data: Uint8Array): Promise<HybridAnalysisResult>;
483
- /** Get available engines and their capabilities */
484
- getAvailableEngines(): Promise<EngineCapability[]>;
485
- /** Cancel ongoing analysis */
486
- cancelAnalysis(sessionId: string): Promise<boolean>;
487
- /** Get analysis progress */
488
- getProgress(sessionId: string): Promise<{
489
- phase: AnalysisPhase;
490
- completedTasks: number;
491
- totalTasks: number;
492
- estimatedTimeRemaining: number;
493
- }>;
494
- }
495
- export type { BinaryNinjaOptions, DecompilationMatch, DecompilationResult, DecompilationScanner, FunctionAnalysis, GhidraOptions, } from "./decompilation";
@@ -1,48 +0,0 @@
1
- /** Shared types for Pompelmi */
2
- export type Verdict = "clean" | "suspicious" | "malicious";
3
- export interface YaraMatch {
4
- rule: string;
5
- namespace?: string;
6
- tags?: string[];
7
- meta?: Record<string, unknown>;
8
- }
9
- export * from "./types/decompilation";
10
- export interface Match {
11
- rule: string;
12
- severity?: "info" | "low" | "medium" | "high" | "critical" | "suspicious" | "malicious";
13
- meta?: Record<string, unknown>;
14
- }
15
- export interface FileInfo {
16
- name?: string;
17
- mimeType?: string;
18
- size?: number;
19
- sha256?: string;
20
- }
21
- export type ScanContext = {
22
- filename?: string;
23
- mimeType?: string;
24
- size?: number;
25
- };
26
- export type ScanFn = (input: Uint8Array, ctx?: ScanContext) => Promise<Match[]> | Match[];
27
- export type Scanner = ScanFn | {
28
- name?: string;
29
- scan: ScanFn;
30
- };
31
- interface BaseReport {
32
- verdict: Verdict;
33
- matches: YaraMatch[];
34
- reasons?: string[];
35
- file?: FileInfo;
36
- durationMs?: number;
37
- error?: string;
38
- ok: boolean;
39
- truncated?: boolean;
40
- timedOut?: boolean;
41
- engine?: string;
42
- }
43
- export interface NormalScanReport extends BaseReport {
44
- }
45
- export interface StreamScanReport extends BaseReport {
46
- }
47
- export type ScanReport = NormalScanReport | StreamScanReport;
48
- export type Uint8ArrayLike = Uint8Array | ArrayBufferView;
@@ -1,15 +0,0 @@
1
- import type { ScanReport } from "./types";
2
- /**
3
- * React Hook: handles <input type="file" onChange> with validation + scanning.
4
- */
5
- export declare function useFileScanner(): {
6
- results: {
7
- file: File;
8
- report: ScanReport;
9
- }[];
10
- errors: {
11
- file: File;
12
- error: string;
13
- }[];
14
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
15
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Advanced threat detection utilities
3
- * @module utils/advanced-detection
4
- */
5
- import type { Match } from "../types";
6
- /**
7
- * Enhanced polyglot file detection
8
- * Detects files that can be interpreted as multiple formats
9
- */
10
- export declare function detectPolyglot(bytes: Uint8Array): Match[];
11
- /**
12
- * Detect obfuscated JavaScript/VBScript
13
- */
14
- export declare function detectObfuscatedScripts(bytes: Uint8Array): Match[];
15
- /**
16
- * Enhanced nested archive detection with depth limits
17
- */
18
- export declare function analyzeNestedArchives(bytes: Uint8Array, maxDepth?: number): {
19
- depth: number;
20
- hasExcessiveNesting: boolean;
21
- };
@@ -1,62 +0,0 @@
1
- /**
2
- * Batch scanning with concurrency control
3
- * @module utils/batch-scanner
4
- */
5
- import { type ScanOptions } from "../scan";
6
- import type { ScanContext, ScanReport } from "../types";
7
- export interface BatchScanOptions extends Omit<ScanOptions, "ctx"> {
8
- /** Maximum concurrent scans (default: 5) */
9
- concurrency?: number;
10
- /** Callback for individual scan completion */
11
- onProgress?: (completed: number, total: number, report: ScanReport) => void;
12
- /** Callback for individual scan error */
13
- onError?: (error: Error, index: number) => void;
14
- /** Continue scanning on error (default: true) */
15
- continueOnError?: boolean;
16
- /** Enable result caching (default: false) */
17
- enableCache?: boolean;
18
- }
19
- export interface BatchScanResult {
20
- /** All scan reports (null for failed scans if continueOnError is true) */
21
- reports: (ScanReport | null)[];
22
- /** Number of successful scans */
23
- successCount: number;
24
- /** Number of failed scans */
25
- errorCount: number;
26
- /** Total duration in milliseconds */
27
- totalDurationMs: number;
28
- /** Errors encountered (if continueOnError is true) */
29
- errors: Array<{
30
- index: number;
31
- error: Error;
32
- }>;
33
- }
34
- export interface ScanTask {
35
- /** File content to scan */
36
- content: Uint8Array;
37
- /** Scan context (filename, mime type, etc.) */
38
- context?: ScanContext;
39
- }
40
- /**
41
- * Batch file scanner with concurrency control and progress tracking
42
- */
43
- export declare class BatchScanner {
44
- private readonly options;
45
- constructor(options?: BatchScanOptions);
46
- /**
47
- * Scan multiple files with controlled concurrency
48
- */
49
- scanBatch(tasks: ScanTask[]): Promise<BatchScanResult>;
50
- /**
51
- * Scan files from File objects (browser environment)
52
- */
53
- scanFiles(files: File[]): Promise<BatchScanResult>;
54
- /**
55
- * Scan files from file paths (Node.js environment)
56
- */
57
- scanFilePaths(filePaths: string[]): Promise<BatchScanResult>;
58
- }
59
- /**
60
- * Quick helper for batch scanning with default options
61
- */
62
- export declare function batchScan(tasks: ScanTask[], options?: BatchScanOptions): Promise<BatchScanResult>;