erosolar-cli 1.7.55 → 1.7.57

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 (273) hide show
  1. package/dist/shell/unifiedInputProcessor.d.ts +15 -12
  2. package/dist/shell/unifiedInputProcessor.d.ts.map +1 -1
  3. package/dist/shell/unifiedInputProcessor.js +45 -72
  4. package/dist/shell/unifiedInputProcessor.js.map +1 -1
  5. package/package.json +4 -4
  6. package/dist/active-stack-security.d.ts +0 -110
  7. package/dist/active-stack-security.js +0 -313
  8. package/dist/active-stack-security.js.map +0 -1
  9. package/dist/advanced-targeting.d.ts +0 -113
  10. package/dist/advanced-targeting.js +0 -252
  11. package/dist/advanced-targeting.js.map +0 -1
  12. package/dist/bin/adapters/node/index.js +0 -33
  13. package/dist/bin/adapters/types.js +0 -1
  14. package/dist/bin/alpha-zero/agentWrapper.js +0 -165
  15. package/dist/bin/alpha-zero/codeEvaluator.js +0 -272
  16. package/dist/bin/alpha-zero/competitiveRunner.js +0 -219
  17. package/dist/bin/alpha-zero/index.js +0 -98
  18. package/dist/bin/alpha-zero/introspection.js +0 -298
  19. package/dist/bin/alpha-zero/metricsTracker.js +0 -207
  20. package/dist/bin/alpha-zero/security/core.js +0 -269
  21. package/dist/bin/alpha-zero/security/google.js +0 -308
  22. package/dist/bin/alpha-zero/security/googleLoader.js +0 -40
  23. package/dist/bin/alpha-zero/security/index.js +0 -31
  24. package/dist/bin/alpha-zero/security/simulation.js +0 -274
  25. package/dist/bin/alpha-zero/selfModification.js +0 -231
  26. package/dist/bin/alpha-zero/types.js +0 -30
  27. package/dist/bin/bin/erosolar-optimized.js +0 -205
  28. package/dist/bin/capabilities/agentSpawningCapability.js +0 -116
  29. package/dist/bin/capabilities/bashCapability.js +0 -22
  30. package/dist/bin/capabilities/cloudCapability.js +0 -36
  31. package/dist/bin/capabilities/codeAnalysisCapability.js +0 -22
  32. package/dist/bin/capabilities/codeQualityCapability.js +0 -23
  33. package/dist/bin/capabilities/dependencySecurityCapability.js +0 -22
  34. package/dist/bin/capabilities/devCapability.js +0 -22
  35. package/dist/bin/capabilities/editCapability.js +0 -28
  36. package/dist/bin/capabilities/emailCapability.js +0 -20
  37. package/dist/bin/capabilities/enhancedGitCapability.js +0 -221
  38. package/dist/bin/capabilities/filesystemCapability.js +0 -22
  39. package/dist/bin/capabilities/globCapability.js +0 -28
  40. package/dist/bin/capabilities/interactionCapability.js +0 -20
  41. package/dist/bin/capabilities/learnCapability.js +0 -22
  42. package/dist/bin/capabilities/mcpCapability.js +0 -20
  43. package/dist/bin/capabilities/notebookCapability.js +0 -28
  44. package/dist/bin/capabilities/planningCapability.js +0 -27
  45. package/dist/bin/capabilities/refactoringCapability.js +0 -23
  46. package/dist/bin/capabilities/repoChecksCapability.js +0 -22
  47. package/dist/bin/capabilities/searchCapability.js +0 -22
  48. package/dist/bin/capabilities/skillCapability.js +0 -76
  49. package/dist/bin/capabilities/taskManagementCapability.js +0 -20
  50. package/dist/bin/capabilities/testingCapability.js +0 -23
  51. package/dist/bin/capabilities/toolManifest.js +0 -159
  52. package/dist/bin/capabilities/toolRegistry.js +0 -114
  53. package/dist/bin/capabilities/webCapability.js +0 -20
  54. package/dist/bin/config.js +0 -139
  55. package/dist/bin/contracts/v1/agent.js +0 -7
  56. package/dist/bin/contracts/v1/agentProfileManifest.js +0 -8
  57. package/dist/bin/contracts/v1/agentRules.js +0 -9
  58. package/dist/bin/contracts/v1/toolAccess.js +0 -8
  59. package/dist/bin/erosolar-optimized.d.ts +0 -12
  60. package/dist/bin/erosolar-optimized.d.ts.map +0 -1
  61. package/dist/bin/erosolar-optimized.js +0 -239
  62. package/dist/bin/erosolar-optimized.js.map +0 -1
  63. package/dist/bin/headless/headlessApp.js +0 -172
  64. package/dist/bin/mcp/config.js +0 -202
  65. package/dist/bin/mcp/stdioClient.js +0 -172
  66. package/dist/bin/mcp/toolBridge.js +0 -104
  67. package/dist/bin/mcp/types.js +0 -1
  68. package/dist/bin/plugins/index.js +0 -113
  69. package/dist/bin/plugins/providers/anthropic/index.js +0 -25
  70. package/dist/bin/plugins/providers/deepseek/index.js +0 -24
  71. package/dist/bin/plugins/providers/google/index.js +0 -26
  72. package/dist/bin/plugins/providers/index.js +0 -19
  73. package/dist/bin/plugins/providers/ollama/index.js +0 -59
  74. package/dist/bin/plugins/providers/openai/index.js +0 -26
  75. package/dist/bin/plugins/providers/xai/index.js +0 -24
  76. package/dist/bin/plugins/tools/agentSpawning/agentSpawningPlugin.js +0 -8
  77. package/dist/bin/plugins/tools/bash/localBashPlugin.js +0 -13
  78. package/dist/bin/plugins/tools/checks/localRepoChecksPlugin.js +0 -13
  79. package/dist/bin/plugins/tools/cloud/cloudPlugin.js +0 -13
  80. package/dist/bin/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +0 -13
  81. package/dist/bin/plugins/tools/codeQuality/codeQualityPlugin.js +0 -13
  82. package/dist/bin/plugins/tools/dependency/dependencyPlugin.js +0 -11
  83. package/dist/bin/plugins/tools/development/devPlugin.js +0 -13
  84. package/dist/bin/plugins/tools/edit/editPlugin.js +0 -14
  85. package/dist/bin/plugins/tools/email/emailPlugin.js +0 -11
  86. package/dist/bin/plugins/tools/enhancedGit/enhancedGitPlugin.js +0 -8
  87. package/dist/bin/plugins/tools/filesystem/localFilesystemPlugin.js +0 -13
  88. package/dist/bin/plugins/tools/glob/globPlugin.js +0 -14
  89. package/dist/bin/plugins/tools/index.js +0 -2
  90. package/dist/bin/plugins/tools/interaction/interactionPlugin.js +0 -11
  91. package/dist/bin/plugins/tools/learn/learnPlugin.js +0 -13
  92. package/dist/bin/plugins/tools/mcp/mcpPlugin.js +0 -8
  93. package/dist/bin/plugins/tools/nodeDefaults.js +0 -56
  94. package/dist/bin/plugins/tools/notebook/notebookPlugin.js +0 -14
  95. package/dist/bin/plugins/tools/planning/planningPlugin.js +0 -14
  96. package/dist/bin/plugins/tools/refactoring/refactoringPlugin.js +0 -11
  97. package/dist/bin/plugins/tools/registry.js +0 -57
  98. package/dist/bin/plugins/tools/search/localSearchPlugin.js +0 -13
  99. package/dist/bin/plugins/tools/skills/skillPlugin.js +0 -8
  100. package/dist/bin/plugins/tools/taskManagement/taskManagementPlugin.js +0 -11
  101. package/dist/bin/plugins/tools/testing/testingPlugin.js +0 -11
  102. package/dist/bin/plugins/tools/web/webPlugin.js +0 -11
  103. package/dist/bin/providers/anthropicProvider.js +0 -329
  104. package/dist/bin/providers/googleProvider.js +0 -203
  105. package/dist/bin/providers/openaiChatCompletionsProvider.js +0 -208
  106. package/dist/bin/providers/openaiResponsesProvider.js +0 -249
  107. package/dist/bin/providers/providerFactory.js +0 -24
  108. package/dist/bin/runtime/agentController.js +0 -321
  109. package/dist/bin/runtime/agentHost.js +0 -153
  110. package/dist/bin/runtime/agentSession.js +0 -195
  111. package/dist/bin/runtime/node.js +0 -10
  112. package/dist/bin/runtime/universal.js +0 -28
  113. package/dist/bin/skills/skillRepository.js +0 -236
  114. package/dist/bin/skills/types.js +0 -1
  115. package/dist/bin/subagents/taskRunner.js +0 -269
  116. package/dist/bin/tools/backgroundBashTools.js +0 -211
  117. package/dist/bin/tools/bashTools.js +0 -159
  118. package/dist/bin/tools/cloudTools.js +0 -864
  119. package/dist/bin/tools/codeAnalysisTools.js +0 -641
  120. package/dist/bin/tools/codeQualityTools.js +0 -294
  121. package/dist/bin/tools/dependencyTools.js +0 -282
  122. package/dist/bin/tools/devTools.js +0 -238
  123. package/dist/bin/tools/diffUtils.js +0 -137
  124. package/dist/bin/tools/editTools.js +0 -134
  125. package/dist/bin/tools/emailTools.js +0 -448
  126. package/dist/bin/tools/fileTools.js +0 -282
  127. package/dist/bin/tools/globTools.js +0 -173
  128. package/dist/bin/tools/grepTools.js +0 -332
  129. package/dist/bin/tools/interactionTools.js +0 -170
  130. package/dist/bin/tools/learnTools.js +0 -1818
  131. package/dist/bin/tools/notebookEditTools.js +0 -196
  132. package/dist/bin/tools/planningTools.js +0 -46
  133. package/dist/bin/tools/refactoringTools.js +0 -293
  134. package/dist/bin/tools/repoChecksTools.js +0 -160
  135. package/dist/bin/tools/searchTools.js +0 -206
  136. package/dist/bin/tools/skillTools.js +0 -177
  137. package/dist/bin/tools/taskManagementTools.js +0 -156
  138. package/dist/bin/tools/testingTools.js +0 -232
  139. package/dist/bin/tools/webTools.js +0 -480
  140. package/dist/bin/workspace.js +0 -106
  141. package/dist/bin/workspace.validator.js +0 -213
  142. package/dist/capabilities/offensiveSecurityCapability.d.ts +0 -26
  143. package/dist/capabilities/offensiveSecurityCapability.d.ts.map +0 -1
  144. package/dist/capabilities/offensiveSecurityCapability.js +0 -58
  145. package/dist/capabilities/offensiveSecurityCapability.js.map +0 -1
  146. package/dist/capabilities/realSecurityCapability.d.ts +0 -26
  147. package/dist/capabilities/realSecurityCapability.d.ts.map +0 -1
  148. package/dist/capabilities/realSecurityCapability.js +0 -53
  149. package/dist/capabilities/realSecurityCapability.js.map +0 -1
  150. package/dist/capabilities/securityCapability.d.ts +0 -32
  151. package/dist/capabilities/securityCapability.d.ts.map +0 -1
  152. package/dist/capabilities/securityCapability.js +0 -57
  153. package/dist/capabilities/securityCapability.js.map +0 -1
  154. package/dist/capabilities/ultimateSecurityCapability.d.ts +0 -42
  155. package/dist/capabilities/ultimateSecurityCapability.d.ts.map +0 -1
  156. package/dist/capabilities/ultimateSecurityCapability.js +0 -96
  157. package/dist/capabilities/ultimateSecurityCapability.js.map +0 -1
  158. package/dist/core/designThoughtCheck.d.ts +0 -196
  159. package/dist/core/designThoughtCheck.d.ts.map +0 -1
  160. package/dist/core/designThoughtCheck.js +0 -287
  161. package/dist/core/designThoughtCheck.js.map +0 -1
  162. package/dist/core/designThoughtCheckEngine.d.ts +0 -58
  163. package/dist/core/designThoughtCheckEngine.d.ts.map +0 -1
  164. package/dist/core/designThoughtCheckEngine.js +0 -358
  165. package/dist/core/designThoughtCheckEngine.js.map +0 -1
  166. package/dist/core/designThoughtCheckIntegration.d.ts +0 -103
  167. package/dist/core/designThoughtCheckIntegration.d.ts.map +0 -1
  168. package/dist/core/designThoughtCheckIntegration.js +0 -207
  169. package/dist/core/designThoughtCheckIntegration.js.map +0 -1
  170. package/dist/core/intelligenceTools.d.ts +0 -19
  171. package/dist/core/intelligenceTools.d.ts.map +0 -1
  172. package/dist/core/intelligenceTools.js +0 -453
  173. package/dist/core/intelligenceTools.js.map +0 -1
  174. package/dist/core/operationalTools.d.ts +0 -19
  175. package/dist/core/operationalTools.d.ts.map +0 -1
  176. package/dist/core/operationalTools.js +0 -467
  177. package/dist/core/operationalTools.js.map +0 -1
  178. package/dist/offensive/core/offensive-engine.d.ts +0 -171
  179. package/dist/offensive/core/offensive-engine.d.ts.map +0 -1
  180. package/dist/offensive/core/offensive-engine.js +0 -345
  181. package/dist/offensive/core/offensive-engine.js.map +0 -1
  182. package/dist/offensive/core/offensive-integration.d.ts +0 -129
  183. package/dist/offensive/core/offensive-integration.d.ts.map +0 -1
  184. package/dist/offensive/core/offensive-integration.js +0 -364
  185. package/dist/offensive/core/offensive-integration.js.map +0 -1
  186. package/dist/offensive/core/offensive-tools.d.ts +0 -55
  187. package/dist/offensive/core/offensive-tools.d.ts.map +0 -1
  188. package/dist/offensive/core/offensive-tools.js +0 -438
  189. package/dist/offensive/core/offensive-tools.js.map +0 -1
  190. package/dist/offensive/offensive-cli.d.ts +0 -48
  191. package/dist/offensive/offensive-cli.d.ts.map +0 -1
  192. package/dist/offensive/offensive-cli.js +0 -233
  193. package/dist/offensive/offensive-cli.js.map +0 -1
  194. package/dist/security/apt-simulation-cli.d.ts +0 -57
  195. package/dist/security/apt-simulation-cli.d.ts.map +0 -1
  196. package/dist/security/apt-simulation-cli.js +0 -278
  197. package/dist/security/apt-simulation-cli.js.map +0 -1
  198. package/dist/security/apt-simulation-engine-complete.d.ts +0 -97
  199. package/dist/security/apt-simulation-engine-complete.d.ts.map +0 -1
  200. package/dist/security/apt-simulation-engine-complete.js +0 -441
  201. package/dist/security/apt-simulation-engine-complete.js.map +0 -1
  202. package/dist/security/apt-simulation-engine.d.ts +0 -97
  203. package/dist/security/apt-simulation-engine.d.ts.map +0 -1
  204. package/dist/security/apt-simulation-engine.js +0 -441
  205. package/dist/security/apt-simulation-engine.js.map +0 -1
  206. package/dist/security/authorization.d.ts +0 -45
  207. package/dist/security/authorization.d.ts.map +0 -1
  208. package/dist/security/authorization.js +0 -128
  209. package/dist/security/authorization.js.map +0 -1
  210. package/dist/security/comprehensive-security-research.d.ts +0 -84
  211. package/dist/security/comprehensive-security-research.d.ts.map +0 -1
  212. package/dist/security/comprehensive-security-research.js +0 -211
  213. package/dist/security/comprehensive-security-research.js.map +0 -1
  214. package/dist/security/offensive/exploitationEngine.d.ts +0 -54
  215. package/dist/security/offensive/exploitationEngine.d.ts.map +0 -1
  216. package/dist/security/offensive/exploitationEngine.js +0 -263
  217. package/dist/security/offensive/exploitationEngine.js.map +0 -1
  218. package/dist/security/real/networkExploitation.d.ts +0 -92
  219. package/dist/security/real/networkExploitation.d.ts.map +0 -1
  220. package/dist/security/real/networkExploitation.js +0 -316
  221. package/dist/security/real/networkExploitation.js.map +0 -1
  222. package/dist/security/real/persistenceImplementation.d.ts +0 -62
  223. package/dist/security/real/persistenceImplementation.d.ts.map +0 -1
  224. package/dist/security/real/persistenceImplementation.js +0 -323
  225. package/dist/security/real/persistenceImplementation.js.map +0 -1
  226. package/dist/security/real/vulnerabilityScanner.d.ts +0 -73
  227. package/dist/security/real/vulnerabilityScanner.d.ts.map +0 -1
  228. package/dist/security/real/vulnerabilityScanner.js +0 -341
  229. package/dist/security/real/vulnerabilityScanner.js.map +0 -1
  230. package/dist/shell/capturePastePatch.d.ts +0 -9
  231. package/dist/shell/capturePastePatch.d.ts.map +0 -1
  232. package/dist/shell/capturePastePatch.js +0 -98
  233. package/dist/shell/capturePastePatch.js.map +0 -1
  234. package/dist/shell/enhancedInteractiveShell.d.ts +0 -90
  235. package/dist/shell/enhancedInteractiveShell.d.ts.map +0 -1
  236. package/dist/shell/enhancedInteractiveShell.js +0 -248
  237. package/dist/shell/enhancedInteractiveShell.js.map +0 -1
  238. package/dist/shell/inputProcessor.d.ts +0 -56
  239. package/dist/shell/inputProcessor.d.ts.map +0 -1
  240. package/dist/shell/inputProcessor.js +0 -172
  241. package/dist/shell/inputProcessor.js.map +0 -1
  242. package/dist/shell/interactiveShell-patch.d.ts +0 -27
  243. package/dist/shell/interactiveShell-patch.d.ts.map +0 -1
  244. package/dist/shell/interactiveShell-patch.js +0 -38
  245. package/dist/shell/interactiveShell-patch.js.map +0 -1
  246. package/dist/shell/interactiveShell-robust.d.ts +0 -26
  247. package/dist/shell/interactiveShell-robust.d.ts.map +0 -1
  248. package/dist/shell/interactiveShell-robust.js +0 -34
  249. package/dist/shell/interactiveShell-robust.js.map +0 -1
  250. package/dist/shell/multiLinePasteManager.d.ts +0 -106
  251. package/dist/shell/multiLinePasteManager.d.ts.map +0 -1
  252. package/dist/shell/multiLinePasteManager.js +0 -308
  253. package/dist/shell/multiLinePasteManager.js.map +0 -1
  254. package/dist/shell/processInputBlockPatch.d.ts +0 -8
  255. package/dist/shell/processInputBlockPatch.d.ts.map +0 -1
  256. package/dist/shell/processInputBlockPatch.js +0 -133
  257. package/dist/shell/processInputBlockPatch.js.map +0 -1
  258. package/dist/tools/enhancedSecurityTools.d.ts +0 -19
  259. package/dist/tools/enhancedSecurityTools.d.ts.map +0 -1
  260. package/dist/tools/enhancedSecurityTools.js +0 -215
  261. package/dist/tools/enhancedSecurityTools.js.map +0 -1
  262. package/dist/tools/offensiveSecurityTools.d.ts +0 -16
  263. package/dist/tools/offensiveSecurityTools.d.ts.map +0 -1
  264. package/dist/tools/offensiveSecurityTools.js +0 -285
  265. package/dist/tools/offensiveSecurityTools.js.map +0 -1
  266. package/dist/tools/realSecurityTools.d.ts +0 -18
  267. package/dist/tools/realSecurityTools.d.ts.map +0 -1
  268. package/dist/tools/realSecurityTools.js +0 -468
  269. package/dist/tools/realSecurityTools.js.map +0 -1
  270. package/dist/tools/securityTools.d.ts +0 -20
  271. package/dist/tools/securityTools.d.ts.map +0 -1
  272. package/dist/tools/securityTools.js +0 -449
  273. package/dist/tools/securityTools.js.map +0 -1
