erosolar-cli 2.1.249 → 2.1.253
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/agents/general.rules.json +10 -133
- package/agents/general.rules.json.bak +278 -0
- package/agents/general.rules.json.bak2 +306 -0
- package/dist/bin/erosolar.js +9 -5
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/capabilities/bidirectionalAuditCapability.d.ts +26 -0
- package/dist/capabilities/bidirectionalAuditCapability.d.ts.map +1 -0
- package/dist/capabilities/bidirectionalAuditCapability.js +44 -0
- package/dist/capabilities/bidirectionalAuditCapability.js.map +1 -0
- package/dist/capabilities/globCapability.d.ts +3 -6
- package/dist/capabilities/globCapability.d.ts.map +1 -1
- package/dist/capabilities/globCapability.js +6 -10
- package/dist/capabilities/globCapability.js.map +1 -1
- package/dist/capabilities/index.d.ts +1 -18
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +1 -18
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/orchestrationCapability.d.ts +2 -0
- package/dist/capabilities/orchestrationCapability.d.ts.map +1 -1
- package/dist/capabilities/orchestrationCapability.js +980 -2
- package/dist/capabilities/orchestrationCapability.js.map +1 -1
- package/dist/capabilities/searchCapability.d.ts +8 -2
- package/dist/capabilities/searchCapability.d.ts.map +1 -1
- package/dist/capabilities/searchCapability.js +11 -6
- package/dist/capabilities/searchCapability.js.map +1 -1
- package/dist/contracts/tools.schema.json +9 -133
- package/dist/core/aiErrorFixer.d.ts +1 -14
- package/dist/core/aiErrorFixer.d.ts.map +1 -1
- package/dist/core/aiErrorFixer.js +51 -239
- package/dist/core/aiErrorFixer.js.map +1 -1
- package/dist/core/alphaZeroEngine.d.ts +16 -256
- package/dist/core/alphaZeroEngine.d.ts.map +1 -1
- package/dist/core/alphaZeroEngine.js +22 -513
- package/dist/core/alphaZeroEngine.js.map +1 -1
- package/dist/core/completeAttackOrchestrator.d.ts +102 -0
- package/dist/core/completeAttackOrchestrator.d.ts.map +1 -0
- package/dist/core/completeAttackOrchestrator.js +293 -0
- package/dist/core/completeAttackOrchestrator.js.map +1 -0
- package/dist/core/defensiveSecurityToolkit.d.ts +373 -0
- package/dist/core/defensiveSecurityToolkit.d.ts.map +1 -0
- package/dist/core/defensiveSecurityToolkit.js +1304 -0
- package/dist/core/defensiveSecurityToolkit.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +30 -57
- package/dist/core/errors/errorTypes.d.ts.map +1 -1
- package/dist/core/errors/errorTypes.js +51 -228
- package/dist/core/errors/errorTypes.js.map +1 -1
- package/dist/core/errors/safetyValidator.d.ts +19 -3
- package/dist/core/errors/safetyValidator.d.ts.map +1 -1
- package/dist/core/errors/safetyValidator.js +33 -71
- package/dist/core/errors/safetyValidator.js.map +1 -1
- package/dist/core/failureRecovery.d.ts +4 -100
- package/dist/core/failureRecovery.d.ts.map +1 -1
- package/dist/core/failureRecovery.js +16 -440
- package/dist/core/failureRecovery.js.map +1 -1
- package/dist/core/intelligentTargetResearcher.d.ts +142 -0
- package/dist/core/intelligentTargetResearcher.d.ts.map +1 -0
- package/dist/core/intelligentTargetResearcher.js +367 -0
- package/dist/core/intelligentTargetResearcher.js.map +1 -0
- package/dist/core/intelligentTestFlows.d.ts +26 -107
- package/dist/core/intelligentTestFlows.d.ts.map +1 -1
- package/dist/core/intelligentTestFlows.js +15 -659
- package/dist/core/intelligentTestFlows.js.map +1 -1
- package/dist/core/learningPersistence.d.ts +45 -132
- package/dist/core/learningPersistence.d.ts.map +1 -1
- package/dist/core/learningPersistence.js +32 -463
- package/dist/core/learningPersistence.js.map +1 -1
- package/dist/core/metricsTracker.d.ts +22 -139
- package/dist/core/metricsTracker.d.ts.map +1 -1
- package/dist/core/metricsTracker.js +51 -241
- package/dist/core/metricsTracker.js.map +1 -1
- package/dist/core/performanceMonitor.d.ts +15 -109
- package/dist/core/performanceMonitor.d.ts.map +1 -1
- package/dist/core/performanceMonitor.js +27 -184
- package/dist/core/performanceMonitor.js.map +1 -1
- package/dist/core/reliabilityPrompt.d.ts.map +1 -1
- package/dist/core/reliabilityPrompt.js +14 -0
- package/dist/core/reliabilityPrompt.js.map +1 -1
- package/dist/core/resultVerification.d.ts +6 -100
- package/dist/core/resultVerification.d.ts.map +1 -1
- package/dist/core/resultVerification.js +31 -400
- package/dist/core/resultVerification.js.map +1 -1
- package/dist/core/selfEvolution.d.ts +32 -126
- package/dist/core/selfEvolution.d.ts.map +1 -1
- package/dist/core/selfEvolution.js +24 -967
- package/dist/core/selfEvolution.js.map +1 -1
- package/dist/core/selfImprovement.d.ts +50 -109
- package/dist/core/selfImprovement.d.ts.map +1 -1
- package/dist/core/selfImprovement.js +14 -689
- package/dist/core/selfImprovement.js.map +1 -1
- package/dist/core/sourceCodeManager.d.ts +89 -0
- package/dist/core/sourceCodeManager.d.ts.map +1 -0
- package/dist/core/sourceCodeManager.js +332 -0
- package/dist/core/sourceCodeManager.js.map +1 -0
- package/dist/core/unifiedOrchestrator.d.ts +88 -0
- package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
- package/dist/core/unifiedOrchestrator.js +284 -0
- package/dist/core/unifiedOrchestrator.js.map +1 -0
- package/dist/core/userDefenseOrchestrator.d.ts +202 -0
- package/dist/core/userDefenseOrchestrator.d.ts.map +1 -0
- package/dist/core/userDefenseOrchestrator.js +1006 -0
- package/dist/core/userDefenseOrchestrator.js.map +1 -0
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +36 -26
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +8 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +17 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +14 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +17 -54
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +9 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +18 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +97 -2
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +1001 -6
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/tools/appleExposureTools.d.ts +108 -0
- package/dist/tools/appleExposureTools.d.ts.map +1 -0
- package/dist/tools/appleExposureTools.js +850 -0
- package/dist/tools/appleExposureTools.js.map +1 -0
- package/dist/tools/bidirectionalAuditTools.d.ts +104 -0
- package/dist/tools/bidirectionalAuditTools.d.ts.map +1 -0
- package/dist/tools/bidirectionalAuditTools.js +1280 -0
- package/dist/tools/bidirectionalAuditTools.js.map +1 -0
- package/dist/tools/defensiveSecurityTools.d.ts +152 -0
- package/dist/tools/defensiveSecurityTools.d.ts.map +1 -0
- package/dist/tools/defensiveSecurityTools.js +576 -0
- package/dist/tools/defensiveSecurityTools.js.map +1 -0
- package/dist/tools/forwardAttackChainTracer.d.ts +73 -0
- package/dist/tools/forwardAttackChainTracer.d.ts.map +1 -0
- package/dist/tools/forwardAttackChainTracer.js +604 -0
- package/dist/tools/forwardAttackChainTracer.js.map +1 -0
- package/dist/tools/localExplore.d.ts +12 -199
- package/dist/tools/localExplore.d.ts.map +1 -1
- package/dist/tools/localExplore.js +18 -1352
- package/dist/tools/localExplore.js.map +1 -1
- package/dist/tools/offensiveTransparencyTools.d.ts +188 -0
- package/dist/tools/offensiveTransparencyTools.d.ts.map +1 -0
- package/dist/tools/offensiveTransparencyTools.js +890 -0
- package/dist/tools/offensiveTransparencyTools.js.map +1 -0
- package/dist/tools/planningTools.d.ts +8 -17
- package/dist/tools/planningTools.d.ts.map +1 -1
- package/dist/tools/planningTools.js +31 -141
- package/dist/tools/planningTools.js.map +1 -1
- package/dist/tools/searchTools.d.ts +9 -0
- package/dist/tools/searchTools.d.ts.map +1 -1
- package/dist/tools/searchTools.js +305 -189
- package/dist/tools/searchTools.js.map +1 -1
- package/dist/tools/skillTools.d.ts +7 -5
- package/dist/tools/skillTools.d.ts.map +1 -1
- package/dist/tools/skillTools.js +13 -155
- package/dist/tools/skillTools.js.map +1 -1
- package/dist/tools/threatIntelligenceTools.d.ts +128 -0
- package/dist/tools/threatIntelligenceTools.d.ts.map +1 -0
- package/dist/tools/threatIntelligenceTools.js +712 -0
- package/dist/tools/threatIntelligenceTools.js.map +1 -0
- package/dist/ui/PromptController.d.ts +4 -0
- package/dist/ui/PromptController.d.ts.map +1 -1
- package/dist/ui/PromptController.js +32 -11
- package/dist/ui/PromptController.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +20 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +235 -28
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/dist/ui/animatedStatus.d.ts +2 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -1
- package/dist/ui/animatedStatus.js +36 -2
- package/dist/ui/animatedStatus.js.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +10 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -1
- package/dist/ui/orchestration/StatusOrchestrator.js +36 -4
- package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -1
- package/package.json +1 -1
- package/dist/capabilities/advancedTestGenerationCapability.d.ts +0 -17
- package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +0 -1
- package/dist/capabilities/advancedTestGenerationCapability.js +0 -28
- package/dist/capabilities/advancedTestGenerationCapability.js.map +0 -1
- package/dist/capabilities/browserAutomationCapability.d.ts +0 -37
- package/dist/capabilities/browserAutomationCapability.d.ts.map +0 -1
- package/dist/capabilities/browserAutomationCapability.js +0 -49
- package/dist/capabilities/browserAutomationCapability.js.map +0 -1
- package/dist/capabilities/buildCapability.d.ts +0 -24
- package/dist/capabilities/buildCapability.d.ts.map +0 -1
- package/dist/capabilities/buildCapability.js +0 -25
- package/dist/capabilities/buildCapability.js.map +0 -1
- package/dist/capabilities/cloudCapability.d.ts +0 -13
- package/dist/capabilities/cloudCapability.d.ts.map +0 -1
- package/dist/capabilities/cloudCapability.js +0 -38
- package/dist/capabilities/cloudCapability.js.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/codeAnalysisCapability.js +0 -24
- package/dist/capabilities/codeAnalysisCapability.js.map +0 -1
- package/dist/capabilities/codeQualityCapability.d.ts +0 -13
- package/dist/capabilities/codeQualityCapability.d.ts.map +0 -1
- package/dist/capabilities/codeQualityCapability.js +0 -25
- package/dist/capabilities/codeQualityCapability.js.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.d.ts +0 -13
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +0 -1
- package/dist/capabilities/dependencySecurityCapability.js +0 -24
- package/dist/capabilities/dependencySecurityCapability.js.map +0 -1
- package/dist/capabilities/devCapability.d.ts +0 -13
- package/dist/capabilities/devCapability.d.ts.map +0 -1
- package/dist/capabilities/devCapability.js +0 -24
- package/dist/capabilities/devCapability.js.map +0 -1
- package/dist/capabilities/emailCapability.d.ts +0 -12
- package/dist/capabilities/emailCapability.d.ts.map +0 -1
- package/dist/capabilities/emailCapability.js +0 -22
- package/dist/capabilities/emailCapability.js.map +0 -1
- package/dist/capabilities/enhancedAnalysisCapability.d.ts +0 -13
- package/dist/capabilities/enhancedAnalysisCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedAnalysisCapability.js +0 -20
- package/dist/capabilities/enhancedAnalysisCapability.js.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +0 -17
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js +0 -28
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +0 -17
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +0 -1
- package/dist/capabilities/enhancedDevWorkflowCapability.js +0 -28
- package/dist/capabilities/enhancedDevWorkflowCapability.js.map +0 -1
- package/dist/capabilities/frontendTestingCapability.d.ts +0 -13
- package/dist/capabilities/frontendTestingCapability.d.ts.map +0 -1
- package/dist/capabilities/frontendTestingCapability.js +0 -28
- package/dist/capabilities/frontendTestingCapability.js.map +0 -1
- package/dist/capabilities/interactionCapability.d.ts +0 -12
- package/dist/capabilities/interactionCapability.d.ts.map +0 -1
- package/dist/capabilities/interactionCapability.js +0 -22
- package/dist/capabilities/interactionCapability.js.map +0 -1
- package/dist/capabilities/learnCapability.d.ts +0 -22
- package/dist/capabilities/learnCapability.d.ts.map +0 -1
- package/dist/capabilities/learnCapability.js +0 -37
- package/dist/capabilities/learnCapability.js.map +0 -1
- package/dist/capabilities/notebookCapability.d.ts +0 -17
- package/dist/capabilities/notebookCapability.d.ts.map +0 -1
- package/dist/capabilities/notebookCapability.js +0 -27
- package/dist/capabilities/notebookCapability.js.map +0 -1
- package/dist/capabilities/planningCapability.d.ts +0 -16
- package/dist/capabilities/planningCapability.d.ts.map +0 -1
- package/dist/capabilities/planningCapability.js +0 -26
- package/dist/capabilities/planningCapability.js.map +0 -1
- package/dist/capabilities/refactoringCapability.d.ts +0 -13
- package/dist/capabilities/refactoringCapability.d.ts.map +0 -1
- package/dist/capabilities/refactoringCapability.js +0 -25
- package/dist/capabilities/refactoringCapability.js.map +0 -1
- package/dist/capabilities/repoChecksCapability.d.ts +0 -10
- package/dist/capabilities/repoChecksCapability.d.ts.map +0 -1
- package/dist/capabilities/repoChecksCapability.js +0 -24
- package/dist/capabilities/repoChecksCapability.js.map +0 -1
- package/dist/capabilities/taskManagementCapability.d.ts +0 -12
- package/dist/capabilities/taskManagementCapability.d.ts.map +0 -1
- package/dist/capabilities/taskManagementCapability.js +0 -22
- package/dist/capabilities/taskManagementCapability.js.map +0 -1
- package/dist/capabilities/testingCapability.d.ts +0 -13
- package/dist/capabilities/testingCapability.d.ts.map +0 -1
- package/dist/capabilities/testingCapability.js +0 -25
- package/dist/capabilities/testingCapability.js.map +0 -1
- package/dist/capabilities/validationCapability.d.ts +0 -13
- package/dist/capabilities/validationCapability.d.ts.map +0 -1
- package/dist/capabilities/validationCapability.js +0 -24
- package/dist/capabilities/validationCapability.js.map +0 -1
- package/dist/capabilities/webCapability.d.ts +0 -12
- package/dist/capabilities/webCapability.d.ts.map +0 -1
- package/dist/capabilities/webCapability.js +0 -22
- package/dist/capabilities/webCapability.js.map +0 -1
- package/dist/core/deepBugAnalyzer.d.ts +0 -128
- package/dist/core/deepBugAnalyzer.d.ts.map +0 -1
- package/dist/core/deepBugAnalyzer.js +0 -406
- package/dist/core/deepBugAnalyzer.js.map +0 -1
- package/dist/core/hypothesisEngine.d.ts +0 -113
- package/dist/core/hypothesisEngine.d.ts.map +0 -1
- package/dist/core/hypothesisEngine.js +0 -264
- package/dist/core/hypothesisEngine.js.map +0 -1
- package/dist/core/productTestHarness.d.ts +0 -113
- package/dist/core/productTestHarness.d.ts.map +0 -1
- package/dist/core/productTestHarness.js +0 -351
- package/dist/core/productTestHarness.js.map +0 -1
- package/dist/core/validationRunner.d.ts +0 -106
- package/dist/core/validationRunner.d.ts.map +0 -1
- package/dist/core/validationRunner.js +0 -892
- package/dist/core/validationRunner.js.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts +0 -14
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/browser/browserAutomationPlugin.js +0 -26
- package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +0 -3
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +0 -14
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts +0 -3
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/cloud/cloudPlugin.js +0 -14
- package/dist/plugins/tools/cloud/cloudPlugin.js.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +0 -3
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +0 -14
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +0 -3
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/dependency/dependencyPlugin.js +0 -12
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +0 -1
- package/dist/plugins/tools/development/devPlugin.d.ts +0 -3
- package/dist/plugins/tools/development/devPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/development/devPlugin.js +0 -14
- package/dist/plugins/tools/development/devPlugin.js.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.d.ts +0 -3
- package/dist/plugins/tools/email/emailPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/email/emailPlugin.js +0 -12
- package/dist/plugins/tools/email/emailPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js +0 -14
- package/dist/plugins/tools/enhancedAnalysis/enhancedAnalysisPlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js +0 -12
- package/dist/plugins/tools/enhancedCodeIntelligence/enhancedCodeIntelligencePlugin.js.map +0 -1
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts +0 -3
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js +0 -12
- package/dist/plugins/tools/enhancedDevWorkflow/enhancedDevWorkflowPlugin.js.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts +0 -3
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +0 -14
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts +0 -3
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/interaction/interactionPlugin.js +0 -12
- package/dist/plugins/tools/interaction/interactionPlugin.js.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.d.ts +0 -3
- package/dist/plugins/tools/learn/learnPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/learn/learnPlugin.js +0 -14
- package/dist/plugins/tools/learn/learnPlugin.js.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts +0 -9
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/notebook/notebookPlugin.js +0 -15
- package/dist/plugins/tools/notebook/notebookPlugin.js.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.d.ts +0 -9
- package/dist/plugins/tools/planning/planningPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/planning/planningPlugin.js +0 -15
- package/dist/plugins/tools/planning/planningPlugin.js.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +0 -3
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +0 -12
- package/dist/plugins/tools/refactoring/refactoringPlugin.js.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +0 -3
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +0 -12
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.d.ts +0 -3
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/testing/testingPlugin.js +0 -12
- package/dist/plugins/tools/testing/testingPlugin.js.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.d.ts +0 -3
- package/dist/plugins/tools/validation/validationPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/validation/validationPlugin.js +0 -14
- package/dist/plugins/tools/validation/validationPlugin.js.map +0 -1
- package/dist/plugins/tools/web/webPlugin.d.ts +0 -3
- package/dist/plugins/tools/web/webPlugin.d.ts.map +0 -1
- package/dist/plugins/tools/web/webPlugin.js +0 -12
- package/dist/plugins/tools/web/webPlugin.js.map +0 -1
- package/dist/tools/advancedTestGenerationTools.d.ts +0 -21
- package/dist/tools/advancedTestGenerationTools.d.ts.map +0 -1
- package/dist/tools/advancedTestGenerationTools.js +0 -304
- package/dist/tools/advancedTestGenerationTools.js.map +0 -1
- package/dist/tools/browserAutomationTools.d.ts +0 -23
- package/dist/tools/browserAutomationTools.d.ts.map +0 -1
- package/dist/tools/browserAutomationTools.js +0 -916
- package/dist/tools/browserAutomationTools.js.map +0 -1
- package/dist/tools/buildTools.d.ts +0 -9
- package/dist/tools/buildTools.d.ts.map +0 -1
- package/dist/tools/buildTools.js +0 -346
- package/dist/tools/buildTools.js.map +0 -1
- package/dist/tools/cloudTools.d.ts +0 -49
- package/dist/tools/cloudTools.d.ts.map +0 -1
- package/dist/tools/cloudTools.js +0 -1258
- package/dist/tools/cloudTools.js.map +0 -1
- package/dist/tools/codeAnalysisTools.d.ts +0 -74
- package/dist/tools/codeAnalysisTools.d.ts.map +0 -1
- package/dist/tools/codeAnalysisTools.js +0 -664
- package/dist/tools/codeAnalysisTools.js.map +0 -1
- package/dist/tools/codeGenerationTools.d.ts +0 -3
- package/dist/tools/codeGenerationTools.d.ts.map +0 -1
- package/dist/tools/codeGenerationTools.js +0 -439
- package/dist/tools/codeGenerationTools.js.map +0 -1
- package/dist/tools/codeQualityTools.d.ts +0 -3
- package/dist/tools/codeQualityTools.d.ts.map +0 -1
- package/dist/tools/codeQualityTools.js +0 -297
- package/dist/tools/codeQualityTools.js.map +0 -1
- package/dist/tools/dependencyTools.d.ts +0 -3
- package/dist/tools/dependencyTools.d.ts.map +0 -1
- package/dist/tools/dependencyTools.js +0 -284
- package/dist/tools/dependencyTools.js.map +0 -1
- package/dist/tools/devTools.d.ts +0 -10
- package/dist/tools/devTools.d.ts.map +0 -1
- package/dist/tools/devTools.js +0 -2126
- package/dist/tools/devTools.js.map +0 -1
- package/dist/tools/emailTools.d.ts +0 -21
- package/dist/tools/emailTools.d.ts.map +0 -1
- package/dist/tools/emailTools.js +0 -449
- package/dist/tools/emailTools.js.map +0 -1
- package/dist/tools/enhancedAnalysisTools.d.ts +0 -9
- package/dist/tools/enhancedAnalysisTools.d.ts.map +0 -1
- package/dist/tools/enhancedAnalysisTools.js +0 -370
- package/dist/tools/enhancedAnalysisTools.js.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts +0 -7
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +0 -1
- package/dist/tools/enhancedCodeIntelligenceTools.js +0 -540
- package/dist/tools/enhancedCodeIntelligenceTools.js.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.d.ts +0 -7
- package/dist/tools/enhancedDevWorkflowTools.d.ts.map +0 -1
- package/dist/tools/enhancedDevWorkflowTools.js +0 -432
- package/dist/tools/enhancedDevWorkflowTools.js.map +0 -1
- package/dist/tools/frontendTestingTools.d.ts +0 -35
- package/dist/tools/frontendTestingTools.d.ts.map +0 -1
- package/dist/tools/frontendTestingTools.js +0 -1258
- package/dist/tools/frontendTestingTools.js.map +0 -1
- package/dist/tools/globTools.d.ts +0 -15
- package/dist/tools/globTools.d.ts.map +0 -1
- package/dist/tools/globTools.js +0 -174
- package/dist/tools/globTools.js.map +0 -1
- package/dist/tools/grepTools.d.ts +0 -19
- package/dist/tools/grepTools.d.ts.map +0 -1
- package/dist/tools/grepTools.js +0 -411
- package/dist/tools/grepTools.js.map +0 -1
- package/dist/tools/interactionTools.d.ts +0 -6
- package/dist/tools/interactionTools.d.ts.map +0 -1
- package/dist/tools/interactionTools.js +0 -209
- package/dist/tools/interactionTools.js.map +0 -1
- package/dist/tools/learnTools.d.ts +0 -164
- package/dist/tools/learnTools.d.ts.map +0 -1
- package/dist/tools/learnTools.js +0 -2098
- package/dist/tools/learnTools.js.map +0 -1
- package/dist/tools/notebookEditTools.d.ts +0 -15
- package/dist/tools/notebookEditTools.d.ts.map +0 -1
- package/dist/tools/notebookEditTools.js +0 -197
- package/dist/tools/notebookEditTools.js.map +0 -1
- package/dist/tools/refactoringTools.d.ts +0 -3
- package/dist/tools/refactoringTools.d.ts.map +0 -1
- package/dist/tools/refactoringTools.js +0 -294
- package/dist/tools/refactoringTools.js.map +0 -1
- package/dist/tools/repoChecksTools.d.ts +0 -3
- package/dist/tools/repoChecksTools.d.ts.map +0 -1
- package/dist/tools/repoChecksTools.js +0 -276
- package/dist/tools/repoChecksTools.js.map +0 -1
- package/dist/tools/taskManagementTools.d.ts +0 -10
- package/dist/tools/taskManagementTools.d.ts.map +0 -1
- package/dist/tools/taskManagementTools.js +0 -133
- package/dist/tools/taskManagementTools.js.map +0 -1
- package/dist/tools/testingTools.d.ts +0 -3
- package/dist/tools/testingTools.d.ts.map +0 -1
- package/dist/tools/testingTools.js +0 -237
- package/dist/tools/testingTools.js.map +0 -1
- package/dist/tools/validationTools.d.ts +0 -7
- package/dist/tools/validationTools.d.ts.map +0 -1
- package/dist/tools/validationTools.js +0 -344
- package/dist/tools/validationTools.js.map +0 -1
- package/dist/tools/webTools.d.ts +0 -3
- package/dist/tools/webTools.d.ts.map +0 -1
- package/dist/tools/webTools.js +0 -502
- package/dist/tools/webTools.js.map +0 -1
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Threat Intelligence & Counterintelligence Tools
|
|
3
|
+
*
|
|
4
|
+
* Capabilities for understanding threats against YOUR systems:
|
|
5
|
+
* - Attack surface analysis (what vectors could be used against you)
|
|
6
|
+
* - Threat actor profiling (who might target you and how)
|
|
7
|
+
* - Indicator of Compromise (IOC) detection
|
|
8
|
+
* - Traffic analysis and anomaly detection
|
|
9
|
+
* - Capability assessment (understanding attacker TTPs)
|
|
10
|
+
*
|
|
11
|
+
* This module provides DEFENSIVE intelligence - understanding how
|
|
12
|
+
* attacks work so you can detect and document them.
|
|
13
|
+
*
|
|
14
|
+
* For authorized security research and defensive purposes only.
|
|
15
|
+
*/
|
|
16
|
+
import { execSync } from 'node:child_process';
|
|
17
|
+
import * as fs from 'node:fs';
|
|
18
|
+
import * as path from 'node:path';
|
|
19
|
+
import * as crypto from 'node:crypto';
|
|
20
|
+
import * as dns from 'node:dns';
|
|
21
|
+
import { promisify } from 'node:util';
|
|
22
|
+
const dnsResolve = promisify(dns.resolve);
|
|
23
|
+
const dnsResolve4 = promisify(dns.resolve4);
|
|
24
|
+
const dnsResolveTxt = promisify(dns.resolveTxt);
|
|
25
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
26
|
+
// THREAT ACTOR PROFILES
|
|
27
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
28
|
+
const KNOWN_THREAT_ACTORS = [
|
|
29
|
+
{
|
|
30
|
+
id: 'ta-apple-internal',
|
|
31
|
+
name: 'Apple Internal Operations',
|
|
32
|
+
type: 'corporate',
|
|
33
|
+
capabilities: [
|
|
34
|
+
'Full device control via firmware',
|
|
35
|
+
'Key injection into iCloud Keychain',
|
|
36
|
+
'Push notification injection',
|
|
37
|
+
'Software update manipulation',
|
|
38
|
+
'Certificate authority control',
|
|
39
|
+
'DNS manipulation for Apple domains',
|
|
40
|
+
'iMessage key substitution',
|
|
41
|
+
'Activation Lock control',
|
|
42
|
+
'Location tracking via Find My',
|
|
43
|
+
'Remote device wipe',
|
|
44
|
+
],
|
|
45
|
+
knownTTPs: [
|
|
46
|
+
'T1195.002 - Supply Chain Compromise: Compromise Software Supply Chain',
|
|
47
|
+
'T1553.004 - Subvert Trust Controls: Install Root Certificate',
|
|
48
|
+
'T1556.004 - Modify Authentication Process: Network Device Authentication',
|
|
49
|
+
'T1557 - Adversary-in-the-Middle',
|
|
50
|
+
'T1602 - Data from Configuration Repository',
|
|
51
|
+
'T1612 - Build Image on Host',
|
|
52
|
+
'T1542 - Pre-OS Boot',
|
|
53
|
+
],
|
|
54
|
+
targetingProfile: ['All Apple device users', 'iCloud users', 'iMessage users'],
|
|
55
|
+
infrastructure: [
|
|
56
|
+
'courier.push.apple.com (APNs)',
|
|
57
|
+
'identity.ess.apple.com (IDS)',
|
|
58
|
+
'gateway.icloud.com (CloudKit)',
|
|
59
|
+
'p43-escrowproxy.icloud.com (Key Escrow)',
|
|
60
|
+
'gsa.apple.com (Authentication)',
|
|
61
|
+
],
|
|
62
|
+
attributionConfidence: 'high',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'ta-law-enforcement',
|
|
66
|
+
name: 'Law Enforcement (with Apple cooperation)',
|
|
67
|
+
type: 'nation-state',
|
|
68
|
+
capabilities: [
|
|
69
|
+
'iCloud data access via legal process',
|
|
70
|
+
'Device unlock assistance (limited)',
|
|
71
|
+
'Account information disclosure',
|
|
72
|
+
'Push notification metadata',
|
|
73
|
+
'Location data (with warrant)',
|
|
74
|
+
],
|
|
75
|
+
knownTTPs: [
|
|
76
|
+
'T1114 - Email Collection',
|
|
77
|
+
'T1530 - Data from Cloud Storage Object',
|
|
78
|
+
'T1213 - Data from Information Repositories',
|
|
79
|
+
],
|
|
80
|
+
targetingProfile: ['Subjects of legal investigation'],
|
|
81
|
+
infrastructure: ['Apple Legal Process Portal'],
|
|
82
|
+
attributionConfidence: 'high',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'ta-third-party-cloud',
|
|
86
|
+
name: 'Third-Party Cloud Providers',
|
|
87
|
+
type: 'corporate',
|
|
88
|
+
capabilities: [
|
|
89
|
+
'Access to stored iCloud data (AWS, Google Cloud)',
|
|
90
|
+
'Siri audio processing (AWS)',
|
|
91
|
+
'CDN traffic inspection (Akamai, Fastly)',
|
|
92
|
+
],
|
|
93
|
+
knownTTPs: [
|
|
94
|
+
'T1530 - Data from Cloud Storage Object',
|
|
95
|
+
'T1040 - Network Sniffing',
|
|
96
|
+
],
|
|
97
|
+
targetingProfile: ['iCloud users', 'Siri users', 'iCloud Private Relay users'],
|
|
98
|
+
infrastructure: [
|
|
99
|
+
'AWS us-east-1 (Siri)',
|
|
100
|
+
'Google Cloud (iCloud storage)',
|
|
101
|
+
'Akamai CDN',
|
|
102
|
+
'Fastly CDN (Private Relay)',
|
|
103
|
+
],
|
|
104
|
+
attributionConfidence: 'medium',
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
108
|
+
// ATTACK VECTOR CATALOG
|
|
109
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
110
|
+
const ATTACK_VECTORS = [
|
|
111
|
+
// Firmware/Hardware Level
|
|
112
|
+
{
|
|
113
|
+
id: 'av-firmware-update',
|
|
114
|
+
name: 'Malicious Firmware Update',
|
|
115
|
+
category: 'supply-chain',
|
|
116
|
+
mitreTactic: 'Persistence',
|
|
117
|
+
mitreId: 'T1542.001',
|
|
118
|
+
description: 'Attacker with Apple-level access could push malicious firmware that persists across OS reinstalls',
|
|
119
|
+
prerequisites: ['Apple signing keys', 'Push update capability'],
|
|
120
|
+
detectability: 'none',
|
|
121
|
+
userDefense: 'none',
|
|
122
|
+
evidence: ['Firmware version changes', 'Unexpected reboots'],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'av-sep-compromise',
|
|
126
|
+
name: 'Secure Enclave Key Extraction',
|
|
127
|
+
category: 'physical',
|
|
128
|
+
mitreTactic: 'Credential Access',
|
|
129
|
+
mitreId: 'T1552',
|
|
130
|
+
description: 'Physical or firmware-level access to Secure Enclave could expose private keys',
|
|
131
|
+
prerequisites: ['Physical access OR firmware compromise', 'SEP vulnerability'],
|
|
132
|
+
detectability: 'none',
|
|
133
|
+
userDefense: 'none',
|
|
134
|
+
evidence: ['Unexpected key usage', 'Authentication anomalies'],
|
|
135
|
+
},
|
|
136
|
+
// Network Level
|
|
137
|
+
{
|
|
138
|
+
id: 'av-dns-hijack',
|
|
139
|
+
name: 'Apple DNS Manipulation',
|
|
140
|
+
category: 'network',
|
|
141
|
+
mitreTactic: 'Command and Control',
|
|
142
|
+
mitreId: 'T1071.004',
|
|
143
|
+
description: 'Apple controls all DNS for Apple domains; could redirect to malicious servers',
|
|
144
|
+
prerequisites: ['Apple DNS infrastructure access'],
|
|
145
|
+
detectability: 'low',
|
|
146
|
+
userDefense: 'partial',
|
|
147
|
+
evidence: ['DNS response changes', 'Unexpected IP addresses'],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'av-cert-mitm',
|
|
151
|
+
name: 'Certificate Authority MITM',
|
|
152
|
+
category: 'network',
|
|
153
|
+
mitreTactic: 'Collection',
|
|
154
|
+
mitreId: 'T1557.002',
|
|
155
|
+
description: 'Apple Root CAs in system trust store enable MITM of any TLS connection',
|
|
156
|
+
prerequisites: ['Apple CA private keys'],
|
|
157
|
+
detectability: 'low',
|
|
158
|
+
userDefense: 'none',
|
|
159
|
+
evidence: ['Certificate changes', 'New intermediate CAs'],
|
|
160
|
+
},
|
|
161
|
+
// Application Level
|
|
162
|
+
{
|
|
163
|
+
id: 'av-imessage-key-inject',
|
|
164
|
+
name: 'iMessage Key Injection',
|
|
165
|
+
category: 'application',
|
|
166
|
+
mitreTactic: 'Credential Access',
|
|
167
|
+
mitreId: 'T1556',
|
|
168
|
+
description: 'Apple IDS servers could inject additional public keys to enable message interception',
|
|
169
|
+
prerequisites: ['IDS server access', 'Key database write access'],
|
|
170
|
+
detectability: 'low',
|
|
171
|
+
userDefense: 'partial',
|
|
172
|
+
evidence: ['Key count changes', 'Unknown device keys', 'Key Transparency alerts'],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: 'av-push-injection',
|
|
176
|
+
name: 'Push Notification Injection',
|
|
177
|
+
category: 'application',
|
|
178
|
+
mitreTactic: 'Initial Access',
|
|
179
|
+
mitreId: 'T1199',
|
|
180
|
+
description: 'APNs infrastructure allows sending arbitrary push notifications to any device',
|
|
181
|
+
prerequisites: ['APNs infrastructure access'],
|
|
182
|
+
detectability: 'medium',
|
|
183
|
+
userDefense: 'none',
|
|
184
|
+
evidence: ['Unexpected notifications', 'Malformed payloads'],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: 'av-icloud-keychain-inject',
|
|
188
|
+
name: 'iCloud Keychain Key Injection',
|
|
189
|
+
category: 'application',
|
|
190
|
+
mitreTactic: 'Persistence',
|
|
191
|
+
mitreId: 'T1556.001',
|
|
192
|
+
description: 'Escrow proxy access could inject recovery keys or add trusted devices',
|
|
193
|
+
prerequisites: ['Escrow HSM access', 'iCloud account access'],
|
|
194
|
+
detectability: 'low',
|
|
195
|
+
userDefense: 'partial',
|
|
196
|
+
evidence: ['New trusted devices', 'Keychain sync anomalies'],
|
|
197
|
+
},
|
|
198
|
+
// Supply Chain
|
|
199
|
+
{
|
|
200
|
+
id: 'av-app-store-trojan',
|
|
201
|
+
name: 'App Store Trojan Update',
|
|
202
|
+
category: 'supply-chain',
|
|
203
|
+
mitreTactic: 'Initial Access',
|
|
204
|
+
mitreId: 'T1195.002',
|
|
205
|
+
description: 'Apple could modify app binaries during App Store distribution',
|
|
206
|
+
prerequisites: ['App Store infrastructure access', 'Code signing capability'],
|
|
207
|
+
detectability: 'none',
|
|
208
|
+
userDefense: 'none',
|
|
209
|
+
evidence: ['Binary hash changes', 'Unexpected app behavior'],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: 'av-xcode-implant',
|
|
213
|
+
name: 'Development Tool Compromise',
|
|
214
|
+
category: 'supply-chain',
|
|
215
|
+
mitreTactic: 'Initial Access',
|
|
216
|
+
mitreId: 'T1195.001',
|
|
217
|
+
description: 'Xcode or development tools could be modified to inject code into compiled apps',
|
|
218
|
+
prerequisites: ['Developer tool distribution access'],
|
|
219
|
+
detectability: 'low',
|
|
220
|
+
userDefense: 'partial',
|
|
221
|
+
evidence: ['Tool hash changes', 'Unexpected code in builds'],
|
|
222
|
+
},
|
|
223
|
+
];
|
|
224
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
225
|
+
// THREAT INTELLIGENCE ENGINE
|
|
226
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
227
|
+
export class ThreatIntelligenceEngine {
|
|
228
|
+
evidenceDir;
|
|
229
|
+
iocs = [];
|
|
230
|
+
anomalies = [];
|
|
231
|
+
constructor(evidenceDir) {
|
|
232
|
+
this.evidenceDir = evidenceDir;
|
|
233
|
+
if (!fs.existsSync(evidenceDir)) {
|
|
234
|
+
fs.mkdirSync(evidenceDir, { recursive: true });
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Analyze current threat landscape for this device
|
|
239
|
+
*/
|
|
240
|
+
async analyzeThreatLandscape() {
|
|
241
|
+
// Determine which threat actors are relevant
|
|
242
|
+
const relevantActors = KNOWN_THREAT_ACTORS.filter(actor => {
|
|
243
|
+
// All Apple users are targeted by Apple internal
|
|
244
|
+
if (actor.id === 'ta-apple-internal')
|
|
245
|
+
return true;
|
|
246
|
+
// Check if using relevant services
|
|
247
|
+
if (actor.id === 'ta-third-party-cloud') {
|
|
248
|
+
// Check if iCloud is enabled
|
|
249
|
+
const icloudEnabled = this.checkICloudEnabled();
|
|
250
|
+
return icloudEnabled;
|
|
251
|
+
}
|
|
252
|
+
return true;
|
|
253
|
+
});
|
|
254
|
+
// Determine applicable attack vectors
|
|
255
|
+
const applicableVectors = ATTACK_VECTORS.filter(vector => {
|
|
256
|
+
// All vectors apply to Apple device users
|
|
257
|
+
return true;
|
|
258
|
+
});
|
|
259
|
+
// Calculate risk score
|
|
260
|
+
let riskScore = 0;
|
|
261
|
+
for (const vector of applicableVectors) {
|
|
262
|
+
if (vector.userDefense === 'none')
|
|
263
|
+
riskScore += 30;
|
|
264
|
+
else if (vector.userDefense === 'partial')
|
|
265
|
+
riskScore += 15;
|
|
266
|
+
if (vector.detectability === 'none')
|
|
267
|
+
riskScore += 20;
|
|
268
|
+
else if (vector.detectability === 'low')
|
|
269
|
+
riskScore += 10;
|
|
270
|
+
}
|
|
271
|
+
riskScore = Math.min(100, riskScore / applicableVectors.length * 10);
|
|
272
|
+
return {
|
|
273
|
+
actors: relevantActors,
|
|
274
|
+
vectors: applicableVectors,
|
|
275
|
+
riskScore,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Scan for Indicators of Compromise
|
|
280
|
+
*/
|
|
281
|
+
async scanForIOCs() {
|
|
282
|
+
const found = [];
|
|
283
|
+
// Check for unexpected Apple infrastructure connections
|
|
284
|
+
const netstat = this.exec('netstat -an 2>/dev/null | grep ESTABLISHED');
|
|
285
|
+
const appleIPs = netstat.match(/\b(17\.\d+\.\d+\.\d+|18\.\d+\.\d+\.\d+)\b/g) || [];
|
|
286
|
+
for (const ip of [...new Set(appleIPs)]) {
|
|
287
|
+
// Check if this is a known Apple IP range
|
|
288
|
+
const isKnownApple = this.isKnownAppleIP(ip);
|
|
289
|
+
if (!isKnownApple) {
|
|
290
|
+
found.push({
|
|
291
|
+
type: 'ip',
|
|
292
|
+
value: ip,
|
|
293
|
+
confidence: 0.6,
|
|
294
|
+
source: 'network_scan',
|
|
295
|
+
firstSeen: new Date().toISOString(),
|
|
296
|
+
lastSeen: new Date().toISOString(),
|
|
297
|
+
context: 'Unknown IP in Apple range - possible infrastructure change or anomaly',
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
// Check for suspicious certificates
|
|
302
|
+
const certs = this.exec('security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain 2>/dev/null | grep -c "BEGIN CERTIFICATE"');
|
|
303
|
+
const certCount = parseInt(certs.trim()) || 0;
|
|
304
|
+
// macOS typically has ~150-180 root certificates
|
|
305
|
+
if (certCount > 200 || certCount < 100) {
|
|
306
|
+
found.push({
|
|
307
|
+
type: 'certificate',
|
|
308
|
+
value: `Unexpected certificate count: ${certCount}`,
|
|
309
|
+
confidence: 0.7,
|
|
310
|
+
source: 'certificate_scan',
|
|
311
|
+
firstSeen: new Date().toISOString(),
|
|
312
|
+
lastSeen: new Date().toISOString(),
|
|
313
|
+
context: 'Unusual number of root certificates - possible CA injection',
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
// Check for suspicious LaunchDaemons/Agents
|
|
317
|
+
const launchItems = this.exec('ls -la /Library/LaunchDaemons /Library/LaunchAgents ~/Library/LaunchAgents 2>/dev/null | grep -v "^total" | grep -v "com.apple"');
|
|
318
|
+
if (launchItems.trim()) {
|
|
319
|
+
const nonAppleItems = launchItems.split('\n').filter(l => l.trim());
|
|
320
|
+
for (const item of nonAppleItems.slice(0, 5)) {
|
|
321
|
+
found.push({
|
|
322
|
+
type: 'filename',
|
|
323
|
+
value: item.trim(),
|
|
324
|
+
confidence: 0.5,
|
|
325
|
+
source: 'persistence_scan',
|
|
326
|
+
firstSeen: new Date().toISOString(),
|
|
327
|
+
lastSeen: new Date().toISOString(),
|
|
328
|
+
context: 'Non-Apple persistence mechanism - review for legitimacy',
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
// Check for unexpected kernel extensions
|
|
333
|
+
const kexts = this.exec('kextstat 2>/dev/null | grep -v com.apple');
|
|
334
|
+
if (kexts.trim()) {
|
|
335
|
+
const nonAppleKexts = kexts.split('\n').filter(l => l.trim());
|
|
336
|
+
for (const kext of nonAppleKexts.slice(0, 3)) {
|
|
337
|
+
found.push({
|
|
338
|
+
type: 'filename',
|
|
339
|
+
value: kext.trim(),
|
|
340
|
+
confidence: 0.6,
|
|
341
|
+
source: 'kernel_scan',
|
|
342
|
+
firstSeen: new Date().toISOString(),
|
|
343
|
+
lastSeen: new Date().toISOString(),
|
|
344
|
+
context: 'Third-party kernel extension - potential attack vector',
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
this.iocs.push(...found);
|
|
349
|
+
return found;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Detect traffic anomalies
|
|
353
|
+
*/
|
|
354
|
+
async detectAnomalies() {
|
|
355
|
+
const found = [];
|
|
356
|
+
// Check for unusual connection volumes
|
|
357
|
+
const connCount = this.exec('netstat -an | grep ESTABLISHED | wc -l');
|
|
358
|
+
const count = parseInt(connCount.trim()) || 0;
|
|
359
|
+
if (count > 100) {
|
|
360
|
+
found.push({
|
|
361
|
+
id: `anomaly_${Date.now()}_conn`,
|
|
362
|
+
timestamp: new Date().toISOString(),
|
|
363
|
+
type: 'volume',
|
|
364
|
+
severity: count > 200 ? 'high' : 'medium',
|
|
365
|
+
description: `High number of established connections: ${count}`,
|
|
366
|
+
evidence: `netstat count: ${count}`,
|
|
367
|
+
recommendation: 'Review active connections for data exfiltration',
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
// Check for connections to unusual ports
|
|
371
|
+
const unusualPorts = this.exec('netstat -an | grep ESTABLISHED | grep -E "\\.(4444|5555|6666|31337|8080|8443|9999)\\s"');
|
|
372
|
+
if (unusualPorts.trim()) {
|
|
373
|
+
found.push({
|
|
374
|
+
id: `anomaly_${Date.now()}_port`,
|
|
375
|
+
timestamp: new Date().toISOString(),
|
|
376
|
+
type: 'destination',
|
|
377
|
+
severity: 'high',
|
|
378
|
+
description: 'Connection to suspicious port detected',
|
|
379
|
+
evidence: unusualPorts.trim().slice(0, 200),
|
|
380
|
+
recommendation: 'Investigate process making connection; may indicate C2',
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
// Check Apple Push Service connection status
|
|
384
|
+
const apsdConn = this.exec('lsof -i :5223 2>/dev/null');
|
|
385
|
+
if (!apsdConn.includes('apsd')) {
|
|
386
|
+
found.push({
|
|
387
|
+
id: `anomaly_${Date.now()}_apsd`,
|
|
388
|
+
timestamp: new Date().toISOString(),
|
|
389
|
+
type: 'protocol',
|
|
390
|
+
severity: 'medium',
|
|
391
|
+
description: 'APNs daemon (apsd) not connected on port 5223',
|
|
392
|
+
evidence: 'Missing apsd connection',
|
|
393
|
+
recommendation: 'May indicate network filtering or service disruption',
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
// Check for DNS anomalies
|
|
397
|
+
try {
|
|
398
|
+
const appleIPs = await dnsResolve4('apple.com');
|
|
399
|
+
const isAppleRange = appleIPs.some(ip => ip.startsWith('17.') || ip.startsWith('18.'));
|
|
400
|
+
if (!isAppleRange) {
|
|
401
|
+
found.push({
|
|
402
|
+
id: `anomaly_${Date.now()}_dns`,
|
|
403
|
+
timestamp: new Date().toISOString(),
|
|
404
|
+
type: 'destination',
|
|
405
|
+
severity: 'critical',
|
|
406
|
+
description: 'apple.com resolving to non-Apple IP range',
|
|
407
|
+
evidence: `Resolved to: ${appleIPs.join(', ')}`,
|
|
408
|
+
recommendation: 'Possible DNS hijacking - verify DNS configuration',
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
catch {
|
|
413
|
+
found.push({
|
|
414
|
+
id: `anomaly_${Date.now()}_dns_fail`,
|
|
415
|
+
timestamp: new Date().toISOString(),
|
|
416
|
+
type: 'protocol',
|
|
417
|
+
severity: 'medium',
|
|
418
|
+
description: 'Unable to resolve apple.com',
|
|
419
|
+
evidence: 'DNS resolution failed',
|
|
420
|
+
recommendation: 'Check network connectivity and DNS settings',
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
this.anomalies.push(...found);
|
|
424
|
+
return found;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Generate capability assessment for specific threat actor
|
|
428
|
+
*/
|
|
429
|
+
assessCapabilities(actorId) {
|
|
430
|
+
const actor = KNOWN_THREAT_ACTORS.find(a => a.id === actorId);
|
|
431
|
+
if (!actor)
|
|
432
|
+
return [];
|
|
433
|
+
const assessments = [];
|
|
434
|
+
for (const capability of actor.capabilities) {
|
|
435
|
+
const assessment = {
|
|
436
|
+
threatActor: actor.name,
|
|
437
|
+
capability,
|
|
438
|
+
technicalRequirements: this.getRequirementsForCapability(capability),
|
|
439
|
+
resourceRequirements: actor.type === 'nation-state' ? 'nation-state' : 'corporate',
|
|
440
|
+
likelihoodOfUse: this.assessLikelihood(capability, actor),
|
|
441
|
+
impactIfUsed: this.assessImpact(capability),
|
|
442
|
+
detectionMethods: this.getDetectionMethods(capability),
|
|
443
|
+
mitigations: this.getMitigations(capability),
|
|
444
|
+
};
|
|
445
|
+
assessments.push(assessment);
|
|
446
|
+
}
|
|
447
|
+
return assessments;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Generate comprehensive threat report
|
|
451
|
+
*/
|
|
452
|
+
async generateThreatReport(scope = 'Full Apple Ecosystem Analysis') {
|
|
453
|
+
const landscape = await this.analyzeThreatLandscape();
|
|
454
|
+
const iocs = await this.scanForIOCs();
|
|
455
|
+
const anomalies = await this.detectAnomalies();
|
|
456
|
+
// Get capabilities for primary threat actor
|
|
457
|
+
const capabilities = this.assessCapabilities('ta-apple-internal');
|
|
458
|
+
const report = {
|
|
459
|
+
id: `threat_${Date.now()}_${Math.random().toString(36).substring(7)}`,
|
|
460
|
+
generatedAt: new Date().toISOString(),
|
|
461
|
+
scope,
|
|
462
|
+
threatActors: landscape.actors,
|
|
463
|
+
attackVectors: landscape.vectors,
|
|
464
|
+
iocs,
|
|
465
|
+
anomalies,
|
|
466
|
+
capabilities,
|
|
467
|
+
riskScore: landscape.riskScore,
|
|
468
|
+
executiveSummary: this.generateExecutiveSummary(landscape, iocs, anomalies),
|
|
469
|
+
technicalDetails: this.generateTechnicalDetails(landscape, capabilities),
|
|
470
|
+
recommendations: this.generateRecommendations(landscape, iocs, anomalies),
|
|
471
|
+
hash: '',
|
|
472
|
+
};
|
|
473
|
+
// Calculate hash
|
|
474
|
+
const reportJson = JSON.stringify(report, null, 2);
|
|
475
|
+
report.hash = crypto.createHash('sha256').update(reportJson).digest('hex');
|
|
476
|
+
// Save report
|
|
477
|
+
this.saveReport(report);
|
|
478
|
+
return report;
|
|
479
|
+
}
|
|
480
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
481
|
+
// HELPER METHODS
|
|
482
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
483
|
+
checkICloudEnabled() {
|
|
484
|
+
const icloudPath = `${process.env['HOME']}/Library/Mobile Documents`;
|
|
485
|
+
return fs.existsSync(icloudPath);
|
|
486
|
+
}
|
|
487
|
+
isKnownAppleIP(ip) {
|
|
488
|
+
// Apple's known ranges: 17.0.0.0/8 and portions of 18.x.x.x
|
|
489
|
+
// This is simplified - in production you'd use a full IP database
|
|
490
|
+
return ip.startsWith('17.') || ip.startsWith('18.');
|
|
491
|
+
}
|
|
492
|
+
getRequirementsForCapability(capability) {
|
|
493
|
+
const requirements = {
|
|
494
|
+
'Full device control via firmware': ['Firmware signing keys', 'Update distribution infrastructure'],
|
|
495
|
+
'Key injection into iCloud Keychain': ['Escrow HSM access', 'iCloud authentication'],
|
|
496
|
+
'Push notification injection': ['APNs infrastructure', 'Device token database'],
|
|
497
|
+
'Software update manipulation': ['Code signing keys', 'Update servers'],
|
|
498
|
+
'Certificate authority control': ['Root CA private keys', 'Certificate infrastructure'],
|
|
499
|
+
'DNS manipulation for Apple domains': ['Authoritative DNS access', 'Zone file control'],
|
|
500
|
+
'iMessage key substitution': ['IDS key database', 'Key distribution servers'],
|
|
501
|
+
'Activation Lock control': ['Activation servers', 'Device database'],
|
|
502
|
+
'Location tracking via Find My': ['Find My infrastructure', 'Device registration'],
|
|
503
|
+
'Remote device wipe': ['MDM infrastructure', 'Device enrollment'],
|
|
504
|
+
};
|
|
505
|
+
return requirements[capability] || ['Unknown requirements'];
|
|
506
|
+
}
|
|
507
|
+
assessLikelihood(capability, actor) {
|
|
508
|
+
// Capabilities that are routine operations
|
|
509
|
+
const routineCapabilities = ['Location tracking via Find My', 'Remote device wipe'];
|
|
510
|
+
if (routineCapabilities.includes(capability))
|
|
511
|
+
return 'high';
|
|
512
|
+
// Capabilities requiring legal process
|
|
513
|
+
const legalCapabilities = ['Full device control via firmware', 'iMessage key substitution'];
|
|
514
|
+
if (legalCapabilities.includes(capability))
|
|
515
|
+
return 'low';
|
|
516
|
+
return 'medium';
|
|
517
|
+
}
|
|
518
|
+
assessImpact(capability) {
|
|
519
|
+
const criticalCapabilities = [
|
|
520
|
+
'Full device control via firmware',
|
|
521
|
+
'Key injection into iCloud Keychain',
|
|
522
|
+
'iMessage key substitution',
|
|
523
|
+
'Certificate authority control',
|
|
524
|
+
];
|
|
525
|
+
if (criticalCapabilities.includes(capability))
|
|
526
|
+
return 'critical';
|
|
527
|
+
const highCapabilities = [
|
|
528
|
+
'Software update manipulation',
|
|
529
|
+
'DNS manipulation for Apple domains',
|
|
530
|
+
'Push notification injection',
|
|
531
|
+
];
|
|
532
|
+
if (highCapabilities.includes(capability))
|
|
533
|
+
return 'high';
|
|
534
|
+
return 'medium';
|
|
535
|
+
}
|
|
536
|
+
getDetectionMethods(capability) {
|
|
537
|
+
const methods = {
|
|
538
|
+
'Full device control via firmware': ['Firmware version monitoring', 'Boot attestation (if available)'],
|
|
539
|
+
'Key injection into iCloud Keychain': ['Key count monitoring', 'Device list auditing', 'Key Transparency checks'],
|
|
540
|
+
'Push notification injection': ['Notification logging', 'Payload inspection'],
|
|
541
|
+
'Software update manipulation': ['Update hash verification', 'Delta analysis'],
|
|
542
|
+
'Certificate authority control': ['Certificate monitoring', 'CT log checking', 'Pin validation'],
|
|
543
|
+
'DNS manipulation for Apple domains': ['DNS response monitoring', 'IP range validation'],
|
|
544
|
+
'iMessage key substitution': ['Key Transparency alerts', 'Manual key verification'],
|
|
545
|
+
'Activation Lock control': ['Activation status monitoring'],
|
|
546
|
+
'Location tracking via Find My': ['Location access logs', 'Find My status'],
|
|
547
|
+
'Remote device wipe': ['MDM profile monitoring', 'Backup status'],
|
|
548
|
+
};
|
|
549
|
+
return methods[capability] || ['Manual inspection required'];
|
|
550
|
+
}
|
|
551
|
+
getMitigations(capability) {
|
|
552
|
+
const mitigations = {
|
|
553
|
+
'Full device control via firmware': ['No user mitigation available', 'Legal/regulatory pressure'],
|
|
554
|
+
'Key injection into iCloud Keychain': ['Disable iCloud Keychain', 'Use third-party password manager', 'Monitor Key Transparency'],
|
|
555
|
+
'Push notification injection': ['Disable notifications for sensitive apps', 'Use alternative messaging'],
|
|
556
|
+
'Software update manipulation': ['Delay updates to verify community reports', 'Hash verification'],
|
|
557
|
+
'Certificate authority control': ['Use certificate pinning where possible', 'Monitor for new CAs'],
|
|
558
|
+
'DNS manipulation for Apple domains': ['Use third-party DNS with DNSSEC', 'VPN with trusted provider'],
|
|
559
|
+
'iMessage key substitution': ['Verify keys out-of-band', 'Use Signal/other E2E apps', 'Enable Contact Key Verification'],
|
|
560
|
+
'Activation Lock control': ['Maintain local backups', 'Document ownership'],
|
|
561
|
+
'Location tracking via Find My': ['Disable Find My', 'Location Services control'],
|
|
562
|
+
'Remote device wipe': ['Local encrypted backups', 'Avoid MDM enrollment'],
|
|
563
|
+
};
|
|
564
|
+
return mitigations[capability] || ['Consult security professional'];
|
|
565
|
+
}
|
|
566
|
+
generateExecutiveSummary(landscape, iocs, anomalies) {
|
|
567
|
+
const lines = [];
|
|
568
|
+
lines.push('EXECUTIVE SUMMARY');
|
|
569
|
+
lines.push('═'.repeat(60));
|
|
570
|
+
lines.push('');
|
|
571
|
+
lines.push(`Risk Score: ${landscape.riskScore}/100`);
|
|
572
|
+
lines.push(`Threat Actors Analyzed: ${landscape.actors.length}`);
|
|
573
|
+
lines.push(`Attack Vectors Identified: ${landscape.vectors.length}`);
|
|
574
|
+
lines.push(`IOCs Detected: ${iocs.length}`);
|
|
575
|
+
lines.push(`Traffic Anomalies: ${anomalies.length}`);
|
|
576
|
+
lines.push('');
|
|
577
|
+
lines.push('KEY FINDINGS:');
|
|
578
|
+
lines.push('');
|
|
579
|
+
// Summarize by user defense capability
|
|
580
|
+
const noDefense = landscape.vectors.filter(v => v.userDefense === 'none').length;
|
|
581
|
+
const partialDefense = landscape.vectors.filter(v => v.userDefense === 'partial').length;
|
|
582
|
+
lines.push(`• ${noDefense} attack vectors have NO user defense available`);
|
|
583
|
+
lines.push(`• ${partialDefense} attack vectors have only PARTIAL defense`);
|
|
584
|
+
lines.push(`• ${landscape.vectors.length - noDefense - partialDefense} attack vectors can be fully defended`);
|
|
585
|
+
lines.push('');
|
|
586
|
+
// Highlight critical IOCs
|
|
587
|
+
const criticalIOCs = iocs.filter(i => i.confidence > 0.7);
|
|
588
|
+
if (criticalIOCs.length > 0) {
|
|
589
|
+
lines.push(`• ${criticalIOCs.length} high-confidence IOCs require investigation`);
|
|
590
|
+
}
|
|
591
|
+
// Highlight critical anomalies
|
|
592
|
+
const criticalAnomalies = anomalies.filter(a => a.severity === 'critical' || a.severity === 'high');
|
|
593
|
+
if (criticalAnomalies.length > 0) {
|
|
594
|
+
lines.push(`• ${criticalAnomalies.length} critical/high severity anomalies detected`);
|
|
595
|
+
}
|
|
596
|
+
lines.push('');
|
|
597
|
+
lines.push('CONCLUSION:');
|
|
598
|
+
lines.push('The analysis demonstrates significant attack surface exposure with');
|
|
599
|
+
lines.push('limited user defense options against platform-level threats.');
|
|
600
|
+
return lines.join('\n');
|
|
601
|
+
}
|
|
602
|
+
generateTechnicalDetails(landscape, capabilities) {
|
|
603
|
+
const lines = [];
|
|
604
|
+
lines.push('TECHNICAL DETAILS');
|
|
605
|
+
lines.push('═'.repeat(60));
|
|
606
|
+
lines.push('');
|
|
607
|
+
// Attack vectors by category
|
|
608
|
+
lines.push('ATTACK VECTORS BY CATEGORY:');
|
|
609
|
+
lines.push('');
|
|
610
|
+
const categories = ['network', 'application', 'supply-chain', 'physical'];
|
|
611
|
+
for (const cat of categories) {
|
|
612
|
+
const vectors = landscape.vectors.filter(v => v.category === cat);
|
|
613
|
+
if (vectors.length > 0) {
|
|
614
|
+
lines.push(`[${cat.toUpperCase()}]`);
|
|
615
|
+
for (const v of vectors) {
|
|
616
|
+
lines.push(` • ${v.name} (${v.mitreId})`);
|
|
617
|
+
lines.push(` User Defense: ${v.userDefense.toUpperCase()}`);
|
|
618
|
+
lines.push(` Detectability: ${v.detectability.toUpperCase()}`);
|
|
619
|
+
}
|
|
620
|
+
lines.push('');
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
// Capability assessment summary
|
|
624
|
+
lines.push('CAPABILITY ASSESSMENT:');
|
|
625
|
+
lines.push('');
|
|
626
|
+
const criticalCaps = capabilities.filter(c => c.impactIfUsed === 'critical');
|
|
627
|
+
for (const cap of criticalCaps) {
|
|
628
|
+
lines.push(` • ${cap.capability}`);
|
|
629
|
+
lines.push(` Impact: CRITICAL`);
|
|
630
|
+
lines.push(` Detection: ${cap.detectionMethods.slice(0, 2).join(', ')}`);
|
|
631
|
+
}
|
|
632
|
+
return lines.join('\n');
|
|
633
|
+
}
|
|
634
|
+
generateRecommendations(landscape, iocs, anomalies) {
|
|
635
|
+
const recommendations = [];
|
|
636
|
+
// Based on attack vectors
|
|
637
|
+
recommendations.push('IMMEDIATE ACTIONS:');
|
|
638
|
+
recommendations.push('1. Enable Contact Key Verification for iMessage if available');
|
|
639
|
+
recommendations.push('2. Review and audit iCloud Keychain device list');
|
|
640
|
+
recommendations.push('3. Monitor for unexpected certificate changes');
|
|
641
|
+
recommendations.push('4. Consider third-party DNS with DNSSEC');
|
|
642
|
+
// Based on IOCs
|
|
643
|
+
if (iocs.length > 0) {
|
|
644
|
+
recommendations.push('');
|
|
645
|
+
recommendations.push('IOC RESPONSE:');
|
|
646
|
+
recommendations.push('5. Investigate each detected IOC for legitimacy');
|
|
647
|
+
recommendations.push('6. Document findings for potential legal action');
|
|
648
|
+
}
|
|
649
|
+
// Based on anomalies
|
|
650
|
+
if (anomalies.some(a => a.severity === 'critical')) {
|
|
651
|
+
recommendations.push('');
|
|
652
|
+
recommendations.push('CRITICAL ANOMALY RESPONSE:');
|
|
653
|
+
recommendations.push('7. Immediately investigate critical anomalies');
|
|
654
|
+
recommendations.push('8. Consider network isolation if compromise suspected');
|
|
655
|
+
}
|
|
656
|
+
// Long-term
|
|
657
|
+
recommendations.push('');
|
|
658
|
+
recommendations.push('LONG-TERM STRATEGY:');
|
|
659
|
+
recommendations.push('9. Implement continuous monitoring for all identified attack vectors');
|
|
660
|
+
recommendations.push('10. Maintain evidence packages for potential legal proceedings');
|
|
661
|
+
recommendations.push('11. Consider alternative platforms for high-security communications');
|
|
662
|
+
recommendations.push('12. Engage legal counsel regarding platform provider obligations');
|
|
663
|
+
return recommendations;
|
|
664
|
+
}
|
|
665
|
+
saveReport(report) {
|
|
666
|
+
const reportPath = path.join(this.evidenceDir, `threat_report_${report.id}.json`);
|
|
667
|
+
fs.writeFileSync(reportPath, JSON.stringify(report, null, 2));
|
|
668
|
+
// Generate human-readable version
|
|
669
|
+
const textPath = path.join(this.evidenceDir, `THREAT_REPORT_${report.id}.txt`);
|
|
670
|
+
const lines = [];
|
|
671
|
+
lines.push('═'.repeat(80));
|
|
672
|
+
lines.push(' THREAT INTELLIGENCE REPORT');
|
|
673
|
+
lines.push('═'.repeat(80));
|
|
674
|
+
lines.push('');
|
|
675
|
+
lines.push(`Report ID: ${report.id}`);
|
|
676
|
+
lines.push(`Generated: ${report.generatedAt}`);
|
|
677
|
+
lines.push(`Scope: ${report.scope}`);
|
|
678
|
+
lines.push(`Risk Score: ${report.riskScore}/100`);
|
|
679
|
+
lines.push(`SHA-256: ${report.hash}`);
|
|
680
|
+
lines.push('');
|
|
681
|
+
lines.push(report.executiveSummary);
|
|
682
|
+
lines.push('');
|
|
683
|
+
lines.push(report.technicalDetails);
|
|
684
|
+
lines.push('');
|
|
685
|
+
lines.push('RECOMMENDATIONS');
|
|
686
|
+
lines.push('═'.repeat(60));
|
|
687
|
+
lines.push('');
|
|
688
|
+
lines.push(report.recommendations.join('\n'));
|
|
689
|
+
lines.push('');
|
|
690
|
+
lines.push('═'.repeat(80));
|
|
691
|
+
lines.push(' END OF REPORT');
|
|
692
|
+
lines.push('═'.repeat(80));
|
|
693
|
+
fs.writeFileSync(textPath, lines.join('\n'));
|
|
694
|
+
}
|
|
695
|
+
exec(cmd) {
|
|
696
|
+
try {
|
|
697
|
+
return execSync(cmd, { encoding: 'utf-8', maxBuffer: 10 * 1024 * 1024 });
|
|
698
|
+
}
|
|
699
|
+
catch {
|
|
700
|
+
return '';
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
705
|
+
// EXPORTS
|
|
706
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
707
|
+
export { KNOWN_THREAT_ACTORS, ATTACK_VECTORS };
|
|
708
|
+
export async function runThreatAnalysis(evidenceDir) {
|
|
709
|
+
const engine = new ThreatIntelligenceEngine(evidenceDir);
|
|
710
|
+
return engine.generateThreatReport();
|
|
711
|
+
}
|
|
712
|
+
//# sourceMappingURL=threatIntelligenceTools.js.map
|