souleyez 2.43.29__py3-none-any.whl → 3.0.0__py3-none-any.whl

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 (358) hide show
  1. souleyez/__init__.py +1 -2
  2. souleyez/ai/__init__.py +21 -15
  3. souleyez/ai/action_mapper.py +249 -150
  4. souleyez/ai/chain_advisor.py +116 -100
  5. souleyez/ai/claude_provider.py +29 -28
  6. souleyez/ai/context_builder.py +80 -62
  7. souleyez/ai/executor.py +158 -117
  8. souleyez/ai/feedback_handler.py +136 -121
  9. souleyez/ai/llm_factory.py +27 -20
  10. souleyez/ai/llm_provider.py +4 -2
  11. souleyez/ai/ollama_provider.py +6 -9
  12. souleyez/ai/ollama_service.py +44 -37
  13. souleyez/ai/path_scorer.py +91 -76
  14. souleyez/ai/recommender.py +176 -144
  15. souleyez/ai/report_context.py +74 -73
  16. souleyez/ai/report_service.py +84 -66
  17. souleyez/ai/result_parser.py +222 -229
  18. souleyez/ai/safety.py +67 -44
  19. souleyez/auth/__init__.py +23 -22
  20. souleyez/auth/audit.py +36 -26
  21. souleyez/auth/engagement_access.py +65 -48
  22. souleyez/auth/permissions.py +14 -3
  23. souleyez/auth/session_manager.py +54 -37
  24. souleyez/auth/user_manager.py +109 -64
  25. souleyez/commands/audit.py +40 -43
  26. souleyez/commands/auth.py +35 -15
  27. souleyez/commands/deliverables.py +55 -50
  28. souleyez/commands/engagement.py +47 -28
  29. souleyez/commands/license.py +32 -23
  30. souleyez/commands/screenshots.py +36 -32
  31. souleyez/commands/user.py +82 -36
  32. souleyez/config.py +52 -44
  33. souleyez/core/credential_tester.py +87 -81
  34. souleyez/core/cve_mappings.py +179 -192
  35. souleyez/core/cve_matcher.py +162 -148
  36. souleyez/core/msf_auto_mapper.py +100 -83
  37. souleyez/core/msf_chain_engine.py +294 -256
  38. souleyez/core/msf_database.py +153 -70
  39. souleyez/core/msf_integration.py +679 -673
  40. souleyez/core/msf_rpc_client.py +40 -42
  41. souleyez/core/msf_rpc_manager.py +77 -79
  42. souleyez/core/msf_sync_manager.py +241 -181
  43. souleyez/core/network_utils.py +22 -15
  44. souleyez/core/parser_handler.py +34 -25
  45. souleyez/core/pending_chains.py +114 -63
  46. souleyez/core/templates.py +158 -107
  47. souleyez/core/tool_chaining.py +9564 -2881
  48. souleyez/core/version_utils.py +79 -94
  49. souleyez/core/vuln_correlation.py +136 -89
  50. souleyez/core/web_utils.py +33 -32
  51. souleyez/data/wordlists/ad_users.txt +378 -0
  52. souleyez/data/wordlists/api_endpoints_large.txt +769 -0
  53. souleyez/data/wordlists/home_dir_sensitive.txt +39 -0
  54. souleyez/data/wordlists/lfi_payloads.txt +82 -0
  55. souleyez/data/wordlists/passwords_brute.txt +1548 -0
  56. souleyez/data/wordlists/passwords_crack.txt +2479 -0
  57. souleyez/data/wordlists/passwords_spray.txt +386 -0
  58. souleyez/data/wordlists/subdomains_large.txt +5057 -0
  59. souleyez/data/wordlists/usernames_common.txt +694 -0
  60. souleyez/data/wordlists/web_dirs_large.txt +4769 -0
  61. souleyez/detection/__init__.py +1 -1
  62. souleyez/detection/attack_signatures.py +12 -17
  63. souleyez/detection/mitre_mappings.py +61 -55
  64. souleyez/detection/validator.py +97 -86
  65. souleyez/devtools.py +23 -10
  66. souleyez/docs/README.md +4 -4
  67. souleyez/docs/api-reference/cli-commands.md +2 -2
  68. souleyez/docs/developer-guide/adding-new-tools.md +562 -0
  69. souleyez/docs/user-guide/auto-chaining.md +30 -8
  70. souleyez/docs/user-guide/getting-started.md +1 -1
  71. souleyez/docs/user-guide/installation.md +26 -3
  72. souleyez/docs/user-guide/metasploit-integration.md +2 -2
  73. souleyez/docs/user-guide/rbac.md +1 -1
  74. souleyez/docs/user-guide/scope-management.md +1 -1
  75. souleyez/docs/user-guide/siem-integration.md +1 -1
  76. souleyez/docs/user-guide/tools-reference.md +1 -8
  77. souleyez/docs/user-guide/worker-management.md +1 -1
  78. souleyez/engine/background.py +1239 -535
  79. souleyez/engine/base.py +4 -1
  80. souleyez/engine/job_status.py +17 -49
  81. souleyez/engine/log_sanitizer.py +103 -77
  82. souleyez/engine/manager.py +38 -7
  83. souleyez/engine/result_handler.py +2200 -1550
  84. souleyez/engine/worker_manager.py +50 -41
  85. souleyez/export/evidence_bundle.py +72 -62
  86. souleyez/feature_flags/features.py +16 -20
  87. souleyez/feature_flags.py +5 -9
  88. souleyez/handlers/__init__.py +11 -0
  89. souleyez/handlers/base.py +188 -0
  90. souleyez/handlers/bash_handler.py +277 -0
  91. souleyez/handlers/bloodhound_handler.py +243 -0
  92. souleyez/handlers/certipy_handler.py +311 -0
  93. souleyez/handlers/crackmapexec_handler.py +486 -0
  94. souleyez/handlers/dnsrecon_handler.py +344 -0
  95. souleyez/handlers/enum4linux_handler.py +400 -0
  96. souleyez/handlers/evil_winrm_handler.py +493 -0
  97. souleyez/handlers/ffuf_handler.py +815 -0
  98. souleyez/handlers/gobuster_handler.py +1114 -0
  99. souleyez/handlers/gpp_extract_handler.py +334 -0
  100. souleyez/handlers/hashcat_handler.py +444 -0
  101. souleyez/handlers/hydra_handler.py +564 -0
  102. souleyez/handlers/impacket_getuserspns_handler.py +343 -0
  103. souleyez/handlers/impacket_psexec_handler.py +222 -0
  104. souleyez/handlers/impacket_secretsdump_handler.py +426 -0
  105. souleyez/handlers/john_handler.py +286 -0
  106. souleyez/handlers/katana_handler.py +425 -0
  107. souleyez/handlers/kerbrute_handler.py +298 -0
  108. souleyez/handlers/ldapsearch_handler.py +636 -0
  109. souleyez/handlers/lfi_extract_handler.py +464 -0
  110. souleyez/handlers/msf_auxiliary_handler.py +409 -0
  111. souleyez/handlers/msf_exploit_handler.py +380 -0
  112. souleyez/handlers/nikto_handler.py +413 -0
  113. souleyez/handlers/nmap_handler.py +821 -0
  114. souleyez/handlers/nuclei_handler.py +359 -0
  115. souleyez/handlers/nxc_handler.py +417 -0
  116. souleyez/handlers/rdp_sec_check_handler.py +353 -0
  117. souleyez/handlers/registry.py +292 -0
  118. souleyez/handlers/responder_handler.py +232 -0
  119. souleyez/handlers/service_explorer_handler.py +434 -0
  120. souleyez/handlers/smbclient_handler.py +344 -0
  121. souleyez/handlers/smbmap_handler.py +510 -0
  122. souleyez/handlers/smbpasswd_handler.py +296 -0
  123. souleyez/handlers/sqlmap_handler.py +1116 -0
  124. souleyez/handlers/theharvester_handler.py +601 -0
  125. souleyez/handlers/web_login_test_handler.py +327 -0
  126. souleyez/handlers/whois_handler.py +277 -0
  127. souleyez/handlers/wpscan_handler.py +554 -0
  128. souleyez/history.py +32 -16
  129. souleyez/importers/msf_importer.py +106 -75
  130. souleyez/importers/smart_importer.py +208 -147
  131. souleyez/integrations/siem/__init__.py +10 -10
  132. souleyez/integrations/siem/base.py +17 -18
  133. souleyez/integrations/siem/elastic.py +108 -122
  134. souleyez/integrations/siem/factory.py +207 -80
  135. souleyez/integrations/siem/googlesecops.py +146 -154
  136. souleyez/integrations/siem/rule_mappings/__init__.py +1 -1
  137. souleyez/integrations/siem/rule_mappings/wazuh_rules.py +8 -5
  138. souleyez/integrations/siem/sentinel.py +107 -109
  139. souleyez/integrations/siem/splunk.py +246 -212
  140. souleyez/integrations/siem/wazuh.py +65 -71
  141. souleyez/integrations/wazuh/__init__.py +5 -5
  142. souleyez/integrations/wazuh/client.py +70 -93
  143. souleyez/integrations/wazuh/config.py +85 -57
  144. souleyez/integrations/wazuh/host_mapper.py +28 -36
  145. souleyez/integrations/wazuh/sync.py +78 -68
  146. souleyez/intelligence/__init__.py +4 -5
  147. souleyez/intelligence/correlation_analyzer.py +309 -295
  148. souleyez/intelligence/exploit_knowledge.py +661 -623
  149. souleyez/intelligence/exploit_suggestions.py +159 -139
  150. souleyez/intelligence/gap_analyzer.py +132 -97
  151. souleyez/intelligence/gap_detector.py +251 -214
  152. souleyez/intelligence/sensitive_tables.py +266 -129
  153. souleyez/intelligence/service_parser.py +137 -123
  154. souleyez/intelligence/surface_analyzer.py +407 -268
  155. souleyez/intelligence/target_parser.py +159 -162
  156. souleyez/licensing/__init__.py +6 -6
  157. souleyez/licensing/validator.py +17 -19
  158. souleyez/log_config.py +79 -54
  159. souleyez/main.py +1505 -687
  160. souleyez/migrations/fix_job_counter.py +16 -14
  161. souleyez/parsers/bloodhound_parser.py +41 -39
  162. souleyez/parsers/crackmapexec_parser.py +178 -111
  163. souleyez/parsers/dalfox_parser.py +72 -77
  164. souleyez/parsers/dnsrecon_parser.py +103 -91
  165. souleyez/parsers/enum4linux_parser.py +183 -153
  166. souleyez/parsers/ffuf_parser.py +29 -25
  167. souleyez/parsers/gobuster_parser.py +301 -41
  168. souleyez/parsers/hashcat_parser.py +324 -79
  169. souleyez/parsers/http_fingerprint_parser.py +350 -103
  170. souleyez/parsers/hydra_parser.py +131 -111
  171. souleyez/parsers/impacket_parser.py +231 -178
  172. souleyez/parsers/john_parser.py +98 -86
  173. souleyez/parsers/katana_parser.py +316 -0
  174. souleyez/parsers/msf_parser.py +943 -498
  175. souleyez/parsers/nikto_parser.py +346 -65
  176. souleyez/parsers/nmap_parser.py +262 -174
  177. souleyez/parsers/nuclei_parser.py +40 -44
  178. souleyez/parsers/responder_parser.py +26 -26
  179. souleyez/parsers/searchsploit_parser.py +74 -74
  180. souleyez/parsers/service_explorer_parser.py +279 -0
  181. souleyez/parsers/smbmap_parser.py +180 -124
  182. souleyez/parsers/sqlmap_parser.py +434 -308
  183. souleyez/parsers/theharvester_parser.py +75 -57
  184. souleyez/parsers/whois_parser.py +135 -94
  185. souleyez/parsers/wpscan_parser.py +278 -190
  186. souleyez/plugins/afp.py +44 -36
  187. souleyez/plugins/afp_brute.py +114 -46
  188. souleyez/plugins/ard.py +48 -37
  189. souleyez/plugins/bloodhound.py +95 -61
  190. souleyez/plugins/certipy.py +303 -0
  191. souleyez/plugins/crackmapexec.py +186 -85
  192. souleyez/plugins/dalfox.py +120 -59
  193. souleyez/plugins/dns_hijack.py +146 -41
  194. souleyez/plugins/dnsrecon.py +97 -61
  195. souleyez/plugins/enum4linux.py +91 -66
  196. souleyez/plugins/evil_winrm.py +291 -0
  197. souleyez/plugins/ffuf.py +166 -90
  198. souleyez/plugins/firmware_extract.py +133 -29
  199. souleyez/plugins/gobuster.py +387 -190
  200. souleyez/plugins/gpp_extract.py +393 -0
  201. souleyez/plugins/hashcat.py +100 -73
  202. souleyez/plugins/http_fingerprint.py +913 -267
  203. souleyez/plugins/hydra.py +566 -200
  204. souleyez/plugins/impacket_getnpusers.py +117 -69
  205. souleyez/plugins/impacket_psexec.py +84 -64
  206. souleyez/plugins/impacket_secretsdump.py +103 -69
  207. souleyez/plugins/impacket_smbclient.py +89 -75
  208. souleyez/plugins/john.py +86 -69
  209. souleyez/plugins/katana.py +313 -0
  210. souleyez/plugins/kerbrute.py +237 -0
  211. souleyez/plugins/lfi_extract.py +541 -0
  212. souleyez/plugins/macos_ssh.py +117 -48
  213. souleyez/plugins/mdns.py +35 -30
  214. souleyez/plugins/msf_auxiliary.py +253 -130
  215. souleyez/plugins/msf_exploit.py +239 -161
  216. souleyez/plugins/nikto.py +134 -78
  217. souleyez/plugins/nmap.py +275 -91
  218. souleyez/plugins/nuclei.py +180 -89
  219. souleyez/plugins/nxc.py +285 -0
  220. souleyez/plugins/plugin_base.py +35 -36
  221. souleyez/plugins/plugin_template.py +13 -5
  222. souleyez/plugins/rdp_sec_check.py +130 -0
  223. souleyez/plugins/responder.py +112 -71
  224. souleyez/plugins/router_http_brute.py +76 -65
  225. souleyez/plugins/router_ssh_brute.py +118 -41
  226. souleyez/plugins/router_telnet_brute.py +124 -42
  227. souleyez/plugins/routersploit.py +91 -59
  228. souleyez/plugins/routersploit_exploit.py +77 -55
  229. souleyez/plugins/searchsploit.py +91 -77
  230. souleyez/plugins/service_explorer.py +1160 -0
  231. souleyez/plugins/smbmap.py +122 -72
  232. souleyez/plugins/smbpasswd.py +215 -0
  233. souleyez/plugins/sqlmap.py +301 -113
  234. souleyez/plugins/theharvester.py +127 -75
  235. souleyez/plugins/tr069.py +79 -57
  236. souleyez/plugins/upnp.py +65 -47
  237. souleyez/plugins/upnp_abuse.py +73 -55
  238. souleyez/plugins/vnc_access.py +129 -42
  239. souleyez/plugins/vnc_brute.py +109 -38
  240. souleyez/plugins/web_login_test.py +417 -0
  241. souleyez/plugins/whois.py +77 -58
  242. souleyez/plugins/wpscan.py +219 -69
  243. souleyez/reporting/__init__.py +2 -1
  244. souleyez/reporting/attack_chain.py +411 -346
  245. souleyez/reporting/charts.py +436 -501
  246. souleyez/reporting/compliance_mappings.py +334 -201
  247. souleyez/reporting/detection_report.py +126 -125
  248. souleyez/reporting/formatters.py +828 -591
  249. souleyez/reporting/generator.py +386 -302
  250. souleyez/reporting/metrics.py +72 -75
  251. souleyez/scanner.py +35 -29
  252. souleyez/security/__init__.py +37 -11
  253. souleyez/security/scope_validator.py +175 -106
  254. souleyez/security/validation.py +237 -149
  255. souleyez/security.py +22 -6
  256. souleyez/storage/credentials.py +247 -186
  257. souleyez/storage/crypto.py +296 -129
  258. souleyez/storage/database.py +73 -50
  259. souleyez/storage/db.py +58 -36
  260. souleyez/storage/deliverable_evidence.py +177 -128
  261. souleyez/storage/deliverable_exporter.py +282 -246
  262. souleyez/storage/deliverable_templates.py +134 -116
  263. souleyez/storage/deliverables.py +135 -130
  264. souleyez/storage/engagements.py +109 -56
  265. souleyez/storage/evidence.py +181 -152
  266. souleyez/storage/execution_log.py +31 -17
  267. souleyez/storage/exploit_attempts.py +93 -57
  268. souleyez/storage/exploits.py +67 -36
  269. souleyez/storage/findings.py +48 -61
  270. souleyez/storage/hosts.py +176 -144
  271. souleyez/storage/migrate_to_engagements.py +43 -19
  272. souleyez/storage/migrations/_001_add_credential_enhancements.py +22 -12
  273. souleyez/storage/migrations/_002_add_status_tracking.py +10 -7
  274. souleyez/storage/migrations/_003_add_execution_log.py +14 -8
  275. souleyez/storage/migrations/_005_screenshots.py +13 -5
  276. souleyez/storage/migrations/_006_deliverables.py +13 -5
  277. souleyez/storage/migrations/_007_deliverable_templates.py +12 -7
  278. souleyez/storage/migrations/_008_add_nuclei_table.py +10 -4
  279. souleyez/storage/migrations/_010_evidence_linking.py +17 -10
  280. souleyez/storage/migrations/_011_timeline_tracking.py +20 -13
  281. souleyez/storage/migrations/_012_team_collaboration.py +34 -21
  282. souleyez/storage/migrations/_013_add_host_tags.py +12 -6
  283. souleyez/storage/migrations/_014_exploit_attempts.py +22 -10
  284. souleyez/storage/migrations/_015_add_mac_os_fields.py +15 -7
  285. souleyez/storage/migrations/_016_add_domain_field.py +10 -4
  286. souleyez/storage/migrations/_017_msf_sessions.py +16 -8
  287. souleyez/storage/migrations/_018_add_osint_target.py +10 -6
  288. souleyez/storage/migrations/_019_add_engagement_type.py +10 -6
  289. souleyez/storage/migrations/_020_add_rbac.py +36 -15
  290. souleyez/storage/migrations/_021_wazuh_integration.py +20 -8
  291. souleyez/storage/migrations/_022_wazuh_indexer_columns.py +6 -4
  292. souleyez/storage/migrations/_023_fix_detection_results_fk.py +16 -6
  293. souleyez/storage/migrations/_024_wazuh_vulnerabilities.py +26 -10
  294. souleyez/storage/migrations/_025_multi_siem_support.py +3 -5
  295. souleyez/storage/migrations/_026_add_engagement_scope.py +31 -12
  296. souleyez/storage/migrations/_027_multi_siem_persistence.py +32 -15
  297. souleyez/storage/migrations/__init__.py +26 -26
  298. souleyez/storage/migrations/migration_manager.py +19 -19
  299. souleyez/storage/msf_sessions.py +100 -65
  300. souleyez/storage/osint.py +17 -24
  301. souleyez/storage/recommendation_engine.py +269 -235
  302. souleyez/storage/screenshots.py +33 -32
  303. souleyez/storage/smb_shares.py +136 -92
  304. souleyez/storage/sqlmap_data.py +183 -128
  305. souleyez/storage/team_collaboration.py +135 -141
  306. souleyez/storage/timeline_tracker.py +122 -94
  307. souleyez/storage/wazuh_vulns.py +64 -66
  308. souleyez/storage/web_paths.py +33 -37
  309. souleyez/testing/credential_tester.py +221 -205
  310. souleyez/ui/__init__.py +1 -1
  311. souleyez/ui/ai_quotes.py +12 -12
  312. souleyez/ui/attack_surface.py +2439 -1516
  313. souleyez/ui/chain_rules_view.py +914 -382
  314. souleyez/ui/correlation_view.py +312 -230
  315. souleyez/ui/dashboard.py +2382 -1130
  316. souleyez/ui/deliverables_view.py +148 -62
  317. souleyez/ui/design_system.py +13 -13
  318. souleyez/ui/errors.py +49 -49
  319. souleyez/ui/evidence_linking_view.py +284 -179
  320. souleyez/ui/evidence_vault.py +393 -285
  321. souleyez/ui/exploit_suggestions_view.py +555 -349
  322. souleyez/ui/export_view.py +100 -66
  323. souleyez/ui/gap_analysis_view.py +315 -171
  324. souleyez/ui/help_system.py +105 -97
  325. souleyez/ui/intelligence_view.py +436 -293
  326. souleyez/ui/interactive.py +23034 -10679
  327. souleyez/ui/interactive_selector.py +75 -68
  328. souleyez/ui/log_formatter.py +47 -39
  329. souleyez/ui/menu_components.py +22 -13
  330. souleyez/ui/msf_auxiliary_menu.py +184 -133
  331. souleyez/ui/pending_chains_view.py +336 -172
  332. souleyez/ui/progress_indicators.py +5 -3
  333. souleyez/ui/recommendations_view.py +195 -137
  334. souleyez/ui/rule_builder.py +343 -225
  335. souleyez/ui/setup_wizard.py +678 -284
  336. souleyez/ui/shortcuts.py +217 -165
  337. souleyez/ui/splunk_gap_analysis_view.py +452 -270
  338. souleyez/ui/splunk_vulns_view.py +139 -86
  339. souleyez/ui/team_dashboard.py +498 -335
  340. souleyez/ui/template_selector.py +196 -105
  341. souleyez/ui/terminal.py +6 -6
  342. souleyez/ui/timeline_view.py +198 -127
  343. souleyez/ui/tool_setup.py +264 -164
  344. souleyez/ui/tutorial.py +202 -72
  345. souleyez/ui/tutorial_state.py +40 -40
  346. souleyez/ui/wazuh_vulns_view.py +235 -141
  347. souleyez/ui/wordlist_browser.py +260 -107
  348. souleyez/ui.py +464 -312
  349. souleyez/utils/tool_checker.py +427 -367
  350. souleyez/utils.py +33 -29
  351. souleyez/wordlists.py +134 -167
  352. {souleyez-2.43.29.dist-info → souleyez-3.0.0.dist-info}/METADATA +2 -2
  353. souleyez-3.0.0.dist-info/RECORD +443 -0
  354. {souleyez-2.43.29.dist-info → souleyez-3.0.0.dist-info}/WHEEL +1 -1
  355. souleyez-2.43.29.dist-info/RECORD +0 -379
  356. {souleyez-2.43.29.dist-info → souleyez-3.0.0.dist-info}/entry_points.txt +0 -0
  357. {souleyez-2.43.29.dist-info → souleyez-3.0.0.dist-info}/licenses/LICENSE +0 -0
  358. {souleyez-2.43.29.dist-info → souleyez-3.0.0.dist-info}/top_level.txt +0 -0