@@ -1,341 +0,0 @@
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
@@ -1 +0,0 @@
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,e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;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"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Patch for capturePaste method to use robust input processing
3
- */
4
- import { RobustInputProcessor } from './inputProcessor.js';
5
- export declare function createRobustCapturePaste(inputProcessor: RobustInputProcessor): (this: any, content: string, lineCount: number) => void;
6
- export declare function handleInlinePaste(this: any, content: string, processed: any): void;
7
- export declare function handleBlockPaste(this: any, content: string, processed: any): void;
8
- export declare function handlePasteChip(this: any, content: string, processed: any): void;
9
- //# sourceMappingURL=capturePastePatch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capturePastePatch.d.ts","sourceRoot":"","sources":["../../src/shell/capturePastePatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,oBAAoB,IAC9C,MAAM,GAAG,EAAE,SAAS,MAAM,EAAE,WAAW,MAAM,KAAG,IAAI,CAqClF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CA2BlF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAyBjF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAyBhF"}
@@ -1,98 +0,0 @@
1
- /**
2
- * Patch for capturePaste method to use robust input processing
3
- */
4
- export function createRobustCapturePaste(inputProcessor) {
5
- return function capturePaste(content, lineCount) {
6
- this.resetBufferedInputLines();
7
- // Use robust input processor to determine best display format
8
- const processed = inputProcessor.processInput(content);
9
- // Check for initialization warnings and extract clean content
10
- const { content: cleanContent, hadWarning } = inputProcessor.extractContentFromWarning(content);
11
- if (hadWarning) {
12
- // Handle initialization warnings gracefully
13
- this.display.showInfo('Initialization complete. Processing input...');
14
- }
15
- // Validate input for common issues
16
- const validation = inputProcessor.validateInput(cleanContent);
17
- if (!validation.isValid) {
18
- this.display.showWarning(`Input validation issues: ${validation.issues.join(', ')}`);
19
- this.rl.prompt();
20
- return;
21
- }
22
- // Handle different display formats
23
- switch (processed.displayFormat) {
24
- case 'inline':
25
- this.handleInlinePaste(cleanContent, processed);
26
- break;
27
- case 'block':
28
- this.handleBlockPaste(cleanContent, processed);
29
- break;
30
- case 'paste-chip':
31
- this.handlePasteChip(cleanContent, processed);
32
- break;
33
- }
34
- };
35
- }
36
- export function handleInlinePaste(content, processed) {
37
- const displayContent = processed.lineCount === 1
38
- ? content
39
- : content.replace(/\n/g, ' ↵ '); // Visual newline indicator
40
- // Clear any echoed content first
41
- this.output.write('\r\x1b[K');
42
- // Get current readline content and append paste
43
- const currentLine = this.rl.line || '';
44
- const cursorPos = this.rl.cursor || 0;
45
- // Insert paste at cursor position
46
- const before = currentLine.slice(0, cursorPos);
47
- const after = currentLine.slice(cursorPos);
48
- const newLine = before + displayContent + after;
49
- const newCursor = cursorPos + displayContent.length;
50
- // Update readline buffer - write directly without storing in composableMessage
51
- this.rl.write(null, { ctrl: true, name: 'u' }); // Clear line
52
- this.rl.write(newLine); // Write new content
53
- // Update persistent prompt display
54
- this.persistentPrompt.updateInput(newLine, newCursor);
55
- // Re-prompt to show the inline content
56
- this.rl.prompt(true);
57
- }
58
- export function handleBlockPaste(content, processed) {
59
- // For block format, store as composable block
60
- this.composableMessage.addPaste(content);
61
- // Clear remaining echoed lines from terminal
62
- this.output.write('\r\x1b[K');
63
- // Build the paste chips to show inline with prompt
64
- const pasteChips = this.composableMessage.formatPasteChips();
65
- // Update status bar with instructions
66
- this.persistentPrompt.updateStatusBar({
67
- message: 'Paste more, type text, or press Enter to send (/cancel to discard)',
68
- });
69
- // Set the prompt to show paste chips, then position cursor after them
70
- this.persistentPrompt.updateInput(pasteChips + ' ', pasteChips.length + 1);
71
- // Update readline's line buffer to include the chips as prefix
72
- if (this.rl.line !== undefined) {
73
- this.rl.line = pasteChips + ' ';
74
- this.rl.cursor = pasteChips.length + 1;
75
- }
76
- this.rl.prompt(true); // preserveCursor=true to keep position after chips
77
- }
78
- export function handlePasteChip(content, processed) {
79
- // For very long content, use paste-chip format with summary
80
- this.composableMessage.addPaste(content);
81
- // Clear remaining echoed lines from terminal
82
- this.output.write('\r\x1b[K');
83
- // Use the summary from the input processor
84
- const pasteChips = processed.summary || this.composableMessage.formatPasteChips();
85
- // Update status bar with instructions
86
- this.persistentPrompt.updateStatusBar({
87
- message: 'Large paste detected. Press Enter to send or /cancel to discard',
88
- });
89
- // Set the prompt to show paste chips
90
- this.persistentPrompt.updateInput(pasteChips + ' ', pasteChips.length + 1);
91
- // Update readline's line buffer
92
- if (this.rl.line !== undefined) {
93
- this.rl.line = pasteChips + ' ';
94
- this.rl.cursor = pasteChips.length + 1;
95
- }
96
- this.rl.prompt(true);
97
- }
98
- //# sourceMappingURL=capturePastePatch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capturePastePatch.js","sourceRoot":"","sources":["../../src/shell/capturePastePatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,UAAU,wBAAwB,CAAC,cAAoC;IAC3E,OAAO,SAAS,YAAY,CAAY,OAAe,EAAE,SAAiB;QACxE,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAE/B,8DAA8D;QAC9D,MAAM,SAAS,GAAG,cAAc,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAEvD,8DAA8D;QAC9D,MAAM,EAAE,OAAO,EA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AM,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
@@ -1,90 +0,0 @@
1
- /**
2
- * EnhancedInteractiveShell - Improved shell with better multi-line paste UX
3
- *
4
- * Features:
5
- * - Short block descriptions for pastes: "[Pasted: 15 lines]"
6
- * - Full content sent to AI on Enter
7
- * - Visual feedback during paste operations
8
- * - Graceful handling of large pastes
9
- */
10
- import { MultiLinePasteManager } from './multiLinePasteManager.js';
11
- import { ComposableMessageBuilder } from './composableMessage.js';
12
- export declare class EnhancedInteractiveShell {
13
- private rl;
14
- private pasteManager;
15
- private messageBuilder;
16
- private bracketedPasteEnabled;
17
- private currentPrompt;
18
- private onInputCallback;
19
- private onExitCallback;
20
- constructor();
21
- /**
22
- * Set up event handlers for the readline interface
23
- */
24
- private setupEventHandlers;
25
- /**
26
- * Handle raw input for paste detection
27
- */
28
- private handleRawInput;
29
- /**
30
- * Handle line input (Enter key)
31
- */
32
- private handleLineInput;
33
- /**
34
- * Show preview of current paste operation
35
- */
36
- private showPastePreview;
37
- /**
38
- * Clear paste preview
39
- */
40
- private clearPastePreview;
41
- /**
42
- * Show current message state (text + paste blocks)
43
- */
44
- private showCurrentMessageState;
45
- /**
46
- * Show message being sent to AI
47
- */
48
- private showSendingMessage;
49
- /**
50
- * Show the prompt
51
- */
52
- private showPrompt;
53
- /**
54
- * Handle shell close
55
- */
56
- private handleClose;
57
- /**
58
- * Enable bracketed paste mode
59
- */
60
- private enableBracketedPasteMode;
61
- /**
62
- * Disable bracketed paste mode
63
- */
64
- private disableBracketedPasteMode;
65
- /**
66
- * Start the enhanced shell
67
- */
68
- start(): void;
69
- /**
70
- * Stop the shell
71
- */
72
- stop(): void;
73
- /**
74
- * Set callback for user input
75
- */
76
- onInput(callback: (input: string) => void): void;
77
- /**
78
- * Set callback for shell exit
79
- */
80
- onExit(callback: () => void): void;
81
- /**
82
- * Get current paste manager for debugging
83
- */
84
- getPasteManager(): MultiLinePasteManager;
85
- /**
86
- * Get current message builder for debugging
87
- */
88
- getMessageBuilder(): ComposableMessageBuilder;
89
- }
90
- //# sourceMappingURL=enhancedInteractiveShell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhancedInteractiveShell.d.ts","sourceRoot":"","sources":["../../src/shell/enhancedInteractiveShell.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAOlE,qBAAa,wBAAwB;IACnC,OAAO,CAAC,EAAE,CAAqB;IAC/B,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,eAAe,CAA0C;IACjE,OAAO,CAAC,cAAc,CAA6B;;IAyBnD;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,cAAc;IAetB;;OAEG;IACH,OAAO,CAAC,eAAe;IAiCvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAKzB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAgB/B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,UAAU;IAMlB;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAgBhC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAajC;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,IAAI,IAAI,IAAI;IAKZ;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAIhD;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAIlC;;O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