souleyez 2.43.34__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 +297 -230
- 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 -1
- 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 +2 -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 +50 -19
- 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 +149 -40
- 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 +49 -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/validation.py +14 -0
- 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 +1512 -584
- 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-2.43.34.dist-info → souleyez-3.0.7.dist-info}/METADATA +2 -2
- souleyez-3.0.7.dist-info/RECORD +445 -0
- souleyez-2.43.34.dist-info/RECORD +0 -443
- {souleyez-2.43.34.dist-info → souleyez-3.0.7.dist-info}/WHEEL +0 -0
- {souleyez-2.43.34.dist-info → souleyez-3.0.7.dist-info}/entry_points.txt +0 -0
- {souleyez-2.43.34.dist-info → souleyez-3.0.7.dist-info}/licenses/LICENSE +0 -0
- {souleyez-2.43.34.dist-info → souleyez-3.0.7.dist-info}/top_level.txt +0 -0
souleyez/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "
|
|
1
|
+
__version__ = "3.0.7"
|
souleyez/ai/__init__.py
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
souleyez.ai - AI-powered attack path recommendations and report generation
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from .ollama_service import OllamaService, OLLAMA_AVAILABLE
|
|
6
|
-
from .context_builder import ContextBuilder
|
|
7
|
-
from .recommender import AttackRecommender
|
|
8
|
-
from .llm_provider import LLMProvider, LLMProviderType
|
|
9
|
-
from .ollama_provider import OllamaProvider
|
|
10
5
|
from .claude_provider import (
|
|
11
|
-
ClaudeProvider,
|
|
12
6
|
ANTHROPIC_AVAILABLE,
|
|
13
|
-
|
|
7
|
+
ClaudeProvider,
|
|
14
8
|
clear_claude_api_key,
|
|
9
|
+
set_claude_api_key,
|
|
15
10
|
)
|
|
11
|
+
from .context_builder import ContextBuilder
|
|
16
12
|
from .llm_factory import LLMFactory
|
|
13
|
+
from .llm_provider import LLMProvider, LLMProviderType
|
|
14
|
+
from .ollama_provider import OllamaProvider
|
|
15
|
+
from .ollama_service import OLLAMA_AVAILABLE, OllamaService
|
|
16
|
+
from .recommender import AttackRecommender
|
|
17
17
|
from .report_context import ReportContextBuilder
|
|
18
18
|
from .report_service import AIReportService
|
|
19
19
|
|
souleyez/ai/action_mapper.py
CHANGED
souleyez/ai/chain_advisor.py
CHANGED
|
@@ -5,11 +5,12 @@ souleyez.ai.chain_advisor - AI-powered tool chain recommendations
|
|
|
5
5
|
Uses LLM to analyze scan results and suggest additional tools to run,
|
|
6
6
|
complementing the static rule-based chaining system.
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import logging
|
|
9
10
|
import re
|
|
10
11
|
from dataclasses import dataclass, field
|
|
11
12
|
from enum import Enum
|
|
12
|
-
from typing import
|
|
13
|
+
from typing import Any, Dict, List, Optional
|
|
13
14
|
|
|
14
15
|
from .llm_factory import LLMFactory
|
|
15
16
|
|
souleyez/ai/claude_provider.py
CHANGED
|
@@ -6,7 +6,7 @@ Requires API key stored securely via CryptoManager.
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
import logging
|
|
9
|
-
from typing import
|
|
9
|
+
from typing import Any, Dict, Optional
|
|
10
10
|
|
|
11
11
|
from .llm_provider import LLMProvider, LLMProviderType
|
|
12
12
|
|
|
@@ -240,8 +240,8 @@ def set_claude_api_key(api_key: str) -> bool:
|
|
|
240
240
|
Returns:
|
|
241
241
|
bool: True if stored successfully, False otherwise
|
|
242
242
|
"""
|
|
243
|
-
from souleyez.storage.crypto import get_crypto_manager
|
|
244
243
|
from souleyez.config import read_config, write_config
|
|
244
|
+
from souleyez.storage.crypto import get_crypto_manager
|
|
245
245
|
|
|
246
246
|
crypto = get_crypto_manager()
|
|
247
247
|
if not crypto.is_unlocked():
|
souleyez/ai/context_builder.py
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
"""
|
|
3
3
|
souleyez.ai.context_builder - Build context from engagement data for LLM
|
|
4
4
|
"""
|
|
5
|
+
|
|
5
6
|
from typing import Optional
|
|
6
|
-
|
|
7
|
-
from ..storage.hosts import HostManager
|
|
7
|
+
|
|
8
8
|
from ..storage.credentials import CredentialsManager
|
|
9
|
+
from ..storage.engagements import EngagementManager
|
|
9
10
|
from ..storage.findings import FindingsManager
|
|
11
|
+
from ..storage.hosts import HostManager
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
class ContextBuilder:
|
souleyez/ai/executor.py
CHANGED
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
"""
|
|
3
3
|
souleyez.ai.executor - Interactive AI-driven command execution
|
|
4
4
|
"""
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import logging
|
|
7
|
+
import subprocess
|
|
8
|
+
from typing import Any, Dict, Optional
|
|
9
|
+
|
|
7
10
|
import click
|
|
8
|
-
|
|
9
|
-
from .
|
|
11
|
+
|
|
12
|
+
from ..storage.execution_log import ExecutionLogManager
|
|
10
13
|
from .action_mapper import ActionMapper
|
|
11
|
-
from .safety import SafetyFramework, ApprovalMode, RiskLevel
|
|
12
|
-
from .result_parser import ResultParser
|
|
13
14
|
from .feedback_handler import FeedbackHandler
|
|
14
|
-
from
|
|
15
|
+
from .recommender import AttackRecommender
|
|
16
|
+
from .result_parser import ResultParser
|
|
17
|
+
from .safety import ApprovalMode, RiskLevel, SafetyFramework
|
|
15
18
|
|
|
16
19
|
logger = logging.getLogger(__name__)
|
|
17
20
|
|
souleyez/ai/feedback_handler.py
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
"""
|
|
3
3
|
souleyez.ai.feedback_handler - Auto-update database after command execution
|
|
4
4
|
"""
|
|
5
|
+
|
|
5
6
|
import logging
|
|
6
|
-
from typing import Dict, Any, Optional
|
|
7
7
|
from datetime import datetime
|
|
8
|
-
from
|
|
8
|
+
from typing import Any, Dict, Optional
|
|
9
|
+
|
|
9
10
|
from ..storage.credentials import CredentialsManager
|
|
11
|
+
from ..storage.hosts import HostManager
|
|
10
12
|
|
|
11
13
|
logger = logging.getLogger(__name__)
|
|
12
14
|
|
souleyez/ai/llm_provider.py
CHANGED
|
@@ -5,10 +5,10 @@ This module defines the abstract base class for LLM providers,
|
|
|
5
5
|
enabling support for multiple backends (Ollama, Claude, etc.)
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import logging
|
|
8
9
|
from abc import ABC, abstractmethod
|
|
9
10
|
from enum import Enum
|
|
10
|
-
from typing import
|
|
11
|
-
import logging
|
|
11
|
+
from typing import Any, Dict, Optional
|
|
12
12
|
|
|
13
13
|
logger = logging.getLogger(__name__)
|
|
14
14
|
|
souleyez/ai/ollama_provider.py
CHANGED
|
@@ -5,10 +5,10 @@ Wraps the existing OllamaService to implement the LLMProvider interface.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import Any, Dict, Optional
|
|
9
9
|
|
|
10
10
|
from .llm_provider import LLMProvider, LLMProviderType
|
|
11
|
-
from .ollama_service import
|
|
11
|
+
from .ollama_service import OLLAMA_AVAILABLE, OllamaService
|
|
12
12
|
|
|
13
13
|
logger = logging.getLogger(__name__)
|
|
14
14
|
|
souleyez/ai/ollama_service.py
CHANGED
|
@@ -7,7 +7,7 @@ without sending sensitive engagement data to the cloud.
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import logging
|
|
10
|
-
from typing import
|
|
10
|
+
from typing import Any, Dict, Optional
|
|
11
11
|
|
|
12
12
|
# Ollama is optional - not available in Ubuntu repos
|
|
13
13
|
try:
|
|
@@ -252,40 +252,24 @@ class OllamaService:
|
|
|
252
252
|
return None
|
|
253
253
|
|
|
254
254
|
try:
|
|
255
|
-
import
|
|
255
|
+
import concurrent.futures
|
|
256
256
|
|
|
257
|
-
#
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
# Use signal-based timeout (only works in main thread)
|
|
262
|
-
import signal
|
|
263
|
-
|
|
264
|
-
def timeout_handler(signum, frame):
|
|
265
|
-
raise TimeoutError("AI generation timed out")
|
|
266
|
-
|
|
267
|
-
old_handler = signal.signal(signal.SIGALRM, timeout_handler)
|
|
268
|
-
signal.alarm(timeout)
|
|
257
|
+
# Use thread-based timeout instead of signals
|
|
258
|
+
# Signals can interrupt unrelated code (like click.prompt) causing crashes
|
|
259
|
+
def _do_generate():
|
|
260
|
+
return self.client.generate(model=model_name, prompt=prompt)
|
|
269
261
|
|
|
262
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
|
|
263
|
+
future = executor.submit(_do_generate)
|
|
270
264
|
try:
|
|
271
|
-
response =
|
|
272
|
-
signal.alarm(0)
|
|
273
|
-
signal.signal(signal.SIGALRM, old_handler)
|
|
265
|
+
response = future.result(timeout=timeout)
|
|
274
266
|
return response.get("response", "")
|
|
275
|
-
except TimeoutError:
|
|
276
|
-
signal.alarm(0)
|
|
277
|
-
signal.signal(signal.SIGALRM, old_handler)
|
|
267
|
+
except concurrent.futures.TimeoutError:
|
|
278
268
|
logger.error(f"Generation timed out after {timeout}s")
|
|
279
269
|
return None
|
|
280
270
|
except Exception as e:
|
|
281
|
-
signal.alarm(0)
|
|
282
|
-
signal.signal(signal.SIGALRM, old_handler)
|
|
283
271
|
logger.error(f"Generation error: {e}")
|
|
284
272
|
return None
|
|
285
|
-
else:
|
|
286
|
-
# In a thread - can't use signals, just call directly
|
|
287
|
-
response = self.client.generate(model=model_name, prompt=prompt)
|
|
288
|
-
return response.get("response", "")
|
|
289
273
|
except Exception as e:
|
|
290
274
|
logger.error(f"Generation failed: {e}")
|
|
291
275
|
return None
|
souleyez/ai/path_scorer.py
CHANGED
souleyez/ai/recommender.py
CHANGED
|
@@ -5,12 +5,14 @@ souleyez.ai.recommender - AI-powered attack path recommendations
|
|
|
5
5
|
Uses LLM (via Ollama or Claude) to analyze engagement data and suggest
|
|
6
6
|
the next most promising penetration testing step.
|
|
7
7
|
"""
|
|
8
|
+
|
|
8
9
|
import logging
|
|
9
10
|
import re
|
|
10
|
-
from typing import
|
|
11
|
-
|
|
11
|
+
from typing import Any, Dict, List, Optional
|
|
12
|
+
|
|
12
13
|
from .context_builder import ContextBuilder
|
|
13
14
|
from .llm_factory import LLMFactory
|
|
15
|
+
from .ollama_service import OllamaService
|
|
14
16
|
|
|
15
17
|
logger = logging.getLogger(__name__)
|
|
16
18
|
|
|
@@ -585,10 +587,10 @@ Be specific and actionable. Think like a professional pentester considering mult
|
|
|
585
587
|
|
|
586
588
|
def _get_engagement_data(self, engagement_id: int) -> Dict[str, Any]:
|
|
587
589
|
"""Get engagement data for scoring."""
|
|
588
|
-
from ..storage.engagements import EngagementManager
|
|
589
|
-
from ..storage.hosts import HostManager
|
|
590
590
|
from ..storage.credentials import CredentialsManager
|
|
591
|
+
from ..storage.engagements import EngagementManager
|
|
591
592
|
from ..storage.findings import FindingsManager
|
|
593
|
+
from ..storage.hosts import HostManager
|
|
592
594
|
|
|
593
595
|
em = EngagementManager()
|
|
594
596
|
hm = HostManager()
|
souleyez/ai/report_context.py
CHANGED
|
@@ -5,7 +5,7 @@ Prepares engagement data in formats suitable for LLM prompt templates.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
|
-
from typing import
|
|
8
|
+
from typing import Any, Dict, List, Optional
|
|
9
9
|
|
|
10
10
|
logger = logging.getLogger(__name__)
|
|
11
11
|
|
|
@@ -19,10 +19,10 @@ class ReportContextBuilder:
|
|
|
19
19
|
"""
|
|
20
20
|
|
|
21
21
|
def __init__(self):
|
|
22
|
+
from souleyez.storage.credentials import CredentialsManager
|
|
22
23
|
from souleyez.storage.engagements import EngagementManager
|
|
23
24
|
from souleyez.storage.findings import FindingsManager
|
|
24
25
|
from souleyez.storage.hosts import HostManager
|
|
25
|
-
from souleyez.storage.credentials import CredentialsManager
|
|
26
26
|
|
|
27
27
|
self.em = EngagementManager()
|
|
28
28
|
self.fm = FindingsManager()
|
souleyez/ai/report_service.py
CHANGED
|
@@ -5,21 +5,21 @@ Provides methods for generating AI-enhanced report sections using
|
|
|
5
5
|
configured LLM providers (Claude or Ollama).
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
+
import concurrent.futures
|
|
8
9
|
import logging
|
|
9
10
|
import re
|
|
10
|
-
import
|
|
11
|
-
from typing import Optional, Dict, Any, List
|
|
11
|
+
from typing import Any, Dict, List, Optional
|
|
12
12
|
|
|
13
|
-
from .llm_provider import LLMProvider
|
|
14
13
|
from .llm_factory import LLMFactory
|
|
14
|
+
from .llm_provider import LLMProvider
|
|
15
15
|
from .report_context import ReportContextBuilder
|
|
16
16
|
from .report_prompts import (
|
|
17
|
-
|
|
17
|
+
ATTACK_CHAIN_PROMPT,
|
|
18
18
|
EXECUTIVE_SUMMARY_PROMPT,
|
|
19
19
|
FINDING_ENHANCEMENT_PROMPT,
|
|
20
20
|
REMEDIATION_PLAN_PROMPT,
|
|
21
|
+
REPORT_SYSTEM_PROMPT,
|
|
21
22
|
RISK_RATING_PROMPT,
|
|
22
|
-
ATTACK_CHAIN_PROMPT,
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
logger = logging.getLogger(__name__)
|
souleyez/ai/result_parser.py
CHANGED
souleyez/ai/safety.py
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
"""
|
|
3
3
|
souleyez.ai.safety - Safety framework for AI-driven command execution
|
|
4
4
|
"""
|
|
5
|
-
|
|
6
|
-
from typing import Dict, Optional
|
|
5
|
+
|
|
7
6
|
from enum import Enum
|
|
7
|
+
from typing import Dict, Optional
|
|
8
|
+
|
|
9
|
+
import click
|
|
10
|
+
|
|
8
11
|
from souleyez.ui.design_system import DesignSystem
|
|
9
12
|
|
|
10
13
|
|
souleyez/auth/__init__.py
CHANGED
|
@@ -10,20 +10,20 @@ Usage:
|
|
|
10
10
|
pass
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
+
from .audit import AuditAction, AuditLogger, audit_log, get_audit_logger
|
|
13
14
|
from .permissions import (
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
PRO_TIER_PERMISSIONS,
|
|
16
|
+
ROLE_PERMISSIONS,
|
|
16
17
|
Permission,
|
|
17
18
|
PermissionChecker,
|
|
19
|
+
Role,
|
|
20
|
+
Tier,
|
|
18
21
|
requires_permission,
|
|
19
22
|
requires_pro,
|
|
20
23
|
requires_role,
|
|
21
|
-
PRO_TIER_PERMISSIONS,
|
|
22
|
-
ROLE_PERMISSIONS,
|
|
23
24
|
)
|
|
24
|
-
from .user_manager import User, UserManager
|
|
25
25
|
from .session_manager import Session, SessionManager
|
|
26
|
-
from .
|
|
26
|
+
from .user_manager import User, UserManager
|
|
27
27
|
|
|
28
28
|
# Module-level session manager instance (initialized on first use)
|
|
29
29
|
_session_manager: SessionManager = None
|
souleyez/auth/audit.py
CHANGED
|
@@ -5,11 +5,11 @@ All sensitive actions should be logged through this module.
|
|
|
5
5
|
Logs are immutable and include user context automatically.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import sqlite3
|
|
9
8
|
import json
|
|
9
|
+
import sqlite3
|
|
10
10
|
from datetime import datetime, timedelta
|
|
11
|
-
from typing import Optional, Dict, Any, List
|
|
12
11
|
from enum import Enum
|
|
12
|
+
from typing import Any, Dict, List, Optional
|
|
13
13
|
|
|
14
14
|
from souleyez.storage.database import get_db
|
|
15
15
|
|
|
@@ -8,12 +8,12 @@ Permission levels:
|
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
import sqlite3
|
|
11
|
-
from enum import Enum
|
|
12
|
-
from typing import Optional, List, Dict, Any
|
|
13
11
|
from dataclasses import dataclass
|
|
14
12
|
from datetime import datetime
|
|
13
|
+
from enum import Enum
|
|
14
|
+
from typing import Any, Dict, List, Optional
|
|
15
15
|
|
|
16
|
-
from souleyez.auth import
|
|
16
|
+
from souleyez.auth import Role, get_current_user
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class EngagementPermission(Enum):
|
|
@@ -131,13 +131,11 @@ class EngagementAccessManager:
|
|
|
131
131
|
|
|
132
132
|
if user_role == Role.ADMIN:
|
|
133
133
|
# Admins see everything
|
|
134
|
-
rows = conn.execute(
|
|
135
|
-
"""
|
|
134
|
+
rows = conn.execute("""
|
|
136
135
|
SELECT e.*, 'admin' as permission_level
|
|
137
136
|
FROM engagements e
|
|
138
137
|
ORDER BY e.created_at DESC
|
|
139
|
-
"""
|
|
140
|
-
).fetchall()
|
|
138
|
+
""").fetchall()
|
|
141
139
|
else:
|
|
142
140
|
# Non-admins see owned + shared engagements
|
|
143
141
|
rows = conn.execute(
|
souleyez/auth/permissions.py
CHANGED
souleyez/auth/session_manager.py
CHANGED
|
@@ -7,18 +7,17 @@ Handles:
|
|
|
7
7
|
- Current user context
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
import sqlite3
|
|
11
|
-
import secrets
|
|
12
10
|
import hashlib
|
|
13
11
|
import json
|
|
12
|
+
import secrets
|
|
13
|
+
import sqlite3
|
|
14
|
+
from dataclasses import dataclass
|
|
14
15
|
from datetime import datetime, timedelta
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
from typing import Optional
|
|
17
|
-
from dataclasses import dataclass
|
|
18
18
|
|
|
19
|
-
from .user_manager import User, UserManager
|
|
20
19
|
from .permissions import Role, Tier
|
|
21
|
-
|
|
20
|
+
from .user_manager import User, UserManager
|
|
22
21
|
|
|
23
22
|
# Session configuration
|
|
24
23
|
SESSION_TOKEN_BYTES = 32
|
|
@@ -250,6 +249,7 @@ class SessionManager:
|
|
|
250
249
|
vault_failures: Number of recent vault unlock failures
|
|
251
250
|
"""
|
|
252
251
|
import time
|
|
252
|
+
|
|
253
253
|
import click
|
|
254
254
|
|
|
255
255
|
if vault_failures >= 2:
|
souleyez/auth/user_manager.py
CHANGED
|
@@ -8,17 +8,16 @@ Handles:
|
|
|
8
8
|
- Tier management for licensing
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
import sqlite3
|
|
12
11
|
import hashlib
|
|
13
|
-
import secrets
|
|
14
12
|
import re
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import secrets
|
|
14
|
+
import sqlite3
|
|
17
15
|
from dataclasses import dataclass
|
|
16
|
+
from datetime import datetime
|
|
17
|
+
from typing import List, Optional
|
|
18
18
|
|
|
19
19
|
from .permissions import Role, Tier
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
# OWASP 2023 recommendation for PBKDF2-HMAC-SHA256
|
|
23
22
|
HASH_ITERATIONS = 480_000
|
|
24
23
|
SALT_LENGTH = 32
|
souleyez/commands/audit.py
CHANGED
|
@@ -8,17 +8,18 @@ Commands:
|
|
|
8
8
|
- souleyez audit export - Export audit logs
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import json
|
|
12
12
|
from datetime import datetime
|
|
13
|
+
|
|
14
|
+
import click
|
|
13
15
|
from rich.console import Console
|
|
14
|
-
from rich.table import Table
|
|
15
16
|
from rich.panel import Panel
|
|
16
|
-
import
|
|
17
|
+
from rich.table import Table
|
|
17
18
|
|
|
18
|
-
from souleyez.security import require_login
|
|
19
19
|
from souleyez.auth import Role
|
|
20
|
-
from souleyez.auth.permissions import requires_role
|
|
21
20
|
from souleyez.auth.audit import get_audit_logger
|
|
21
|
+
from souleyez.auth.permissions import requires_role
|
|
22
|
+
from souleyez.security import require_login
|
|
22
23
|
|
|
23
24
|
console = Console()
|
|
24
25
|
|
souleyez/commands/auth.py
CHANGED
|
@@ -7,19 +7,20 @@ Commands:
|
|
|
7
7
|
- souleyez whoami - Show current user info
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
import click
|
|
11
10
|
import getpass
|
|
11
|
+
|
|
12
|
+
import click
|
|
12
13
|
from rich.console import Console
|
|
13
14
|
from rich.panel import Panel
|
|
14
15
|
from rich.table import Table
|
|
15
16
|
|
|
16
17
|
from souleyez.auth import (
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
Tier,
|
|
19
|
+
UserManager,
|
|
19
20
|
get_current_user,
|
|
21
|
+
get_session_manager,
|
|
22
|
+
init_auth,
|
|
20
23
|
is_logged_in,
|
|
21
|
-
UserManager,
|
|
22
|
-
Tier,
|
|
23
24
|
)
|
|
24
25
|
from souleyez.storage.database import get_db
|
|
25
26
|
|
|
@@ -4,17 +4,16 @@ CLI commands for deliverable tracking.
|
|
|
4
4
|
|
|
5
5
|
import click
|
|
6
6
|
from rich.console import Console
|
|
7
|
+
from rich.progress import BarColumn, Progress, TextColumn
|
|
7
8
|
from rich.table import Table
|
|
8
|
-
from rich.progress import Progress, BarColumn, TextColumn
|
|
9
9
|
|
|
10
10
|
try:
|
|
11
11
|
from rich.progress import TaskProgressColumn
|
|
12
12
|
except ImportError:
|
|
13
13
|
TaskProgressColumn = None # Not available in older rich versions
|
|
14
|
+
from souleyez.security import require_password
|
|
14
15
|
from souleyez.storage.deliverables import DeliverableManager
|
|
15
16
|
from souleyez.storage.engagements import EngagementManager
|
|
16
|
-
from souleyez.security import require_password
|
|
17
|
-
|
|
18
17
|
|
|
19
18
|
console = Console()
|
|
20
19
|
|
souleyez/commands/engagement.py
CHANGED
|
@@ -12,14 +12,14 @@ import click
|
|
|
12
12
|
from rich.console import Console
|
|
13
13
|
from rich.table import Table
|
|
14
14
|
|
|
15
|
-
from souleyez.
|
|
16
|
-
from souleyez.auth import get_current_user, Role, UserManager
|
|
15
|
+
from souleyez.auth import Role, UserManager, get_current_user
|
|
17
16
|
from souleyez.auth.engagement_access import (
|
|
18
17
|
EngagementAccessManager,
|
|
19
18
|
EngagementPermission,
|
|
20
19
|
)
|
|
21
|
-
from souleyez.
|
|
20
|
+
from souleyez.security import require_login
|
|
22
21
|
from souleyez.storage.database import get_db
|
|
22
|
+
from souleyez.storage.engagements import EngagementManager
|
|
23
23
|
|
|
24
24
|
console = Console()
|
|
25
25
|
|
souleyez/commands/license.py
CHANGED
|
@@ -7,9 +7,10 @@ souleyez license deactivate - Remove license
|
|
|
7
7
|
souleyez license machine-id - Show machine ID for hardware-bound licenses
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
import click
|
|
11
10
|
from datetime import datetime
|
|
12
11
|
|
|
12
|
+
import click
|
|
13
|
+
|
|
13
14
|
|
|
14
15
|
@click.group()
|
|
15
16
|
def license():
|
|
@@ -59,7 +60,7 @@ def activate(license_key: str):
|
|
|
59
60
|
|
|
60
61
|
# Update user tier if auth system is in use
|
|
61
62
|
try:
|
|
62
|
-
from souleyez.auth import
|
|
63
|
+
from souleyez.auth import UserManager, get_current_user
|
|
63
64
|
from souleyez.auth.permissions import Tier
|
|
64
65
|
from souleyez.storage.database import get_db
|
|
65
66
|
|
souleyez/commands/screenshots.py
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
CLI commands for screenshot management.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
import click
|
|
6
5
|
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import click
|
|
7
8
|
from rich.console import Console
|
|
8
9
|
from rich.table import Table
|
|
9
|
-
from souleyez.storage.screenshots import ScreenshotManager
|
|
10
|
-
from souleyez.storage.engagements import EngagementManager
|
|
11
|
-
from souleyez.security import require_password
|
|
12
10
|
|
|
11
|
+
from souleyez.security import require_password
|
|
12
|
+
from souleyez.storage.engagements import EngagementManager
|
|
13
|
+
from souleyez.storage.screenshots import ScreenshotManager
|
|
13
14
|
|
|
14
15
|
console = Console()
|
|
15
16
|
|
souleyez/commands/user.py
CHANGED
|
@@ -9,23 +9,24 @@ Commands (admin only):
|
|
|
9
9
|
- souleyez user passwd [username] - Change password
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
import click
|
|
13
12
|
import getpass
|
|
13
|
+
|
|
14
|
+
import click
|
|
14
15
|
from rich.console import Console
|
|
15
|
-
from rich.table import Table
|
|
16
16
|
from rich.panel import Panel
|
|
17
|
+
from rich.table import Table
|
|
17
18
|
|
|
18
19
|
from souleyez.auth import (
|
|
19
|
-
init_auth,
|
|
20
|
-
get_current_user,
|
|
21
|
-
is_logged_in,
|
|
22
|
-
UserManager,
|
|
23
20
|
Role,
|
|
24
21
|
Tier,
|
|
22
|
+
UserManager,
|
|
23
|
+
get_current_user,
|
|
24
|
+
init_auth,
|
|
25
|
+
is_logged_in,
|
|
25
26
|
)
|
|
26
|
-
from souleyez.storage.database import get_db
|
|
27
|
-
from souleyez.security import require_login, require_admin
|
|
28
27
|
from souleyez.licensing.validator import get_active_license
|
|
28
|
+
from souleyez.security import require_admin, require_login
|
|
29
|
+
from souleyez.storage.database import get_db
|
|
29
30
|
|
|
30
31
|
console = Console()
|
|
31
32
|
|
|
@@ -410,6 +411,7 @@ def _log_audit(action: str, user_id: str, username: str, details: str = None):
|
|
|
410
411
|
"""Log an audit event."""
|
|
411
412
|
import sqlite3
|
|
412
413
|
from datetime import datetime
|
|
414
|
+
|
|
413
415
|
from souleyez.storage.database import get_db
|
|
414
416
|
|
|
415
417
|
try:
|