erosolar-cli 1.7.327 → 1.7.329

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 (323) hide show
  1. package/README.md +148 -24
  2. package/dist/alpha-zero/agentWrapper.d.ts +84 -0
  3. package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
  4. package/dist/alpha-zero/agentWrapper.js +171 -0
  5. package/dist/alpha-zero/agentWrapper.js.map +1 -0
  6. package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
  7. package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
  8. package/dist/alpha-zero/codeEvaluator.js +273 -0
  9. package/dist/alpha-zero/codeEvaluator.js.map +1 -0
  10. package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
  11. package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
  12. package/dist/alpha-zero/competitiveRunner.js +224 -0
  13. package/dist/alpha-zero/competitiveRunner.js.map +1 -0
  14. package/dist/alpha-zero/index.d.ts +67 -0
  15. package/dist/alpha-zero/index.d.ts.map +1 -0
  16. package/dist/alpha-zero/index.js +99 -0
  17. package/dist/alpha-zero/index.js.map +1 -0
  18. package/dist/alpha-zero/introspection.d.ts +128 -0
  19. package/dist/alpha-zero/introspection.d.ts.map +1 -0
  20. package/dist/alpha-zero/introspection.js +300 -0
  21. package/dist/alpha-zero/introspection.js.map +1 -0
  22. package/dist/alpha-zero/metricsTracker.d.ts +71 -0
  23. package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
  24. package/dist/{core → alpha-zero}/metricsTracker.js +5 -2
  25. package/dist/alpha-zero/metricsTracker.js.map +1 -0
  26. package/dist/alpha-zero/security/core.d.ts +125 -0
  27. package/dist/alpha-zero/security/core.d.ts.map +1 -0
  28. package/dist/alpha-zero/security/core.js +271 -0
  29. package/dist/alpha-zero/security/core.js.map +1 -0
  30. package/dist/alpha-zero/security/google.d.ts +125 -0
  31. package/dist/alpha-zero/security/google.d.ts.map +1 -0
  32. package/dist/alpha-zero/security/google.js +311 -0
  33. package/dist/alpha-zero/security/google.js.map +1 -0
  34. package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
  35. package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
  36. package/dist/alpha-zero/security/googleLoader.js +41 -0
  37. package/dist/alpha-zero/security/googleLoader.js.map +1 -0
  38. package/dist/alpha-zero/security/index.d.ts +29 -0
  39. package/dist/alpha-zero/security/index.d.ts.map +1 -0
  40. package/dist/alpha-zero/security/index.js +32 -0
  41. package/dist/alpha-zero/security/index.js.map +1 -0
  42. package/dist/alpha-zero/security/simulation.d.ts +124 -0
  43. package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
  44. package/dist/alpha-zero/security/simulation.js +277 -0
  45. package/dist/alpha-zero/security/simulation.js.map +1 -0
  46. package/dist/alpha-zero/selfModification.d.ts +109 -0
  47. package/dist/alpha-zero/selfModification.d.ts.map +1 -0
  48. package/dist/alpha-zero/selfModification.js +233 -0
  49. package/dist/alpha-zero/selfModification.js.map +1 -0
  50. package/dist/alpha-zero/types.d.ts +170 -0
  51. package/dist/alpha-zero/types.d.ts.map +1 -0
  52. package/dist/alpha-zero/types.js +31 -0
  53. package/dist/alpha-zero/types.js.map +1 -0
  54. package/dist/bin/erosolar.js +21 -5
  55. package/dist/bin/erosolar.js.map +1 -1
  56. package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
  57. package/dist/capabilities/agentSpawningCapability.js +31 -56
  58. package/dist/capabilities/agentSpawningCapability.js.map +1 -1
  59. package/dist/capabilities/securityTestingCapability.d.ts +13 -0
  60. package/dist/capabilities/securityTestingCapability.d.ts.map +1 -0
  61. package/dist/capabilities/securityTestingCapability.js +25 -0
  62. package/dist/capabilities/securityTestingCapability.js.map +1 -0
  63. package/dist/contracts/agent-schemas.json +15 -0
  64. package/dist/contracts/tools.schema.json +9 -0
  65. package/dist/core/agent.d.ts +2 -2
  66. package/dist/core/agent.d.ts.map +1 -1
  67. package/dist/core/agent.js.map +1 -1
  68. package/dist/core/aiFlowOptimizer.d.ts +26 -0
  69. package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
  70. package/dist/core/aiFlowOptimizer.js +31 -0
  71. package/dist/core/aiFlowOptimizer.js.map +1 -0
  72. package/dist/core/aiOptimizationEngine.d.ts +158 -0
  73. package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
  74. package/dist/core/aiOptimizationEngine.js +428 -0
  75. package/dist/core/aiOptimizationEngine.js.map +1 -0
  76. package/dist/core/aiOptimizationIntegration.d.ts +93 -0
  77. package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
  78. package/dist/core/aiOptimizationIntegration.js +250 -0
  79. package/dist/core/aiOptimizationIntegration.js.map +1 -0
  80. package/dist/core/customCommands.d.ts +0 -1
  81. package/dist/core/customCommands.d.ts.map +1 -1
  82. package/dist/core/customCommands.js +0 -3
  83. package/dist/core/customCommands.js.map +1 -1
  84. package/dist/core/enhancedErrorRecovery.d.ts +100 -0
  85. package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
  86. package/dist/core/enhancedErrorRecovery.js +345 -0
  87. package/dist/core/enhancedErrorRecovery.js.map +1 -0
  88. package/dist/core/hooksSystem.d.ts +65 -0
  89. package/dist/core/hooksSystem.d.ts.map +1 -0
  90. package/dist/core/hooksSystem.js +273 -0
  91. package/dist/core/hooksSystem.js.map +1 -0
  92. package/dist/core/memorySystem.d.ts +48 -0
  93. package/dist/core/memorySystem.d.ts.map +1 -0
  94. package/dist/core/memorySystem.js +271 -0
  95. package/dist/core/memorySystem.js.map +1 -0
  96. package/dist/core/toolPreconditions.d.ts.map +1 -1
  97. package/dist/core/toolPreconditions.js +14 -0
  98. package/dist/core/toolPreconditions.js.map +1 -1
  99. package/dist/core/toolRuntime.d.ts +1 -22
  100. package/dist/core/toolRuntime.d.ts.map +1 -1
  101. package/dist/core/toolRuntime.js +5 -0
  102. package/dist/core/toolRuntime.js.map +1 -1
  103. package/dist/core/toolValidation.d.ts.map +1 -1
  104. package/dist/core/toolValidation.js +3 -14
  105. package/dist/core/toolValidation.js.map +1 -1
  106. package/dist/core/unified/errors.d.ts +189 -0
  107. package/dist/core/unified/errors.d.ts.map +1 -0
  108. package/dist/core/unified/errors.js +497 -0
  109. package/dist/core/unified/errors.js.map +1 -0
  110. package/dist/core/unified/index.d.ts +19 -0
  111. package/dist/core/unified/index.d.ts.map +1 -0
  112. package/dist/core/unified/index.js +68 -0
  113. package/dist/core/unified/index.js.map +1 -0
  114. package/dist/core/unified/schema.d.ts +101 -0
  115. package/dist/core/unified/schema.d.ts.map +1 -0
  116. package/dist/core/unified/schema.js +350 -0
  117. package/dist/core/unified/schema.js.map +1 -0
  118. package/dist/core/unified/toolRuntime.d.ts +179 -0
  119. package/dist/core/unified/toolRuntime.d.ts.map +1 -0
  120. package/dist/core/unified/toolRuntime.js +517 -0
  121. package/dist/core/unified/toolRuntime.js.map +1 -0
  122. package/dist/core/unified/tools.d.ts +127 -0
  123. package/dist/core/unified/tools.d.ts.map +1 -0
  124. package/dist/core/unified/tools.js +1333 -0
  125. package/dist/core/unified/tools.js.map +1 -0
  126. package/dist/core/unified/types.d.ts +352 -0
  127. package/dist/core/unified/types.d.ts.map +1 -0
  128. package/dist/core/unified/types.js +12 -0
  129. package/dist/core/unified/types.js.map +1 -0
  130. package/dist/core/unified/version.d.ts +209 -0
  131. package/dist/core/unified/version.d.ts.map +1 -0
  132. package/dist/core/unified/version.js +454 -0
  133. package/dist/core/unified/version.js.map +1 -0
  134. package/dist/core/validationRunner.d.ts +3 -1
  135. package/dist/core/validationRunner.d.ts.map +1 -1
  136. package/dist/core/validationRunner.js.map +1 -1
  137. package/dist/headless/headlessApp.d.ts.map +1 -1
  138. package/dist/headless/headlessApp.js +0 -21
  139. package/dist/headless/headlessApp.js.map +1 -1
  140. package/dist/mcp/sseClient.d.ts.map +1 -1
  141. package/dist/mcp/sseClient.js +18 -9
  142. package/dist/mcp/sseClient.js.map +1 -1
  143. package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
  144. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  145. package/dist/plugins/tools/build/buildPlugin.js +10 -4
  146. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  147. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  148. package/dist/plugins/tools/nodeDefaults.js +2 -0
  149. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  150. package/dist/plugins/tools/security/securityPlugin.d.ts +3 -0
  151. package/dist/plugins/tools/security/securityPlugin.d.ts.map +1 -0
  152. package/dist/plugins/tools/security/securityPlugin.js +12 -0
  153. package/dist/plugins/tools/security/securityPlugin.js.map +1 -0
  154. package/dist/runtime/agentSession.d.ts +2 -2
  155. package/dist/runtime/agentSession.d.ts.map +1 -1
  156. package/dist/runtime/agentSession.js +2 -2
  157. package/dist/runtime/agentSession.js.map +1 -1
  158. package/dist/security/active-stack-security.d.ts +112 -0
  159. package/dist/security/active-stack-security.d.ts.map +1 -0
  160. package/dist/security/active-stack-security.js +296 -0
  161. package/dist/security/active-stack-security.js.map +1 -0
  162. package/dist/security/advanced-persistence-research.d.ts +92 -0
  163. package/dist/security/advanced-persistence-research.d.ts.map +1 -0
  164. package/dist/security/advanced-persistence-research.js +195 -0
  165. package/dist/security/advanced-persistence-research.js.map +1 -0
  166. package/dist/security/advanced-targeting.d.ts +119 -0
  167. package/dist/security/advanced-targeting.d.ts.map +1 -0
  168. package/dist/security/advanced-targeting.js +233 -0
  169. package/dist/security/advanced-targeting.js.map +1 -0
  170. package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
  171. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
  172. package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
  173. package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
  174. package/dist/security/authorization/securityAuthorization.d.ts +88 -0
  175. package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
  176. package/dist/security/authorization/securityAuthorization.js +172 -0
  177. package/dist/security/authorization/securityAuthorization.js.map +1 -0
  178. package/dist/security/comprehensive-targeting.d.ts +85 -0
  179. package/dist/security/comprehensive-targeting.d.ts.map +1 -0
  180. package/dist/security/comprehensive-targeting.js +438 -0
  181. package/dist/security/comprehensive-targeting.js.map +1 -0
  182. package/dist/security/global-security-integration.d.ts +91 -0
  183. package/dist/security/global-security-integration.d.ts.map +1 -0
  184. package/dist/security/global-security-integration.js +218 -0
  185. package/dist/security/global-security-integration.js.map +1 -0
  186. package/dist/security/index.d.ts +38 -0
  187. package/dist/security/index.d.ts.map +1 -0
  188. package/dist/security/index.js +47 -0
  189. package/dist/security/index.js.map +1 -0
  190. package/dist/security/persistence-analyzer.d.ts +56 -0
  191. package/dist/security/persistence-analyzer.d.ts.map +1 -0
  192. package/dist/security/persistence-analyzer.js +187 -0
  193. package/dist/security/persistence-analyzer.js.map +1 -0
  194. package/dist/security/persistence-cli.d.ts +36 -0
  195. package/dist/security/persistence-cli.d.ts.map +1 -0
  196. package/dist/security/persistence-cli.js +160 -0
  197. package/dist/security/persistence-cli.js.map +1 -0
  198. package/dist/security/persistence-research.d.ts +92 -0
  199. package/dist/security/persistence-research.d.ts.map +1 -0
  200. package/dist/security/persistence-research.js +364 -0
  201. package/dist/security/persistence-research.js.map +1 -0
  202. package/dist/security/research/persistenceResearch.d.ts +97 -0
  203. package/dist/security/research/persistenceResearch.d.ts.map +1 -0
  204. package/dist/security/research/persistenceResearch.js +282 -0
  205. package/dist/security/research/persistenceResearch.js.map +1 -0
  206. package/dist/security/security-integration.d.ts +74 -0
  207. package/dist/security/security-integration.d.ts.map +1 -0
  208. package/dist/security/security-integration.js +137 -0
  209. package/dist/security/security-integration.js.map +1 -0
  210. package/dist/security/security-testing-framework.d.ts +112 -0
  211. package/dist/security/security-testing-framework.d.ts.map +1 -0
  212. package/dist/security/security-testing-framework.js +364 -0
  213. package/dist/security/security-testing-framework.js.map +1 -0
  214. package/dist/security/simulation/attackSimulation.d.ts +93 -0
  215. package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
  216. package/dist/security/simulation/attackSimulation.js +341 -0
  217. package/dist/security/simulation/attackSimulation.js.map +1 -0
  218. package/dist/security/strategic-operations.d.ts +100 -0
  219. package/dist/security/strategic-operations.d.ts.map +1 -0
  220. package/dist/security/strategic-operations.js +276 -0
  221. package/dist/security/strategic-operations.js.map +1 -0
  222. package/dist/security/tool-security-wrapper.d.ts +58 -0
  223. package/dist/security/tool-security-wrapper.d.ts.map +1 -0
  224. package/dist/security/tool-security-wrapper.js +156 -0
  225. package/dist/security/tool-security-wrapper.js.map +1 -0
  226. package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
  227. package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
  228. package/dist/shell/claudeCodeStreamHandler.js +322 -0
  229. package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
  230. package/dist/shell/inputQueueManager.d.ts +144 -0
  231. package/dist/shell/inputQueueManager.d.ts.map +1 -0
  232. package/dist/shell/inputQueueManager.js +290 -0
  233. package/dist/shell/inputQueueManager.js.map +1 -0
  234. package/dist/shell/interactiveShell.d.ts +7 -16
  235. package/dist/shell/interactiveShell.d.ts.map +1 -1
  236. package/dist/shell/interactiveShell.js +164 -235
  237. package/dist/shell/interactiveShell.js.map +1 -1
  238. package/dist/shell/metricsTracker.d.ts +60 -0
  239. package/dist/shell/metricsTracker.d.ts.map +1 -0
  240. package/dist/shell/metricsTracker.js +119 -0
  241. package/dist/shell/metricsTracker.js.map +1 -0
  242. package/dist/shell/shellApp.d.ts +0 -2
  243. package/dist/shell/shellApp.d.ts.map +1 -1
  244. package/dist/shell/shellApp.js +9 -40
  245. package/dist/shell/shellApp.js.map +1 -1
  246. package/dist/shell/streamingOutputManager.d.ts +115 -0
  247. package/dist/shell/streamingOutputManager.d.ts.map +1 -0
  248. package/dist/shell/streamingOutputManager.js +225 -0
  249. package/dist/shell/streamingOutputManager.js.map +1 -0
  250. package/dist/shell/systemPrompt.d.ts.map +1 -1
  251. package/dist/shell/systemPrompt.js +4 -1
  252. package/dist/shell/systemPrompt.js.map +1 -1
  253. package/dist/shell/terminalInput.d.ts +117 -149
  254. package/dist/shell/terminalInput.d.ts.map +1 -1
  255. package/dist/shell/terminalInput.js +521 -639
  256. package/dist/shell/terminalInput.js.map +1 -1
  257. package/dist/shell/terminalInputAdapter.d.ts +20 -79
  258. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  259. package/dist/shell/terminalInputAdapter.js +30 -99
  260. package/dist/shell/terminalInputAdapter.js.map +1 -1
  261. package/dist/subagents/taskRunner.d.ts +1 -7
  262. package/dist/subagents/taskRunner.d.ts.map +1 -1
  263. package/dist/subagents/taskRunner.js +47 -180
  264. package/dist/subagents/taskRunner.js.map +1 -1
  265. package/dist/tools/securityTools.d.ts +22 -0
  266. package/dist/tools/securityTools.d.ts.map +1 -0
  267. package/dist/tools/securityTools.js +448 -0
  268. package/dist/tools/securityTools.js.map +1 -0
  269. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  270. package/dist/ui/ShellUIAdapter.js +12 -13
  271. package/dist/ui/ShellUIAdapter.js.map +1 -1
  272. package/dist/ui/display.d.ts +45 -24
  273. package/dist/ui/display.d.ts.map +1 -1
  274. package/dist/ui/display.js +259 -140
  275. package/dist/ui/display.js.map +1 -1
  276. package/dist/ui/persistentPrompt.d.ts +50 -0
  277. package/dist/ui/persistentPrompt.d.ts.map +1 -0
  278. package/dist/ui/persistentPrompt.js +92 -0
  279. package/dist/ui/persistentPrompt.js.map +1 -0
  280. package/dist/ui/terminalUISchema.d.ts +195 -0
  281. package/dist/ui/terminalUISchema.d.ts.map +1 -0
  282. package/dist/ui/terminalUISchema.js +113 -0
  283. package/dist/ui/terminalUISchema.js.map +1 -0
  284. package/dist/ui/theme.d.ts.map +1 -1
  285. package/dist/ui/theme.js +8 -6
  286. package/dist/ui/theme.js.map +1 -1
  287. package/dist/ui/toolDisplay.d.ts +158 -0
  288. package/dist/ui/toolDisplay.d.ts.map +1 -1
  289. package/dist/ui/toolDisplay.js +348 -0
  290. package/dist/ui/toolDisplay.js.map +1 -1
  291. package/dist/ui/unified/layout.d.ts +0 -1
  292. package/dist/ui/unified/layout.d.ts.map +1 -1
  293. package/dist/ui/unified/layout.js +25 -15
  294. package/dist/ui/unified/layout.js.map +1 -1
  295. package/package.json +4 -4
  296. package/scripts/deploy-security-capabilities.js +178 -0
  297. package/dist/core/hooks.d.ts +0 -113
  298. package/dist/core/hooks.d.ts.map +0 -1
  299. package/dist/core/hooks.js +0 -267
  300. package/dist/core/hooks.js.map +0 -1
  301. package/dist/core/metricsTracker.d.ts +0 -122
  302. package/dist/core/metricsTracker.d.ts.map +0 -1
  303. package/dist/core/metricsTracker.js.map +0 -1
  304. package/dist/core/securityAssessment.d.ts +0 -91
  305. package/dist/core/securityAssessment.d.ts.map +0 -1
  306. package/dist/core/securityAssessment.js +0 -580
  307. package/dist/core/securityAssessment.js.map +0 -1
  308. package/dist/core/verification.d.ts +0 -137
  309. package/dist/core/verification.d.ts.map +0 -1
  310. package/dist/core/verification.js +0 -323
  311. package/dist/core/verification.js.map +0 -1
  312. package/dist/subagents/agentConfig.d.ts +0 -27
  313. package/dist/subagents/agentConfig.d.ts.map +0 -1
  314. package/dist/subagents/agentConfig.js +0 -89
  315. package/dist/subagents/agentConfig.js.map +0 -1
  316. package/dist/subagents/agentRegistry.d.ts +0 -33
  317. package/dist/subagents/agentRegistry.d.ts.map +0 -1
  318. package/dist/subagents/agentRegistry.js +0 -162
  319. package/dist/subagents/agentRegistry.js.map +0 -1
  320. package/dist/utils/frontmatter.d.ts +0 -10
  321. package/dist/utils/frontmatter.d.ts.map +0 -1
  322. package/dist/utils/frontmatter.js +0 -78
  323. package/dist/utils/frontmatter.js.map +0 -1