@@ -13,576 +13,582 @@ import os
13
13
 
14
14
  # Exploit database with known vulnerabilities
15
15
  EXPLOIT_DATABASE = {
16
- 'ssh': {
17
- 'patterns': [
18
- {
19
- 'product': 'OpenSSH',
20
- 'version_range': '<7.4',
21
- 'cve': 'CVE-2016-10009',
22
- 'title': 'OpenSSH Username Enumeration',
23
- 'msf_module': 'auxiliary/scanner/ssh/ssh_enumusers',
24
- 'severity': 'medium',
25
- 'description': 'Username enumeration via timing attack in OpenSSH < 7.4'
26
- },
27
- {
28
- 'product': 'OpenSSH',
29
- 'version_range': 'all',
30
- 'cve': None,
31
- 'title': 'SSH Login Brute Force',
32
- 'msf_module': 'auxiliary/scanner/ssh/ssh_login',
33
- 'severity': 'high',
34
- 'description': 'Attempt credential brute force attack'
35
- },
36
- {
37
- 'product': 'OpenSSH',
38
- 'version_range': 'all',
39
- 'cve': None,
40
- 'title': 'SSH Key Enumeration',
41
- 'msf_module': 'auxiliary/scanner/ssh/ssh_enumusers',
42
- 'severity': 'low',
43
- 'description': 'Enumerate valid SSH users'
44
- }
16
+ "ssh": {
17
+ "patterns": [
18
+ {
19
+ "product": "OpenSSH",
20
+ "version_range": "<7.4",
21
+ "cve": "CVE-2016-10009",
22
+ "title": "OpenSSH Username Enumeration",
23
+ "msf_module": "auxiliary/scanner/ssh/ssh_enumusers",
24
+ "severity": "medium",
25
+ "description": "Username enumeration via timing attack in OpenSSH < 7.4",
26
+ },
27
+ {
28
+ "product": "OpenSSH",
29
+ "version_range": "all",
30
+ "cve": None,
31
+ "title": "SSH Login Brute Force",
32
+ "msf_module": "auxiliary/scanner/ssh/ssh_login",
33
+ "severity": "high",
34
+ "description": "Attempt credential brute force attack",
35
+ },
36
+ {
37
+ "product": "OpenSSH",
38
+ "version_range": "all",
39
+ "cve": None,
40
+ "title": "SSH Key Enumeration",
41
+ "msf_module": "auxiliary/scanner/ssh/ssh_enumusers",
42
+ "severity": "low",
43
+ "description": "Enumerate valid SSH users",
44
+ },
45
45
  ],
46
- 'techniques': [
46
+ "techniques": [
47
47
  {
48
- 'name': 'SSH Key Enumeration',
49
- 'msf_modules': ['auxiliary/scanner/ssh/ssh_enumusers'],
50
- 'severity': 'low'
48
+ "name": "SSH Key Enumeration",
49
+ "msf_modules": ["auxiliary/scanner/ssh/ssh_enumusers"],
50
+ "severity": "low",
51
51
  },
52
52
  {
53
- 'name': 'Password Spray',
54
- 'msf_modules': ['auxiliary/scanner/ssh/ssh_login'],
55
- 'severity': 'high'
53
+ "name": "Password Spray",
54
+ "msf_modules": ["auxiliary/scanner/ssh/ssh_login"],
55
+ "severity": "high",
56
56
  },
57
57
  {
58
- 'name': 'SSH Tunneling',
59
- 'msf_modules': ['auxiliary/scanner/ssh/detect_kippo'],
60
- 'severity': 'medium'
58
+ "name": "SSH Tunneling",
59
+ "msf_modules": ["auxiliary/scanner/ssh/detect_kippo"],
60
+ "severity": "medium",
61
61
  },
62
62
  {
63
- 'name': 'Weak Crypto Detection',
64
- 'msf_modules': ['auxiliary/scanner/ssh/ssh_version'],
65
- 'severity': 'low'
66
- }
67
- ]
63
+ "name": "Weak Crypto Detection",
64
+ "msf_modules": ["auxiliary/scanner/ssh/ssh_version"],
65
+ "severity": "low",
66
+ },
67
+ ],
68
68
  },
69
- 'ftp': {
70
- 'patterns': [
71
- {
72
- 'product': 'vsftpd',
73
- 'version_exact': '2.3.4',
74
- 'cve': 'CVE-2011-2523',
75
- 'title': 'vsftpd 2.3.4 Backdoor Command Execution',
76
- 'msf_module': 'exploit/unix/ftp/vsftpd_234_backdoor',
77
- 'severity': 'critical',
78
- 'description': 'Backdoor in vsftpd 2.3.4 allows arbitrary command execution via :) in username'
79
- },
80
- {
81
- 'product': 'ProFTPD',
82
- 'version_range': '1.3.3c',
83
- 'cve': 'CVE-2010-4221',
84
- 'title': 'ProFTPD Telnet IAC Buffer Overflow',
85
- 'msf_module': 'exploit/unix/ftp/proftpd_telnet_iac',
86
- 'severity': 'high',
87
- 'description': 'Stack-based buffer overflow in ProFTPD 1.3.2-1.3.3b'
88
- },
89
- {
90
- 'product': 'ProFTPD',
91
- 'version_range': '1.3.5',
92
- 'cve': 'CVE-2015-3306',
93
- 'title': 'ProFTPD mod_copy Command Execution',
94
- 'msf_module': 'exploit/unix/ftp/proftpd_modcopy_exec',
95
- 'severity': 'critical',
96
- 'description': 'Unauthenticated copying of files via SITE CPFR/CPTO commands'
97
- },
98
- {
99
- 'product': 'all',
100
- 'version_range': 'all',
101
- 'cve': None,
102
- 'title': 'FTP Anonymous Login',
103
- 'msf_module': 'auxiliary/scanner/ftp/anonymous',
104
- 'severity': 'medium',
105
- 'description': 'Check for anonymous FTP access'
106
- },
107
- {
108
- 'product': 'all',
109
- 'version_range': 'all',
110
- 'cve': None,
111
- 'title': 'FTP Login Brute Force',
112
- 'msf_module': 'auxiliary/scanner/ftp/ftp_login',
113
- 'severity': 'high',
114
- 'description': 'Attempt credential brute force'
115
- }
69
+ "ftp": {
70
+ "patterns": [
71
+ {
72
+ "product": "vsftpd",
73
+ "version_exact": "2.3.4",
74
+ "cve": "CVE-2011-2523",
75
+ "title": "vsftpd 2.3.4 Backdoor Command Execution",
76
+ "msf_module": "exploit/unix/ftp/vsftpd_234_backdoor",
77
+ "severity": "critical",
78
+ "description": "Backdoor in vsftpd 2.3.4 allows arbitrary command execution via :) in username",
79
+ },
80
+ {
81
+ "product": "ProFTPD",
82
+ "version_range": "1.3.3c",
83
+ "cve": "CVE-2010-4221",
84
+ "title": "ProFTPD Telnet IAC Buffer Overflow",
85
+ "msf_module": "exploit/unix/ftp/proftpd_telnet_iac",
86
+ "severity": "high",
87
+ "description": "Stack-based buffer overflow in ProFTPD 1.3.2-1.3.3b",
88
+ },
89
+ {
90
+ "product": "ProFTPD",
91
+ "version_range": "1.3.5",
92
+ "cve": "CVE-2015-3306",
93
+ "title": "ProFTPD mod_copy Command Execution",
94
+ "msf_module": "exploit/unix/ftp/proftpd_modcopy_exec",
95
+ "severity": "critical",
96
+ "description": "Unauthenticated copying of files via SITE CPFR/CPTO commands",
97
+ },
98
+ {
99
+ "product": "all",
100
+ "version_range": "all",
101
+ "cve": None,
102
+ "title": "FTP Anonymous Login",
103
+ "msf_module": "auxiliary/scanner/ftp/anonymous",
104
+ "severity": "medium",
105
+ "description": "Check for anonymous FTP access",
106
+ },
107
+ {
108
+ "product": "all",
109
+ "version_range": "all",
110
+ "cve": None,
111
+ "title": "FTP Login Brute Force",
112
+ "msf_module": "auxiliary/scanner/ftp/ftp_login",
113
+ "severity": "high",
114
+ "description": "Attempt credential brute force",
115
+ },
116
116
  ],
117
- 'techniques': [
117
+ "techniques": [
118
118
  {
119
- 'name': 'Anonymous FTP Access',
120
- 'msf_modules': ['auxiliary/scanner/ftp/anonymous'],
121
- 'severity': 'medium'
119
+ "name": "Anonymous FTP Access",
120
+ "msf_modules": ["auxiliary/scanner/ftp/anonymous"],
121
+ "severity": "medium",
122
122
  },
123
123
  {
124
- 'name': 'FTP Bounce Attack',
125
- 'msf_modules': ['auxiliary/scanner/ftp/ftp_version'],
126
- 'severity': 'medium'
124
+ "name": "FTP Bounce Attack",
125
+ "msf_modules": ["auxiliary/scanner/ftp/ftp_version"],
126
+ "severity": "medium",
127
127
  },
128
128
  {
129
- 'name': 'Credential Brute Force',
130
- 'msf_modules': ['auxiliary/scanner/ftp/ftp_login'],
131
- 'severity': 'high'
129
+ "name": "Credential Brute Force",
130
+ "msf_modules": ["auxiliary/scanner/ftp/ftp_login"],
131
+ "severity": "high",
132
132
  },
133
133
  {
134
- 'name': 'Directory Traversal',
135
- 'msf_modules': ['auxiliary/scanner/ftp/anonymous'],
136
- 'severity': 'medium'
137
- }
138
- ]
139
- },
140
- 'mysql': {
141
- 'patterns': [
142
- {
143
- 'product': 'MySQL',
144
- 'version_range': '<5.0.83',
145
- 'cve': 'CVE-2009-2446',
146
- 'title': 'MySQL yaSSL Buffer Overflow',
147
- 'msf_module': 'exploit/linux/mysql/mysql_yassl_getname',
148
- 'severity': 'critical',
149
- 'description': 'Remote code execution via yaSSL SSL_get_peer_name buffer overflow'
150
- },
151
- {
152
- 'product': 'MySQL',
153
- 'version_range': '<5.1.63',
154
- 'cve': 'CVE-2012-2122',
155
- 'title': 'MySQL Authentication Bypass',
156
- 'msf_module': 'auxiliary/scanner/mysql/mysql_authbypass_hashdump',
157
- 'severity': 'critical',
158
- 'description': 'Authentication bypass allows login with any password'
159
- },
160
- {
161
- 'product': 'MySQL',
162
- 'version_range': 'all',
163
- 'cve': None,
164
- 'title': 'MySQL Login Brute Force',
165
- 'msf_module': 'auxiliary/scanner/mysql/mysql_login',
166
- 'severity': 'medium',
167
- 'description': 'Attempt credential brute force'
168
- },
169
- {
170
- 'product': 'MySQL',
171
- 'version_range': 'all',
172
- 'cve': None,
173
- 'title': 'MySQL Schema Enumeration',
174
- 'msf_module': 'auxiliary/admin/mysql/mysql_enum',
175
- 'severity': 'low',
176
- 'description': 'Enumerate databases, tables, and users'
177
- },
178
- {
179
- 'product': 'MySQL',
180
- 'version_range': 'all',
181
- 'cve': None,
182
- 'title': 'MySQL SQL Query',
183
- 'msf_module': 'auxiliary/admin/mysql/mysql_sql',
184
- 'severity': 'high',
185
- 'description': 'Execute arbitrary SQL queries'
186
- }
134
+ "name": "Directory Traversal",
135
+ "msf_modules": ["auxiliary/scanner/ftp/anonymous"],
136
+ "severity": "medium",
137
+ },
187
138
  ],
188
- 'techniques': [
139
+ },
140
+ "mysql": {
141
+ "patterns": [
142
+ {
143
+ "product": "MySQL",
144
+ "version_range": "<5.0.83",
145
+ "cve": "CVE-2009-2446",
146
+ "title": "MySQL yaSSL Buffer Overflow",
147
+ "msf_module": "exploit/linux/mysql/mysql_yassl_getname",
148
+ "severity": "critical",
149
+ "description": "Remote code execution via yaSSL SSL_get_peer_name buffer overflow",
150
+ },
189
151
  {
190
- 'name': 'UDF Injection',
191
- 'msf_modules': ['exploit/linux/mysql/mysql_udf_payload', 'exploit/windows/mysql/mysql_payload'],
192
- 'severity': 'critical'
152
+ "product": "MySQL",
153
+ "version_range": "<5.1.63",
154
+ "cve": "CVE-2012-2122",
155
+ "title": "MySQL Authentication Bypass",
156
+ "msf_module": "auxiliary/scanner/mysql/mysql_authbypass_hashdump",
157
+ "severity": "critical",
158
+ "description": "Authentication bypass allows login with any password",
193
159
  },
194
160
  {
195
- 'name': 'File Read (load_file)',
196
- 'msf_modules': ['auxiliary/admin/mysql/mysql_sql'],
197
- 'severity': 'high'
161
+ "product": "MySQL",
162
+ "version_range": "all",
163
+ "cve": None,
164
+ "title": "MySQL Login Brute Force",
165
+ "msf_module": "auxiliary/scanner/mysql/mysql_login",
166
+ "severity": "medium",
167
+ "description": "Attempt credential brute force",
198
168
  },
199
169
  {
200
- 'name': 'Credential Theft',
201
- 'msf_modules': ['auxiliary/scanner/mysql/mysql_hashdump'],
202
- 'severity': 'high'
170
+ "product": "MySQL",
171
+ "version_range": "all",
172
+ "cve": None,
173
+ "title": "MySQL Schema Enumeration",
174
+ "msf_module": "auxiliary/admin/mysql/mysql_enum",
175
+ "severity": "low",
176
+ "description": "Enumerate databases, tables, and users",
203
177
  },
204
178
  {
205
- 'name': 'SQL Injection',
206
- 'msf_modules': ['auxiliary/scanner/http/sqlmap'],
207
- 'severity': 'high'
208
- }
209
- ]
179
+ "product": "MySQL",
180
+ "version_range": "all",
181
+ "cve": None,
182
+ "title": "MySQL SQL Query",
183
+ "msf_module": "auxiliary/admin/mysql/mysql_sql",
184
+ "severity": "high",
185
+ "description": "Execute arbitrary SQL queries",
186
+ },
187
+ ],
188
+ "techniques": [
189
+ {
190
+ "name": "UDF Injection",
191
+ "msf_modules": [
192
+ "exploit/linux/mysql/mysql_udf_payload",
193
+ "exploit/windows/mysql/mysql_payload",
194
+ ],
195
+ "severity": "critical",
196
+ },
197
+ {
198
+ "name": "File Read (load_file)",
199
+ "msf_modules": ["auxiliary/admin/mysql/mysql_sql"],
200
+ "severity": "high",
201
+ },
202
+ {
203
+ "name": "Credential Theft",
204
+ "msf_modules": ["auxiliary/scanner/mysql/mysql_hashdump"],
205
+ "severity": "high",
206
+ },
207
+ {
208
+ "name": "SQL Injection",
209
+ "msf_modules": ["auxiliary/scanner/http/sqlmap"],
210
+ "severity": "high",
211
+ },
212
+ ],
210
213
  },
211
- 'http': {
212
- 'patterns': [
213
- {
214
- 'product': 'Apache',
215
- 'version_range': '2.4.49-2.4.50',
216
- 'cve': 'CVE-2021-41773',
217
- 'title': 'Apache HTTP Server Path Traversal RCE',
218
- 'msf_module': 'exploit/multi/http/apache_normalize_path_rce',
219
- 'severity': 'critical',
220
- 'description': 'Path traversal and RCE in Apache 2.4.49-2.4.50'
221
- },
222
- {
223
- 'product': 'Apache',
224
- 'version_range': '2.2.0-2.2.21',
225
- 'cve': 'CVE-2011-3192',
226
- 'title': 'Apache Range Header DoS',
227
- 'msf_module': 'auxiliary/dos/http/apache_range_dos',
228
- 'severity': 'medium',
229
- 'description': 'Denial of Service via Range header'
230
- },
231
- {
232
- 'product': 'all',
233
- 'version_range': 'all',
234
- 'cve': None,
235
- 'title': 'HTTP Directory Scanner',
236
- 'msf_module': 'auxiliary/scanner/http/dir_scanner',
237
- 'severity': 'low',
238
- 'description': 'Scan for common directories and files'
239
- },
240
- {
241
- 'product': 'all',
242
- 'version_range': 'all',
243
- 'cve': None,
244
- 'title': 'HTTP Title Grabber',
245
- 'msf_module': 'auxiliary/scanner/http/title',
246
- 'severity': 'info',
247
- 'description': 'Extract HTTP page titles for recon'
248
- }
214
+ "http": {
215
+ "patterns": [
216
+ {
217
+ "product": "Apache",
218
+ "version_range": "2.4.49-2.4.50",
219
+ "cve": "CVE-2021-41773",
220
+ "title": "Apache HTTP Server Path Traversal RCE",
221
+ "msf_module": "exploit/multi/http/apache_normalize_path_rce",
222
+ "severity": "critical",
223
+ "description": "Path traversal and RCE in Apache 2.4.49-2.4.50",
224
+ },
225
+ {
226
+ "product": "Apache",
227
+ "version_range": "2.2.0-2.2.21",
228
+ "cve": "CVE-2011-3192",
229
+ "title": "Apache Range Header DoS",
230
+ "msf_module": "auxiliary/dos/http/apache_range_dos",
231
+ "severity": "medium",
232
+ "description": "Denial of Service via Range header",
233
+ },
234
+ {
235
+ "product": "all",
236
+ "version_range": "all",
237
+ "cve": None,
238
+ "title": "HTTP Directory Scanner",
239
+ "msf_module": "auxiliary/scanner/http/dir_scanner",
240
+ "severity": "low",
241
+ "description": "Scan for common directories and files",
242
+ },
243
+ {
244
+ "product": "all",
245
+ "version_range": "all",
246
+ "cve": None,
247
+ "title": "HTTP Title Grabber",
248
+ "msf_module": "auxiliary/scanner/http/title",
249
+ "severity": "info",
250
+ "description": "Extract HTTP page titles for recon",
251
+ },
249
252
  ],
250
- 'techniques': [
253
+ "techniques": [
251
254
  {
252
- 'name': 'SQL Injection',
253
- 'msf_modules': ['auxiliary/scanner/http/sqlmap'],
254
- 'severity': 'high'
255
+ "name": "SQL Injection",
256
+ "msf_modules": ["auxiliary/scanner/http/sqlmap"],
257
+ "severity": "high",
255
258
  },
256
259
  {
257
- 'name': 'XSS',
258
- 'msf_modules': ['auxiliary/scanner/http/xpath'],
259
- 'severity': 'medium'
260
+ "name": "XSS",
261
+ "msf_modules": ["auxiliary/scanner/http/xpath"],
262
+ "severity": "medium",
260
263
  },
261
264
  {
262
- 'name': 'Directory Traversal',
263
- 'msf_modules': ['auxiliary/scanner/http/dir_scanner', 'auxiliary/scanner/http/dir_listing'],
264
- 'severity': 'medium'
265
+ "name": "Directory Traversal",
266
+ "msf_modules": [
267
+ "auxiliary/scanner/http/dir_scanner",
268
+ "auxiliary/scanner/http/dir_listing",
269
+ ],
270
+ "severity": "medium",
265
271
  },
266
272
  {
267
- 'name': 'File Upload',
268
- 'msf_modules': ['exploit/multi/http/php_file_upload'],
269
- 'severity': 'high'
273
+ "name": "File Upload",
274
+ "msf_modules": ["exploit/multi/http/php_file_upload"],
275
+ "severity": "high",
270
276
  },
271
277
  {
272
- 'name': 'Command Injection',
273
- 'msf_modules': ['auxiliary/scanner/http/http_put'],
274
- 'severity': 'critical'
278
+ "name": "Command Injection",
279
+ "msf_modules": ["auxiliary/scanner/http/http_put"],
280
+ "severity": "critical",
275
281
  },
276
282
  {
277
- 'name': 'SSRF',
278
- 'msf_modules': ['auxiliary/scanner/http/wordpress_ssrf'],
279
- 'severity': 'high'
280
- }
281
- ]
283
+ "name": "SSRF",
284
+ "msf_modules": ["auxiliary/scanner/http/wordpress_ssrf"],
285
+ "severity": "high",
286
+ },
287
+ ],
282
288
  },
283
- 'https': {
284
- 'patterns': [
285
- {
286
- 'product': 'all',
287
- 'version_range': 'all',
288
- 'cve': None,
289
- 'title': 'SSL/TLS Scanner',
290
- 'msf_module': 'auxiliary/scanner/ssl/ssl_version',
291
- 'severity': 'low',
292
- 'description': 'Enumerate SSL/TLS versions and ciphers'
293
- },
294
- {
295
- 'product': 'OpenSSL',
296
- 'version_range': '1.0.1-1.0.1f',
297
- 'cve': 'CVE-2014-0160',
298
- 'title': 'Heartbleed SSL Memory Disclosure',
299
- 'msf_module': 'auxiliary/scanner/ssl/openssl_heartbleed',
300
- 'severity': 'critical',
301
- 'description': 'OpenSSL Heartbleed vulnerability allows memory disclosure'
302
- }
289
+ "https": {
290
+ "patterns": [
291
+ {
292
+ "product": "all",
293
+ "version_range": "all",
294
+ "cve": None,
295
+ "title": "SSL/TLS Scanner",
296
+ "msf_module": "auxiliary/scanner/ssl/ssl_version",
297
+ "severity": "low",
298
+ "description": "Enumerate SSL/TLS versions and ciphers",
299
+ },
300
+ {
301
+ "product": "OpenSSL",
302
+ "version_range": "1.0.1-1.0.1f",
303
+ "cve": "CVE-2014-0160",
304
+ "title": "Heartbleed SSL Memory Disclosure",
305
+ "msf_module": "auxiliary/scanner/ssl/openssl_heartbleed",
306
+ "severity": "critical",
307
+ "description": "OpenSSL Heartbleed vulnerability allows memory disclosure",
308
+ },
303
309
  ],
304
- 'techniques': [
310
+ "techniques": [
305
311
  {
306
- 'name': 'SSL Stripping',
307
- 'msf_modules': ['auxiliary/scanner/ssl/ssl_version'],
308
- 'severity': 'medium'
312
+ "name": "SSL Stripping",
313
+ "msf_modules": ["auxiliary/scanner/ssl/ssl_version"],
314
+ "severity": "medium",
309
315
  },
310
316
  {
311
- 'name': 'Weak Cipher Exploitation',
312
- 'msf_modules': ['auxiliary/scanner/ssl/ssl_version'],
313
- 'severity': 'high'
317
+ "name": "Weak Cipher Exploitation",
318
+ "msf_modules": ["auxiliary/scanner/ssl/ssl_version"],
319
+ "severity": "high",
314
320
  },
315
321
  {
316
- 'name': 'Certificate Spoofing',
317
- 'msf_modules': ['auxiliary/gather/ssl_heartbleed'],
318
- 'severity': 'high'
319
- }
320
- ]
322
+ "name": "Certificate Spoofing",
323
+ "msf_modules": ["auxiliary/gather/ssl_heartbleed"],
324
+ "severity": "high",
325
+ },
326
+ ],
321
327
  },
322
- 'smb': {
323
- 'patterns': [
324
- {
325
- 'product': 'Samba',
326
- 'version_range': '3.0.20-3.0.25',
327
- 'cve': 'CVE-2007-2447',
328
- 'title': 'Samba "username map script" Command Execution',
329
- 'msf_module': 'exploit/multi/samba/usermap_script',
330
- 'severity': 'critical',
331
- 'description': 'Command injection in username parameter allows RCE'
332
- },
333
- {
334
- 'product': 'Samba',
335
- 'version_range': '3.5.0-4.6.4',
336
- 'cve': 'CVE-2017-7494',
337
- 'title': 'SambaCry Remote Code Execution',
338
- 'msf_module': 'exploit/linux/samba/is_known_pipename',
339
- 'severity': 'critical',
340
- 'description': 'Remote code execution via uploaded shared library'
341
- },
342
- {
343
- 'product': 'Windows',
344
- 'version_range': 'all',
345
- 'cve': 'CVE-2017-0143',
346
- 'title': 'EternalBlue SMB Remote Code Execution',
347
- 'msf_module': 'exploit/windows/smb/ms17_010_eternalblue',
348
- 'severity': 'critical',
349
- 'description': 'SMBv1 vulnerability (MS17-010) allows remote code execution'
350
- },
351
- {
352
- 'product': 'Windows',
353
- 'version_range': 'all',
354
- 'cve': 'CVE-2017-0144',
355
- 'title': 'EternalBlue DoublePulsar Check',
356
- 'msf_module': 'auxiliary/scanner/smb/smb_ms17_010',
357
- 'severity': 'critical',
358
- 'description': 'Check if system is vulnerable to MS17-010'
359
- },
360
- {
361
- 'product': 'all',
362
- 'version_range': 'all',
363
- 'cve': None,
364
- 'title': 'SMB Version Detection',
365
- 'msf_module': 'auxiliary/scanner/smb/smb_version',
366
- 'severity': 'info',
367
- 'description': 'Detect SMB version and OS information'
368
- },
369
- {
370
- 'product': 'all',
371
- 'version_range': 'all',
372
- 'cve': None,
373
- 'title': 'SMB Share Enumeration',
374
- 'msf_module': 'auxiliary/scanner/smb/smb_enumshares',
375
- 'severity': 'low',
376
- 'description': 'Enumerate SMB shares'
377
- },
378
- {
379
- 'product': 'all',
380
- 'version_range': 'all',
381
- 'cve': None,
382
- 'title': 'SMB Login Brute Force',
383
- 'msf_module': 'auxiliary/scanner/smb/smb_login',
384
- 'severity': 'high',
385
- 'description': 'Attempt credential brute force'
386
- }
328
+ "smb": {
329
+ "patterns": [
330
+ {
331
+ "product": "Samba",
332
+ "version_range": "3.0.20-3.0.25",
333
+ "cve": "CVE-2007-2447",
334
+ "title": 'Samba "username map script" Command Execution',
335
+ "msf_module": "exploit/multi/samba/usermap_script",
336
+ "severity": "critical",
337
+ "description": "Command injection in username parameter allows RCE",
338
+ },
339
+ {
340
+ "product": "Samba",
341
+ "version_range": "3.5.0-4.6.4",
342
+ "cve": "CVE-2017-7494",
343
+ "title": "SambaCry Remote Code Execution",
344
+ "msf_module": "exploit/linux/samba/is_known_pipename",
345
+ "severity": "critical",
346
+ "description": "Remote code execution via uploaded shared library",
347
+ },
348
+ {
349
+ "product": "Windows",
350
+ "version_range": "all",
351
+ "cve": "CVE-2017-0143",
352
+ "title": "EternalBlue SMB Remote Code Execution",
353
+ "msf_module": "exploit/windows/smb/ms17_010_eternalblue",
354
+ "severity": "critical",
355
+ "description": "SMBv1 vulnerability (MS17-010) allows remote code execution",
356
+ },
357
+ {
358
+ "product": "Windows",
359
+ "version_range": "all",
360
+ "cve": "CVE-2017-0144",
361
+ "title": "EternalBlue DoublePulsar Check",
362
+ "msf_module": "auxiliary/scanner/smb/smb_ms17_010",
363
+ "severity": "critical",
364
+ "description": "Check if system is vulnerable to MS17-010",
365
+ },
366
+ {
367
+ "product": "all",
368
+ "version_range": "all",
369
+ "cve": None,
370
+ "title": "SMB Version Detection",
371
+ "msf_module": "auxiliary/scanner/smb/smb_version",
372
+ "severity": "info",
373
+ "description": "Detect SMB version and OS information",
374
+ },
375
+ {
376
+ "product": "all",
377
+ "version_range": "all",
378
+ "cve": None,
379
+ "title": "SMB Share Enumeration",
380
+ "msf_module": "auxiliary/scanner/smb/smb_enumshares",
381
+ "severity": "low",
382
+ "description": "Enumerate SMB shares",
383
+ },
384
+ {
385
+ "product": "all",
386
+ "version_range": "all",
387
+ "cve": None,
388
+ "title": "SMB Login Brute Force",
389
+ "msf_module": "auxiliary/scanner/smb/smb_login",
390
+ "severity": "high",
391
+ "description": "Attempt credential brute force",
392
+ },
387
393
  ],
388
- 'techniques': [
394
+ "techniques": [
389
395
  {
390
- 'name': 'Share Enumeration',
391
- 'msf_modules': ['auxiliary/scanner/smb/smb_enumshares'],
392
- 'severity': 'low'
396
+ "name": "Share Enumeration",
397
+ "msf_modules": ["auxiliary/scanner/smb/smb_enumshares"],
398
+ "severity": "low",
393
399
  },
394
400
  {
395
- 'name': 'Credential Brute Force',
396
- 'msf_modules': ['auxiliary/scanner/smb/smb_login'],
397
- 'severity': 'high'
401
+ "name": "Credential Brute Force",
402
+ "msf_modules": ["auxiliary/scanner/smb/smb_login"],
403
+ "severity": "high",
398
404
  },
399
405
  {
400
- 'name': 'Pass-the-Hash',
401
- 'msf_modules': ['exploit/windows/smb/psexec'],
402
- 'severity': 'critical'
406
+ "name": "Pass-the-Hash",
407
+ "msf_modules": ["exploit/windows/smb/psexec"],
408
+ "severity": "critical",
403
409
  },
404
410
  {
405
- 'name': 'SMB Relay Attack',
406
- 'msf_modules': ['auxiliary/server/capture/smb'],
407
- 'severity': 'high'
411
+ "name": "SMB Relay Attack",
412
+ "msf_modules": ["auxiliary/server/capture/smb"],
413
+ "severity": "high",
408
414
  },
409
415
  {
410
- 'name': 'Null Session',
411
- 'msf_modules': ['auxiliary/scanner/smb/smb_enumshares'],
412
- 'severity': 'medium'
413
- }
414
- ]
416
+ "name": "Null Session",
417
+ "msf_modules": ["auxiliary/scanner/smb/smb_enumshares"],
418
+ "severity": "medium",
419
+ },
420
+ ],
415
421
  },
416
- 'postgres': {
417
- 'patterns': [
418
- {
419
- 'product': 'PostgreSQL',
420
- 'version_range': 'all',
421
- 'cve': None,
422
- 'title': 'PostgreSQL Login Brute Force',
423
- 'msf_module': 'auxiliary/scanner/postgres/postgres_login',
424
- 'severity': 'medium',
425
- 'description': 'Attempt credential brute force'
426
- },
427
- {
428
- 'product': 'PostgreSQL',
429
- 'version_range': 'all',
430
- 'cve': None,
431
- 'title': 'PostgreSQL Database Enumeration',
432
- 'msf_module': 'auxiliary/admin/postgres/postgres_sql',
433
- 'severity': 'low',
434
- 'description': 'Execute arbitrary SQL queries'
435
- },
436
- {
437
- 'product': 'PostgreSQL',
438
- 'version_range': '<9.3',
439
- 'cve': 'CVE-2013-1899',
440
- 'title': 'PostgreSQL COPY FROM PROGRAM Command Execution',
441
- 'msf_module': 'exploit/linux/postgres/postgres_payload',
442
- 'severity': 'high',
443
- 'description': 'Execute OS commands via COPY FROM PROGRAM'
444
- }
422
+ "postgres": {
423
+ "patterns": [
424
+ {
425
+ "product": "PostgreSQL",
426
+ "version_range": "all",
427
+ "cve": None,
428
+ "title": "PostgreSQL Login Brute Force",
429
+ "msf_module": "auxiliary/scanner/postgres/postgres_login",
430
+ "severity": "medium",
431
+ "description": "Attempt credential brute force",
432
+ },
433
+ {
434
+ "product": "PostgreSQL",
435
+ "version_range": "all",
436
+ "cve": None,
437
+ "title": "PostgreSQL Database Enumeration",
438
+ "msf_module": "auxiliary/admin/postgres/postgres_sql",
439
+ "severity": "low",
440
+ "description": "Execute arbitrary SQL queries",
441
+ },
442
+ {
443
+ "product": "PostgreSQL",
444
+ "version_range": "<9.3",
445
+ "cve": "CVE-2013-1899",
446
+ "title": "PostgreSQL COPY FROM PROGRAM Command Execution",
447
+ "msf_module": "exploit/linux/postgres/postgres_payload",
448
+ "severity": "high",
449
+ "description": "Execute OS commands via COPY FROM PROGRAM",
450
+ },
445
451
  ],
446
- 'techniques': [
452
+ "techniques": [
447
453
  {
448
- 'name': 'SQL Injection',
449
- 'msf_modules': ['auxiliary/admin/postgres/postgres_sql'],
450
- 'severity': 'high'
454
+ "name": "SQL Injection",
455
+ "msf_modules": ["auxiliary/admin/postgres/postgres_sql"],
456
+ "severity": "high",
451
457
  },
452
458
  {
453
- 'name': 'Command Execution (COPY FROM PROGRAM)',
454
- 'msf_modules': ['exploit/linux/postgres/postgres_payload'],
455
- 'severity': 'critical'
459
+ "name": "Command Execution (COPY FROM PROGRAM)",
460
+ "msf_modules": ["exploit/linux/postgres/postgres_payload"],
461
+ "severity": "critical",
456
462
  },
457
463
  {
458
- 'name': 'File Read/Write',
459
- 'msf_modules': ['auxiliary/admin/postgres/postgres_readfile'],
460
- 'severity': 'high'
464
+ "name": "File Read/Write",
465
+ "msf_modules": ["auxiliary/admin/postgres/postgres_readfile"],
466
+ "severity": "high",
461
467
  },
462
468
  {
463
- 'name': 'Privilege Escalation',
464
- 'msf_modules': ['exploit/linux/postgres/postgres_payload'],
465
- 'severity': 'high'
466
- }
467
- ]
469
+ "name": "Privilege Escalation",
470
+ "msf_modules": ["exploit/linux/postgres/postgres_payload"],
471
+ "severity": "high",
472
+ },
473
+ ],
468
474
  },
469
- 'telnet': {
470
- 'patterns': [
471
- {
472
- 'product': 'all',
473
- 'version_range': 'all',
474
- 'cve': None,
475
- 'title': 'Telnet Login Brute Force',
476
- 'msf_module': 'auxiliary/scanner/telnet/telnet_login',
477
- 'severity': 'high',
478
- 'description': 'Attempt credential brute force'
479
- },
480
- {
481
- 'product': 'all',
482
- 'version_range': 'all',
483
- 'cve': None,
484
- 'title': 'Telnet Version Detection',
485
- 'msf_module': 'auxiliary/scanner/telnet/telnet_version',
486
- 'severity': 'info',
487
- 'description': 'Detect telnet service version'
488
- }
475
+ "telnet": {
476
+ "patterns": [
477
+ {
478
+ "product": "all",
479
+ "version_range": "all",
480
+ "cve": None,
481
+ "title": "Telnet Login Brute Force",
482
+ "msf_module": "auxiliary/scanner/telnet/telnet_login",
483
+ "severity": "high",
484
+ "description": "Attempt credential brute force",
485
+ },
486
+ {
487
+ "product": "all",
488
+ "version_range": "all",
489
+ "cve": None,
490
+ "title": "Telnet Version Detection",
491
+ "msf_module": "auxiliary/scanner/telnet/telnet_version",
492
+ "severity": "info",
493
+ "description": "Detect telnet service version",
494
+ },
489
495
  ],
490
- 'techniques': [
496
+ "techniques": [
491
497
  {
492
- 'name': 'Credential Brute Force',
493
- 'msf_modules': ['auxiliary/scanner/telnet/telnet_login'],
494
- 'severity': 'high'
498
+ "name": "Credential Brute Force",
499
+ "msf_modules": ["auxiliary/scanner/telnet/telnet_login"],
500
+ "severity": "high",
495
501
  },
496
502
  {
497
- 'name': 'Session Hijacking',
498
- 'msf_modules': ['auxiliary/scanner/telnet/telnet_version'],
499
- 'severity': 'medium'
503
+ "name": "Session Hijacking",
504
+ "msf_modules": ["auxiliary/scanner/telnet/telnet_version"],
505
+ "severity": "medium",
500
506
  },
501
507
  {
502
- 'name': 'Traffic Sniffing',
503
- 'msf_modules': ['auxiliary/sniffer/psnuffle'],
504
- 'severity': 'medium'
505
- }
506
- ]
508
+ "name": "Traffic Sniffing",
509
+ "msf_modules": ["auxiliary/sniffer/psnuffle"],
510
+ "severity": "medium",
511
+ },
512
+ ],
507
513
  },
508
- 'smtp': {
509
- 'patterns': [
510
- {
511
- 'product': 'all',
512
- 'version_range': 'all',
513
- 'cve': None,
514
- 'title': 'SMTP User Enumeration',
515
- 'msf_module': 'auxiliary/scanner/smtp/smtp_enum',
516
- 'severity': 'low',
517
- 'description': 'Enumerate valid SMTP users via VRFY/EXPN/RCPT'
518
- },
519
- {
520
- 'product': 'all',
521
- 'version_range': 'all',
522
- 'cve': None,
523
- 'title': 'SMTP Version Detection',
524
- 'msf_module': 'auxiliary/scanner/smtp/smtp_version',
525
- 'severity': 'info',
526
- 'description': 'Detect SMTP service version'
527
- }
514
+ "smtp": {
515
+ "patterns": [
516
+ {
517
+ "product": "all",
518
+ "version_range": "all",
519
+ "cve": None,
520
+ "title": "SMTP User Enumeration",
521
+ "msf_module": "auxiliary/scanner/smtp/smtp_enum",
522
+ "severity": "low",
523
+ "description": "Enumerate valid SMTP users via VRFY/EXPN/RCPT",
524
+ },
525
+ {
526
+ "product": "all",
527
+ "version_range": "all",
528
+ "cve": None,
529
+ "title": "SMTP Version Detection",
530
+ "msf_module": "auxiliary/scanner/smtp/smtp_version",
531
+ "severity": "info",
532
+ "description": "Detect SMTP service version",
533
+ },
528
534
  ],
529
- 'techniques': [
535
+ "techniques": [
530
536
  {
531
- 'name': 'User Enumeration',
532
- 'msf_modules': ['auxiliary/scanner/smtp/smtp_enum'],
533
- 'severity': 'low'
537
+ "name": "User Enumeration",
538
+ "msf_modules": ["auxiliary/scanner/smtp/smtp_enum"],
539
+ "severity": "low",
534
540
  },
535
541
  {
536
- 'name': 'Email Spoofing',
537
- 'msf_modules': ['auxiliary/scanner/smtp/smtp_relay'],
538
- 'severity': 'medium'
542
+ "name": "Email Spoofing",
543
+ "msf_modules": ["auxiliary/scanner/smtp/smtp_relay"],
544
+ "severity": "medium",
539
545
  },
540
546
  {
541
- 'name': 'Open Relay Abuse',
542
- 'msf_modules': ['auxiliary/scanner/smtp/smtp_relay'],
543
- 'severity': 'high'
544
- }
545
- ]
547
+ "name": "Open Relay Abuse",
548
+ "msf_modules": ["auxiliary/scanner/smtp/smtp_relay"],
549
+ "severity": "high",
550
+ },
551
+ ],
546
552
  },
547
- 'rdp': {
548
- 'patterns': [
549
- {
550
- 'product': 'Windows',
551
- 'version_range': 'all',
552
- 'cve': 'CVE-2019-0708',
553
- 'title': 'BlueKeep RDP Remote Code Execution',
554
- 'msf_module': 'exploit/windows/rdp/cve_2019_0708_bluekeep_rce',
555
- 'severity': 'critical',
556
- 'description': 'Pre-authentication RCE in Remote Desktop Services'
557
- },
558
- {
559
- 'product': 'all',
560
- 'version_range': 'all',
561
- 'cve': None,
562
- 'title': 'RDP Login Brute Force',
563
- 'msf_module': 'auxiliary/scanner/rdp/rdp_scanner',
564
- 'severity': 'high',
565
- 'description': 'Scan for RDP services and attempt login'
566
- }
553
+ "rdp": {
554
+ "patterns": [
555
+ {
556
+ "product": "Windows",
557
+ "version_range": "all",
558
+ "cve": "CVE-2019-0708",
559
+ "title": "BlueKeep RDP Remote Code Execution",
560
+ "msf_module": "exploit/windows/rdp/cve_2019_0708_bluekeep_rce",
561
+ "severity": "critical",
562
+ "description": "Pre-authentication RCE in Remote Desktop Services",
563
+ },
564
+ {
565
+ "product": "all",
566
+ "version_range": "all",
567
+ "cve": None,
568
+ "title": "RDP Login Brute Force",
569
+ "msf_module": "auxiliary/scanner/rdp/rdp_scanner",
570
+ "severity": "high",
571
+ "description": "Scan for RDP services and attempt login",
572
+ },
567
573
  ],
568
- 'techniques': [
574
+ "techniques": [
569
575
  {
570
- 'name': 'Credential Brute Force',
571
- 'msf_modules': ['auxiliary/scanner/rdp/rdp_scanner'],
572
- 'severity': 'high'
576
+ "name": "Credential Brute Force",
577
+ "msf_modules": ["auxiliary/scanner/rdp/rdp_scanner"],
578
+ "severity": "high",
573
579
  },
574
580
  {
575
- 'name': 'Session Hijacking',
576
- 'msf_modules': ['auxiliary/scanner/rdp/rdp_scanner'],
577
- 'severity': 'high'
581
+ "name": "Session Hijacking",
582
+ "msf_modules": ["auxiliary/scanner/rdp/rdp_scanner"],
583
+ "severity": "high",
578
584
  },
579
585
  {
580
- 'name': 'Pass-the-Hash',
581
- 'msf_modules': ['exploit/windows/local/ms14_068_kerberos_checksum'],
582
- 'severity': 'critical'
583
- }
584
- ]
585
- }
586
+ "name": "Pass-the-Hash",
587
+ "msf_modules": ["exploit/windows/local/ms14_068_kerberos_checksum"],
588
+ "severity": "critical",
589
+ },
590
+ ],
591
+ },
586
592
  }
587
593
 
588
594
 
@@ -607,15 +613,16 @@ class ExploitKnowledgeBase:
607
613
  def _searchsploit_available(self) -> bool:
608
614
  """Check if searchsploit is installed and available."""
609
615
  try:
610
- subprocess.run(['searchsploit', '--help'],
611
- capture_output=True,
612
- timeout=2,
613
- check=False)
616
+ subprocess.run(
617
+ ["searchsploit", "--help"], capture_output=True, timeout=2, check=False
618
+ )
614
619
  return True
615
620
  except (FileNotFoundError, subprocess.TimeoutExpired):
616
621
  return False
617
-
618
- def find_exploits(self, service: str, version: str, product: str = None) -> List[Dict]:
622
+
623
+ def find_exploits(
624
+ self, service: str, version: str, product: str = None
625
+ ) -> List[Dict]:
619
626
  """
620
627
  Find matching exploits for a service.
621
628
 
@@ -633,17 +640,13 @@ class ExploitKnowledgeBase:
633
640
  matches = []
634
641
  if service_lower in self.database:
635
642
  service_data = self.database[service_lower]
636
- patterns = service_data.get('patterns', [])
643
+ patterns = service_data.get("patterns", [])
637
644
 
638
645
  for pattern in patterns:
639
646
  match_type = self._check_match(pattern, version, product)
640
647
 
641
648
  if match_type:
642
- exploit = {
643
- **pattern,
644
- 'match_type': match_type,
645
- 'source': 'msf_kb'
646
- }
649
+ exploit = {**pattern, "match_type": match_type, "source": "msf_kb"}
647
650
  matches.append(exploit)
648
651
 
649
652
  # Augment with searchsploit results if enabled
@@ -654,13 +657,13 @@ class ExploitKnowledgeBase:
654
657
  # Deduplicate and rank by priority
655
658
  matches = self._deduplicate_exploits(matches)
656
659
  return self._rank_exploits(matches)
657
-
660
+
658
661
  def get_techniques(self, service: str) -> List[str]:
659
662
  """Get exploitation techniques for a service type."""
660
663
  service_lower = service.lower()
661
664
 
662
665
  if service_lower in self.database:
663
- return self.database[service_lower].get('techniques', [])
666
+ return self.database[service_lower].get("techniques", [])
664
667
 
665
668
  return []
666
669
 
@@ -684,13 +687,13 @@ class ExploitKnowledgeBase:
684
687
 
685
688
  # Search static knowledge base
686
689
  for service_name, service_data in self.database.items():
687
- for pattern in service_data.get('patterns', []):
688
- if pattern.get('cve') and pattern['cve'].upper() == cve_upper:
690
+ for pattern in service_data.get("patterns", []):
691
+ if pattern.get("cve") and pattern["cve"].upper() == cve_upper:
689
692
  exploit = {
690
693
  **pattern,
691
- 'match_type': 'exact',
692
- 'source': 'msf_kb',
693
- 'matched_service': service_name
694
+ "match_type": "exact",
695
+ "source": "msf_kb",
696
+ "matched_service": service_name,
694
697
  }
695
698
  matches.append(exploit)
696
699
 
@@ -714,11 +717,11 @@ class ExploitKnowledgeBase:
714
717
 
715
718
  try:
716
719
  result = subprocess.run(
717
- ['searchsploit', '--json', cve_id],
720
+ ["searchsploit", "--json", cve_id],
718
721
  capture_output=True,
719
722
  timeout=5,
720
723
  text=True,
721
- check=False
724
+ check=False,
722
725
  )
723
726
 
724
727
  if result.returncode != 0:
@@ -727,23 +730,27 @@ class ExploitKnowledgeBase:
727
730
  data = json.loads(result.stdout)
728
731
  exploits = []
729
732
 
730
- for exploit_result in data.get('RESULTS_EXPLOIT', []):
731
- title = exploit_result.get('Title', '')
732
- edb_id = exploit_result.get('EDB-ID', '')
733
- platform = exploit_result.get('Platform', '')
733
+ for exploit_result in data.get("RESULTS_EXPLOIT", []):
734
+ title = exploit_result.get("Title", "")
735
+ edb_id = exploit_result.get("EDB-ID", "")
736
+ platform = exploit_result.get("Platform", "")
734
737
 
735
738
  exploit = {
736
- 'title': title,
737
- 'severity': self._determine_searchsploit_severity(title, platform),
738
- 'msf_module': None,
739
- 'cve': cve_id.upper(),
740
- 'description': f"Exploit-DB entry for {cve_id}",
741
- 'match_type': 'exact',
742
- 'source': 'searchsploit',
743
- 'edb_id': edb_id,
744
- 'edb_url': f"https://www.exploit-db.com/exploits/{edb_id}" if edb_id else None,
745
- 'platform': platform,
746
- 'path': exploit_result.get('Path', '')
739
+ "title": title,
740
+ "severity": self._determine_searchsploit_severity(title, platform),
741
+ "msf_module": None,
742
+ "cve": cve_id.upper(),
743
+ "description": f"Exploit-DB entry for {cve_id}",
744
+ "match_type": "exact",
745
+ "source": "searchsploit",
746
+ "edb_id": edb_id,
747
+ "edb_url": (
748
+ f"https://www.exploit-db.com/exploits/{edb_id}"
749
+ if edb_id
750
+ else None
751
+ ),
752
+ "platform": platform,
753
+ "path": exploit_result.get("Path", ""),
747
754
  }
748
755
  exploits.append(exploit)
749
756
 
@@ -754,7 +761,9 @@ class ExploitKnowledgeBase:
754
761
  except (subprocess.TimeoutExpired, json.JSONDecodeError, Exception):
755
762
  return []
756
763
 
757
- def _query_searchsploit(self, service: str, version: str, product: str = None) -> List[Dict]:
764
+ def _query_searchsploit(
765
+ self, service: str, version: str, product: str = None
766
+ ) -> List[Dict]:
758
767
  """
759
768
  Query searchsploit for exploits.
760
769
 
@@ -767,11 +776,11 @@ class ExploitKnowledgeBase:
767
776
  List of exploits from searchsploit
768
777
  """
769
778
  # Build smart query - use product+version if available, otherwise service
770
- if product and version and version != 'unknown':
779
+ if product and version and version != "unknown":
771
780
  query = f"{product} {version}"
772
781
  elif product:
773
782
  query = product
774
- elif version and version != 'unknown':
783
+ elif version and version != "unknown":
775
784
  query = f"{service} {version}"
776
785
  else:
777
786
  query = service
@@ -786,11 +795,11 @@ class ExploitKnowledgeBase:
786
795
  # Run searchsploit
787
796
  try:
788
797
  result = subprocess.run(
789
- ['searchsploit', '--json', query],
798
+ ["searchsploit", "--json", query],
790
799
  capture_output=True,
791
800
  timeout=5, # Reduced to 5s to prevent UI hangs
792
801
  text=True,
793
- check=False
802
+ check=False,
794
803
  )
795
804
 
796
805
  if result.returncode != 0:
@@ -801,14 +810,18 @@ class ExploitKnowledgeBase:
801
810
  exploits = []
802
811
 
803
812
  # Parse exploit results
804
- for exploit_result in data.get('RESULTS_EXPLOIT', []):
805
- exploit = self._parse_searchsploit_result(exploit_result, service, version, product)
813
+ for exploit_result in data.get("RESULTS_EXPLOIT", []):
814
+ exploit = self._parse_searchsploit_result(
815
+ exploit_result, service, version, product
816
+ )
806
817
  if exploit:
807
818
  exploits.append(exploit)
808
819
 
809
820
  # Parse shellcode results (less common but useful)
810
- for shellcode_result in data.get('RESULTS_SHELLCODE', []):
811
- exploit = self._parse_searchsploit_result(shellcode_result, service, version, product, is_shellcode=True)
821
+ for shellcode_result in data.get("RESULTS_SHELLCODE", []):
822
+ exploit = self._parse_searchsploit_result(
823
+ shellcode_result, service, version, product, is_shellcode=True
824
+ )
812
825
  if exploit:
813
826
  exploits.append(exploit)
814
827
 
@@ -821,8 +834,14 @@ class ExploitKnowledgeBase:
821
834
  # Graceful degradation - if searchsploit fails, just return empty
822
835
  return []
823
836
 
824
- def _parse_searchsploit_result(self, result: Dict, service: str, version: str,
825
- product: str = None, is_shellcode: bool = False) -> Optional[Dict]:
837
+ def _parse_searchsploit_result(
838
+ self,
839
+ result: Dict,
840
+ service: str,
841
+ version: str,
842
+ product: str = None,
843
+ is_shellcode: bool = False,
844
+ ) -> Optional[Dict]:
826
845
  """
827
846
  Parse a single searchsploit result and convert to our format.
828
847
 
@@ -836,9 +855,9 @@ class ExploitKnowledgeBase:
836
855
  Returns:
837
856
  Formatted exploit dict or None if should be filtered
838
857
  """
839
- title = result.get('Title', '')
840
- platform = result.get('Platform', result.get('Type', ''))
841
- edb_id = result.get('EDB-ID', '')
858
+ title = result.get("Title", "")
859
+ platform = result.get("Platform", result.get("Type", ""))
860
+ edb_id = result.get("EDB-ID", "")
842
861
 
843
862
  # Filter out irrelevant platforms for better signal-to-noise
844
863
  # e.g., if we're scanning a Linux host, skip Windows exploits
@@ -850,39 +869,43 @@ class ExploitKnowledgeBase:
850
869
 
851
870
  # Extract CVE if mentioned in title
852
871
  cve = None
853
- cve_match = re.search(r'CVE-\d{4}-\d{4,}', title, re.IGNORECASE)
872
+ cve_match = re.search(r"CVE-\d{4}-\d{4,}", title, re.IGNORECASE)
854
873
  if cve_match:
855
874
  cve = cve_match.group(0).upper()
856
875
 
857
876
  return {
858
- 'title': title,
859
- 'severity': severity,
860
- 'msf_module': None, # searchsploit results aren't MSF modules
861
- 'cve': cve,
862
- 'description': f"Exploit-DB entry for {product or service}",
863
- 'match_type': match_type,
864
- 'source': 'searchsploit',
865
- 'edb_id': edb_id,
866
- 'edb_url': f"https://www.exploit-db.com/exploits/{edb_id}" if edb_id else None,
867
- 'platform': platform,
868
- 'path': result.get('Path', ''),
869
- 'is_shellcode': is_shellcode
877
+ "title": title,
878
+ "severity": severity,
879
+ "msf_module": None, # searchsploit results aren't MSF modules
880
+ "cve": cve,
881
+ "description": f"Exploit-DB entry for {product or service}",
882
+ "match_type": match_type,
883
+ "source": "searchsploit",
884
+ "edb_id": edb_id,
885
+ "edb_url": (
886
+ f"https://www.exploit-db.com/exploits/{edb_id}" if edb_id else None
887
+ ),
888
+ "platform": platform,
889
+ "path": result.get("Path", ""),
890
+ "is_shellcode": is_shellcode,
870
891
  }
871
892
 
872
- def _determine_searchsploit_match_type(self, title: str, version: str, product: str) -> str:
893
+ def _determine_searchsploit_match_type(
894
+ self, title: str, version: str, product: str
895
+ ) -> str:
873
896
  """Determine how well the searchsploit result matches our query."""
874
897
  title_lower = title.lower()
875
898
 
876
899
  # Check if exact version is in title
877
- if version and version != 'unknown' and version in title_lower:
878
- return 'exact'
900
+ if version and version != "unknown" and version in title_lower:
901
+ return "exact"
879
902
 
880
903
  # Check if product is in title
881
904
  if product and product.lower() in title_lower:
882
- return 'range'
905
+ return "range"
883
906
 
884
907
  # Generic match
885
- return 'generic'
908
+ return "generic"
886
909
 
887
910
  def _determine_searchsploit_severity(self, title: str, platform: str) -> str:
888
911
  """
@@ -893,25 +916,46 @@ class ExploitKnowledgeBase:
893
916
  title_lower = title.lower()
894
917
 
895
918
  # Critical indicators
896
- critical_keywords = ['remote code execution', 'rce', 'backdoor', 'unauthenticated',
897
- 'pre-auth', 'arbitrary code', 'command injection', 'command execution']
919
+ critical_keywords = [
920
+ "remote code execution",
921
+ "rce",
922
+ "backdoor",
923
+ "unauthenticated",
924
+ "pre-auth",
925
+ "arbitrary code",
926
+ "command injection",
927
+ "command execution",
928
+ ]
898
929
  if any(keyword in title_lower for keyword in critical_keywords):
899
- return 'critical'
930
+ return "critical"
900
931
 
901
932
  # High indicators
902
- high_keywords = ['privilege escalation', 'buffer overflow', 'sql injection',
903
- 'authentication bypass', 'file upload', 'arbitrary file']
933
+ high_keywords = [
934
+ "privilege escalation",
935
+ "buffer overflow",
936
+ "sql injection",
937
+ "authentication bypass",
938
+ "file upload",
939
+ "arbitrary file",
940
+ ]
904
941
  if any(keyword in title_lower for keyword in high_keywords):
905
- return 'high'
942
+ return "high"
906
943
 
907
944
  # Medium indicators
908
- medium_keywords = ['denial of service', 'dos', 'xss', 'csrf', 'information disclosure',
909
- 'directory traversal', 'path traversal']
945
+ medium_keywords = [
946
+ "denial of service",
947
+ "dos",
948
+ "xss",
949
+ "csrf",
950
+ "information disclosure",
951
+ "directory traversal",
952
+ "path traversal",
953
+ ]
910
954
  if any(keyword in title_lower for keyword in medium_keywords):
911
- return 'medium'
955
+ return "medium"
912
956
 
913
957
  # Default to low for everything else
914
- return 'low'
958
+ return "low"
915
959
 
916
960
  def _deduplicate_exploits(self, exploits: List[Dict]) -> List[Dict]:
917
961
  """
@@ -930,18 +974,20 @@ class ExploitKnowledgeBase:
930
974
  deduplicated = []
931
975
 
932
976
  # Sort so MSF results come first (they'll be kept in case of duplicates)
933
- exploits_sorted = sorted(exploits, key=lambda x: 0 if x.get('source') == 'msf_kb' else 1)
977
+ exploits_sorted = sorted(
978
+ exploits, key=lambda x: 0 if x.get("source") == "msf_kb" else 1
979
+ )
934
980
 
935
981
  for exploit in exploits_sorted:
936
982
  # Check CVE deduplication
937
- cve = exploit.get('cve')
983
+ cve = exploit.get("cve")
938
984
  if cve and cve in seen_cves:
939
985
  continue
940
986
 
941
987
  # Check title similarity (fuzzy matching)
942
- title = exploit.get('title', '').lower()
988
+ title = exploit.get("title", "").lower()
943
989
  # Normalize title for comparison
944
- title_normalized = re.sub(r'[^\w\s]', '', title)
990
+ title_normalized = re.sub(r"[^\w\s]", "", title)
945
991
 
946
992
  is_duplicate = False
947
993
  for seen_title in seen_titles:
@@ -982,104 +1028,106 @@ class ExploitKnowledgeBase:
982
1028
  def _check_match(self, pattern: Dict, version: str, product: str) -> Optional[str]:
983
1029
  """
984
1030
  Check if service matches exploit pattern.
985
-
1031
+
986
1032
  Returns:
987
1033
  'exact' | 'range' | 'generic' | None
988
1034
  """
989
1035
  # Check product match
990
- pattern_product = pattern.get('product', 'all')
991
- if pattern_product != 'all' and product:
1036
+ pattern_product = pattern.get("product", "all")
1037
+ if pattern_product != "all" and product:
992
1038
  if pattern_product.lower() != product.lower():
993
1039
  return None
994
-
1040
+
995
1041
  # Check version match
996
- if pattern.get('version_exact'):
997
- if version == pattern['version_exact']:
998
- return 'exact'
1042
+ if pattern.get("version_exact"):
1043
+ if version == pattern["version_exact"]:
1044
+ return "exact"
999
1045
  return None
1000
-
1001
- if pattern.get('version_range'):
1002
- version_range = pattern['version_range']
1003
-
1004
- if version_range == 'all':
1005
- return 'generic'
1006
-
1046
+
1047
+ if pattern.get("version_range"):
1048
+ version_range = pattern["version_range"]
1049
+
1050
+ if version_range == "all":
1051
+ return "generic"
1052
+
1007
1053
  if self.version_matches(version, version_range):
1008
- return 'range'
1054
+ return "range"
1009
1055
  return None
1010
-
1056
+
1011
1057
  # No version constraint = generic match
1012
- return 'generic'
1013
-
1058
+ return "generic"
1059
+
1014
1060
  def version_matches(self, target_version: str, version_spec: str) -> bool:
1015
1061
  """
1016
1062
  Check if version matches specification.
1017
-
1063
+
1018
1064
  Examples:
1019
1065
  version_matches('2.3.4', '2.3.4') → True (exact)
1020
1066
  version_matches('7.2', '<7.4') → True (range)
1021
1067
  version_matches('8.2', 'all') → True (any)
1022
1068
  """
1023
- if version_spec == 'all':
1069
+ if version_spec == "all":
1024
1070
  return True
1025
-
1026
- if target_version == 'unknown':
1071
+
1072
+ if target_version == "unknown":
1027
1073
  return False
1028
-
1074
+
1029
1075
  # Exact match
1030
1076
  if version_spec == target_version:
1031
1077
  return True
1032
-
1078
+
1033
1079
  # Range match
1034
- if '-' in version_spec:
1080
+ if "-" in version_spec:
1035
1081
  # Format: "3.0.20-3.0.25"
1036
1082
  try:
1037
- start, end = version_spec.split('-')
1038
- return self._version_compare(target_version, start) >= 0 and \
1039
- self._version_compare(target_version, end) <= 0
1083
+ start, end = version_spec.split("-")
1084
+ return (
1085
+ self._version_compare(target_version, start) >= 0
1086
+ and self._version_compare(target_version, end) <= 0
1087
+ )
1040
1088
  except:
1041
1089
  return False
1042
-
1090
+
1043
1091
  # Less than
1044
- if version_spec.startswith('<'):
1092
+ if version_spec.startswith("<"):
1045
1093
  compare_version = version_spec[1:]
1046
1094
  return self._version_compare(target_version, compare_version) < 0
1047
-
1095
+
1048
1096
  # Greater than
1049
- if version_spec.startswith('>'):
1097
+ if version_spec.startswith(">"):
1050
1098
  compare_version = version_spec[1:]
1051
1099
  return self._version_compare(target_version, compare_version) > 0
1052
-
1100
+
1053
1101
  return False
1054
-
1102
+
1055
1103
  def _version_compare(self, v1: str, v2: str) -> int:
1056
1104
  """
1057
1105
  Compare two version numbers.
1058
-
1106
+
1059
1107
  Returns:
1060
1108
  -1 if v1 < v2
1061
1109
  0 if v1 == v2
1062
1110
  1 if v1 > v2
1063
1111
  """
1064
1112
  try:
1065
- parts1 = [int(x) for x in v1.replace('p', '.').split('.')]
1066
- parts2 = [int(x) for x in v2.replace('p', '.').split('.')]
1067
-
1113
+ parts1 = [int(x) for x in v1.replace("p", ".").split(".")]
1114
+ parts2 = [int(x) for x in v2.replace("p", ".").split(".")]
1115
+
1068
1116
  # Pad with zeros
1069
1117
  max_len = max(len(parts1), len(parts2))
1070
1118
  parts1 += [0] * (max_len - len(parts1))
1071
1119
  parts2 += [0] * (max_len - len(parts2))
1072
-
1120
+
1073
1121
  for p1, p2 in zip(parts1, parts2):
1074
1122
  if p1 < p2:
1075
1123
  return -1
1076
1124
  elif p1 > p2:
1077
1125
  return 1
1078
-
1126
+
1079
1127
  return 0
1080
1128
  except:
1081
1129
  return 0
1082
-
1130
+
1083
1131
  def _rank_exploits(self, exploits: List[Dict]) -> List[Dict]:
1084
1132
  """
1085
1133
  Rank exploits by priority.
@@ -1090,26 +1138,16 @@ class ExploitKnowledgeBase:
1090
1138
  3. Source (MSF modules preferred over searchsploit)
1091
1139
  4. CVE availability
1092
1140
  """
1093
- severity_order = {
1094
- 'critical': 5,
1095
- 'high': 4,
1096
- 'medium': 3,
1097
- 'low': 2,
1098
- 'info': 1
1099
- }
1141
+ severity_order = {"critical": 5, "high": 4, "medium": 3, "low": 2, "info": 1}
1100
1142
 
1101
- match_order = {
1102
- 'exact': 3,
1103
- 'range': 2,
1104
- 'generic': 1
1105
- }
1143
+ match_order = {"exact": 3, "range": 2, "generic": 1}
1106
1144
 
1107
1145
  def sort_key(exploit):
1108
- severity_score = severity_order.get(exploit.get('severity', 'info'), 0)
1109
- match_score = match_order.get(exploit.get('match_type', 'generic'), 0)
1146
+ severity_score = severity_order.get(exploit.get("severity", "info"), 0)
1147
+ match_score = match_order.get(exploit.get("match_type", "generic"), 0)
1110
1148
  # Prefer MSF modules (more actionable) over searchsploit results
1111
- source_score = 1 if exploit.get('source') == 'msf_kb' else 0
1112
- cve_score = 1 if exploit.get('cve') else 0
1149
+ source_score = 1 if exploit.get("source") == "msf_kb" else 0
1150
+ cve_score = 1 if exploit.get("cve") else 0
1113
1151
 
1114
1152
  return (severity_score, match_score, source_score, cve_score)
1115
1153