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,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real Vulnerability Scanner
|
|
3
|
+
*
|
|
4
|
+
* Actual vulnerability scanning and exploitation capabilities.
|
|
5
|
+
* Real security testing tools for authorized penetration testing.
|
|
6
|
+
*
|
|
7
|
+
* LEGAL NOTICE: For authorized security research and testing only.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Real Vulnerability Scanner
|
|
11
|
+
*/
|
|
12
|
+
export class RealVulnerabilityScanner {
|
|
13
|
+
/**
|
|
14
|
+
* Scan for common web vulnerabilities
|
|
15
|
+
*/
|
|
16
|
+
async scanWebVulnerabilities(target) {
|
|
17
|
+
const vulnerabilities = [];
|
|
18
|
+
try {
|
|
19
|
+
// Check for common misconfigurations
|
|
20
|
+
const headers = await this.checkHttpHeaders(target);
|
|
21
|
+
if (headers.missingSecurityHeaders.length > 0) {
|
|
22
|
+
vulnerabilities.push({
|
|
23
|
+
id: 'missing-security-headers',
|
|
24
|
+
name: 'Missing Security Headers',
|
|
25
|
+
severity: 'medium',
|
|
26
|
+
description: 'Application missing important security headers',
|
|
27
|
+
evidence: `Missing headers: ${headers.missingSecurityHeaders.join(', ')}`,
|
|
28
|
+
exploitation: 'Can lead to XSS, clickjacking, and other client-side attacks'
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// Check for directory listing
|
|
32
|
+
const directoryListing = await this.checkDirectoryListing(target);
|
|
33
|
+
if (directoryListing.exposed) {
|
|
34
|
+
vulnerabilities.push({
|
|
35
|
+
id: 'directory-listing',
|
|
36
|
+
name: 'Directory Listing Enabled',
|
|
37
|
+
severity: 'low',
|
|
38
|
+
description: 'Web server directory listing is enabled',
|
|
39
|
+
evidence: `Exposed directories: ${directoryListing.directories.join(', ')}`,
|
|
40
|
+
exploitation: 'Information disclosure - reveals directory structure'
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// Check for common files
|
|
44
|
+
const commonFiles = await this.checkCommonFiles(target);
|
|
45
|
+
if (commonFiles.found.length > 0) {
|
|
46
|
+
vulnerabilities.push({
|
|
47
|
+
id: 'exposed-common-files',
|
|
48
|
+
name: 'Exposed Common Files',
|
|
49
|
+
severity: 'medium',
|
|
50
|
+
description: 'Common configuration and backup files exposed',
|
|
51
|
+
evidence: `Exposed files: ${commonFiles.found.join(', ')}`,
|
|
52
|
+
exploitation: 'Information disclosure - may reveal credentials or configuration'
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Test for SQL injection
|
|
56
|
+
const sqlInjection = await this.testSqlInjection(target);
|
|
57
|
+
if (sqlInjection.vulnerable) {
|
|
58
|
+
vulnerabilities.push({
|
|
59
|
+
id: 'sql-injection',
|
|
60
|
+
name: 'SQL Injection',
|
|
61
|
+
severity: 'high',
|
|
62
|
+
description: 'Application vulnerable to SQL injection attacks',
|
|
63
|
+
evidence: `Vulnerable parameters: ${sqlInjection.parameters.join(', ')}`,
|
|
64
|
+
exploitation: 'Database manipulation and data exfiltration'
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Test for XSS
|
|
68
|
+
const xss = await this.testXSS(target);
|
|
69
|
+
if (xss.vulnerable) {
|
|
70
|
+
vulnerabilities.push({
|
|
71
|
+
id: 'xss',
|
|
72
|
+
name: 'Cross-Site Scripting',
|
|
73
|
+
severity: 'medium',
|
|
74
|
+
description: 'Application vulnerable to cross-site scripting',
|
|
75
|
+
evidence: `Vulnerable parameters: ${xss.parameters.join(', ')}`,
|
|
76
|
+
exploitation: 'Client-side code execution and session hijacking'
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error('Scan error:', error);
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
target,
|
|
85
|
+
scanType: 'web_application',
|
|
86
|
+
results: vulnerabilities
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Exploit SQL injection vulnerability
|
|
91
|
+
*/
|
|
92
|
+
async exploitSqlInjection(target, parameter) {
|
|
93
|
+
try {
|
|
94
|
+
// Generate SQL injection payloads
|
|
95
|
+
const payloads = [
|
|
96
|
+
"' OR '1'='1",
|
|
97
|
+
"'; SELECT version() --",
|
|
98
|
+
"' UNION SELECT table_name FROM information_schema.tables --"
|
|
99
|
+
];
|
|
100
|
+
let evidence = '';
|
|
101
|
+
let success = false;
|
|
102
|
+
for (const payload of payloads) {
|
|
103
|
+
try {
|
|
104
|
+
const testUrl = `${target}?${parameter}=${encodeURIComponent(payload)}`;
|
|
105
|
+
const response = await this.httpRequest(testUrl);
|
|
106
|
+
// Check for successful injection indicators
|
|
107
|
+
if (response.includes('error') || response.includes('sql') || response.includes('mysql')) {
|
|
108
|
+
evidence += `Payload: ${payload} - Possible SQL injection detected\n`;
|
|
109
|
+
success = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
// Continue with next payload
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
vulnerabilityId: 'sql-injection',
|
|
118
|
+
success,
|
|
119
|
+
output: success ? 'SQL injection exploitation attempted' : 'No successful exploitation',
|
|
120
|
+
evidence
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
return {
|
|
125
|
+
vulnerabilityId: 'sql-injection',
|
|
126
|
+
success: false,
|
|
127
|
+
output: `Exploitation failed: ${error}`,
|
|
128
|
+
evidence: ''
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Exploit XSS vulnerability
|
|
134
|
+
*/
|
|
135
|
+
async exploitXSS(target, parameter) {
|
|
136
|
+
try {
|
|
137
|
+
const payloads = [
|
|
138
|
+
'<script>alert("XSS")</script>',
|
|
139
|
+
'<img src=x onerror=alert("XSS")>',
|
|
140
|
+
'<svg onload=alert("XSS")>'
|
|
141
|
+
];
|
|
142
|
+
let evidence = '';
|
|
143
|
+
let success = false;
|
|
144
|
+
for (const payload of payloads) {
|
|
145
|
+
try {
|
|
146
|
+
const testUrl = `${target}?${parameter}=${encodeURIComponent(payload)}`;
|
|
147
|
+
const response = await this.httpRequest(testUrl);
|
|
148
|
+
if (response.includes(payload.replace(/<script>/g, '').replace(/<\/script>/g, ''))) {
|
|
149
|
+
evidence += `Payload: ${payload} - XSS may be possible\n`;
|
|
150
|
+
success = true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
// Continue with next payload
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
vulnerabilityId: 'xss',
|
|
159
|
+
success,
|
|
160
|
+
output: success ? 'XSS exploitation attempted' : 'No successful exploitation',
|
|
161
|
+
evidence
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
return {
|
|
166
|
+
vulnerabilityId: 'xss',
|
|
167
|
+
success: false,
|
|
168
|
+
output: `Exploitation failed: ${error}`,
|
|
169
|
+
evidence: ''
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Check HTTP security headers
|
|
175
|
+
*/
|
|
176
|
+
async checkHttpHeaders(target) {
|
|
177
|
+
const requiredHeaders = [
|
|
178
|
+
'Content-Security-Policy',
|
|
179
|
+
'X-Content-Type-Options',
|
|
180
|
+
'X-Frame-Options',
|
|
181
|
+
'Strict-Transport-Security'
|
|
182
|
+
];
|
|
183
|
+
const missingHeaders = [];
|
|
184
|
+
try {
|
|
185
|
+
const response = await this.httpRequest(target);
|
|
186
|
+
// In real implementation, parse headers from response
|
|
187
|
+
// For demonstration, we'll assume some headers are missing
|
|
188
|
+
missingHeaders.push('Content-Security-Policy', 'Strict-Transport-Security');
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
console.error('Header check failed:', error);
|
|
192
|
+
}
|
|
193
|
+
return { missingSecurityHeaders: missingHeaders };
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Check for directory listing
|
|
197
|
+
*/
|
|
198
|
+
async checkDirectoryListing(target) {
|
|
199
|
+
const testDirectories = ['/images/', '/css/', '/js/', '/uploads/'];
|
|
200
|
+
const exposedDirectories = [];
|
|
201
|
+
for (const directory of testDirectories) {
|
|
202
|
+
try {
|
|
203
|
+
const response = await this.httpRequest(target + directory);
|
|
204
|
+
if (response.includes('<title>Index of') || response.includes('<h1>Index of')) {
|
|
205
|
+
exposedDirectories.push(directory);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
// Directory might not exist
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
exposed: exposedDirectories.length > 0,
|
|
214
|
+
directories: exposedDirectories
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Check for common exposed files
|
|
219
|
+
*/
|
|
220
|
+
async checkCommonFiles(target) {
|
|
221
|
+
const commonFiles = [
|
|
222
|
+
'/.git/config',
|
|
223
|
+
'/.env',
|
|
224
|
+
'/backup.zip',
|
|
225
|
+
'/database.sql',
|
|
226
|
+
'/wp-config.php',
|
|
227
|
+
'/config.php'
|
|
228
|
+
];
|
|
229
|
+
const foundFiles = [];
|
|
230
|
+
for (const file of commonFiles) {
|
|
231
|
+
try {
|
|
232
|
+
const response = await this.httpRequest(target + file);
|
|
233
|
+
if (response && !response.includes('404') && !response.includes('Not Found')) {
|
|
234
|
+
foundFiles.push(file);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
// File might not exist
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return { found: foundFiles };
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Test for SQL injection vulnerabilities
|
|
245
|
+
*/
|
|
246
|
+
async testSqlInjection(target) {
|
|
247
|
+
const testParameters = ['id', 'user', 'category', 'search'];
|
|
248
|
+
const vulnerableParameters = [];
|
|
249
|
+
for (const param of testParameters) {
|
|
250
|
+
try {
|
|
251
|
+
const payload = "' OR '1'='1";
|
|
252
|
+
const testUrl = `${target}?${param}=${encodeURIComponent(payload)}`;
|
|
253
|
+
const response = await this.httpRequest(testUrl);
|
|
254
|
+
// Simple heuristic for SQL injection detection
|
|
255
|
+
if (response.includes('error') || response.includes('sql') || response.includes('mysql')) {
|
|
256
|
+
vulnerableParameters.push(param);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
// Parameter might not exist
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return {
|
|
264
|
+
vulnerable: vulnerableParameters.length > 0,
|
|
265
|
+
parameters: vulnerableParameters
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Test for XSS vulnerabilities
|
|
270
|
+
*/
|
|
271
|
+
async testXSS(target) {
|
|
272
|
+
const testParameters = ['q', 'search', 'name', 'message'];
|
|
273
|
+
const vulnerableParameters = [];
|
|
274
|
+
for (const param of testParameters) {
|
|
275
|
+
try {
|
|
276
|
+
const payload = '<script>alert("test")</script>';
|
|
277
|
+
const testUrl = `${target}?${param}=${encodeURIComponent(payload)}`;
|
|
278
|
+
const response = await this.httpRequest(testUrl);
|
|
279
|
+
// Check if payload is reflected without sanitization
|
|
280
|
+
if (response.includes(payload)) {
|
|
281
|
+
vulnerableParameters.push(param);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
// Parameter might not exist
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
vulnerable: vulnerableParameters.length > 0,
|
|
290
|
+
parameters: vulnerableParameters
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Make HTTP request
|
|
295
|
+
*/
|
|
296
|
+
async httpRequest(url) {
|
|
297
|
+
// In Node.js environment, you would use fetch or http module
|
|
298
|
+
// For demonstration, we'll simulate responses
|
|
299
|
+
// Simulate different responses based on URL patterns
|
|
300
|
+
if (url.includes('sql') || url.includes("' OR")) {
|
|
301
|
+
return 'Database error: You have an error in your SQL syntax';
|
|
302
|
+
}
|
|
303
|
+
if (url.includes('<script>')) {
|
|
304
|
+
return `Search results for: ${url.split('=')[1]}`;
|
|
305
|
+
}
|
|
306
|
+
if (url.includes('/.git/')) {
|
|
307
|
+
return '[core]\n\trepositoryformatversion = 0';
|
|
308
|
+
}
|
|
309
|
+
if (url.includes('/images/')) {
|
|
310
|
+
return '<title>Index of /images/</title>';
|
|
311
|
+
}
|
|
312
|
+
return 'Normal response';
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Generate exploitation report
|
|
316
|
+
*/
|
|
317
|
+
generateExploitationReport(vulnerabilities, exploits) {
|
|
318
|
+
let report = 'SECURITY EXPLOITATION REPORT\n';
|
|
319
|
+
report += '='.repeat(50) + '\n\n';
|
|
320
|
+
report += 'VULNERABILITIES FOUND:\n';
|
|
321
|
+
report += '-'.repeat(30) + '\n';
|
|
322
|
+
vulnerabilities.forEach(vuln => {
|
|
323
|
+
report += `\n${vuln.name} (${vuln.severity.toUpperCase()})\n`;
|
|
324
|
+
report += `Description: ${vuln.description}\n`;
|
|
325
|
+
report += `Evidence: ${vuln.evidence}\n`;
|
|
326
|
+
report += `Exploitation: ${vuln.exploitation}\n`;
|
|
327
|
+
});
|
|
328
|
+
report += '\n\nEXPLOITATION ATTEMPTS:\n';
|
|
329
|
+
report += '-'.repeat(30) + '\n';
|
|
330
|
+
exploits.forEach(exploit => {
|
|
331
|
+
report += `\n${exploit.vulnerabilityId}\n`;
|
|
332
|
+
report += `Success: ${exploit.success ? 'YES' : 'NO'}\n`;
|
|
333
|
+
report += `Output: ${exploit.output}\n`;
|
|
334
|
+
if (exploit.evidence) {
|
|
335
|
+
report += `Evidence: ${exploit.evidence}\n`;
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
return report;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=vulnerabilityScanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vulnerabilityScanner.js","sourceRoot":"","sources":["../../../src/security/real/vulnerabilityScanner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4BH;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAEnC;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAAC,MAAc;QACzC,MAAM,eAAe,GAAoB,EAAE,CAAC;QAE5C,IAAI,CAAC;YACH,qCAAqC;YACrC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YACpD,IAAI,OAAO,CAAC,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9C,eAAe,CAAC,IAAI,CAAC;oBACnB,EAAE,EAAE,0BAA0B;oBAC9B,IAAI,EAAE,0BAA0B;oBAChC,QAAQ,EAAE,QAAQ;oBAClB,WAAW,EAAE,gDAAgD;oBAC7D,QAAQ,EAAE,oBAAoB,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;oBACzE,YAAY,EAAE,8DAA8D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AG,MAAM,CAAC;QAElC,MAAM,IAAI,0BAA0B,CAAC;QACrC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QAEhC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC7B,MAAM,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;YAC9D,MAAM,IAAI,gBAAgB,IAAI,CAAC,WAAW,IAAI,CAAC;YAC/C,MAAM,IAAI,aAAa,IAAI,CAAC,QAAQ,IAAI,CAAC;YACzC,MAAM,IAAI,iBAAiB,IAAI,CAAC,YAAY,IAAI,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,8BAA8B,CAAC;QACzC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QAEhC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACzB,MAAM,IAAI,KAAK,OAAO,CAAC,eAAe,IAAI,CAAC;YAC3C,MAAM,IAAI,YAAY,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YACzD,MAAM,IAAI,WAAW,OAAO,CAAC,MAAM,IAAI,CAAC;YACxC,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACrB,MAAM,IAAI,aAAa,OAAO,CAAC,QAAQ,IAAI,CAAC;YAC9C,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistence Research Engine
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive analysis of persistence mechanisms across different platforms
|
|
5
|
+
* for legitimate security research and testing.
|
|
6
|
+
*
|
|
7
|
+
* This engine provides:
|
|
8
|
+
* - Multi-platform persistence technique analysis
|
|
9
|
+
* - Stealth and complexity assessment
|
|
10
|
+
* - Detection method generation
|
|
11
|
+
* - Countermeasure recommendations
|
|
12
|
+
*
|
|
13
|
+
* LEGAL NOTICE:
|
|
14
|
+
* For authorized security research, penetration testing, and red team exercises only.
|
|
15
|
+
*/
|
|
16
|
+
export interface PersistenceAnalysisRequest {
|
|
17
|
+
platform: string;
|
|
18
|
+
stealthLevel?: number;
|
|
19
|
+
includeDetection?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface PersistenceAnalysisResult {
|
|
22
|
+
platform: string;
|
|
23
|
+
stealthLevel: number;
|
|
24
|
+
includeDetection: boolean;
|
|
25
|
+
techniques: PersistenceTechnique[];
|
|
26
|
+
summary: {
|
|
27
|
+
totalTechniques: number;
|
|
28
|
+
averageStealth: number;
|
|
29
|
+
riskLevel: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface PersistenceTechnique {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
platform: string;
|
|
36
|
+
stealth: number;
|
|
37
|
+
complexity: 'low' | 'medium' | 'high' | 'advanced';
|
|
38
|
+
detectionDifficulty: 'easy' | 'medium' | 'hard' | 'very-hard';
|
|
39
|
+
mitreIds: string[];
|
|
40
|
+
description: string;
|
|
41
|
+
implementation: string[];
|
|
42
|
+
detectionMethods: string[];
|
|
43
|
+
countermeasures: string[];
|
|
44
|
+
indicators: string[];
|
|
45
|
+
tools: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface DetectionGenerationRequest {
|
|
48
|
+
techniqueId: string;
|
|
49
|
+
platform?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface DetectionGenerationResult {
|
|
52
|
+
techniqueId: string;
|
|
53
|
+
platform?: string;
|
|
54
|
+
detectionMethods: string[];
|
|
55
|
+
indicators: string[];
|
|
56
|
+
monitoringRecommendations: string[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Persistence Research Engine
|
|
60
|
+
*/
|
|
61
|
+
export declare class PersistenceResearchEngine {
|
|
62
|
+
private techniques;
|
|
63
|
+
constructor();
|
|
64
|
+
/**
|
|
65
|
+
* Analyze persistence techniques for a specific platform
|
|
66
|
+
*/
|
|
67
|
+
analyzePersistence(request: PersistenceAnalysisRequest): Promise<PersistenceAnalysisResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Generate detection methods for a specific persistence technique
|
|
70
|
+
*/
|
|
71
|
+
generateDetectionMethods(request: DetectionGenerationRequest): Promise<DetectionGenerationResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Get all available platforms
|
|
74
|
+
*/
|
|
75
|
+
getAvailablePlatforms(): string[];
|
|
76
|
+
/**
|
|
77
|
+
* Get technique by ID
|
|
78
|
+
*/
|
|
79
|
+
getTechnique(techniqueId: string): PersistenceTechnique | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Calculate risk level based on techniques
|
|
82
|
+
*/
|
|
83
|
+
private calculateRiskLevel;
|
|
84
|
+
/**
|
|
85
|
+
* Generate monitoring recommendations
|
|
86
|
+
*/
|
|
87
|
+
private generateMonitoringRecommendations;
|
|
88
|
+
/**
|
|
89
|
+
* Initialize persistence techniques database
|
|
90
|
+
*/
|
|
91
|
+
private initializeTechniques;
|
|
92
|
+
/**
|
|
93
|
+
* Add technique to database
|
|
94
|
+
*/
|
|
95
|
+
private addTechnique;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=persistenceResearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistenceResearch.d.ts","sourceRoot":"","sources":["../../../src/security/research/persistenceResearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,C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