souleyez 3.0.0__py3-none-any.whl → 3.0.7__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.
- souleyez/__init__.py +1 -1
- souleyez/ai/__init__.py +7 -7
- souleyez/ai/action_mapper.py +3 -2
- souleyez/ai/chain_advisor.py +2 -1
- souleyez/ai/claude_provider.py +2 -2
- souleyez/ai/context_builder.py +4 -2
- souleyez/ai/executor.py +9 -6
- souleyez/ai/feedback_handler.py +4 -2
- souleyez/ai/llm_provider.py +2 -2
- souleyez/ai/ollama_provider.py +2 -2
- souleyez/ai/ollama_service.py +10 -26
- souleyez/ai/path_scorer.py +2 -1
- souleyez/ai/recommender.py +6 -4
- souleyez/ai/report_context.py +2 -2
- souleyez/ai/report_service.py +5 -5
- souleyez/ai/result_parser.py +3 -2
- souleyez/ai/safety.py +5 -2
- souleyez/auth/__init__.py +6 -6
- souleyez/auth/audit.py +2 -2
- souleyez/auth/engagement_access.py +5 -7
- souleyez/auth/permissions.py +1 -1
- souleyez/auth/session_manager.py +5 -5
- souleyez/auth/user_manager.py +4 -5
- souleyez/commands/audit.py +6 -5
- souleyez/commands/auth.py +6 -5
- souleyez/commands/deliverables.py +2 -3
- souleyez/commands/engagement.py +3 -3
- souleyez/commands/license.py +3 -2
- souleyez/commands/screenshots.py +5 -4
- souleyez/commands/user.py +10 -8
- souleyez/config.py +4 -2
- souleyez/core/credential_tester.py +4 -2
- souleyez/core/cve_mappings.py +2 -1
- souleyez/core/cve_matcher.py +2 -1
- souleyez/core/msf_auto_mapper.py +2 -0
- souleyez/core/msf_chain_engine.py +3 -1
- souleyez/core/msf_database.py +7 -13
- souleyez/core/msf_integration.py +2 -2
- souleyez/core/msf_rpc_client.py +3 -2
- souleyez/core/msf_rpc_manager.py +4 -4
- souleyez/core/msf_sync_manager.py +7 -7
- souleyez/core/network_utils.py +1 -1
- souleyez/core/parser_handler.py +2 -1
- souleyez/core/pending_chains.py +4 -3
- souleyez/core/templates.py +5 -2
- souleyez/core/tool_chaining.py +101 -70
- souleyez/core/version_utils.py +1 -0
- souleyez/core/vuln_correlation.py +3 -2
- souleyez/core/web_utils.py +2 -1
- souleyez/detection/__init__.py +1 -1
- souleyez/detection/attack_signatures.py +1 -1
- souleyez/detection/mitre_mappings.py +1 -2
- souleyez/detection/validator.py +5 -4
- souleyez/devtools.py +4 -2
- souleyez/docs/README.md +2 -2
- souleyez/engine/background.py +168 -7
- souleyez/engine/base.py +2 -1
- souleyez/engine/loader.py +4 -2
- souleyez/engine/log_sanitizer.py +1 -0
- souleyez/engine/manager.py +3 -1
- souleyez/engine/result_handler.py +50 -67
- souleyez/engine/worker_manager.py +6 -4
- souleyez/export/evidence_bundle.py +1 -0
- souleyez/handlers/base.py +1 -0
- souleyez/handlers/bash_handler.py +1 -0
- souleyez/handlers/bloodhound_handler.py +1 -0
- souleyez/handlers/certipy_handler.py +1 -0
- souleyez/handlers/crackmapexec_handler.py +2 -20
- souleyez/handlers/dnsrecon_handler.py +2 -1
- souleyez/handlers/enum4linux_handler.py +65 -37
- souleyez/handlers/evil_winrm_handler.py +1 -0
- souleyez/handlers/ffuf_handler.py +3 -1
- souleyez/handlers/gobuster_handler.py +7 -6
- souleyez/handlers/gpp_extract_handler.py +1 -0
- souleyez/handlers/hashcat_handler.py +1 -0
- souleyez/handlers/hydra_handler.py +5 -2
- souleyez/handlers/impacket_getuserspns_handler.py +1 -0
- souleyez/handlers/impacket_psexec_handler.py +1 -0
- souleyez/handlers/impacket_secretsdump_handler.py +1 -0
- souleyez/handlers/john_handler.py +1 -0
- souleyez/handlers/katana_handler.py +39 -2
- souleyez/handlers/kerbrute_handler.py +1 -0
- souleyez/handlers/ldapsearch_handler.py +90 -17
- souleyez/handlers/lfi_extract_handler.py +1 -0
- souleyez/handlers/msf_auxiliary_handler.py +1 -0
- souleyez/handlers/msf_exploit_handler.py +1 -0
- souleyez/handlers/nikto_handler.py +2 -1
- souleyez/handlers/nmap_handler.py +2 -1
- souleyez/handlers/nuclei_handler.py +2 -1
- souleyez/handlers/nxc_handler.py +3 -18
- souleyez/handlers/rdp_sec_check_handler.py +1 -0
- souleyez/handlers/registry.py +1 -0
- souleyez/handlers/responder_handler.py +1 -0
- souleyez/handlers/service_explorer_handler.py +2 -1
- souleyez/handlers/smbclient_handler.py +1 -0
- souleyez/handlers/smbmap_handler.py +3 -2
- souleyez/handlers/sqlmap_handler.py +6 -4
- souleyez/handlers/theharvester_handler.py +2 -1
- souleyez/handlers/web_login_test_handler.py +1 -0
- souleyez/handlers/whois_handler.py +3 -2
- souleyez/handlers/wpscan_handler.py +2 -1
- souleyez/history.py +4 -3
- souleyez/importers/msf_importer.py +5 -3
- souleyez/importers/smart_importer.py +6 -4
- souleyez/integrations/siem/__init__.py +6 -6
- souleyez/integrations/siem/base.py +1 -1
- souleyez/integrations/siem/elastic.py +3 -3
- souleyez/integrations/siem/factory.py +1 -2
- souleyez/integrations/siem/googlesecops.py +4 -4
- souleyez/integrations/siem/rule_mappings/wazuh_rules.py +1 -1
- souleyez/integrations/siem/sentinel.py +3 -3
- souleyez/integrations/siem/splunk.py +3 -3
- souleyez/integrations/siem/wazuh.py +4 -4
- souleyez/integrations/wazuh/__init__.py +1 -1
- souleyez/integrations/wazuh/client.py +3 -2
- souleyez/integrations/wazuh/config.py +3 -2
- souleyez/integrations/wazuh/host_mapper.py +3 -1
- souleyez/integrations/wazuh/sync.py +4 -1
- souleyez/intelligence/__init__.py +1 -1
- souleyez/intelligence/correlation_analyzer.py +6 -5
- souleyez/intelligence/exploit_knowledge.py +4 -4
- souleyez/intelligence/exploit_suggestions.py +4 -3
- souleyez/intelligence/gap_analyzer.py +5 -3
- souleyez/intelligence/gap_detector.py +2 -0
- souleyez/intelligence/sensitive_tables.py +1 -1
- souleyez/intelligence/service_parser.py +1 -0
- souleyez/intelligence/surface_analyzer.py +9 -9
- souleyez/intelligence/target_parser.py +1 -0
- souleyez/licensing/__init__.py +3 -3
- souleyez/main.py +25 -18
- souleyez/migrations/fix_job_counter.py +2 -1
- souleyez/parsers/bloodhound_parser.py +1 -0
- souleyez/parsers/crackmapexec_parser.py +2 -1
- souleyez/parsers/dalfox_parser.py +3 -2
- souleyez/parsers/dnsrecon_parser.py +2 -1
- souleyez/parsers/enum4linux_parser.py +2 -1
- souleyez/parsers/ffuf_parser.py +2 -1
- souleyez/parsers/gobuster_parser.py +2 -1
- souleyez/parsers/hashcat_parser.py +3 -2
- souleyez/parsers/http_fingerprint_parser.py +2 -1
- souleyez/parsers/hydra_parser.py +2 -1
- souleyez/parsers/impacket_parser.py +2 -1
- souleyez/parsers/john_parser.py +4 -3
- souleyez/parsers/katana_parser.py +134 -2
- souleyez/parsers/msf_parser.py +2 -1
- souleyez/parsers/nikto_parser.py +2 -1
- souleyez/parsers/nmap_parser.py +14 -3
- souleyez/parsers/nuclei_parser.py +3 -2
- souleyez/parsers/responder_parser.py +1 -0
- souleyez/parsers/searchsploit_parser.py +3 -2
- souleyez/parsers/service_explorer_parser.py +1 -0
- souleyez/parsers/smbmap_parser.py +2 -1
- souleyez/parsers/sqlmap_parser.py +36 -2
- souleyez/parsers/theharvester_parser.py +2 -1
- souleyez/parsers/whois_parser.py +2 -1
- souleyez/parsers/wpscan_parser.py +3 -2
- souleyez/plugins/afp.py +3 -1
- souleyez/plugins/afp_brute.py +3 -1
- souleyez/plugins/ard.py +3 -1
- souleyez/plugins/bloodhound.py +3 -2
- souleyez/plugins/certipy.py +1 -0
- souleyez/plugins/crackmapexec.py +11 -7
- souleyez/plugins/dalfox.py +5 -2
- souleyez/plugins/dns_hijack.py +3 -1
- souleyez/plugins/dnsrecon.py +3 -1
- souleyez/plugins/enum4linux.py +3 -1
- souleyez/plugins/evil_winrm.py +1 -0
- souleyez/plugins/ffuf.py +3 -1
- souleyez/plugins/firmware_extract.py +3 -2
- souleyez/plugins/gobuster.py +6 -3
- souleyez/plugins/gpp_extract.py +1 -0
- souleyez/plugins/hashcat.py +2 -1
- souleyez/plugins/http_fingerprint.py +57 -7
- souleyez/plugins/hydra.py +5 -3
- souleyez/plugins/impacket_common.py +40 -0
- souleyez/plugins/impacket_getnpusers.py +19 -2
- souleyez/plugins/impacket_getuserspns.py +158 -0
- souleyez/plugins/impacket_psexec.py +19 -2
- souleyez/plugins/impacket_secretsdump.py +19 -2
- souleyez/plugins/impacket_smbclient.py +19 -2
- souleyez/plugins/john.py +2 -1
- souleyez/plugins/katana.py +48 -6
- souleyez/plugins/kerbrute.py +1 -0
- souleyez/plugins/lfi_extract.py +1 -0
- souleyez/plugins/macos_ssh.py +3 -1
- souleyez/plugins/mdns.py +3 -1
- souleyez/plugins/msf_auxiliary.py +3 -2
- souleyez/plugins/msf_exploit.py +6 -5
- souleyez/plugins/nikto.py +5 -2
- souleyez/plugins/nmap.py +6 -4
- souleyez/plugins/nuclei.py +3 -1
- souleyez/plugins/nxc.py +1 -0
- souleyez/plugins/plugin_base.py +3 -2
- souleyez/plugins/plugin_template.py +3 -2
- souleyez/plugins/rdp_sec_check.py +1 -0
- souleyez/plugins/responder.py +2 -1
- souleyez/plugins/router_http_brute.py +3 -1
- souleyez/plugins/router_ssh_brute.py +3 -1
- souleyez/plugins/router_telnet_brute.py +3 -1
- souleyez/plugins/routersploit.py +5 -3
- souleyez/plugins/routersploit_exploit.py +5 -3
- souleyez/plugins/searchsploit.py +1 -0
- souleyez/plugins/service_explorer.py +2 -1
- souleyez/plugins/smbmap.py +3 -1
- souleyez/plugins/smbpasswd.py +1 -0
- souleyez/plugins/sqlmap.py +3 -1
- souleyez/plugins/theharvester.py +3 -1
- souleyez/plugins/tr069.py +3 -1
- souleyez/plugins/upnp.py +3 -1
- souleyez/plugins/upnp_abuse.py +4 -2
- souleyez/plugins/vnc_access.py +4 -2
- souleyez/plugins/vnc_brute.py +3 -1
- souleyez/plugins/web_login_test.py +1 -0
- souleyez/plugins/whois.py +3 -1
- souleyez/plugins/wpscan.py +3 -1
- souleyez/reporting/attack_chain.py +2 -1
- souleyez/reporting/charts.py +1 -0
- souleyez/reporting/compliance_mappings.py +1 -0
- souleyez/reporting/detection_report.py +10 -10
- souleyez/reporting/formatters.py +7 -12
- souleyez/reporting/generator.py +34 -46
- souleyez/reporting/metrics.py +2 -1
- souleyez/scanner.py +6 -3
- souleyez/security/__init__.py +7 -5
- souleyez/security/scope_validator.py +5 -4
- souleyez/security.py +5 -2
- souleyez/storage/credentials.py +14 -19
- souleyez/storage/crypto.py +7 -4
- souleyez/storage/database.py +6 -6
- souleyez/storage/db.py +8 -8
- souleyez/storage/deliverable_evidence.py +2 -1
- souleyez/storage/deliverable_exporter.py +3 -2
- souleyez/storage/deliverable_templates.py +2 -1
- souleyez/storage/deliverables.py +2 -1
- souleyez/storage/engagements.py +6 -4
- souleyez/storage/evidence.py +5 -4
- souleyez/storage/execution_log.py +4 -2
- souleyez/storage/exploit_attempts.py +3 -2
- souleyez/storage/exploits.py +3 -1
- souleyez/storage/findings.py +3 -1
- souleyez/storage/hosts.py +5 -2
- souleyez/storage/migrate_to_engagements.py +14 -24
- souleyez/storage/migrations/_001_add_credential_enhancements.py +12 -21
- souleyez/storage/migrations/_003_add_execution_log.py +8 -13
- souleyez/storage/migrations/_005_screenshots.py +2 -4
- souleyez/storage/migrations/_006_deliverables.py +2 -4
- souleyez/storage/migrations/_007_deliverable_templates.py +4 -8
- souleyez/storage/migrations/_008_add_nuclei_table.py +2 -4
- souleyez/storage/migrations/_010_evidence_linking.py +6 -12
- souleyez/storage/migrations/_012_team_collaboration.py +12 -24
- souleyez/storage/migrations/_013_add_host_tags.py +2 -4
- souleyez/storage/migrations/_014_exploit_attempts.py +10 -20
- souleyez/storage/migrations/_015_add_mac_os_fields.py +4 -8
- souleyez/storage/migrations/_016_add_domain_field.py +2 -4
- souleyez/storage/migrations/_017_msf_sessions.py +8 -16
- souleyez/storage/migrations/_018_add_osint_target.py +4 -8
- souleyez/storage/migrations/_019_add_engagement_type.py +4 -8
- souleyez/storage/migrations/_020_add_rbac.py +9 -17
- souleyez/storage/migrations/_021_wazuh_integration.py +4 -8
- souleyez/storage/migrations/_023_fix_detection_results_fk.py +2 -4
- souleyez/storage/migrations/_024_wazuh_vulnerabilities.py +4 -8
- souleyez/storage/migrations/_026_add_engagement_scope.py +4 -8
- souleyez/storage/migrations/_027_multi_siem_persistence.py +8 -16
- souleyez/storage/migrations/__init__.py +1 -4
- souleyez/storage/migrations/migration_manager.py +6 -9
- souleyez/storage/msf_sessions.py +1 -1
- souleyez/storage/osint.py +3 -1
- souleyez/storage/recommendation_engine.py +3 -2
- souleyez/storage/screenshots.py +2 -1
- souleyez/storage/smb_shares.py +3 -1
- souleyez/storage/sqlmap_data.py +6 -4
- souleyez/storage/team_collaboration.py +3 -2
- souleyez/storage/timeline_tracker.py +2 -1
- souleyez/storage/wazuh_vulns.py +3 -1
- souleyez/storage/web_paths.py +3 -1
- souleyez/testing/credential_tester.py +2 -0
- souleyez/ui/__init__.py +2 -1
- souleyez/ui/ai_quotes.py +1 -1
- souleyez/ui/attack_surface.py +50 -28
- souleyez/ui/chain_rules_view.py +6 -3
- souleyez/ui/correlation_view.py +3 -2
- souleyez/ui/dashboard.py +85 -139
- souleyez/ui/deliverables_view.py +1 -1
- souleyez/ui/design_system.py +5 -3
- souleyez/ui/errors.py +3 -1
- souleyez/ui/evidence_linking_view.py +2 -1
- souleyez/ui/evidence_vault.py +11 -6
- souleyez/ui/exploit_suggestions_view.py +11 -7
- souleyez/ui/export_view.py +3 -1
- souleyez/ui/gap_analysis_view.py +6 -3
- souleyez/ui/help_system.py +4 -1
- souleyez/ui/intelligence_view.py +7 -3
- souleyez/ui/interactive.py +1280 -558
- souleyez/ui/interactive_selector.py +3 -2
- souleyez/ui/log_formatter.py +1 -0
- souleyez/ui/menu_components.py +3 -1
- souleyez/ui/msf_auxiliary_menu.py +4 -1
- souleyez/ui/pending_chains_view.py +15 -12
- souleyez/ui/progress_indicators.py +5 -2
- souleyez/ui/recommendations_view.py +4 -2
- souleyez/ui/rule_builder.py +4 -1
- souleyez/ui/setup_wizard.py +10 -8
- souleyez/ui/shortcuts.py +1 -1
- souleyez/ui/splunk_gap_analysis_view.py +7 -4
- souleyez/ui/splunk_vulns_view.py +4 -1
- souleyez/ui/team_dashboard.py +7 -5
- souleyez/ui/template_selector.py +2 -1
- souleyez/ui/terminal.py +3 -2
- souleyez/ui/timeline_view.py +2 -1
- souleyez/ui/tool_setup.py +92 -31
- souleyez/ui/tutorial.py +7 -4
- souleyez/ui/tutorial_state.py +3 -2
- souleyez/ui/wazuh_vulns_view.py +5 -2
- souleyez/ui/wordlist_browser.py +4 -3
- souleyez/ui.py +13 -7
- souleyez/utils/tool_checker.py +61 -12
- souleyez/utils.py +4 -4
- souleyez/wordlists.py +1 -0
- {souleyez-3.0.0.dist-info → souleyez-3.0.7.dist-info}/METADATA +1 -1
- souleyez-3.0.7.dist-info/RECORD +445 -0
- souleyez-3.0.0.dist-info/RECORD +0 -443
- {souleyez-3.0.0.dist-info → souleyez-3.0.7.dist-info}/WHEEL +0 -0
- {souleyez-3.0.0.dist-info → souleyez-3.0.7.dist-info}/entry_points.txt +0 -0
- {souleyez-3.0.0.dist-info → souleyez-3.0.7.dist-info}/licenses/LICENSE +0 -0
- {souleyez-3.0.0.dist-info → souleyez-3.0.7.dist-info}/top_level.txt +0 -0
|
@@ -8,17 +8,16 @@ Tables created:
|
|
|
8
8
|
- engagement_permissions: Team access to engagements
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
import secrets
|
|
12
11
|
import hashlib
|
|
13
12
|
import os
|
|
13
|
+
import secrets
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def upgrade(conn):
|
|
17
17
|
"""Add RBAC tables."""
|
|
18
18
|
|
|
19
19
|
# Users table - core user accounts
|
|
20
|
-
conn.execute(
|
|
21
|
-
"""
|
|
20
|
+
conn.execute("""
|
|
22
21
|
CREATE TABLE IF NOT EXISTS users (
|
|
23
22
|
id TEXT PRIMARY KEY,
|
|
24
23
|
username TEXT UNIQUE NOT NULL,
|
|
@@ -36,12 +35,10 @@ def upgrade(conn):
|
|
|
36
35
|
failed_login_attempts INTEGER DEFAULT 0,
|
|
37
36
|
locked_until TIMESTAMP
|
|
38
37
|
)
|
|
39
|
-
"""
|
|
40
|
-
)
|
|
38
|
+
""")
|
|
41
39
|
|
|
42
40
|
# Sessions table - active login sessions
|
|
43
|
-
conn.execute(
|
|
44
|
-
"""
|
|
41
|
+
conn.execute("""
|
|
45
42
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
46
43
|
id TEXT PRIMARY KEY,
|
|
47
44
|
user_id TEXT NOT NULL,
|
|
@@ -52,12 +49,10 @@ def upgrade(conn):
|
|
|
52
49
|
user_agent TEXT,
|
|
53
50
|
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
54
51
|
)
|
|
55
|
-
"""
|
|
56
|
-
)
|
|
52
|
+
""")
|
|
57
53
|
|
|
58
54
|
# Audit log - immutable security trail
|
|
59
|
-
conn.execute(
|
|
60
|
-
"""
|
|
55
|
+
conn.execute("""
|
|
61
56
|
CREATE TABLE IF NOT EXISTS audit_log (
|
|
62
57
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
63
58
|
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
@@ -70,12 +65,10 @@ def upgrade(conn):
|
|
|
70
65
|
ip_address TEXT,
|
|
71
66
|
success BOOLEAN DEFAULT TRUE
|
|
72
67
|
)
|
|
73
|
-
"""
|
|
74
|
-
)
|
|
68
|
+
""")
|
|
75
69
|
|
|
76
70
|
# Engagement permissions - team access control
|
|
77
|
-
conn.execute(
|
|
78
|
-
"""
|
|
71
|
+
conn.execute("""
|
|
79
72
|
CREATE TABLE IF NOT EXISTS engagement_permissions (
|
|
80
73
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
81
74
|
engagement_id INTEGER NOT NULL,
|
|
@@ -87,8 +80,7 @@ def upgrade(conn):
|
|
|
87
80
|
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
|
88
81
|
UNIQUE(engagement_id, user_id)
|
|
89
82
|
)
|
|
90
|
-
"""
|
|
91
|
-
)
|
|
83
|
+
""")
|
|
92
84
|
|
|
93
85
|
# Add owner_id to engagements table
|
|
94
86
|
try:
|
|
@@ -14,8 +14,7 @@ def upgrade(conn):
|
|
|
14
14
|
cursor = conn.cursor()
|
|
15
15
|
|
|
16
16
|
# Wazuh connection configuration
|
|
17
|
-
cursor.execute(
|
|
18
|
-
"""
|
|
17
|
+
cursor.execute("""
|
|
19
18
|
CREATE TABLE IF NOT EXISTS wazuh_config (
|
|
20
19
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
21
20
|
engagement_id INTEGER NOT NULL UNIQUE,
|
|
@@ -31,13 +30,11 @@ def upgrade(conn):
|
|
|
31
30
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
32
31
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE
|
|
33
32
|
)
|
|
34
|
-
"""
|
|
35
|
-
)
|
|
33
|
+
""")
|
|
36
34
|
|
|
37
35
|
# Detection validation results per job
|
|
38
36
|
# Note: job_id references jobs.json (file-based), not a SQLite table
|
|
39
|
-
cursor.execute(
|
|
40
|
-
"""
|
|
37
|
+
cursor.execute("""
|
|
41
38
|
CREATE TABLE IF NOT EXISTS detection_results (
|
|
42
39
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
43
40
|
job_id INTEGER NOT NULL,
|
|
@@ -55,8 +52,7 @@ def upgrade(conn):
|
|
|
55
52
|
checked_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
56
53
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE
|
|
57
54
|
)
|
|
58
|
-
"""
|
|
59
|
-
)
|
|
55
|
+
""")
|
|
60
56
|
|
|
61
57
|
# Indexes
|
|
62
58
|
cursor.execute(
|
|
@@ -32,8 +32,7 @@ def upgrade(conn):
|
|
|
32
32
|
return
|
|
33
33
|
|
|
34
34
|
# Recreate table without the bad FK
|
|
35
|
-
cursor.execute(
|
|
36
|
-
"""
|
|
35
|
+
cursor.execute("""
|
|
37
36
|
CREATE TABLE detection_results_new (
|
|
38
37
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
39
38
|
job_id INTEGER NOT NULL,
|
|
@@ -51,8 +50,7 @@ def upgrade(conn):
|
|
|
51
50
|
checked_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
52
51
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE
|
|
53
52
|
)
|
|
54
|
-
"""
|
|
55
|
-
)
|
|
53
|
+
""")
|
|
56
54
|
|
|
57
55
|
# Copy existing data
|
|
58
56
|
cursor.execute("INSERT INTO detection_results_new SELECT * FROM detection_results")
|
|
@@ -15,8 +15,7 @@ def upgrade(conn):
|
|
|
15
15
|
cursor = conn.cursor()
|
|
16
16
|
|
|
17
17
|
# Wazuh vulnerabilities table
|
|
18
|
-
cursor.execute(
|
|
19
|
-
"""
|
|
18
|
+
cursor.execute("""
|
|
20
19
|
CREATE TABLE IF NOT EXISTS wazuh_vulnerabilities (
|
|
21
20
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
22
21
|
engagement_id INTEGER NOT NULL,
|
|
@@ -59,12 +58,10 @@ def upgrade(conn):
|
|
|
59
58
|
|
|
60
59
|
UNIQUE(engagement_id, agent_id, cve_id, package_name)
|
|
61
60
|
)
|
|
62
|
-
"""
|
|
63
|
-
)
|
|
61
|
+
""")
|
|
64
62
|
|
|
65
63
|
# Sync metadata table
|
|
66
|
-
cursor.execute(
|
|
67
|
-
"""
|
|
64
|
+
cursor.execute("""
|
|
68
65
|
CREATE TABLE IF NOT EXISTS wazuh_vuln_sync (
|
|
69
66
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
70
67
|
engagement_id INTEGER NOT NULL UNIQUE,
|
|
@@ -74,8 +71,7 @@ def upgrade(conn):
|
|
|
74
71
|
last_sync_errors TEXT,
|
|
75
72
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE
|
|
76
73
|
)
|
|
77
|
-
"""
|
|
78
|
-
)
|
|
74
|
+
""")
|
|
79
75
|
|
|
80
76
|
# Indexes for performance
|
|
81
77
|
cursor.execute(
|
|
@@ -17,8 +17,7 @@ def upgrade(conn):
|
|
|
17
17
|
"""Add scope validation tables and columns."""
|
|
18
18
|
|
|
19
19
|
# Engagement scope definitions table
|
|
20
|
-
conn.execute(
|
|
21
|
-
"""
|
|
20
|
+
conn.execute("""
|
|
22
21
|
CREATE TABLE IF NOT EXISTS engagement_scope (
|
|
23
22
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
24
23
|
engagement_id INTEGER NOT NULL,
|
|
@@ -31,12 +30,10 @@ def upgrade(conn):
|
|
|
31
30
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE,
|
|
32
31
|
UNIQUE(engagement_id, scope_type, value)
|
|
33
32
|
)
|
|
34
|
-
"""
|
|
35
|
-
)
|
|
33
|
+
""")
|
|
36
34
|
|
|
37
35
|
# Scope validation audit log
|
|
38
|
-
conn.execute(
|
|
39
|
-
"""
|
|
36
|
+
conn.execute("""
|
|
40
37
|
CREATE TABLE IF NOT EXISTS scope_validation_log (
|
|
41
38
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
42
39
|
engagement_id INTEGER NOT NULL,
|
|
@@ -49,8 +46,7 @@ def upgrade(conn):
|
|
|
49
46
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
50
47
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE
|
|
51
48
|
)
|
|
52
|
-
"""
|
|
53
|
-
)
|
|
49
|
+
""")
|
|
54
50
|
|
|
55
51
|
# Add scope_enforcement column to engagements
|
|
56
52
|
try:
|
|
@@ -26,8 +26,7 @@ def upgrade(conn):
|
|
|
26
26
|
cursor.execute("ALTER TABLE wazuh_config ADD COLUMN config_json TEXT")
|
|
27
27
|
|
|
28
28
|
# Create new table with correct constraint
|
|
29
|
-
cursor.execute(
|
|
30
|
-
"""
|
|
29
|
+
cursor.execute("""
|
|
31
30
|
CREATE TABLE IF NOT EXISTS siem_config_new (
|
|
32
31
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
33
32
|
engagement_id INTEGER NOT NULL,
|
|
@@ -46,12 +45,10 @@ def upgrade(conn):
|
|
|
46
45
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE,
|
|
47
46
|
UNIQUE(engagement_id, siem_type)
|
|
48
47
|
)
|
|
49
|
-
"""
|
|
50
|
-
)
|
|
48
|
+
""")
|
|
51
49
|
|
|
52
50
|
# Copy existing data
|
|
53
|
-
cursor.execute(
|
|
54
|
-
"""
|
|
51
|
+
cursor.execute("""
|
|
55
52
|
INSERT OR IGNORE INTO siem_config_new (
|
|
56
53
|
id, engagement_id, siem_type, api_url, api_user, api_password,
|
|
57
54
|
indexer_url, indexer_user, indexer_password, verify_ssl, enabled,
|
|
@@ -62,8 +59,7 @@ def upgrade(conn):
|
|
|
62
59
|
indexer_url, indexer_user, indexer_password, verify_ssl, enabled,
|
|
63
60
|
config_json, created_at, updated_at
|
|
64
61
|
FROM wazuh_config
|
|
65
|
-
"""
|
|
66
|
-
)
|
|
62
|
+
""")
|
|
67
63
|
|
|
68
64
|
# Drop old table and rename new one
|
|
69
65
|
cursor.execute("DROP TABLE wazuh_config")
|
|
@@ -87,8 +83,7 @@ def downgrade(conn):
|
|
|
87
83
|
"""Revert to single SIEM per engagement (lossy - keeps only first config per engagement)."""
|
|
88
84
|
cursor = conn.cursor()
|
|
89
85
|
|
|
90
|
-
cursor.execute(
|
|
91
|
-
"""
|
|
86
|
+
cursor.execute("""
|
|
92
87
|
CREATE TABLE IF NOT EXISTS wazuh_config_old (
|
|
93
88
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
94
89
|
engagement_id INTEGER NOT NULL UNIQUE,
|
|
@@ -106,12 +101,10 @@ def downgrade(conn):
|
|
|
106
101
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
107
102
|
FOREIGN KEY (engagement_id) REFERENCES engagements(id) ON DELETE CASCADE
|
|
108
103
|
)
|
|
109
|
-
"""
|
|
110
|
-
)
|
|
104
|
+
""")
|
|
111
105
|
|
|
112
106
|
# Copy only first config per engagement
|
|
113
|
-
cursor.execute(
|
|
114
|
-
"""
|
|
107
|
+
cursor.execute("""
|
|
115
108
|
INSERT OR IGNORE INTO wazuh_config_old (
|
|
116
109
|
engagement_id, api_url, api_user, api_password,
|
|
117
110
|
indexer_url, indexer_user, indexer_password, verify_ssl, enabled,
|
|
@@ -123,8 +116,7 @@ def downgrade(conn):
|
|
|
123
116
|
siem_type, config_json, created_at, updated_at
|
|
124
117
|
FROM wazuh_config
|
|
125
118
|
GROUP BY engagement_id
|
|
126
|
-
"""
|
|
127
|
-
)
|
|
119
|
+
""")
|
|
128
120
|
|
|
129
121
|
cursor.execute("DROP TABLE wazuh_config")
|
|
130
122
|
cursor.execute("ALTER TABLE wazuh_config_old RENAME TO wazuh_config")
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# Import all migrations - they register themselves
|
|
5
5
|
from . import (
|
|
6
|
-
# 001-010
|
|
7
|
-
_001_add_credential_enhancements,
|
|
6
|
+
_001_add_credential_enhancements, # 001-010; 011-020; 021-030
|
|
8
7
|
_002_add_status_tracking,
|
|
9
8
|
_003_add_execution_log,
|
|
10
9
|
_005_screenshots,
|
|
@@ -13,7 +12,6 @@ from . import (
|
|
|
13
12
|
_008_add_nuclei_table,
|
|
14
13
|
_009_add_cme_tables,
|
|
15
14
|
_010_evidence_linking,
|
|
16
|
-
# 011-020
|
|
17
15
|
_011_timeline_tracking,
|
|
18
16
|
_012_team_collaboration,
|
|
19
17
|
_013_add_host_tags,
|
|
@@ -24,7 +22,6 @@ from . import (
|
|
|
24
22
|
_018_add_osint_target,
|
|
25
23
|
_019_add_engagement_type,
|
|
26
24
|
_020_add_rbac,
|
|
27
|
-
# 021-030
|
|
28
25
|
_021_wazuh_integration,
|
|
29
26
|
_022_wazuh_indexer_columns,
|
|
30
27
|
_023_fix_detection_results_fk,
|
|
@@ -5,8 +5,9 @@ souleyez.storage.migrations.migration_manager - Database migration system
|
|
|
5
5
|
Uses compiled registry pattern for Nuitka compatibility.
|
|
6
6
|
All migrations are imported in __init__.py and registered in MIGRATIONS_REGISTRY.
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import sqlite3
|
|
9
|
-
from typing import
|
|
10
|
+
from typing import Dict, List
|
|
10
11
|
|
|
11
12
|
# Import registry from package
|
|
12
13
|
from . import MIGRATIONS_REGISTRY, get_all_versions
|
|
@@ -20,16 +21,14 @@ class MigrationManager:
|
|
|
20
21
|
def _ensure_migrations_table(self):
|
|
21
22
|
"""Create migrations tracking table if it doesn't exist."""
|
|
22
23
|
conn = sqlite3.connect(self.db_path)
|
|
23
|
-
conn.execute(
|
|
24
|
-
"""
|
|
24
|
+
conn.execute("""
|
|
25
25
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
26
26
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
27
27
|
version TEXT UNIQUE NOT NULL,
|
|
28
28
|
name TEXT NOT NULL,
|
|
29
29
|
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
30
30
|
)
|
|
31
|
-
"""
|
|
32
|
-
)
|
|
31
|
+
""")
|
|
33
32
|
conn.commit()
|
|
34
33
|
conn.close()
|
|
35
34
|
|
|
@@ -199,13 +198,11 @@ class MigrationManager:
|
|
|
199
198
|
if applied:
|
|
200
199
|
print("✅ Applied:")
|
|
201
200
|
conn = sqlite3.connect(self.db_path)
|
|
202
|
-
cursor = conn.execute(
|
|
203
|
-
"""
|
|
201
|
+
cursor = conn.execute("""
|
|
204
202
|
SELECT version, name, applied_at
|
|
205
203
|
FROM schema_migrations
|
|
206
204
|
ORDER BY version
|
|
207
|
-
"""
|
|
208
|
-
)
|
|
205
|
+
""")
|
|
209
206
|
for row in cursor.fetchall():
|
|
210
207
|
print(f" [{row[0]}] {row[1]} (applied: {row[2]})")
|
|
211
208
|
conn.close()
|
souleyez/storage/msf_sessions.py
CHANGED
|
@@ -5,8 +5,8 @@ Functions for managing Metasploit Framework session records in the database.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
|
-
from typing import Optional, List, Dict, Any
|
|
9
8
|
from datetime import datetime
|
|
9
|
+
from typing import Any, Dict, List, Optional
|
|
10
10
|
|
|
11
11
|
logger = logging.getLogger(__name__)
|
|
12
12
|
|
souleyez/storage/osint.py
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
AI-powered recommendation engine for deliverables.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from typing import Dict, List, Optional
|
|
6
5
|
from datetime import datetime, timedelta
|
|
6
|
+
from typing import Dict, List, Optional
|
|
7
|
+
|
|
7
8
|
from .database import get_db
|
|
8
|
-
from .deliverables import DeliverableManager
|
|
9
9
|
from .deliverable_evidence import EvidenceManager
|
|
10
|
+
from .deliverables import DeliverableManager
|
|
10
11
|
from .timeline_tracker import TimelineTracker
|
|
11
12
|
|
|
12
13
|
|
souleyez/storage/screenshots.py
CHANGED
souleyez/storage/smb_shares.py
CHANGED
souleyez/storage/sqlmap_data.py
CHANGED
|
@@ -4,12 +4,14 @@ souleyez.storage.sqlmap_data
|
|
|
4
4
|
|
|
5
5
|
Storage manager for SQLMap SQL injection discoveries (databases, tables, columns, dumped data)
|
|
6
6
|
"""
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
import json
|
|
9
|
-
|
|
10
|
-
from
|
|
11
|
-
|
|
9
|
+
import sqlite3
|
|
10
|
+
from typing import Any, Dict, List, Optional
|
|
11
|
+
|
|
12
12
|
from souleyez.log_config import get_logger
|
|
13
|
+
from souleyez.storage.crypto import get_crypto_manager
|
|
14
|
+
from souleyez.storage.database import Database
|
|
13
15
|
|
|
14
16
|
logger = get_logger(__name__)
|
|
15
17
|
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Team collaboration features for deliverables.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import os
|
|
6
6
|
from datetime import datetime
|
|
7
|
+
from typing import Dict, List, Optional
|
|
8
|
+
|
|
7
9
|
from .database import get_db
|
|
8
|
-
import os
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class TeamCollaboration:
|
souleyez/storage/wazuh_vulns.py
CHANGED
|
@@ -5,9 +5,11 @@ souleyez.storage.wazuh_vulns - Wazuh vulnerabilities database operations
|
|
|
5
5
|
Stores vulnerabilities discovered by Wazuh agents for gap analysis
|
|
6
6
|
between passive (agent-based) and active (scan-based) detection.
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import json
|
|
9
10
|
from datetime import datetime
|
|
10
|
-
from typing import
|
|
11
|
+
from typing import Any, Dict, List, Optional
|
|
12
|
+
|
|
11
13
|
from .database import get_db
|
|
12
14
|
|
|
13
15
|
|
souleyez/storage/web_paths.py
CHANGED
souleyez/ui/__init__.py
CHANGED
souleyez/ui/ai_quotes.py
CHANGED
|
@@ -5,8 +5,8 @@ souleyez.ui.ai_quotes - Entertaining quotes for AI generation progress
|
|
|
5
5
|
Displays rotating quotes during long AI operations to keep users entertained
|
|
6
6
|
and informed that the system is still working.
|
|
7
7
|
"""
|
|
8
|
-
import random
|
|
9
8
|
|
|
9
|
+
import random
|
|
10
10
|
|
|
11
11
|
# Hacker humor and pentesting jokes
|
|
12
12
|
HACKER_HUMOR = [
|