erosolar-cli 1.5.3 → 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.
Files changed (327) hide show
  1. package/config/security-deployment.json +54 -0
  2. package/dist/bin/adapters/node/index.js +33 -0
  3. package/dist/bin/adapters/types.js +1 -0
  4. package/dist/bin/alpha-zero/agentWrapper.js +165 -0
  5. package/dist/bin/alpha-zero/codeEvaluator.js +272 -0
  6. package/dist/bin/alpha-zero/competitiveRunner.js +219 -0
  7. package/dist/bin/alpha-zero/index.js +98 -0
  8. package/dist/bin/alpha-zero/introspection.js +298 -0
  9. package/dist/bin/alpha-zero/metricsTracker.js +207 -0
  10. package/dist/bin/alpha-zero/security/core.js +269 -0
  11. package/dist/bin/alpha-zero/security/google.js +308 -0
  12. package/dist/bin/alpha-zero/security/googleLoader.js +40 -0
  13. package/dist/bin/alpha-zero/security/index.js +31 -0
  14. package/dist/bin/alpha-zero/security/simulation.js +274 -0
  15. package/dist/bin/alpha-zero/selfModification.js +231 -0
  16. package/dist/bin/alpha-zero/types.js +30 -0
  17. package/dist/bin/bin/erosolar-optimized.js +205 -0
  18. package/dist/bin/capabilities/agentSpawningCapability.js +116 -0
  19. package/dist/bin/capabilities/bashCapability.js +22 -0
  20. package/dist/bin/capabilities/cloudCapability.js +36 -0
  21. package/dist/bin/capabilities/codeAnalysisCapability.js +22 -0
  22. package/dist/bin/capabilities/codeQualityCapability.js +23 -0
  23. package/dist/bin/capabilities/dependencySecurityCapability.js +22 -0
  24. package/dist/bin/capabilities/devCapability.js +22 -0
  25. package/dist/bin/capabilities/editCapability.js +28 -0
  26. package/dist/bin/capabilities/emailCapability.js +20 -0
  27. package/dist/bin/capabilities/enhancedGitCapability.js +221 -0
  28. package/dist/bin/capabilities/filesystemCapability.js +22 -0
  29. package/dist/bin/capabilities/globCapability.js +28 -0
  30. package/dist/bin/capabilities/interactionCapability.js +20 -0
  31. package/dist/bin/capabilities/learnCapability.js +22 -0
  32. package/dist/bin/capabilities/mcpCapability.js +20 -0
  33. package/dist/bin/capabilities/notebookCapability.js +28 -0
  34. package/dist/bin/capabilities/planningCapability.js +27 -0
  35. package/dist/bin/capabilities/refactoringCapability.js +23 -0
  36. package/dist/bin/capabilities/repoChecksCapability.js +22 -0
  37. package/dist/bin/capabilities/searchCapability.js +22 -0
  38. package/dist/bin/capabilities/skillCapability.js +76 -0
  39. package/dist/bin/capabilities/taskManagementCapability.js +20 -0
  40. package/dist/bin/capabilities/testingCapability.js +23 -0
  41. package/dist/bin/capabilities/toolManifest.js +159 -0
  42. package/dist/bin/capabilities/toolRegistry.js +114 -0
  43. package/dist/bin/capabilities/webCapability.js +20 -0
  44. package/dist/bin/config.js +139 -0
  45. package/dist/bin/contracts/v1/agent.js +7 -0
  46. package/dist/bin/contracts/v1/agentProfileManifest.js +8 -0
  47. package/dist/bin/contracts/v1/agentRules.js +9 -0
  48. package/dist/bin/contracts/v1/toolAccess.js +8 -0
  49. package/dist/bin/core/agent.js +362 -0
  50. package/dist/bin/core/agentProfileManifest.js +187 -0
  51. package/dist/bin/core/agentProfiles.js +34 -0
  52. package/dist/bin/core/agentRulebook.js +135 -0
  53. package/dist/bin/core/agentSchemaLoader.js +233 -0
  54. package/dist/bin/core/contextManager.js +412 -0
  55. package/dist/bin/core/contextWindow.js +122 -0
  56. package/dist/bin/core/customCommands.js +80 -0
  57. package/dist/bin/core/errors/apiKeyErrors.js +114 -0
  58. package/dist/bin/core/errors/errorTypes.js +340 -0
  59. package/dist/bin/core/errors/safetyValidator.js +304 -0
  60. package/dist/bin/core/errors.js +32 -0
  61. package/dist/bin/core/modelDiscovery.js +755 -0
  62. package/dist/bin/core/preferences.js +224 -0
  63. package/dist/bin/core/schemaValidator.js +92 -0
  64. package/dist/bin/core/secretStore.js +199 -0
  65. package/dist/bin/core/sessionStore.js +187 -0
  66. package/dist/bin/core/toolRuntime.js +290 -0
  67. package/dist/bin/core/types.js +1 -0
  68. package/dist/bin/erosolar-optimized.d.ts +12 -0
  69. package/dist/bin/erosolar-optimized.d.ts.map +1 -0
  70. package/dist/bin/erosolar-optimized.js +239 -0
  71. package/dist/bin/erosolar-optimized.js.map +1 -0
  72. package/dist/bin/erosolar.js +14 -0
  73. package/dist/bin/erosolar.js.map +1 -1
  74. package/dist/bin/headless/headlessApp.js +172 -0
  75. package/dist/bin/mcp/config.js +202 -0
  76. package/dist/bin/mcp/stdioClient.js +172 -0
  77. package/dist/bin/mcp/toolBridge.js +104 -0
  78. package/dist/bin/mcp/types.js +1 -0
  79. package/dist/bin/plugins/index.js +113 -0
  80. package/dist/bin/plugins/providers/anthropic/index.js +25 -0
  81. package/dist/bin/plugins/providers/deepseek/index.js +24 -0
  82. package/dist/bin/plugins/providers/google/index.js +26 -0
  83. package/dist/bin/plugins/providers/index.js +19 -0
  84. package/dist/bin/plugins/providers/ollama/index.js +59 -0
  85. package/dist/bin/plugins/providers/openai/index.js +26 -0
  86. package/dist/bin/plugins/providers/xai/index.js +24 -0
  87. package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +8 -0
  88. package/dist/bin/plugins/tools/bash/localBashPlugin.js +13 -0
  89. package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +13 -0
  90. package/dist/bin/plugins/tools/cloud/cloudPlugin.js +13 -0
  91. package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +13 -0
  92. package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +13 -0
  93. package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +11 -0
  94. package/dist/bin/plugins/tools/development/devPlugin.js +13 -0
  95. package/dist/bin/plugins/tools/edit/editPlugin.js +14 -0
  96. package/dist/bin/plugins/tools/email/emailPlugin.js +11 -0
  97. package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +8 -0
  98. package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +13 -0
  99. package/dist/bin/plugins/tools/glob/globPlugin.js +14 -0
  100. package/dist/bin/plugins/tools/index.js +2 -0
  101. package/dist/bin/plugins/tools/interaction/interactionPlugin.js +11 -0
  102. package/dist/bin/plugins/tools/learn/learnPlugin.js +13 -0
  103. package/dist/bin/plugins/tools/mcp/mcpPlugin.js +8 -0
  104. package/dist/bin/plugins/tools/nodeDefaults.js +56 -0
  105. package/dist/bin/plugins/tools/notebook/notebookPlugin.js +14 -0
  106. package/dist/bin/plugins/tools/planning/planningPlugin.js +14 -0
  107. package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +11 -0
  108. package/dist/bin/plugins/tools/registry.js +57 -0
  109. package/dist/bin/plugins/tools/search/localSearchPlugin.js +13 -0
  110. package/dist/bin/plugins/tools/skills/skillPlugin.js +8 -0
  111. package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +11 -0
  112. package/dist/bin/plugins/tools/testing/testingPlugin.js +11 -0
  113. package/dist/bin/plugins/tools/web/webPlugin.js +11 -0
  114. package/dist/bin/providers/anthropicProvider.js +329 -0
  115. package/dist/bin/providers/googleProvider.js +203 -0
  116. package/dist/bin/providers/openaiChatCompletionsProvider.js +208 -0
  117. package/dist/bin/providers/openaiResponsesProvider.js +249 -0
  118. package/dist/bin/providers/providerFactory.js +24 -0
  119. package/dist/bin/runtime/agentController.js +321 -0
  120. package/dist/bin/runtime/agentHost.js +153 -0
  121. package/dist/bin/runtime/agentSession.js +195 -0
  122. package/dist/bin/runtime/node.js +10 -0
  123. package/dist/bin/runtime/universal.js +28 -0
  124. package/dist/bin/shell/bracketedPasteManager.js +350 -0
  125. package/dist/bin/shell/fileChangeTracker.js +65 -0
  126. package/dist/bin/shell/interactiveShell.js +2908 -0
  127. package/dist/bin/shell/liveStatus.js +78 -0
  128. package/dist/bin/shell/shellApp.js +290 -0
  129. package/dist/bin/shell/systemPrompt.js +60 -0
  130. package/dist/bin/shell/updateManager.js +108 -0
  131. package/dist/bin/skills/skillRepository.js +236 -0
  132. package/dist/bin/skills/types.js +1 -0
  133. package/dist/bin/subagents/taskRunner.js +269 -0
  134. package/dist/bin/tools/backgroundBashTools.js +211 -0
  135. package/dist/bin/tools/bashTools.js +159 -0
  136. package/dist/bin/tools/cloudTools.js +864 -0
  137. package/dist/bin/tools/codeAnalysisTools.js +641 -0
  138. package/dist/bin/tools/codeQualityTools.js +294 -0
  139. package/dist/bin/tools/dependencyTools.js +282 -0
  140. package/dist/bin/tools/devTools.js +238 -0
  141. package/dist/bin/tools/diffUtils.js +137 -0
  142. package/dist/bin/tools/editTools.js +134 -0
  143. package/dist/bin/tools/emailTools.js +448 -0
  144. package/dist/bin/tools/fileTools.js +282 -0
  145. package/dist/bin/tools/globTools.js +173 -0
  146. package/dist/bin/tools/grepTools.js +332 -0
  147. package/dist/bin/tools/interactionTools.js +170 -0
  148. package/dist/bin/tools/learnTools.js +1818 -0
  149. package/dist/bin/tools/notebookEditTools.js +196 -0
  150. package/dist/bin/tools/planningTools.js +46 -0
  151. package/dist/bin/tools/refactoringTools.js +293 -0
  152. package/dist/bin/tools/repoChecksTools.js +160 -0
  153. package/dist/bin/tools/searchTools.js +206 -0
  154. package/dist/bin/tools/skillTools.js +177 -0
  155. package/dist/bin/tools/taskManagementTools.js +156 -0
  156. package/dist/bin/tools/testingTools.js +232 -0
  157. package/dist/bin/tools/webTools.js +480 -0
  158. package/dist/bin/ui/ShellUIAdapter.js +459 -0
  159. package/dist/bin/ui/UnifiedUIController.js +183 -0
  160. package/dist/bin/ui/animation/AnimationScheduler.js +430 -0
  161. package/dist/bin/ui/codeHighlighter.js +854 -0
  162. package/dist/bin/ui/designSystem.js +121 -0
  163. package/dist/bin/ui/display.js +1222 -0
  164. package/dist/bin/ui/interrupts/InterruptManager.js +437 -0
  165. package/dist/bin/ui/layout.js +139 -0
  166. package/dist/bin/ui/orchestration/StatusOrchestrator.js +403 -0
  167. package/dist/bin/ui/outputMode.js +38 -0
  168. package/dist/bin/ui/persistentPrompt.js +183 -0
  169. package/dist/bin/ui/richText.js +338 -0
  170. package/dist/bin/ui/shortcutsHelp.js +87 -0
  171. package/dist/bin/ui/telemetry/UITelemetry.js +443 -0
  172. package/dist/bin/ui/textHighlighter.js +210 -0
  173. package/dist/bin/ui/theme.js +116 -0
  174. package/dist/bin/ui/toolDisplay.js +423 -0
  175. package/dist/bin/ui/toolDisplayAdapter.js +357 -0
  176. package/dist/bin/workspace.js +106 -0
  177. package/dist/bin/workspace.validator.js +213 -0
  178. package/dist/capabilities/offensiveSecurityCapability.d.ts +26 -0
  179. package/dist/capabilities/offensiveSecurityCapability.d.ts.map +1 -0
  180. package/dist/capabilities/offensiveSecurityCapability.js +58 -0
  181. package/dist/capabilities/offensiveSecurityCapability.js.map +1 -0
  182. package/dist/capabilities/realSecurityCapability.d.ts +26 -0
  183. package/dist/capabilities/realSecurityCapability.d.ts.map +1 -0
  184. package/dist/capabilities/realSecurityCapability.js +53 -0
  185. package/dist/capabilities/realSecurityCapability.js.map +1 -0
  186. package/dist/capabilities/securityCapability.d.ts +32 -0
  187. package/dist/capabilities/securityCapability.d.ts.map +1 -0
  188. package/dist/capabilities/securityCapability.js +57 -0
  189. package/dist/capabilities/securityCapability.js.map +1 -0
  190. package/dist/capabilities/ultimateSecurityCapability.d.ts +42 -0
  191. package/dist/capabilities/ultimateSecurityCapability.d.ts.map +1 -0
  192. package/dist/capabilities/ultimateSecurityCapability.js +96 -0
  193. package/dist/capabilities/ultimateSecurityCapability.js.map +1 -0
  194. package/dist/core/LazyLoader.d.ts +129 -0
  195. package/dist/core/LazyLoader.d.ts.map +1 -0
  196. package/dist/core/LazyLoader.js +240 -0
  197. package/dist/core/LazyLoader.js.map +1 -0
  198. package/dist/core/intelligenceTools.d.ts +19 -0
  199. package/dist/core/intelligenceTools.d.ts.map +1 -0
  200. package/dist/core/intelligenceTools.js +453 -0
  201. package/dist/core/intelligenceTools.js.map +1 -0
  202. package/dist/core/operationalTools.d.ts +19 -0
  203. package/dist/core/operationalTools.d.ts.map +1 -0
  204. package/dist/core/operationalTools.js +467 -0
  205. package/dist/core/operationalTools.js.map +1 -0
  206. package/dist/offensive/core/offensive-engine.d.ts +171 -0
  207. package/dist/offensive/core/offensive-engine.d.ts.map +1 -0
  208. package/dist/offensive/core/offensive-engine.js +345 -0
  209. package/dist/offensive/core/offensive-engine.js.map +1 -0
  210. package/dist/offensive/core/offensive-integration.d.ts +129 -0
  211. package/dist/offensive/core/offensive-integration.d.ts.map +1 -0
  212. package/dist/offensive/core/offensive-integration.js +364 -0
  213. package/dist/offensive/core/offensive-integration.js.map +1 -0
  214. package/dist/offensive/core/offensive-tools.d.ts +55 -0
  215. package/dist/offensive/core/offensive-tools.d.ts.map +1 -0
  216. package/dist/offensive/core/offensive-tools.js +438 -0
  217. package/dist/offensive/core/offensive-tools.js.map +1 -0
  218. package/dist/offensive/offensive-cli.d.ts +48 -0
  219. package/dist/offensive/offensive-cli.d.ts.map +1 -0
  220. package/dist/offensive/offensive-cli.js +233 -0
  221. package/dist/offensive/offensive-cli.js.map +1 -0
  222. package/dist/plugins/index.d.ts +1 -1
  223. package/dist/plugins/index.d.ts.map +1 -1
  224. package/dist/plugins/index.js +2 -0
  225. package/dist/plugins/index.js.map +1 -1
  226. package/dist/security/advanced-persistence-research.d.ts +92 -0
  227. package/dist/security/advanced-persistence-research.d.ts.map +1 -0
  228. package/dist/security/advanced-persistence-research.js +195 -0
  229. package/dist/security/advanced-persistence-research.js.map +1 -0
  230. package/dist/security/apt-simulation-cli.d.ts +57 -0
  231. package/dist/security/apt-simulation-cli.d.ts.map +1 -0
  232. package/dist/security/apt-simulation-cli.js +278 -0
  233. package/dist/security/apt-simulation-cli.js.map +1 -0
  234. package/dist/security/apt-simulation-engine-complete.d.ts +97 -0
  235. package/dist/security/apt-simulation-engine-complete.d.ts.map +1 -0
  236. package/dist/security/apt-simulation-engine-complete.js +441 -0
  237. package/dist/security/apt-simulation-engine-complete.js.map +1 -0
  238. package/dist/security/apt-simulation-engine.d.ts +97 -0
  239. package/dist/security/apt-simulation-engine.d.ts.map +1 -0
  240. package/dist/security/apt-simulation-engine.js +441 -0
  241. package/dist/security/apt-simulation-engine.js.map +1 -0
  242. package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
  243. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
  244. package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
  245. package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
  246. package/dist/security/authorization/securityAuthorization.d.ts +88 -0
  247. package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
  248. package/dist/security/authorization/securityAuthorization.js +172 -0
  249. package/dist/security/authorization/securityAuthorization.js.map +1 -0
  250. package/dist/security/authorization.d.ts +45 -0
  251. package/dist/security/authorization.d.ts.map +1 -0
  252. package/dist/security/authorization.js +128 -0
  253. package/dist/security/authorization.js.map +1 -0
  254. package/dist/security/comprehensive-security-research.d.ts +84 -0
  255. package/dist/security/comprehensive-security-research.d.ts.map +1 -0
  256. package/dist/security/comprehensive-security-research.js +211 -0
  257. package/dist/security/comprehensive-security-research.js.map +1 -0
  258. package/dist/security/offensive/exploitationEngine.d.ts +54 -0
  259. package/dist/security/offensive/exploitationEngine.d.ts.map +1 -0
  260. package/dist/security/offensive/exploitationEngine.js +263 -0
  261. package/dist/security/offensive/exploitationEngine.js.map +1 -0
  262. package/dist/security/persistence-cli.d.ts +36 -0
  263. package/dist/security/persistence-cli.d.ts.map +1 -0
  264. package/dist/security/persistence-cli.js +160 -0
  265. package/dist/security/persistence-cli.js.map +1 -0
  266. package/dist/security/persistence-research.d.ts +11 -0
  267. package/dist/security/persistence-research.d.ts.map +1 -1
  268. package/dist/security/persistence-research.js +11 -0
  269. package/dist/security/persistence-research.js.map +1 -1
  270. package/dist/security/real/networkExploitation.d.ts +92 -0
  271. package/dist/security/real/networkExploitation.d.ts.map +1 -0
  272. package/dist/security/real/networkExploitation.js +316 -0
  273. package/dist/security/real/networkExploitation.js.map +1 -0
  274. package/dist/security/real/persistenceImplementation.d.ts +62 -0
  275. package/dist/security/real/persistenceImplementation.d.ts.map +1 -0
  276. package/dist/security/real/persistenceImplementation.js +323 -0
  277. package/dist/security/real/persistenceImplementation.js.map +1 -0
  278. package/dist/security/real/vulnerabilityScanner.d.ts +73 -0
  279. package/dist/security/real/vulnerabilityScanner.d.ts.map +1 -0
  280. package/dist/security/real/vulnerabilityScanner.js +341 -0
  281. package/dist/security/real/vulnerabilityScanner.js.map +1 -0
  282. package/dist/security/research/persistenceResearch.d.ts +97 -0
  283. package/dist/security/research/persistenceResearch.d.ts.map +1 -0
  284. package/dist/security/research/persistenceResearch.js +282 -0
  285. package/dist/security/research/persistenceResearch.js.map +1 -0
  286. package/dist/security/security-testing-framework.d.ts +120 -0
  287. package/dist/security/security-testing-framework.d.ts.map +1 -0
  288. package/dist/security/security-testing-framework.js +372 -0
  289. package/dist/security/security-testing-framework.js.map +1 -0
  290. package/dist/security/simulation/attackSimulation.d.ts +93 -0
  291. package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
  292. package/dist/security/simulation/attackSimulation.js +341 -0
  293. package/dist/security/simulation/attackSimulation.js.map +1 -0
  294. package/dist/shell/bracketedPasteManager.d.ts +33 -0
  295. package/dist/shell/bracketedPasteManager.d.ts.map +1 -1
  296. package/dist/shell/bracketedPasteManager.js +101 -0
  297. package/dist/shell/bracketedPasteManager.js.map +1 -1
  298. package/dist/shell/interactiveShell.d.ts +22 -1
  299. package/dist/shell/interactiveShell.d.ts.map +1 -1
  300. package/dist/shell/interactiveShell.js +257 -24
  301. package/dist/shell/interactiveShell.js.map +1 -1
  302. package/dist/shell/taskCompletionDetector.d.ts +101 -0
  303. package/dist/shell/taskCompletionDetector.d.ts.map +1 -0
  304. package/dist/shell/taskCompletionDetector.js +343 -0
  305. package/dist/shell/taskCompletionDetector.js.map +1 -0
  306. package/dist/tools/cloudTools.d.ts +11 -0
  307. package/dist/tools/cloudTools.d.ts.map +1 -1
  308. package/dist/tools/cloudTools.js +11 -0
  309. package/dist/tools/cloudTools.js.map +1 -1
  310. package/dist/tools/enhancedSecurityTools.d.ts +19 -0
  311. package/dist/tools/enhancedSecurityTools.d.ts.map +1 -0
  312. package/dist/tools/enhancedSecurityTools.js +215 -0
  313. package/dist/tools/enhancedSecurityTools.js.map +1 -0
  314. package/dist/tools/offensiveSecurityTools.d.ts +16 -0
  315. package/dist/tools/offensiveSecurityTools.d.ts.map +1 -0
  316. package/dist/tools/offensiveSecurityTools.js +285 -0
  317. package/dist/tools/offensiveSecurityTools.js.map +1 -0
  318. package/dist/tools/realSecurityTools.d.ts +18 -0
  319. package/dist/tools/realSecurityTools.d.ts.map +1 -0
  320. package/dist/tools/realSecurityTools.js +468 -0
  321. package/dist/tools/realSecurityTools.js.map +1 -0
  322. package/dist/tools/securityTools.d.ts +20 -0
  323. package/dist/tools/securityTools.d.ts.map +1 -0
  324. package/dist/tools/securityTools.js +449 -0
  325. package/dist/tools/securityTools.js.map +1 -0
  326. package/package.json +27 -12
  327. package/scripts/deploy-security-capabilities.js +178 -0