@@ -0,0 +1,311 @@
1
+ /**
2
+ * Google Infrastructure Persistence Vector Research
3
+ *
4
+ * OPTIONAL MODULE - Only loaded when Google security research is enabled.
5
+ *
6
+ * Provides research tools for identifying persistence mechanisms
7
+ * in Google Cloud Platform and Google Workspace environments.
8
+ *
9
+ * AUTHORIZATION: Designed for authorized red team engagements and
10
+ * penetration testing of Google infrastructure under contract.
11
+ *
12
+ * Principal Investigator: Bo Shang
13
+ * Framework: erosolar-cli
14
+ */
15
+ import { AuthorizationScope } from './core.js';
16
+ /**
17
+ * Google services for persistence research
18
+ */
19
+ export var GoogleService;
20
+ (function (GoogleService) {
21
+ // Google Cloud Platform
22
+ GoogleService["GCP_COMPUTE"] = "gcp_compute_engine";
23
+ GoogleService["GCP_GKE"] = "gcp_kubernetes_engine";
24
+ GoogleService["GCP_CLOUD_FUNCTIONS"] = "gcp_cloud_functions";
25
+ GoogleService["GCP_IAM"] = "gcp_iam";
26
+ GoogleService["GCP_SERVICE_ACCOUNTS"] = "gcp_service_accounts";
27
+ GoogleService["GCP_CLOUD_STORAGE"] = "gcp_cloud_storage";
28
+ GoogleService["GCP_SECRETS_MANAGER"] = "gcp_secrets_manager";
29
+ // Google Workspace
30
+ GoogleService["WORKSPACE_GMAIL"] = "workspace_gmail";
31
+ GoogleService["WORKSPACE_DRIVE"] = "workspace_drive";
32
+ GoogleService["WORKSPACE_ADMIN"] = "workspace_admin";
33
+ GoogleService["WORKSPACE_APPS_SCRIPT"] = "workspace_apps_script";
34
+ // Google Identity
35
+ GoogleService["GOOGLE_OAUTH"] = "google_oauth";
36
+ })(GoogleService || (GoogleService = {}));
37
+ /**
38
+ * Categories of persistence mechanisms
39
+ */
40
+ export var PersistenceCategory;
41
+ (function (PersistenceCategory) {
42
+ PersistenceCategory["SERVICE_ACCOUNT_ABUSE"] = "service_account_abuse";
43
+ PersistenceCategory["IAM_POLICY_MODIFICATION"] = "iam_policy_modification";
44
+ PersistenceCategory["OAUTH_APP_CONSENT"] = "oauth_app_consent";
45
+ PersistenceCategory["API_KEYS"] = "api_keys";
46
+ PersistenceCategory["CLOUD_FUNCTION_TRIGGER"] = "cloud_function_trigger";
47
+ PersistenceCategory["APPS_SCRIPT_TRIGGER"] = "apps_script_trigger";
48
+ PersistenceCategory["DELEGATION_ABUSE"] = "delegation_abuse";
49
+ })(PersistenceCategory || (PersistenceCategory = {}));
50
+ /**
51
+ * GCP Persistence Vectors
52
+ */
53
+ export const GCP_PERSISTENCE_VECTORS = {
54
+ sa_key_creation: {
55
+ name: 'Service Account Key Creation',
56
+ service: GoogleService.GCP_SERVICE_ACCOUNTS,
57
+ category: PersistenceCategory.SERVICE_ACCOUNT_ABUSE,
58
+ description: 'Create keys for service accounts to maintain API access',
59
+ techniqueId: 'T1098.001',
60
+ requiredPermissions: ['iam.serviceAccountKeys.create'],
61
+ detectionMethods: ['Cloud Audit Logs', 'Security Command Center'],
62
+ mitigations: ['Use Workload Identity', 'Key rotation policies'],
63
+ stealthRating: 2,
64
+ },
65
+ iam_binding: {
66
+ name: 'IAM Policy Binding',
67
+ service: GoogleService.GCP_IAM,
68
+ category: PersistenceCategory.IAM_POLICY_MODIFICATION,
69
+ description: 'Add IAM bindings for persistent access',
70
+ techniqueId: 'T1098.001',
71
+ requiredPermissions: ['resourcemanager.projects.setIamPolicy'],
72
+ detectionMethods: ['IAM audit logs', 'Policy monitoring'],
73
+ mitigations: ['IAM Recommender', 'Least privilege'],
74
+ stealthRating: 1,
75
+ },
76
+ cloud_function_backdoor: {
77
+ name: 'Cloud Function Backdoor',
78
+ service: GoogleService.GCP_CLOUD_FUNCTIONS,
79
+ category: PersistenceCategory.CLOUD_FUNCTION_TRIGGER,
80
+ description: 'Deploy function as persistent callback',
81
+ techniqueId: 'T1059',
82
+ requiredPermissions: ['cloudfunctions.functions.create'],
83
+ detectionMethods: ['Function deployment logs', 'Network monitoring'],
84
+ mitigations: ['Function allowlisting', 'Binary authorization'],
85
+ stealthRating: 3,
86
+ },
87
+ };
88
+ /**
89
+ * Workspace Persistence Vectors
90
+ */
91
+ export const WORKSPACE_PERSISTENCE_VECTORS = {
92
+ oauth_consent: {
93
+ name: 'OAuth App Consent Persistence',
94
+ service: GoogleService.GOOGLE_OAUTH,
95
+ category: PersistenceCategory.OAUTH_APP_CONSENT,
96
+ description: 'Persist via OAuth app with broad scope consent',
97
+ techniqueId: 'T1550.001',
98
+ requiredPermissions: ['OAuth consent grant'],
99
+ detectionMethods: ['OAuth audit logs', 'App access reviews'],
100
+ mitigations: ['OAuth app restrictions', 'Consent monitoring'],
101
+ stealthRating: 4,
102
+ },
103
+ apps_script_trigger: {
104
+ name: 'Apps Script Trigger Persistence',
105
+ service: GoogleService.WORKSPACE_APPS_SCRIPT,
106
+ category: PersistenceCategory.APPS_SCRIPT_TRIGGER,
107
+ description: 'Create time/event triggers in Apps Script',
108
+ techniqueId: 'T1053',
109
+ requiredPermissions: ['Script Editor access'],
110
+ detectionMethods: ['Apps Script audit logs', 'Trigger inventory'],
111
+ mitigations: ['Apps Script restrictions', 'Trigger monitoring'],
112
+ stealthRating: 4,
113
+ },
114
+ drive_sharing: {
115
+ name: 'Drive Sharing Persistence',
116
+ service: GoogleService.WORKSPACE_DRIVE,
117
+ category: PersistenceCategory.DELEGATION_ABUSE,
118
+ description: 'Maintain access via shared drive permissions',
119
+ techniqueId: 'T1213',
120
+ requiredPermissions: ['Drive sharing permissions'],
121
+ detectionMethods: ['Drive audit logs', 'Sharing reports'],
122
+ mitigations: ['External sharing restrictions', 'DLP policies'],
123
+ stealthRating: 3,
124
+ },
125
+ };
126
+ /**
127
+ * Google Persistence Researcher
128
+ */
129
+ export class GooglePersistenceResearcher {
130
+ authorization;
131
+ verbose;
132
+ testResults = [];
133
+ constructor(authorization, verbose = false) {
134
+ this.authorization = authorization;
135
+ this.verbose = verbose;
136
+ }
137
+ /**
138
+ * Check authorization
139
+ */
140
+ checkAuthorization() {
141
+ if (!this.authorization) {
142
+ throw new Error('No authorization record.');
143
+ }
144
+ const allowed = [
145
+ AuthorizationScope.OWNED_SYSTEMS,
146
+ AuthorizationScope.PENTEST_ENGAGEMENT,
147
+ AuthorizationScope.RED_TEAM,
148
+ AuthorizationScope.BUG_BOUNTY,
149
+ ];
150
+ if (!allowed.includes(this.authorization.scope)) {
151
+ throw new Error('Google research requires pentest/red team authorization.');
152
+ }
153
+ }
154
+ /**
155
+ * Get all Google persistence vectors
156
+ */
157
+ getAllVectors() {
158
+ return { ...GCP_PERSISTENCE_VECTORS, ...WORKSPACE_PERSISTENCE_VECTORS };
159
+ }
160
+ /**
161
+ * Get vectors by service
162
+ */
163
+ getVectorsByService(service) {
164
+ const all = this.getAllVectors();
165
+ return Object.values(all).filter(v => v.service === service);
166
+ }
167
+ /**
168
+ * Get vectors by category
169
+ */
170
+ getVectorsByCategory(category) {
171
+ const all = this.getAllVectors();
172
+ return Object.values(all).filter(v => v.category === category);
173
+ }
174
+ /**
175
+ * Get stealthy vectors
176
+ */
177
+ getStealthyVectors(minRating = 3) {
178
+ const all = this.getAllVectors();
179
+ return Object.values(all).filter(v => v.stealthRating >= minRating);
180
+ }
181
+ /**
182
+ * Analyze a persistence vector
183
+ */
184
+ analyzeVector(vectorId, targetProject) {
185
+ this.checkAuthorization();
186
+ const allVectors = this.getAllVectors();
187
+ if (!(vectorId in allVectors)) {
188
+ throw new Error(`Unknown vector: ${vectorId}`);
189
+ }
190
+ const vector = allVectors[vectorId];
191
+ if (!vector) {
192
+ throw new Error(`Unknown vector ID: ${vectorId}`);
193
+ }
194
+ const result = {
195
+ vector,
196
+ targetProject,
197
+ timestamp: Date.now(),
198
+ testable: true,
199
+ permissionsVerified: [],
200
+ missingPermissions: [],
201
+ detectionRisk: vector.stealthRating < 3 ? 'medium' : 'low',
202
+ notes: `Analysis for ${vector.name}`,
203
+ };
204
+ if (this.verbose) {
205
+ console.log(`[Google] Analyzing ${vector.name}`);
206
+ console.log(` Service: ${vector.service}`);
207
+ console.log(` Stealth: ${vector.stealthRating}/5`);
208
+ }
209
+ this.testResults.push(result);
210
+ return result;
211
+ }
212
+ /**
213
+ * Generate attack playbook
214
+ */
215
+ generateAttackPlaybook(targetProject, vectors) {
216
+ this.checkAuthorization();
217
+ const useVectors = vectors || Object.values(this.getAllVectors());
218
+ // Sort by stealth rating (stealthiest first)
219
+ const sorted = [...useVectors].sort((a, b) => b.stealthRating - a.stealthRating);
220
+ return {
221
+ target: targetProject,
222
+ generated: new Date().toISOString(),
223
+ authorization: {
224
+ scope: this.authorization.scope,
225
+ authorizedBy: this.authorization.authorizedBy,
226
+ },
227
+ vectors: sorted.map(v => ({
228
+ name: v.name,
229
+ service: v.service,
230
+ category: v.category,
231
+ stealthRating: v.stealthRating,
232
+ requiredPermissions: v.requiredPermissions,
233
+ detectionMethods: v.detectionMethods,
234
+ })),
235
+ recommendedOrder: sorted.map(v => v.name),
236
+ detectionCoverage: Array.from(new Set(sorted.flatMap(v => v.detectionMethods))),
237
+ };
238
+ }
239
+ /**
240
+ * Generate detection report (blue team)
241
+ */
242
+ generateDetectionReport() {
243
+ this.checkAuthorization();
244
+ const allVectors = this.getAllVectors();
245
+ const lines = [
246
+ '# Google Infrastructure Detection Guide',
247
+ '',
248
+ `Generated: ${new Date().toISOString()}`,
249
+ '',
250
+ '## Overview',
251
+ '',
252
+ `This guide covers ${Object.keys(allVectors).length} persistence vectors.`,
253
+ '',
254
+ '## Detection Methods',
255
+ '',
256
+ ];
257
+ // Group by detection method
258
+ const detectionMap = {};
259
+ for (const vector of Object.values(allVectors)) {
260
+ for (const method of vector.detectionMethods) {
261
+ if (!detectionMap[method]) {
262
+ detectionMap[method] = [];
263
+ }
264
+ detectionMap[method].push(vector.name);
265
+ }
266
+ }
267
+ for (const [method, vectorNames] of Object.entries(detectionMap).sort()) {
268
+ lines.push(`### ${method}`);
269
+ lines.push('');
270
+ lines.push('Detects:');
271
+ for (const name of vectorNames) {
272
+ lines.push(`- ${name}`);
273
+ }
274
+ lines.push('');
275
+ }
276
+ lines.push('## Vectors by Stealth Rating');
277
+ lines.push('');
278
+ for (let rating = 5; rating >= 1; rating--) {
279
+ const vectorsAtRating = Object.values(allVectors).filter(v => v.stealthRating === rating);
280
+ if (vectorsAtRating.length > 0) {
281
+ lines.push(`### Stealth ${rating}/5`);
282
+ for (const v of vectorsAtRating) {
283
+ lines.push(`- ${v.name} (${v.service})`);
284
+ }
285
+ lines.push('');
286
+ }
287
+ }
288
+ return lines.join('\n');
289
+ }
290
+ }
291
+ /**
292
+ * Create Google authorization
293
+ */
294
+ export function createGoogleAuthorization(engagementType, authorizedBy, targetProject = '*', scopeNotes = '') {
295
+ const scopeMap = {
296
+ bug_bounty: AuthorizationScope.BUG_BOUNTY,
297
+ pentest: AuthorizationScope.PENTEST_ENGAGEMENT,
298
+ red_team: AuthorizationScope.RED_TEAM,
299
+ owned: AuthorizationScope.OWNED_SYSTEMS,
300
+ };
301
+ return {
302
+ scope: scopeMap[engagementType] || AuthorizationScope.PENTEST_ENGAGEMENT,
303
+ targetDomain: `*.googleapis.com,${targetProject}.iam.gserviceaccount.com`,
304
+ authorizedBy,
305
+ authorizationDate: new Date().toISOString(),
306
+ scopeLimitations: [],
307
+ outOfScope: [],
308
+ notes: scopeNotes || `Google ${engagementType} engagement`,
309
+ };
310
+ }
311
+ //# sourceMappingURL=google.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.js","sourceRoot":"","sources":["../../../src/alpha-zero/security/google.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAuB,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAN,IAAY,aAkBX;AAlBD,WAAY,aAAa;IACvB,wBAAwB;IACxB,mDAAkC,CAAA;IAClC,kDAAiC,CAAA;IACjC,4DAA2C,CAAA;IAC3C,oCAAmB,CAAA;IACnB,8DAA6C,CAAA;IAC7C,wDAAuC,CAAA;IACvC,4DAA2C,CAAA;IAE3C,mBAAmB;IACnB,oDAAmC,CAAA;IACnC,oDAAmC,CAAA;IACnC,oDAAmC,CAAA;IACnC,gEAA+C,CAAA;IAE/C,kBAAkB;IAClB,8CAA6B,CAAA;AAC/B,CAAC,EAlBW,aAAa,KAAb,aAAa,QAk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B,CAAC,QAAQ;QACrC,KAAK,EAAE,kBAAkB,CAAC,aAAa;KACxC,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,IAAI,kBAAkB,CAAC,kBAAkB;QACxE,YAAY,EAAE,oBAAoB,aAAa,0BAA0B;QACzE,YAAY;QACZ,iBAAiB,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QAC3C,gBAAgB,EAAE,EAAE;QACpB,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,UAAU,IAAI,UAAU,cAAc,aAAa;KAC3D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Google Security Module Loader
3
+ *
4
+ * Provides lazy loading for the optional Google security research module.
5
+ *
6
+ * Principal Investigator: Bo Shang
7
+ * Framework: erosolar-cli
8
+ */
9
+ /**
10
+ * Check if Google security research module is available
11
+ */
12
+ export declare function isGoogleEnabled(): boolean;
13
+ /**
14
+ * Get the Google security research module (lazy load)
15
+ */
16
+ export declare function getGoogleModule(): Promise<typeof import("./google.js")>;
17
+ //# sourceMappingURL=googleLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googleLoader.d.ts","sourceRoot":"","sources":["../../../src/alpha-zero/security/googleLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAWzC;AAED;;GAEG;AACH,wBAAsB,eAAe,0CAYpC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Google Security Module Loader
3
+ *
4
+ * Provides lazy loading for the optional Google security research module.
5
+ *
6
+ * Principal Investigator: Bo Shang
7
+ * Framework: erosolar-cli
8
+ */
9
+ let googleModule = null;
10
+ /**
11
+ * Check if Google security research module is available
12
+ */
13
+ export function isGoogleEnabled() {
14
+ if (googleModule !== null) {
15
+ return true;
16
+ }
17
+ try {
18
+ // Dynamic import check would go here
19
+ // For now, return true since we're creating the module
20
+ return true;
21
+ }
22
+ catch {
23
+ return false;
24
+ }
25
+ }
26
+ /**
27
+ * Get the Google security research module (lazy load)
28
+ */
29
+ export async function getGoogleModule() {
30
+ if (googleModule === null) {
31
+ try {
32
+ googleModule = await import('./google.js');
33
+ }
34
+ catch (error) {
35
+ throw new Error('Google security research module not available. ' +
36
+ 'Ensure google.ts is built and available.');
37
+ }
38
+ }
39
+ return googleModule;
40
+ }
41
+ //# sourceMappingURL=googleLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googleLoader.js","sourceRoot":"","sources":["../../../src/alpha-zero/security/googleLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,IAAI,YAAY,GAAwC,IAAI,CAAC;AAE7D;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,qCAAqC;QACrC,uDAAuD;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,YAAY,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,iDAAiD;gBACjD,0CAA0C,CAC3C,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Security Research Module for Alpha Zero 2
3
+ *
4
+ * OPTIONAL MODULE - Only loaded when security research is enabled.
5
+ *
6
+ * A modular security research framework with optional provider-specific extensions.
7
+ * All capabilities require explicit authorization.
8
+ *
9
+ * LEGAL NOTICE:
10
+ * These tools are intended for:
11
+ * - Authorized penetration testing engagements
12
+ * - Bug bounty programs with explicit scope
13
+ * - CTF competitions and security training
14
+ * - Red team exercises with written authorization
15
+ * - Security research on systems you own or have permission to test
16
+ *
17
+ * Structure:
18
+ * - core: Base authorization and reconnaissance (always available)
19
+ * - simulation: Attack simulation framework (always available)
20
+ * - google: Google Cloud/Workspace persistence research (optional)
21
+ *
22
+ * Principal Investigator: Bo Shang
23
+ * Framework: erosolar-cli
24
+ */
25
+ export { AuthorizationScope, type AuthorizationRecord, type ReconResult, type VulnerabilityFinding, SecurityResearchEngine, createBugBountyAuthorization, createPentestAuthorization, createCtfAuthorization, } from './core.js';
26
+ export { AttackCategory, AttackPhase, type AttackVector, type AttackSimulationResult, AttackSimulator, PayloadGenerator, ATTACK_VECTORS, } from './simulation.js';
27
+ export { isGoogleEnabled, getGoogleModule } from './googleLoader.js';
28
+ export declare const SECURITY_VERSION = "1.0.0";
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/alpha-zero/security/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,cAAc,EACd,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAErE,eAAO,MAAM,gBAAgB,UAAU,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Security Research Module for Alpha Zero 2
3
+ *
4
+ * OPTIONAL MODULE - Only loaded when security research is enabled.
5
+ *
6
+ * A modular security research framework with optional provider-specific extensions.
7
+ * All capabilities require explicit authorization.
8
+ *
9
+ * LEGAL NOTICE:
10
+ * These tools are intended for:
11
+ * - Authorized penetration testing engagements
12
+ * - Bug bounty programs with explicit scope
13
+ * - CTF competitions and security training
14
+ * - Red team exercises with written authorization
15
+ * - Security research on systems you own or have permission to test
16
+ *
17
+ * Structure:
18
+ * - core: Base authorization and reconnaissance (always available)
19
+ * - simulation: Attack simulation framework (always available)
20
+ * - google: Google Cloud/Workspace persistence research (optional)
21
+ *
22
+ * Principal Investigator: Bo Shang
23
+ * Framework: erosolar-cli
24
+ */
25
+ // Re-export core security components
26
+ export { AuthorizationScope, SecurityResearchEngine, createBugBountyAuthorization, createPentestAuthorization, createCtfAuthorization, } from './core.js';
27
+ // Re-export simulation components
28
+ export { AttackCategory, AttackPhase, AttackSimulator, PayloadGenerator, ATTACK_VECTORS, } from './simulation.js';
29
+ // Google module is optional - export checker function
30
+ export { isGoogleEnabled, getGoogleModule } from './googleLoader.js';
31
+ export const SECURITY_VERSION = '1.0.0';
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alpha-zero/security/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,qCAAqC;AACrC,OAAO,EACL,kBAAkB,EAIlB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAEnB,kCAAkC;AAClC,OAAO,EACL,cAAc,EACd,WAAW,EAGX,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,sDAAsD;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAErE,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Attack Simulation Framework
3
+ *
4
+ * Provides controlled attack simulations for red team exercises.
5
+ * All simulations require explicit authorization.
6
+ *
7
+ * Principal Investigator: Bo Shang
8
+ * Framework: erosolar-cli
9
+ */
10
+ import { AuthorizationRecord } from './core.js';
11
+ /**
12
+ * Categories of attack simulations
13
+ */
14
+ export declare enum AttackCategory {
15
+ RECONNAISSANCE = "reconnaissance",
16
+ WEB_APPLICATION = "web_application",
17
+ AUTHENTICATION = "authentication",
18
+ INJECTION = "injection",
19
+ MISCONFIGURATION = "misconfiguration",
20
+ PRIVILEGE_ESCALATION = "privilege_escalation",
21
+ DATA_EXFILTRATION = "data_exfiltration"
22
+ }
23
+ /**
24
+ * MITRE ATT&CK inspired attack phases
25
+ */
26
+ export declare enum AttackPhase {
27
+ INITIAL_ACCESS = "initial_access",
28
+ EXECUTION = "execution",
29
+ PERSISTENCE = "persistence",
30
+ PRIVILEGE_ESCALATION = "privilege_escalation",
31
+ DEFENSE_EVASION = "defense_evasion",
32
+ CREDENTIAL_ACCESS = "credential_access",
33
+ DISCOVERY = "discovery",
34
+ LATERAL_MOVEMENT = "lateral_movement",
35
+ COLLECTION = "collection",
36
+ EXFILTRATION = "exfiltration",
37
+ IMPACT = "impact"
38
+ }
39
+ /**
40
+ * Attack vector definition
41
+ */
42
+ export interface AttackVector {
43
+ name: string;
44
+ category: AttackCategory;
45
+ phase: AttackPhase;
46
+ description: string;
47
+ techniqueId: string;
48
+ prerequisites: string[];
49
+ detectionMethods: string[];
50
+ mitigations: string[];
51
+ }
52
+ /**
53
+ * Attack simulation result
54
+ */
55
+ export interface AttackSimulationResult {
56
+ vector: AttackVector;
57
+ target: string;
58
+ timestamp: number;
59
+ success: boolean;
60
+ evidence: string[];
61
+ artifacts: Record<string, unknown>;
62
+ detectionTriggered: boolean;
63
+ durationMs: number;
64
+ notes: string;
65
+ }
66
+ /**
67
+ * Common attack vectors based on OWASP Top 10 and MITRE ATT&CK
68
+ */
69
+ export declare const ATTACK_VECTORS: Record<string, AttackVector>;
70
+ /**
71
+ * Payload generator for security testing
72
+ */
73
+ export declare class PayloadGenerator {
74
+ /**
75
+ * Generate SQL injection test payloads
76
+ */
77
+ static sqlInjectionPayloads(): string[];
78
+ /**
79
+ * Generate XSS test payloads
80
+ */
81
+ static xssPayloads(): string[];
82
+ /**
83
+ * Generate path traversal test payloads
84
+ */
85
+ static pathTraversalPayloads(): string[];
86
+ /**
87
+ * Encode payload
88
+ */
89
+ static encodePayload(payload: string, encoding: 'base64' | 'url' | 'hex' | 'none'): string;
90
+ }
91
+ /**
92
+ * Attack simulator
93
+ */
94
+ export declare class AttackSimulator {
95
+ private authorization;
96
+ private verbose;
97
+ results: AttackSimulationResult[];
98
+ constructor(authorization: AuthorizationRecord, verbose?: boolean);
99
+ /**
100
+ * Check authorization
101
+ */
102
+ private checkAuthorization;
103
+ /**
104
+ * Simulate an attack vector
105
+ */
106
+ simulateAttack(target: string, vectorId: string, dryRun?: boolean): Promise<AttackSimulationResult>;
107
+ /**
108
+ * Get payloads for a vector
109
+ */
110
+ private getPayloadsForVector;
111
+ /**
112
+ * Get vectors by category
113
+ */
114
+ getVectorsByCategory(category: AttackCategory): AttackVector[];
115
+ /**
116
+ * Get vectors by phase
117
+ */
118
+ getVectorsByPhase(phase: AttackPhase): AttackVector[];
119
+ /**
120
+ * Generate report
121
+ */
122
+ generateReport(): string;
123
+ }
124
+ //# sourceMappingURL=simulation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulation.d.ts","sourceRoot":"","sources":["../../../src/alpha-zero/security/simulation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,mBAAmB,EAAsB,MAAM,WAAW,CAAC;AAEpE;;GAEG;AACH,oBAAY,cAAc;IACxB,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,SAAS,cAAc;IACvB,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAA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