erosolar-cli 1.5.2 → 1.5.4
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/config/security-deployment.json +54 -0
- package/dist/bin/adapters/node/index.js +33 -0
- package/dist/bin/adapters/types.js +1 -0
- package/dist/bin/alpha-zero/agentWrapper.js +165 -0
- package/dist/bin/alpha-zero/codeEvaluator.js +272 -0
- package/dist/bin/alpha-zero/competitiveRunner.js +219 -0
- package/dist/bin/alpha-zero/index.js +98 -0
- package/dist/bin/alpha-zero/introspection.js +298 -0
- package/dist/bin/alpha-zero/metricsTracker.js +207 -0
- package/dist/bin/alpha-zero/security/core.js +269 -0
- package/dist/bin/alpha-zero/security/google.js +308 -0
- package/dist/bin/alpha-zero/security/googleLoader.js +40 -0
- package/dist/bin/alpha-zero/security/index.js +31 -0
- package/dist/bin/alpha-zero/security/simulation.js +274 -0
- package/dist/bin/alpha-zero/selfModification.js +231 -0
- package/dist/bin/alpha-zero/types.js +30 -0
- package/dist/bin/bin/erosolar-optimized.js +205 -0
- package/dist/bin/capabilities/agentSpawningCapability.js +116 -0
- package/dist/bin/capabilities/bashCapability.js +22 -0
- package/dist/bin/capabilities/cloudCapability.js +36 -0
- package/dist/bin/capabilities/codeAnalysisCapability.js +22 -0
- package/dist/bin/capabilities/codeQualityCapability.js +23 -0
- package/dist/bin/capabilities/dependencySecurityCapability.js +22 -0
- package/dist/bin/capabilities/devCapability.js +22 -0
- package/dist/bin/capabilities/editCapability.js +28 -0
- package/dist/bin/capabilities/emailCapability.js +20 -0
- package/dist/bin/capabilities/enhancedGitCapability.js +221 -0
- package/dist/bin/capabilities/filesystemCapability.js +22 -0
- package/dist/bin/capabilities/globCapability.js +28 -0
- package/dist/bin/capabilities/interactionCapability.js +20 -0
- package/dist/bin/capabilities/learnCapability.js +22 -0
- package/dist/bin/capabilities/mcpCapability.js +20 -0
- package/dist/bin/capabilities/notebookCapability.js +28 -0
- package/dist/bin/capabilities/planningCapability.js +27 -0
- package/dist/bin/capabilities/refactoringCapability.js +23 -0
- package/dist/bin/capabilities/repoChecksCapability.js +22 -0
- package/dist/bin/capabilities/searchCapability.js +22 -0
- package/dist/bin/capabilities/skillCapability.js +76 -0
- package/dist/bin/capabilities/taskManagementCapability.js +20 -0
- package/dist/bin/capabilities/testingCapability.js +23 -0
- package/dist/bin/capabilities/toolManifest.js +159 -0
- package/dist/bin/capabilities/toolRegistry.js +114 -0
- package/dist/bin/capabilities/webCapability.js +20 -0
- package/dist/bin/config.js +139 -0
- package/dist/bin/contracts/v1/agent.js +7 -0
- package/dist/bin/contracts/v1/agentProfileManifest.js +8 -0
- package/dist/bin/contracts/v1/agentRules.js +9 -0
- package/dist/bin/contracts/v1/toolAccess.js +8 -0
- package/dist/bin/core/agent.js +362 -0
- package/dist/bin/core/agentProfileManifest.js +187 -0
- package/dist/bin/core/agentProfiles.js +34 -0
- package/dist/bin/core/agentRulebook.js +135 -0
- package/dist/bin/core/agentSchemaLoader.js +233 -0
- package/dist/bin/core/contextManager.js +412 -0
- package/dist/bin/core/contextWindow.js +122 -0
- package/dist/bin/core/customCommands.js +80 -0
- package/dist/bin/core/errors/apiKeyErrors.js +114 -0
- package/dist/bin/core/errors/errorTypes.js +340 -0
- package/dist/bin/core/errors/safetyValidator.js +304 -0
- package/dist/bin/core/errors.js +32 -0
- package/dist/bin/core/modelDiscovery.js +755 -0
- package/dist/bin/core/preferences.js +224 -0
- package/dist/bin/core/schemaValidator.js +92 -0
- package/dist/bin/core/secretStore.js +199 -0
- package/dist/bin/core/sessionStore.js +187 -0
- package/dist/bin/core/toolRuntime.js +290 -0
- package/dist/bin/core/types.js +1 -0
- package/dist/bin/erosolar-optimized.d.ts +12 -0
- package/dist/bin/erosolar-optimized.d.ts.map +1 -0
- package/dist/bin/erosolar-optimized.js +239 -0
- package/dist/bin/erosolar-optimized.js.map +1 -0
- package/dist/bin/erosolar.js +14 -0
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/bin/headless/headlessApp.js +172 -0
- package/dist/bin/mcp/config.js +202 -0
- package/dist/bin/mcp/stdioClient.js +172 -0
- package/dist/bin/mcp/toolBridge.js +104 -0
- package/dist/bin/mcp/types.js +1 -0
- package/dist/bin/plugins/index.js +113 -0
- package/dist/bin/plugins/providers/anthropic/index.js +25 -0
- package/dist/bin/plugins/providers/deepseek/index.js +24 -0
- package/dist/bin/plugins/providers/google/index.js +26 -0
- package/dist/bin/plugins/providers/index.js +19 -0
- package/dist/bin/plugins/providers/ollama/index.js +59 -0
- package/dist/bin/plugins/providers/openai/index.js +26 -0
- package/dist/bin/plugins/providers/xai/index.js +24 -0
- package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +8 -0
- package/dist/bin/plugins/tools/bash/localBashPlugin.js +13 -0
- package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +13 -0
- package/dist/bin/plugins/tools/cloud/cloudPlugin.js +13 -0
- package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +13 -0
- package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +13 -0
- package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +11 -0
- package/dist/bin/plugins/tools/development/devPlugin.js +13 -0
- package/dist/bin/plugins/tools/edit/editPlugin.js +14 -0
- package/dist/bin/plugins/tools/email/emailPlugin.js +11 -0
- package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +8 -0
- package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +13 -0
- package/dist/bin/plugins/tools/glob/globPlugin.js +14 -0
- package/dist/bin/plugins/tools/index.js +2 -0
- package/dist/bin/plugins/tools/interaction/interactionPlugin.js +11 -0
- package/dist/bin/plugins/tools/learn/learnPlugin.js +13 -0
- package/dist/bin/plugins/tools/mcp/mcpPlugin.js +8 -0
- package/dist/bin/plugins/tools/nodeDefaults.js +56 -0
- package/dist/bin/plugins/tools/notebook/notebookPlugin.js +14 -0
- package/dist/bin/plugins/tools/planning/planningPlugin.js +14 -0
- package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +11 -0
- package/dist/bin/plugins/tools/registry.js +57 -0
- package/dist/bin/plugins/tools/search/localSearchPlugin.js +13 -0
- package/dist/bin/plugins/tools/skills/skillPlugin.js +8 -0
- package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +11 -0
- package/dist/bin/plugins/tools/testing/testingPlugin.js +11 -0
- package/dist/bin/plugins/tools/web/webPlugin.js +11 -0
- package/dist/bin/providers/anthropicProvider.js +329 -0
- package/dist/bin/providers/googleProvider.js +203 -0
- package/dist/bin/providers/openaiChatCompletionsProvider.js +208 -0
- package/dist/bin/providers/openaiResponsesProvider.js +249 -0
- package/dist/bin/providers/providerFactory.js +24 -0
- package/dist/bin/runtime/agentController.js +321 -0
- package/dist/bin/runtime/agentHost.js +153 -0
- package/dist/bin/runtime/agentSession.js +195 -0
- package/dist/bin/runtime/node.js +10 -0
- package/dist/bin/runtime/universal.js +28 -0
- package/dist/bin/shell/bracketedPasteManager.js +350 -0
- package/dist/bin/shell/fileChangeTracker.js +65 -0
- package/dist/bin/shell/interactiveShell.js +2908 -0
- package/dist/bin/shell/liveStatus.js +78 -0
- package/dist/bin/shell/shellApp.js +290 -0
- package/dist/bin/shell/systemPrompt.js +60 -0
- package/dist/bin/shell/updateManager.js +108 -0
- package/dist/bin/skills/skillRepository.js +236 -0
- package/dist/bin/skills/types.js +1 -0
- package/dist/bin/subagents/taskRunner.js +269 -0
- package/dist/bin/tools/backgroundBashTools.js +211 -0
- package/dist/bin/tools/bashTools.js +159 -0
- package/dist/bin/tools/cloudTools.js +864 -0
- package/dist/bin/tools/codeAnalysisTools.js +641 -0
- package/dist/bin/tools/codeQualityTools.js +294 -0
- package/dist/bin/tools/dependencyTools.js +282 -0
- package/dist/bin/tools/devTools.js +238 -0
- package/dist/bin/tools/diffUtils.js +137 -0
- package/dist/bin/tools/editTools.js +134 -0
- package/dist/bin/tools/emailTools.js +448 -0
- package/dist/bin/tools/fileTools.js +282 -0
- package/dist/bin/tools/globTools.js +173 -0
- package/dist/bin/tools/grepTools.js +332 -0
- package/dist/bin/tools/interactionTools.js +170 -0
- package/dist/bin/tools/learnTools.js +1818 -0
- package/dist/bin/tools/notebookEditTools.js +196 -0
- package/dist/bin/tools/planningTools.js +46 -0
- package/dist/bin/tools/refactoringTools.js +293 -0
- package/dist/bin/tools/repoChecksTools.js +160 -0
- package/dist/bin/tools/searchTools.js +206 -0
- package/dist/bin/tools/skillTools.js +177 -0
- package/dist/bin/tools/taskManagementTools.js +156 -0
- package/dist/bin/tools/testingTools.js +232 -0
- package/dist/bin/tools/webTools.js +480 -0
- package/dist/bin/ui/ShellUIAdapter.js +459 -0
- package/dist/bin/ui/UnifiedUIController.js +183 -0
- package/dist/bin/ui/animation/AnimationScheduler.js +430 -0
- package/dist/bin/ui/codeHighlighter.js +854 -0
- package/dist/bin/ui/designSystem.js +121 -0
- package/dist/bin/ui/display.js +1222 -0
- package/dist/bin/ui/interrupts/InterruptManager.js +437 -0
- package/dist/bin/ui/layout.js +139 -0
- package/dist/bin/ui/orchestration/StatusOrchestrator.js +403 -0
- package/dist/bin/ui/outputMode.js +38 -0
- package/dist/bin/ui/persistentPrompt.js +183 -0
- package/dist/bin/ui/richText.js +338 -0
- package/dist/bin/ui/shortcutsHelp.js +87 -0
- package/dist/bin/ui/telemetry/UITelemetry.js +443 -0
- package/dist/bin/ui/textHighlighter.js +210 -0
- package/dist/bin/ui/theme.js +116 -0
- package/dist/bin/ui/toolDisplay.js +423 -0
- package/dist/bin/ui/toolDisplayAdapter.js +357 -0
- package/dist/bin/workspace.js +106 -0
- package/dist/bin/workspace.validator.js +213 -0
- package/dist/capabilities/cloudCapability.d.ts +13 -0
- package/dist/capabilities/cloudCapability.d.ts.map +1 -0
- package/dist/capabilities/cloudCapability.js +38 -0
- package/dist/capabilities/cloudCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +1 -0
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +1 -0
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/offensiveSecurityCapability.d.ts +26 -0
- package/dist/capabilities/offensiveSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/offensiveSecurityCapability.js +58 -0
- package/dist/capabilities/offensiveSecurityCapability.js.map +1 -0
- package/dist/capabilities/realSecurityCapability.d.ts +26 -0
- package/dist/capabilities/realSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/realSecurityCapability.js +53 -0
- package/dist/capabilities/realSecurityCapability.js.map +1 -0
- package/dist/capabilities/securityCapability.d.ts +32 -0
- package/dist/capabilities/securityCapability.d.ts.map +1 -0
- package/dist/capabilities/securityCapability.js +57 -0
- package/dist/capabilities/securityCapability.js.map +1 -0
- package/dist/capabilities/ultimateSecurityCapability.d.ts +42 -0
- package/dist/capabilities/ultimateSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/ultimateSecurityCapability.js +96 -0
- package/dist/capabilities/ultimateSecurityCapability.js.map +1 -0
- package/dist/core/LazyLoader.d.ts +129 -0
- package/dist/core/LazyLoader.d.ts.map +1 -0
- package/dist/core/LazyLoader.js +240 -0
- package/dist/core/LazyLoader.js.map +1 -0
- package/dist/core/intelligenceTools.d.ts +19 -0
- package/dist/core/intelligenceTools.d.ts.map +1 -0
- package/dist/core/intelligenceTools.js +453 -0
- package/dist/core/intelligenceTools.js.map +1 -0
- package/dist/core/operationalTools.d.ts +19 -0
- package/dist/core/operationalTools.d.ts.map +1 -0
- package/dist/core/operationalTools.js +467 -0
- package/dist/core/operationalTools.js.map +1 -0
- package/dist/offensive/core/offensive-engine.d.ts +171 -0
- package/dist/offensive/core/offensive-engine.d.ts.map +1 -0
- package/dist/offensive/core/offensive-engine.js +345 -0
- package/dist/offensive/core/offensive-engine.js.map +1 -0
- package/dist/offensive/core/offensive-integration.d.ts +129 -0
- package/dist/offensive/core/offensive-integration.d.ts.map +1 -0
- package/dist/offensive/core/offensive-integration.js +364 -0
- package/dist/offensive/core/offensive-integration.js.map +1 -0
- package/dist/offensive/core/offensive-tools.d.ts +55 -0
- package/dist/offensive/core/offensive-tools.d.ts.map +1 -0
- package/dist/offensive/core/offensive-tools.js +438 -0
- package/dist/offensive/core/offensive-tools.js.map +1 -0
- package/dist/offensive/offensive-cli.d.ts +48 -0
- package/dist/offensive/offensive-cli.d.ts.map +1 -0
- package/dist/offensive/offensive-cli.js +233 -0
- package/dist/offensive/offensive-cli.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 +2 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts +3 -0
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/cloud/cloudPlugin.js +14 -0
- package/dist/plugins/tools/cloud/cloudPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +2 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/security/advanced-persistence-research.d.ts +92 -0
- package/dist/security/advanced-persistence-research.d.ts.map +1 -0
- package/dist/security/advanced-persistence-research.js +195 -0
- package/dist/security/advanced-persistence-research.js.map +1 -0
- package/dist/security/apt-simulation-cli.d.ts +57 -0
- package/dist/security/apt-simulation-cli.d.ts.map +1 -0
- package/dist/security/apt-simulation-cli.js +278 -0
- package/dist/security/apt-simulation-cli.js.map +1 -0
- package/dist/security/apt-simulation-engine-complete.d.ts +97 -0
- package/dist/security/apt-simulation-engine-complete.d.ts.map +1 -0
- package/dist/security/apt-simulation-engine-complete.js +441 -0
- package/dist/security/apt-simulation-engine-complete.js.map +1 -0
- package/dist/security/apt-simulation-engine.d.ts +97 -0
- package/dist/security/apt-simulation-engine.d.ts.map +1 -0
- package/dist/security/apt-simulation-engine.js +441 -0
- package/dist/security/apt-simulation-engine.js.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
- package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
- package/dist/security/authorization/securityAuthorization.d.ts +88 -0
- package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
- package/dist/security/authorization/securityAuthorization.js +172 -0
- package/dist/security/authorization/securityAuthorization.js.map +1 -0
- package/dist/security/authorization.d.ts +45 -0
- package/dist/security/authorization.d.ts.map +1 -0
- package/dist/security/authorization.js +128 -0
- package/dist/security/authorization.js.map +1 -0
- package/dist/security/comprehensive-security-research.d.ts +84 -0
- package/dist/security/comprehensive-security-research.d.ts.map +1 -0
- package/dist/security/comprehensive-security-research.js +211 -0
- package/dist/security/comprehensive-security-research.js.map +1 -0
- package/dist/security/offensive/exploitationEngine.d.ts +54 -0
- package/dist/security/offensive/exploitationEngine.d.ts.map +1 -0
- package/dist/security/offensive/exploitationEngine.js +263 -0
- package/dist/security/offensive/exploitationEngine.js.map +1 -0
- package/dist/security/persistence-analyzer.d.ts +56 -0
- package/dist/security/persistence-analyzer.d.ts.map +1 -0
- package/dist/security/persistence-analyzer.js +187 -0
- package/dist/security/persistence-analyzer.js.map +1 -0
- package/dist/security/persistence-cli.d.ts +36 -0
- package/dist/security/persistence-cli.d.ts.map +1 -0
- package/dist/security/persistence-cli.js +160 -0
- package/dist/security/persistence-cli.js.map +1 -0
- package/dist/security/persistence-research.d.ts +100 -0
- package/dist/security/persistence-research.d.ts.map +1 -0
- package/dist/security/persistence-research.js +372 -0
- package/dist/security/persistence-research.js.map +1 -0
- package/dist/security/real/networkExploitation.d.ts +92 -0
- package/dist/security/real/networkExploitation.d.ts.map +1 -0
- package/dist/security/real/networkExploitation.js +316 -0
- package/dist/security/real/networkExploitation.js.map +1 -0
- package/dist/security/real/persistenceImplementation.d.ts +62 -0
- package/dist/security/real/persistenceImplementation.d.ts.map +1 -0
- package/dist/security/real/persistenceImplementation.js +323 -0
- package/dist/security/real/persistenceImplementation.js.map +1 -0
- package/dist/security/real/vulnerabilityScanner.d.ts +73 -0
- package/dist/security/real/vulnerabilityScanner.d.ts.map +1 -0
- package/dist/security/real/vulnerabilityScanner.js +341 -0
- package/dist/security/real/vulnerabilityScanner.js.map +1 -0
- package/dist/security/research/persistenceResearch.d.ts +97 -0
- package/dist/security/research/persistenceResearch.d.ts.map +1 -0
- package/dist/security/research/persistenceResearch.js +282 -0
- package/dist/security/research/persistenceResearch.js.map +1 -0
- package/dist/security/security-testing-framework.d.ts +120 -0
- package/dist/security/security-testing-framework.d.ts.map +1 -0
- package/dist/security/security-testing-framework.js +372 -0
- package/dist/security/security-testing-framework.js.map +1 -0
- package/dist/security/simulation/attackSimulation.d.ts +93 -0
- package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
- package/dist/security/simulation/attackSimulation.js +341 -0
- package/dist/security/simulation/attackSimulation.js.map +1 -0
- package/dist/shell/bracketedPasteManager.d.ts +76 -0
- package/dist/shell/bracketedPasteManager.d.ts.map +1 -1
- package/dist/shell/bracketedPasteManager.js +267 -9
- package/dist/shell/bracketedPasteManager.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +34 -1
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +304 -24
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/taskCompletionDetector.d.ts +101 -0
- package/dist/shell/taskCompletionDetector.d.ts.map +1 -0
- package/dist/shell/taskCompletionDetector.js +343 -0
- package/dist/shell/taskCompletionDetector.js.map +1 -0
- package/dist/tools/cloudTools.d.ts +57 -0
- package/dist/tools/cloudTools.d.ts.map +1 -0
- package/dist/tools/cloudTools.js +865 -0
- package/dist/tools/cloudTools.js.map +1 -0
- package/dist/tools/enhancedSecurityTools.d.ts +19 -0
- package/dist/tools/enhancedSecurityTools.d.ts.map +1 -0
- package/dist/tools/enhancedSecurityTools.js +215 -0
- package/dist/tools/enhancedSecurityTools.js.map +1 -0
- package/dist/tools/offensiveSecurityTools.d.ts +16 -0
- package/dist/tools/offensiveSecurityTools.d.ts.map +1 -0
- package/dist/tools/offensiveSecurityTools.js +285 -0
- package/dist/tools/offensiveSecurityTools.js.map +1 -0
- package/dist/tools/realSecurityTools.d.ts +18 -0
- package/dist/tools/realSecurityTools.d.ts.map +1 -0
- package/dist/tools/realSecurityTools.js +468 -0
- package/dist/tools/realSecurityTools.js.map +1 -0
- package/dist/tools/securityTools.d.ts +20 -0
- package/dist/tools/securityTools.d.ts.map +1 -0
- package/dist/tools/securityTools.js +449 -0
- package/dist/tools/securityTools.js.map +1 -0
- package/package.json +27 -12
- package/scripts/deploy-security-capabilities.js +178 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* APT Simulation CLI
|
|
4
|
+
*
|
|
5
|
+
* Command-line interface for simulating Advanced Persistent Threat campaigns
|
|
6
|
+
* from initial access through persistence and data exfiltration.
|
|
7
|
+
*/
|
|
8
|
+
import { APTSimulationConfig } from './apt-simulation-engine-complete.js';
|
|
9
|
+
interface CLIArguments {
|
|
10
|
+
platform?: 'windows' | 'linux' | 'mixed';
|
|
11
|
+
scope?: 'full' | 'initial-access' | 'persistence' | 'lateral-movement' | 'exfiltration';
|
|
12
|
+
complexity?: 'basic' | 'intermediate' | 'advanced';
|
|
13
|
+
stealth?: 'low' | 'medium' | 'high';
|
|
14
|
+
duration?: 'short' | 'medium' | 'extended';
|
|
15
|
+
output?: 'text' | 'json' | 'html';
|
|
16
|
+
listPhases?: boolean;
|
|
17
|
+
listTechniques?: boolean;
|
|
18
|
+
help?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare class APTSimulationCLI {
|
|
21
|
+
private engine;
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Parse command line arguments
|
|
25
|
+
*/
|
|
26
|
+
parseArguments(args: string[]): CLIArguments;
|
|
27
|
+
/**
|
|
28
|
+
* Display help information
|
|
29
|
+
*/
|
|
30
|
+
showHelp(): void;
|
|
31
|
+
/**
|
|
32
|
+
* List all APT attack phases
|
|
33
|
+
*/
|
|
34
|
+
listAttackPhases(): void;
|
|
35
|
+
/**
|
|
36
|
+
* List all APT techniques
|
|
37
|
+
*/
|
|
38
|
+
listTechniques(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Execute APT simulation
|
|
41
|
+
*/
|
|
42
|
+
executeSimulation(config: APTSimulationConfig, outputFormat?: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Simulate attack execution (placeholder for actual implementation)
|
|
45
|
+
*/
|
|
46
|
+
private simulateAttackExecution;
|
|
47
|
+
/**
|
|
48
|
+
* Generate simulation report
|
|
49
|
+
*/
|
|
50
|
+
private generateReport;
|
|
51
|
+
/**
|
|
52
|
+
* Execute the CLI with provided arguments
|
|
53
|
+
*/
|
|
54
|
+
execute(args: string[]): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
export { APTSimulationCLI };
|
|
57
|
+
//# sourceMappingURL=apt-simulation-cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apt-simulation-cli.d.ts","sourceRoot":"","sources":["../../src/security/apt-simulation-cli.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAuB,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE/F,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,GAAG,aAAa,GAAG,kBAAkB,GAAG,cAAc,CAAC;IACxF,UAAU,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,UAAU,CAAC;IACnD,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,cAAM,gBAAgB;IACpB,OAAO,CAAC,MAAM,CAAsB;;IAMpC;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,YAAY;IA8C5C;;OAEG;IACH,QAAQ,IAAI,IAAI;IAwChB;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAqBxB;;OAEG;IACH,cAAc,IAAI,IAAI;IA8BtB;;OAEG;IACG,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,EAAE,YAAY,GAAE,MAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAoClG;;OAEG;YACW,uBAAuB;IAkBrC;;OAEG;IACH,OAAO,CAAC,cAAc;IA0CtB;;OAEG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAkC7C;AAWD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* APT Simulation CLI
|
|
4
|
+
*
|
|
5
|
+
* Command-line interface for simulating Advanced Persistent Threat campaigns
|
|
6
|
+
* from initial access through persistence and data exfiltration.
|
|
7
|
+
*/
|
|
8
|
+
import { APTSimulationEngine } from './apt-simulation-engine-complete.js';
|
|
9
|
+
class APTSimulationCLI {
|
|
10
|
+
engine;
|
|
11
|
+
constructor() {
|
|
12
|
+
this.engine = new APTSimulationEngine();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse command line arguments
|
|
16
|
+
*/
|
|
17
|
+
parseArguments(args) {
|
|
18
|
+
const parsed = {};
|
|
19
|
+
for (let i = 0; i < args.length; i++) {
|
|
20
|
+
const arg = args[i];
|
|
21
|
+
switch (arg) {
|
|
22
|
+
case '--platform':
|
|
23
|
+
case '-p':
|
|
24
|
+
parsed.platform = args[++i];
|
|
25
|
+
break;
|
|
26
|
+
case '--scope':
|
|
27
|
+
case '-s':
|
|
28
|
+
parsed.scope = args[++i];
|
|
29
|
+
break;
|
|
30
|
+
case '--complexity':
|
|
31
|
+
case '-c':
|
|
32
|
+
parsed.complexity = args[++i];
|
|
33
|
+
break;
|
|
34
|
+
case '--stealth':
|
|
35
|
+
parsed.stealth = args[++i];
|
|
36
|
+
break;
|
|
37
|
+
case '--duration':
|
|
38
|
+
case '-d':
|
|
39
|
+
parsed.duration = args[++i];
|
|
40
|
+
break;
|
|
41
|
+
case '--output':
|
|
42
|
+
case '-o':
|
|
43
|
+
parsed.output = args[++i];
|
|
44
|
+
break;
|
|
45
|
+
case '--list-phases':
|
|
46
|
+
parsed.listPhases = true;
|
|
47
|
+
break;
|
|
48
|
+
case '--list-techniques':
|
|
49
|
+
parsed.listTechniques = true;
|
|
50
|
+
break;
|
|
51
|
+
case '--help':
|
|
52
|
+
case '-h':
|
|
53
|
+
parsed.help = true;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return parsed;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Display help information
|
|
61
|
+
*/
|
|
62
|
+
showHelp() {
|
|
63
|
+
console.log(`
|
|
64
|
+
APT Simulation CLI
|
|
65
|
+
|
|
66
|
+
Usage:
|
|
67
|
+
node apt-simulation-cli.js [options]
|
|
68
|
+
|
|
69
|
+
Options:
|
|
70
|
+
--platform, -p <platform> Target platform (windows, linux, mixed)
|
|
71
|
+
--scope, -s <scope> Simulation scope (full, initial-access, persistence, lateral-movement, exfiltration)
|
|
72
|
+
--complexity, -c <level> Attack complexity (basic, intermediate, advanced)
|
|
73
|
+
--stealth <level> Stealth level (low, medium, high)
|
|
74
|
+
--duration, -d <duration> Simulation duration (short, medium, extended)
|
|
75
|
+
--output, -o <format> Output format (text, json, html)
|
|
76
|
+
--list-phases List all APT attack phases
|
|
77
|
+
--list-techniques List all APT techniques
|
|
78
|
+
--help, -h Show this help message
|
|
79
|
+
|
|
80
|
+
Examples:
|
|
81
|
+
# Run full APT simulation on Windows
|
|
82
|
+
node apt-simulation-cli.js --platform windows --scope full --complexity advanced
|
|
83
|
+
|
|
84
|
+
# Simulate initial access techniques only
|
|
85
|
+
node apt-simulation-cli.js --platform linux --scope initial-access --complexity basic
|
|
86
|
+
|
|
87
|
+
# Generate JSON output
|
|
88
|
+
node apt-simulation-cli.js --platform windows --scope persistence --output json
|
|
89
|
+
|
|
90
|
+
# List all attack phases
|
|
91
|
+
node apt-simulation-cli.js --list-phases
|
|
92
|
+
|
|
93
|
+
# List all techniques
|
|
94
|
+
node apt-simulation-cli.js --list-techniques
|
|
95
|
+
|
|
96
|
+
MITRE ATT&CK Framework:
|
|
97
|
+
This tool simulates techniques from the MITRE ATT&CK framework for
|
|
98
|
+
legitimate security research, testing, and educational purposes.
|
|
99
|
+
`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* List all APT attack phases
|
|
103
|
+
*/
|
|
104
|
+
listAttackPhases() {
|
|
105
|
+
const phases = this.engine.getAttackPhases();
|
|
106
|
+
console.log('\nAPT Attack Phases (MITRE ATT&CK Framework)');
|
|
107
|
+
console.log('='.repeat(60));
|
|
108
|
+
phases.forEach(phase => {
|
|
109
|
+
console.log(`\n${phase.name} (${phase.mitreId})`);
|
|
110
|
+
console.log(`Description: ${phase.description}`);
|
|
111
|
+
console.log(`Techniques: ${phase.techniques.length}`);
|
|
112
|
+
console.log('Objectives:');
|
|
113
|
+
phase.objectives.forEach(obj => {
|
|
114
|
+
console.log(` • ${obj}`);
|
|
115
|
+
});
|
|
116
|
+
console.log('Success Criteria:');
|
|
117
|
+
phase.successCriteria.forEach(criteria => {
|
|
118
|
+
console.log(` • ${criteria}`);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* List all APT techniques
|
|
124
|
+
*/
|
|
125
|
+
listTechniques() {
|
|
126
|
+
const phases = this.engine.getAttackPhases();
|
|
127
|
+
console.log('\nAPT Techniques (MITRE ATT&CK Framework)');
|
|
128
|
+
console.log('='.repeat(60));
|
|
129
|
+
phases.forEach(phase => {
|
|
130
|
+
console.log(`\n${phase.name} Phase:`);
|
|
131
|
+
console.log('-'.repeat(40));
|
|
132
|
+
phase.techniques.forEach(tech => {
|
|
133
|
+
console.log(`\n${tech.name} (${tech.mitreId})`);
|
|
134
|
+
console.log(`Risk Level: ${tech.riskLevel}`);
|
|
135
|
+
console.log(`Description: ${tech.description}`);
|
|
136
|
+
console.log('Implementation:');
|
|
137
|
+
tech.implementation.forEach(step => {
|
|
138
|
+
console.log(` • ${step}`);
|
|
139
|
+
});
|
|
140
|
+
console.log('Detection Methods:');
|
|
141
|
+
tech.detectionMethods.forEach(method => {
|
|
142
|
+
console.log(` • ${method}`);
|
|
143
|
+
});
|
|
144
|
+
console.log('Countermeasures:');
|
|
145
|
+
tech.countermeasures.forEach(countermeasure => {
|
|
146
|
+
console.log(` • ${countermeasure}`);
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Execute APT simulation
|
|
153
|
+
*/
|
|
154
|
+
async executeSimulation(config, outputFormat = 'text') {
|
|
155
|
+
console.log('\nStarting APT Simulation...');
|
|
156
|
+
console.log('='.repeat(50));
|
|
157
|
+
try {
|
|
158
|
+
// Generate scenario
|
|
159
|
+
const scenario = this.engine.generateScenario(config);
|
|
160
|
+
console.log(`\nSimulation Configuration:`);
|
|
161
|
+
console.log(` Platform: ${config.targetPlatform}`);
|
|
162
|
+
console.log(` Scope: ${config.simulationScope}`);
|
|
163
|
+
console.log(` Complexity: ${config.complexity}`);
|
|
164
|
+
console.log(` Stealth Level: ${config.stealthLevel}`);
|
|
165
|
+
console.log(` Duration: ${config.duration}`);
|
|
166
|
+
console.log(`\nSelected Techniques: ${scenario.length}`);
|
|
167
|
+
scenario.forEach(tech => {
|
|
168
|
+
console.log(` • ${tech.name} (${tech.mitreId}) - ${tech.phase}`);
|
|
169
|
+
});
|
|
170
|
+
// Simulate attack (in a real implementation, this would execute actual techniques)
|
|
171
|
+
console.log('\nSimulating APT Attack Campaign...');
|
|
172
|
+
await this.simulateAttackExecution(scenario);
|
|
173
|
+
// Generate results
|
|
174
|
+
console.log('\nAPT Simulation Complete!');
|
|
175
|
+
console.log('='.repeat(50));
|
|
176
|
+
this.generateReport(scenario, config);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
console.error('APT Simulation failed:', error);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Simulate attack execution (placeholder for actual implementation)
|
|
185
|
+
*/
|
|
186
|
+
async simulateAttackExecution(techniques) {
|
|
187
|
+
for (const tech of techniques) {
|
|
188
|
+
console.log(`\nExecuting: ${tech.name} (${tech.mitreId})`);
|
|
189
|
+
// Simulate execution delay
|
|
190
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
191
|
+
console.log(` Phase: ${tech.phase}`);
|
|
192
|
+
console.log(` Risk Level: ${tech.riskLevel}`);
|
|
193
|
+
console.log(` Status: Simulated execution completed`);
|
|
194
|
+
// Simulate detection events (random)
|
|
195
|
+
if (Math.random() > 0.7) {
|
|
196
|
+
console.log(` Detection: Simulated detection event (confidence: medium)`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Generate simulation report
|
|
202
|
+
*/
|
|
203
|
+
generateReport(techniques, config) {
|
|
204
|
+
console.log('\nAPT Simulation Report');
|
|
205
|
+
console.log('='.repeat(50));
|
|
206
|
+
// Group techniques by phase
|
|
207
|
+
const techniquesByPhase = {};
|
|
208
|
+
techniques.forEach(tech => {
|
|
209
|
+
if (!techniquesByPhase[tech.phase]) {
|
|
210
|
+
techniquesByPhase[tech.phase] = [];
|
|
211
|
+
}
|
|
212
|
+
techniquesByPhase[tech.phase].push(tech);
|
|
213
|
+
});
|
|
214
|
+
// Generate phase-by-phase report
|
|
215
|
+
Object.keys(techniquesByPhase).forEach(phase => {
|
|
216
|
+
console.log(`\n${phase.toUpperCase()} PHASE:`);
|
|
217
|
+
console.log('-'.repeat(30));
|
|
218
|
+
techniquesByPhase[phase].forEach(tech => {
|
|
219
|
+
console.log(` ${tech.name} (${tech.mitreId})`);
|
|
220
|
+
console.log(` Risk: ${tech.riskLevel}`);
|
|
221
|
+
console.log(` Description: ${tech.description}`);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
// Generate recommendations
|
|
225
|
+
console.log('\nSECURITY RECOMMENDATIONS:');
|
|
226
|
+
console.log('-'.repeat(30));
|
|
227
|
+
const uniqueCountermeasures = new Set();
|
|
228
|
+
techniques.forEach(tech => {
|
|
229
|
+
tech.countermeasures.forEach((cm) => uniqueCountermeasures.add(cm));
|
|
230
|
+
});
|
|
231
|
+
Array.from(uniqueCountermeasures).forEach((cm, index) => {
|
|
232
|
+
console.log(` ${index + 1}. ${cm}`);
|
|
233
|
+
});
|
|
234
|
+
console.log('\nSimulation completed successfully.');
|
|
235
|
+
console.log('This was a simulated APT campaign for research and educational purposes.');
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Execute the CLI with provided arguments
|
|
239
|
+
*/
|
|
240
|
+
async execute(args) {
|
|
241
|
+
const parsedArgs = this.parseArguments(args);
|
|
242
|
+
if (parsedArgs.help || args.length === 0) {
|
|
243
|
+
this.showHelp();
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (parsedArgs.listPhases) {
|
|
247
|
+
this.listAttackPhases();
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (parsedArgs.listTechniques) {
|
|
251
|
+
this.listTechniques();
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (!parsedArgs.platform) {
|
|
255
|
+
console.error('Error: Platform argument required for simulation');
|
|
256
|
+
this.showHelp();
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const config = {
|
|
260
|
+
targetPlatform: parsedArgs.platform,
|
|
261
|
+
simulationScope: parsedArgs.scope || 'full',
|
|
262
|
+
complexity: parsedArgs.complexity || 'intermediate',
|
|
263
|
+
stealthLevel: parsedArgs.stealth || 'medium',
|
|
264
|
+
duration: parsedArgs.duration || 'medium'
|
|
265
|
+
};
|
|
266
|
+
await this.executeSimulation(config, parsedArgs.output || 'text');
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
// CLI entry point
|
|
270
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
271
|
+
const cli = new APTSimulationCLI();
|
|
272
|
+
cli.execute(process.argv.slice(2)).catch(error => {
|
|
273
|
+
console.error('Fatal error:', error);
|
|
274
|
+
process.exit(1);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
export { APTSimulationCLI };
|
|
278
|
+
//# sourceMappingURL=apt-simulation-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apt-simulation-cli.js","sourceRoot":"","sources":["../../src/security/apt-simulation-cli.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,mBAAmB,EAAuB,MAAM,qCAAqC,CAAC;AAc/F,MAAM,gBAAgB;IACZ,MAAM,CAAsB;IAEpC;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,IAAc;QAC3B,MAAM,MAAM,GAAiB,EAAE,CAAC;QAEhC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAEpB,QA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CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACnC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAC/C,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* APT Simulation Engine
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive framework for simulating Advanced Persistent Threat campaigns
|
|
5
|
+
* from initial access through persistence and data exfiltration.
|
|
6
|
+
*
|
|
7
|
+
* Based on MITRE ATT&CK framework and real-world APT tactics.
|
|
8
|
+
*/
|
|
9
|
+
export interface APTAttackPhase {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
mitreId: string;
|
|
13
|
+
description: string;
|
|
14
|
+
techniques: APTTechnique[];
|
|
15
|
+
objectives: string[];
|
|
16
|
+
successCriteria: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface APTTechnique {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
mitreId: string;
|
|
22
|
+
phase: string;
|
|
23
|
+
description: string;
|
|
24
|
+
implementation: string[];
|
|
25
|
+
detectionMethods: string[];
|
|
26
|
+
countermeasures: string[];
|
|
27
|
+
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
28
|
+
}
|
|
29
|
+
export interface APTSimulationConfig {
|
|
30
|
+
targetPlatform: 'windows' | 'linux' | 'mixed';
|
|
31
|
+
simulationScope: 'full' | 'initial-access' | 'persistence' | 'lateral-movement' | 'exfiltration';
|
|
32
|
+
complexity: 'basic' | 'intermediate' | 'advanced';
|
|
33
|
+
stealthLevel: 'low' | 'medium' | 'high';
|
|
34
|
+
duration: 'short' | 'medium' | 'extended';
|
|
35
|
+
}
|
|
36
|
+
export interface APTSimulationResult {
|
|
37
|
+
simulationId: string;
|
|
38
|
+
timestamp: Date;
|
|
39
|
+
config: APTSimulationConfig;
|
|
40
|
+
phasesExecuted: string[];
|
|
41
|
+
techniquesUsed: APTTechnique[];
|
|
42
|
+
successRate: number;
|
|
43
|
+
detectionEvents: DetectionEvent[];
|
|
44
|
+
recommendations: string[];
|
|
45
|
+
evidence: SimulationEvidence[];
|
|
46
|
+
}
|
|
47
|
+
export interface DetectionEvent {
|
|
48
|
+
techniqueId: string;
|
|
49
|
+
timestamp: Date;
|
|
50
|
+
detectionMethod: string;
|
|
51
|
+
confidence: 'low' | 'medium' | 'high';
|
|
52
|
+
evidence: string;
|
|
53
|
+
}
|
|
54
|
+
export interface SimulationEvidence {
|
|
55
|
+
phase: string;
|
|
56
|
+
technique: string;
|
|
57
|
+
evidenceType: 'file' | 'network' | 'process' | 'registry' | 'log';
|
|
58
|
+
content: string;
|
|
59
|
+
location: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* APT Simulation Engine Class
|
|
63
|
+
*/
|
|
64
|
+
export declare class APTSimulationEngine {
|
|
65
|
+
private attackPhases;
|
|
66
|
+
private techniques;
|
|
67
|
+
constructor();
|
|
68
|
+
/**
|
|
69
|
+
* Initialize APT attack phases based on MITRE ATT&CK
|
|
70
|
+
*/
|
|
71
|
+
private initializeAttackPhases;
|
|
72
|
+
/**
|
|
73
|
+
* Initialize APT techniques based on MITRE ATT&CK
|
|
74
|
+
*/
|
|
75
|
+
private initializeTechniques;
|
|
76
|
+
/**
|
|
77
|
+
* Get techniques by attack phase
|
|
78
|
+
*/
|
|
79
|
+
getTechniquesByPhase(phaseId: string): APTTechnique[];
|
|
80
|
+
/**
|
|
81
|
+
* Get all attack phases
|
|
82
|
+
*/
|
|
83
|
+
getAttackPhases(): APTAttackPhase[];
|
|
84
|
+
/**
|
|
85
|
+
* Generate APT simulation scenario
|
|
86
|
+
*/
|
|
87
|
+
generateScenario(config: APTSimulationConfig): APTTechnique[];
|
|
88
|
+
/**
|
|
89
|
+
* Determine if technique should be included in simulation
|
|
90
|
+
*/
|
|
91
|
+
private shouldIncludeTechnique;
|
|
92
|
+
/**
|
|
93
|
+
* Simulate APT attack campaign
|
|
94
|
+
*/
|
|
95
|
+
simulateAttack(config: APTSimulationConfig): Promise<APTSimulationResult>;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=apt-simulation-engine-complete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apt-simulation-engine-complete.d.ts","sourceRoot":"","sources":["../../src/security/apt-simulation-engine-complete.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;CACnD;AAED,MAAM,WAAW,mBAAmB;IAClC,c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