@@ -0,0 +1,282 @@
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
+ /**
17
+ * Persistence Research Engine
18
+ */
19
+ export class PersistenceResearchEngine {
20
+ techniques;
21
+ constructor() {
22
+ this.techniques = new Map();
23
+ this.initializeTechniques();
24
+ }
25
+ /**
26
+ * Analyze persistence techniques for a specific platform
27
+ */
28
+ async analyzePersistence(request) {
29
+ const filteredTechniques = Array.from(this.techniques.values())
30
+ .filter(tech => tech.platform === request.platform || request.platform === 'multi-platform')
31
+ .filter(tech => tech.stealth >= (request.stealthLevel || 1));
32
+ const averageStealth = filteredTechniques.length > 0
33
+ ? filteredTechniques.reduce((sum, tech) => sum + tech.stealth, 0) / filteredTechniques.length
34
+ : 0;
35
+ const riskLevel = this.calculateRiskLevel(filteredTechniques);
36
+ return {
37
+ platform: request.platform,
38
+ stealthLevel: request.stealthLevel || 1,
39
+ includeDetection: request.includeDetection || false,
40
+ techniques: filteredTechniques,
41
+ summary: {
42
+ totalTechniques: filteredTechniques.length,
43
+ averageStealth,
44
+ riskLevel
45
+ }
46
+ };
47
+ }
48
+ /**
49
+ * Generate detection methods for a specific persistence technique
50
+ */
51
+ async generateDetectionMethods(request) {
52
+ const technique = this.techniques.get(request.techniqueId);
53
+ if (!technique) {
54
+ throw new Error(`Persistence technique not found: ${request.techniqueId}`);
55
+ }
56
+ return {
57
+ techniqueId: request.techniqueId,
58
+ platform: request.platform,
59
+ detectionMethods: technique.detectionMethods,
60
+ indicators: technique.indicators,
61
+ monitoringRecommendations: this.generateMonitoringRecommendations(technique)
62
+ };
63
+ }
64
+ /**
65
+ * Get all available platforms
66
+ */
67
+ getAvailablePlatforms() {
68
+ const platforms = new Set();
69
+ for (const technique of this.techniques.values()) {
70
+ platforms.add(technique.platform);
71
+ }
72
+ return Array.from(platforms);
73
+ }
74
+ /**
75
+ * Get technique by ID
76
+ */
77
+ getTechnique(techniqueId) {
78
+ return this.techniques.get(techniqueId);
79
+ }
80
+ /**
81
+ * Calculate risk level based on techniques
82
+ */
83
+ calculateRiskLevel(techniques) {
84
+ if (techniques.length === 0)
85
+ return 'low';
86
+ const highRiskCount = techniques.filter(t => t.stealth >= 4 || t.detectionDifficulty === 'very-hard').length;
87
+ const riskRatio = highRiskCount / techniques.length;
88
+ if (riskRatio >= 0.5)
89
+ return 'high';
90
+ if (riskRatio >= 0.2)
91
+ return 'medium';
92
+ return 'low';
93
+ }
94
+ /**
95
+ * Generate monitoring recommendations
96
+ */
97
+ generateMonitoringRecommendations(technique) {
98
+ const recommendations = [];
99
+ if (technique.platform.includes('windows')) {
100
+ recommendations.push('Enable Windows Event Log monitoring', 'Monitor registry changes', 'Track service creation and modifications');
101
+ }
102
+ if (technique.platform.includes('aws') || technique.platform.includes('azure') || technique.platform.includes('gcp')) {
103
+ recommendations.push('Enable cloud audit logging', 'Monitor IAM role and policy changes', 'Track API key creation and usage');
104
+ }
105
+ if (technique.platform.includes('kubernetes') || technique.platform.includes('docker')) {
106
+ recommendations.push('Monitor container deployments', 'Track image registry changes', 'Audit cluster configuration modifications');
107
+ }
108
+ recommendations.push('Implement behavioral analytics', 'Enable real-time alerting', 'Conduct regular security assessments');
109
+ return recommendations;
110
+ }
111
+ /**
112
+ * Initialize persistence techniques database
113
+ */
114
+ initializeTechniques() {
115
+ // Windows persistence techniques
116
+ this.addTechnique({
117
+ id: 'win-registry-run',
118
+ name: 'Registry Run Keys',
119
+ platform: 'windows',
120
+ stealth: 3,
121
+ complexity: 'medium',
122
+ detectionDifficulty: 'medium',
123
+ mitreIds: ['T1547.001'],
124
+ description: 'Malware adds entries to registry run keys to execute on system startup',
125
+ implementation: [
126
+ 'Add entry to HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
127
+ 'Add entry to HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Run',
128
+ 'Use registry run once keys for single execution'
129
+ ],
130
+ detectionMethods: [
131
+ 'Monitor registry changes in run keys',
132
+ 'Check for suspicious executable paths',
133
+ 'Analyze registry modification events'
134
+ ],
135
+ countermeasures: [
136
+ 'Remove suspicious registry entries',
137
+ 'Implement application whitelisting',
138
+ 'Monitor registry modifications'
139
+ ],
140
+ indicators: [
141
+ 'Unexpected registry modifications',
142
+ 'Suspicious executable paths in run keys',
143
+ 'Registry modification events from unusual processes'
144
+ ],
145
+ tools: ['Regedit', 'Autoruns', 'Sysinternals Suite']
146
+ });
147
+ this.addTechnique({
148
+ id: 'win-scheduled-tasks',
149
+ name: 'Scheduled Tasks',
150
+ platform: 'windows',
151
+ stealth: 2,
152
+ complexity: 'low',
153
+ detectionDifficulty: 'easy',
154
+ mitreIds: ['T1053.005'],
155
+ description: 'Creates scheduled tasks to execute malicious code at specific times or events',
156
+ implementation: [
157
+ 'Create scheduled task using schtasks command',
158
+ 'Use Task Scheduler GUI',
159
+ 'Create tasks with specific triggers and actions'
160
+ ],
161
+ detectionMethods: [
162
+ 'Review scheduled tasks using schtasks',
163
+ 'Monitor Task Scheduler service events',
164
+ 'Check for tasks with suspicious actions'
165
+ ],
166
+ countermeasures: [
167
+ 'Delete malicious scheduled tasks',
168
+ 'Monitor Task Scheduler service',
169
+ 'Implement application whitelisting'
170
+ ],
171
+ indicators: [
172
+ 'New scheduled task creations',
173
+ 'Tasks with suspicious executable paths',
174
+ 'Unusual task triggers or actions'
175
+ ],
176
+ tools: ['Schtasks', 'Task Scheduler', 'PowerShell']
177
+ });
178
+ // Cloud persistence techniques
179
+ this.addTechnique({
180
+ id: 'aws-iam-backdoor',
181
+ name: 'AWS IAM Role Backdoor',
182
+ platform: 'aws',
183
+ stealth: 4,
184
+ complexity: 'high',
185
+ detectionDifficulty: 'hard',
186
+ mitreIds: ['T1078.004'],
187
+ description: 'Creates or modifies IAM roles with external entity trust for persistence',
188
+ implementation: [
189
+ 'Create IAM role with external IDP trust',
190
+ 'Modify existing role trust policy',
191
+ 'Add cross-account access with broad permissions'
192
+ ],
193
+ detectionMethods: [
194
+ 'Monitor CloudTrail for role modifications',
195
+ 'Analyze IAM role trust policies',
196
+ 'Check for external entity trusts'
197
+ ],
198
+ countermeasures: [
199
+ 'Implement least privilege for IAM roles',
200
+ 'Monitor for external trust modifications',
201
+ 'Use AWS Organizations SCPs'
202
+ ],
203
+ indicators: [
204
+ 'IAM role policy modifications',
205
+ 'New external identity provider trusts',
206
+ 'Cross-account role assumptions'
207
+ ],
208
+ tools: ['AWS CLI', 'Pacu', 'CloudSploit']
209
+ });
210
+ this.addTechnique({
211
+ id: 'azure-app-backdoor',
212
+ name: 'Azure AD Application Backdoor',
213
+ platform: 'azure',
214
+ stealth: 4,
215
+ complexity: 'medium',
216
+ detectionDifficulty: 'hard',
217
+ mitreIds: ['T1098.001'],
218
+ description: 'Registers malicious Azure AD application with high privilege permissions',
219
+ implementation: [
220
+ 'Register new Azure AD application',
221
+ 'Grant high privilege permissions',
222
+ 'Create application secret or certificate'
223
+ ],
224
+ detectionMethods: [
225
+ 'Monitor Azure AD audit logs for app registrations',
226
+ 'Check for applications with high privilege permissions',
227
+ 'Analyze application consent grants'
228
+ ],
229
+ countermeasures: [
230
+ 'Implement application governance policies',
231
+ 'Require admin consent for high privilege apps',
232
+ 'Regular review of registered applications'
233
+ ],
234
+ indicators: [
235
+ 'New application registrations with high privileges',
236
+ 'Application consent grants',
237
+ 'Application secret/certificate creation'
238
+ ],
239
+ tools: ['Azure PowerShell', 'Microsoft Graph API', 'Stormspotter']
240
+ });
241
+ // Container persistence techniques
242
+ this.addTechnique({
243
+ id: 'k8s-daemonset',
244
+ name: 'Kubernetes Malicious DaemonSet',
245
+ platform: 'kubernetes',
246
+ stealth: 4,
247
+ complexity: 'high',
248
+ detectionDifficulty: 'hard',
249
+ mitreIds: ['T1053.003'],
250
+ description: 'Deploys malicious DaemonSet that runs on every cluster node',
251
+ implementation: [
252
+ 'Create DaemonSet with privileged container',
253
+ 'Mount host directories for persistence',
254
+ 'Use sidecar containers for covert communication'
255
+ ],
256
+ detectionMethods: [
257
+ 'Monitor for DaemonSet creations/modifications',
258
+ 'Check for privileged container deployments',
259
+ 'Analyze container security contexts'
260
+ ],
261
+ countermeasures: [
262
+ 'Implement Pod Security Standards',
263
+ 'Use admission controllers (OPA Gatekeeper)',
264
+ 'Monitor for privileged container deployments'
265
+ ],
266
+ indicators: [
267
+ 'New DaemonSet deployments',
268
+ 'Containers with privileged security context',
269
+ 'Host path mounts in containers'
270
+ ],
271
+ tools: ['kubectl', 'kubeaudit', 'kube-hunter']
272
+ });
273
+ // Add more techniques as needed...
274
+ }
275
+ /**
276
+ * Add technique to database
277
+ */
278
+ addTechnique(technique) {
279
+ this.techniques.set(technique.id, technique);
280
+ }
281
+ }
282
+ //# sourceMappingURL=persistenceResearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistenceResearch.js","sourceRoot":"","sources":["../../../src/security/research/persistenceResearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiDH;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAC5B,UAAU,CAAoC;IAEtD;QACE,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CAAC,OAAmC;QAC1D,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;aAC5D,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,gBAAgB,CAAC;aAC3F,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC;QAE/D,MAAM,cAAc,GAAG,kBAAkB,CAAC,MAAM,GAAG,CAAC;YAClD,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,kBAAkB,CAAC,MAAM;YAC7F,CAAC,CAAC,CAAC,CAAC;QAEN,MAAM,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;QAE9D,OAAO;YACL,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,CAAC;YACvC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,KAAK;YACnD,UAAU,EAAE,kBAAkB;Y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,EAAE,eAAe;YACnB,IAAI,EAAE,gCAAgC;YACtC,QAAQ,EAAE,YAAY;YACtB,OAAO,EAAE,CAAC;YACV,UAAU,EAAE,MAAM;YAClB,mBAAmB,EAAE,MAAM;YAC3B,QAAQ,EAAE,CAAC,WAAW,CAAC;YACvB,WAAW,EAAE,6DAA6D;YAC1E,cAAc,EAAE;gBACd,4CAA4C;gBAC5C,wCAAwC;gBACxC,iDAAiD;aAClD;YACD,gBAAgB,EAAE;gBAChB,+CAA+C;gBAC/C,4CAA4C;gBAC5C,qCAAqC;aACtC;YACD,eAAe,EAAE;gBACf,kCAAkC;gBAClC,4CAA4C;gBAC5C,8CAA8C;aAC/C;YACD,UAAU,EAAE;gBACV,2BAA2B;gBAC3B,6CAA6C;gBAC7C,gCAAgC;aACjC;YACD,KAAK,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,CAAC;SAC/C,CAAC,CAAC;QAEH,mCAAmC;IACrC,CAAC;IAED;;OAEG;IACK,YAAY,CAAC,SAA+B;QAClD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Security Testing Framework
3
+ *
4
+ * Comprehensive framework for security testing and validation
5
+ * Integrated with the Erosolar CLI ecosystem.
6
+ *
7
+ * @license MIT
8
+ * @author Bo Shang
9
+ *
10
+ * DISCLAIMER: This software is provided for both defensive and offensive security
11
+ * purposes and is open source (available via npm and GitHub) to anyone globally.
12
+ * The creator, Bo Shang, does not solicit or endorse unauthorized attacks.
13
+ * This tool is released with the belief that providing technological freedom
14
+ * globally is the right thing to do. Users are solely responsible for ensuring
15
+ * their use complies with applicable laws and regulations in their jurisdiction.
16
+ * Use responsibly and ethically.
17
+ */
18
+ import { PersistenceResearchToolkit, type PersistenceTechnique } from './persistence-research.js';
19
+ export type { PersistenceTechnique };
20
+ export interface SecurityTest {
21
+ id: string;
22
+ name: string;
23
+ category: 'persistence' | 'privilege-escalation' | 'lateral-movement' | 'defense-evasion';
24
+ platform: string[];
25
+ description: string;
26
+ testSteps: string[];
27
+ expectedResults: string[];
28
+ riskLevel: 'low' | 'medium' | 'high';
29
+ mitreId?: string;
30
+ }
31
+ export interface TestExecutionResult {
32
+ testId: string;
33
+ status: 'passed' | 'failed' | 'skipped' | 'error';
34
+ executionTime: number;
35
+ output: string;
36
+ evidence?: string;
37
+ recommendations?: string[];
38
+ }
39
+ export interface SecurityAssessment {
40
+ timestamp: Date;
41
+ systemInfo: SystemInfo;
42
+ testsExecuted: number;
43
+ testsPassed: number;
44
+ testsFailed: number;
45
+ riskScore: number;
46
+ results: TestExecutionResult[];
47
+ summary: string;
48
+ }
49
+ export interface SystemInfo {
50
+ platform: string;
51
+ architecture: string;
52
+ version: string;
53
+ user: string;
54
+ privileges: string[];
55
+ }
56
+ /**
57
+ * Security Testing Framework Class
58
+ */
59
+ export declare class SecurityTestingFramework {
60
+ private _persistenceToolkit;
61
+ private securityTests;
62
+ constructor();
63
+ /**
64
+ * Get the persistence research toolkit for advanced security analysis
65
+ */
66
+ get persistenceToolkit(): PersistenceResearchToolkit;
67
+ /**
68
+ * Initialize security tests based on persistence techniques
69
+ */
70
+ private initializeSecurityTests;
71
+ /**
72
+ * Get security tests by platform
73
+ */
74
+ getTestsByPlatform(platform: string): SecurityTest[];
75
+ /**
76
+ * Get security tests by category
77
+ */
78
+ getTestsByCategory(category: string): SecurityTest[];
79
+ /**
80
+ * Execute a specific security test
81
+ */
82
+ executeTest(testId: string, platform: string): Promise<TestExecutionResult>;
83
+ /**
84
+ * Execute multiple security tests
85
+ */
86
+ executeTestSuite(testIds: string[], platform: string): Promise<SecurityAssessment>;
87
+ /**
88
+ * Generate test report in various formats
89
+ */
90
+ generateTestReport(assessment: SecurityAssessment, format: 'text' | 'json' | 'html'): string;
91
+ /**
92
+ * Generate remediation guidance based on test results
93
+ */
94
+ generateRemediationGuidance(results: TestExecutionResult[]): string[];
95
+ /**
96
+ * Simulate test execution (placeholder for actual implementation)
97
+ */
98
+ private simulateTestExecution;
99
+ /**
100
+ * Get system information (placeholder for actual implementation)
101
+ */
102
+ private getSystemInfo;
103
+ /**
104
+ * Calculate risk score based on test results
105
+ */
106
+ private calculateRiskScore;
107
+ /**
108
+ * Generate summary of test results
109
+ */
110
+ private generateSummary;
111
+ /**
112
+ * Generate text report
113
+ */
114
+ private generateTextReport;
115
+ /**
116
+ * Generate HTML report
117
+ */
118
+ private generateHTMLReport;
119
+ }
120
+ //# sourceMappingURL=security-testing-framework.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-testing-framework.d.ts","sourceRoot":"","sources":["../../src/security/security-testing-framework.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGlG,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,GAAG,sBAAsB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;IAC1F,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;IAClD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;I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