souleyez 2.22.0__py3-none-any.whl → 2.26.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.
Potentially problematic release.
This version of souleyez might be problematic. Click here for more details.
- souleyez/__init__.py +1 -1
- souleyez/assets/__init__.py +1 -0
- souleyez/assets/souleyez-icon.png +0 -0
- souleyez/core/msf_sync_manager.py +15 -5
- souleyez/core/tool_chaining.py +126 -26
- souleyez/detection/validator.py +4 -2
- souleyez/docs/README.md +2 -2
- souleyez/docs/user-guide/installation.md +14 -1
- souleyez/engine/background.py +17 -1
- souleyez/engine/result_handler.py +89 -0
- souleyez/main.py +103 -4
- souleyez/parsers/crackmapexec_parser.py +101 -43
- souleyez/parsers/dnsrecon_parser.py +50 -35
- souleyez/parsers/enum4linux_parser.py +101 -21
- souleyez/parsers/http_fingerprint_parser.py +319 -0
- souleyez/parsers/hydra_parser.py +56 -5
- souleyez/parsers/impacket_parser.py +123 -44
- souleyez/parsers/john_parser.py +47 -14
- souleyez/parsers/msf_parser.py +20 -5
- souleyez/parsers/nmap_parser.py +48 -27
- souleyez/parsers/smbmap_parser.py +39 -23
- souleyez/parsers/sqlmap_parser.py +18 -9
- souleyez/parsers/theharvester_parser.py +21 -13
- souleyez/plugins/http_fingerprint.py +592 -0
- souleyez/plugins/nuclei.py +41 -17
- souleyez/ui/interactive.py +99 -7
- souleyez/ui/setup_wizard.py +93 -5
- souleyez/ui/tool_setup.py +52 -52
- souleyez/utils/tool_checker.py +45 -5
- {souleyez-2.22.0.dist-info → souleyez-2.26.0.dist-info}/METADATA +16 -3
- {souleyez-2.22.0.dist-info → souleyez-2.26.0.dist-info}/RECORD +35 -31
- {souleyez-2.22.0.dist-info → souleyez-2.26.0.dist-info}/WHEEL +0 -0
- {souleyez-2.22.0.dist-info → souleyez-2.26.0.dist-info}/entry_points.txt +0 -0
- {souleyez-2.22.0.dist-info → souleyez-2.26.0.dist-info}/licenses/LICENSE +0 -0
- {souleyez-2.22.0.dist-info → souleyez-2.26.0.dist-info}/top_level.txt +0 -0
souleyez/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.
|
|
1
|
+
__version__ = '2.26.0'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# SoulEyez assets package
|
|
Binary file
|
|
@@ -29,15 +29,25 @@ logger = logging.getLogger(__name__)
|
|
|
29
29
|
|
|
30
30
|
def get_msf_database_config() -> Optional[Dict[str, Any]]:
|
|
31
31
|
"""
|
|
32
|
-
Get MSF database configuration from ~/.msf4/database.yml
|
|
32
|
+
Get MSF database configuration from ~/.msf4/database.yml or system-wide config.
|
|
33
|
+
|
|
34
|
+
Checks user config first, then falls back to system-wide config (Kali Linux).
|
|
33
35
|
|
|
34
36
|
Returns:
|
|
35
37
|
Dictionary with database config or None if not found/parseable
|
|
36
38
|
"""
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
# Check user config first, then system-wide config (Kali uses system-wide)
|
|
40
|
+
user_db_path = Path.home() / ".msf4" / "database.yml"
|
|
41
|
+
system_db_path = Path('/usr/share/metasploit-framework/config/database.yml')
|
|
42
|
+
|
|
43
|
+
db_yml_path = None
|
|
44
|
+
if user_db_path.exists():
|
|
45
|
+
db_yml_path = user_db_path
|
|
46
|
+
elif system_db_path.exists():
|
|
47
|
+
db_yml_path = system_db_path
|
|
48
|
+
|
|
49
|
+
if not db_yml_path:
|
|
50
|
+
logger.debug("MSF database.yml not found in user or system config")
|
|
41
51
|
return None
|
|
42
52
|
|
|
43
53
|
try:
|
souleyez/core/tool_chaining.py
CHANGED
|
@@ -15,6 +15,17 @@ CATEGORY_CTF = "ctf" # Lab/learning scenarios - vulnerable by design
|
|
|
15
15
|
CATEGORY_ENTERPRISE = "enterprise" # Real-world enterprise testing
|
|
16
16
|
CATEGORY_GENERAL = "general" # Standard recon that applies everywhere
|
|
17
17
|
|
|
18
|
+
# Managed hosting platforms - skip CGI enumeration (pointless on these)
|
|
19
|
+
# These are detected from server headers/banners and product names
|
|
20
|
+
MANAGED_HOSTING_PLATFORMS = {
|
|
21
|
+
'squarespace', 'wix', 'shopify', 'webflow', 'weebly',
|
|
22
|
+
'wordpress.com', 'ghost.io', 'medium', 'tumblr', 'blogger',
|
|
23
|
+
'netlify', 'vercel', 'github.io', 'pages.dev', 'cloudflare',
|
|
24
|
+
'heroku', 'railway', 'render.com', 'fly.io',
|
|
25
|
+
'aws cloudfront', 'akamai', 'fastly', 'cloudflare',
|
|
26
|
+
'azure', 'google cloud', 'firebase',
|
|
27
|
+
}
|
|
28
|
+
|
|
18
29
|
# Category display icons
|
|
19
30
|
CATEGORY_ICONS = {
|
|
20
31
|
CATEGORY_CTF: "🎯",
|
|
@@ -140,6 +151,75 @@ def classify_os_device(os_string: str, services: list) -> dict:
|
|
|
140
151
|
return {'os_family': 'unknown', 'device_type': 'unknown', 'vendor': None}
|
|
141
152
|
|
|
142
153
|
|
|
154
|
+
def is_managed_hosting(services: List[Dict[str, Any]], http_fingerprint: Dict[str, Any] = None) -> bool:
|
|
155
|
+
"""
|
|
156
|
+
Detect if target is a managed hosting platform.
|
|
157
|
+
|
|
158
|
+
These platforms don't have CGI directories, so tools like nikto
|
|
159
|
+
should skip CGI enumeration to avoid long, pointless scans.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
services: List of service dicts from nmap parser
|
|
163
|
+
http_fingerprint: Optional fingerprint data from http_fingerprint plugin
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
True if managed hosting detected, False otherwise
|
|
167
|
+
"""
|
|
168
|
+
# Check fingerprint data first (most reliable, comes from actual HTTP headers)
|
|
169
|
+
if http_fingerprint:
|
|
170
|
+
managed = http_fingerprint.get('managed_hosting')
|
|
171
|
+
if managed:
|
|
172
|
+
return True
|
|
173
|
+
|
|
174
|
+
# Fall back to checking services data (less reliable, from nmap banners)
|
|
175
|
+
for service in services:
|
|
176
|
+
# Check product field
|
|
177
|
+
product = (service.get('product') or '').lower()
|
|
178
|
+
raw_version = (service.get('raw_version') or '').lower()
|
|
179
|
+
service_name = (service.get('service') or '').lower()
|
|
180
|
+
|
|
181
|
+
# Combine all fields for matching
|
|
182
|
+
combined = f"{product} {raw_version} {service_name}"
|
|
183
|
+
|
|
184
|
+
# Check against known managed hosting platforms
|
|
185
|
+
for platform in MANAGED_HOSTING_PLATFORMS:
|
|
186
|
+
if platform in combined:
|
|
187
|
+
return True
|
|
188
|
+
|
|
189
|
+
return False
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def get_managed_hosting_platform(services: List[Dict[str, Any]], http_fingerprint: Dict[str, Any] = None) -> Optional[str]:
|
|
193
|
+
"""
|
|
194
|
+
Get the name of the managed hosting platform if detected.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
services: List of service dicts from nmap parser
|
|
198
|
+
http_fingerprint: Optional fingerprint data from http_fingerprint plugin
|
|
199
|
+
|
|
200
|
+
Returns:
|
|
201
|
+
Platform name or None
|
|
202
|
+
"""
|
|
203
|
+
# Check fingerprint data first
|
|
204
|
+
if http_fingerprint:
|
|
205
|
+
managed = http_fingerprint.get('managed_hosting')
|
|
206
|
+
if managed:
|
|
207
|
+
return managed
|
|
208
|
+
|
|
209
|
+
# Fall back to services check
|
|
210
|
+
for service in services:
|
|
211
|
+
product = (service.get('product') or '').lower()
|
|
212
|
+
raw_version = (service.get('raw_version') or '').lower()
|
|
213
|
+
service_name = (service.get('service') or '').lower()
|
|
214
|
+
combined = f"{product} {raw_version} {service_name}"
|
|
215
|
+
|
|
216
|
+
for platform in MANAGED_HOSTING_PLATFORMS:
|
|
217
|
+
if platform in combined:
|
|
218
|
+
return platform.title()
|
|
219
|
+
|
|
220
|
+
return None
|
|
221
|
+
|
|
222
|
+
|
|
143
223
|
# Technology to Nuclei tags mapping
|
|
144
224
|
# Maps detected products/technologies to relevant nuclei template tags
|
|
145
225
|
TECH_TO_NUCLEI_TAGS = {
|
|
@@ -575,6 +655,25 @@ class ChainRule:
|
|
|
575
655
|
new_args.append(arg)
|
|
576
656
|
args = new_args
|
|
577
657
|
|
|
658
|
+
# For Nikto: Skip CGI enumeration on managed hosting platforms
|
|
659
|
+
# This prevents long, pointless scans on Squarespace, Wix, etc.
|
|
660
|
+
if self.target_tool == 'nikto':
|
|
661
|
+
services = context.get('services', [])
|
|
662
|
+
http_fingerprint = context.get('http_fingerprint', {})
|
|
663
|
+
if is_managed_hosting(services, http_fingerprint):
|
|
664
|
+
# Add -C none to skip CGI dirs (pointless on managed hosting)
|
|
665
|
+
if '-C' not in str(args):
|
|
666
|
+
args.extend(['-C', 'none'])
|
|
667
|
+
# Add -Tuning x6 to skip remote file inclusion tests
|
|
668
|
+
if '-Tuning' not in str(args):
|
|
669
|
+
args.extend(['-Tuning', 'x6'])
|
|
670
|
+
# Log which platform was detected
|
|
671
|
+
platform = get_managed_hosting_platform(services, http_fingerprint)
|
|
672
|
+
if platform:
|
|
673
|
+
from souleyez.log_config import get_logger
|
|
674
|
+
logger = get_logger(__name__)
|
|
675
|
+
logger.info(f"[FINGERPRINT] Managed hosting detected ({platform}) - nikto using optimized scan config")
|
|
676
|
+
|
|
578
677
|
# For SQLMap with POST injections, add --data if we have POST data
|
|
579
678
|
if self.target_tool == 'sqlmap' and post_data and '--data' not in str(args):
|
|
580
679
|
# Insert --data after -u argument
|
|
@@ -642,32 +741,42 @@ class ToolChaining:
|
|
|
642
741
|
|
|
643
742
|
# Web service discovered → run web scanners
|
|
644
743
|
self.rules.extend([
|
|
645
|
-
#
|
|
646
|
-
#
|
|
744
|
+
# HTTP Fingerprinting - runs FIRST to detect WAF/CDN/managed hosting
|
|
745
|
+
# This enables smarter tool configuration for downstream scanners
|
|
647
746
|
ChainRule(
|
|
648
747
|
trigger_tool='nmap',
|
|
649
748
|
trigger_condition='service:http',
|
|
749
|
+
target_tool='http_fingerprint',
|
|
750
|
+
priority=11, # Highest priority - runs before all other web tools
|
|
751
|
+
args_template=[],
|
|
752
|
+
description='Web server detected, fingerprinting for WAF/CDN/platform detection'
|
|
753
|
+
),
|
|
754
|
+
# Nikto triggered by http_fingerprint (uses fingerprint data for smart config)
|
|
755
|
+
ChainRule(
|
|
756
|
+
trigger_tool='http_fingerprint',
|
|
757
|
+
trigger_condition='has:services',
|
|
758
|
+
target_tool='nikto',
|
|
759
|
+
priority=8,
|
|
760
|
+
args_template=['-nointeractive', '-timeout', '10'],
|
|
761
|
+
description='Fingerprinting complete, scanning for server misconfigurations with Nikto'
|
|
762
|
+
),
|
|
763
|
+
# Nuclei triggered by http_fingerprint
|
|
764
|
+
ChainRule(
|
|
765
|
+
trigger_tool='http_fingerprint',
|
|
766
|
+
trigger_condition='has:services',
|
|
650
767
|
target_tool='nuclei',
|
|
651
768
|
priority=9,
|
|
652
769
|
args_template=['-tags', '{nuclei_tags}', '-severity', 'critical,high', '-rate-limit', '50', '-c', '10', '-timeout', '10'],
|
|
653
|
-
description='
|
|
770
|
+
description='Fingerprinting complete, scanning with Nuclei'
|
|
654
771
|
),
|
|
772
|
+
# Gobuster triggered by http_fingerprint
|
|
655
773
|
ChainRule(
|
|
656
|
-
trigger_tool='
|
|
657
|
-
trigger_condition='
|
|
774
|
+
trigger_tool='http_fingerprint',
|
|
775
|
+
trigger_condition='has:services',
|
|
658
776
|
target_tool='gobuster',
|
|
659
777
|
priority=7,
|
|
660
778
|
args_template=['dir', '-u', 'http://{target}:{port}', '-w', 'data/wordlists/web_dirs_common.txt', '-x', 'js,json,php,asp,aspx,html,txt,bak,old,zip', '--no-error', '--timeout', '30s', '-t', '5', '--delay', '20ms'],
|
|
661
|
-
description='
|
|
662
|
-
),
|
|
663
|
-
# Nikto - web server vulnerability scanner (complements nuclei)
|
|
664
|
-
ChainRule(
|
|
665
|
-
trigger_tool='nmap',
|
|
666
|
-
trigger_condition='service:http',
|
|
667
|
-
target_tool='nikto',
|
|
668
|
-
priority=8,
|
|
669
|
-
args_template=['-nointeractive', '-timeout', '10'],
|
|
670
|
-
description='Web server detected, scanning for server misconfigurations with Nikto'
|
|
779
|
+
description='Fingerprinting complete, discovering directories and files'
|
|
671
780
|
),
|
|
672
781
|
# Dalfox - XSS scanner triggered after gobuster finds pages
|
|
673
782
|
ChainRule(
|
|
@@ -746,17 +855,8 @@ class ToolChaining:
|
|
|
746
855
|
args_template=['-a', '{target}'],
|
|
747
856
|
description='SMB service detected, enumerating shares and users (runs after CrackMapExec)'
|
|
748
857
|
),
|
|
749
|
-
#
|
|
750
|
-
# Use crackmapexec/netexec --shares instead (rule
|
|
751
|
-
ChainRule(
|
|
752
|
-
trigger_tool='nmap',
|
|
753
|
-
trigger_condition='service:smb',
|
|
754
|
-
target_tool='smbmap',
|
|
755
|
-
priority=7,
|
|
756
|
-
enabled=False, # Disabled due to impacket pickling bug
|
|
757
|
-
args_template=['-H', '{target}'],
|
|
758
|
-
description='SMB service detected, mapping shares (DISABLED - use netexec)'
|
|
759
|
-
),
|
|
858
|
+
# NOTE: smbmap removed - has upstream impacket pickling bug on Python 3.13+
|
|
859
|
+
# Use crackmapexec/netexec --shares instead (enum4linux rule above)
|
|
760
860
|
])
|
|
761
861
|
|
|
762
862
|
# Active Directory attacks - smart chaining workflow
|
souleyez/detection/validator.py
CHANGED
|
@@ -156,8 +156,10 @@ class DetectionValidator:
|
|
|
156
156
|
job_command = _reconstruct_command(job)
|
|
157
157
|
# Use started_at or finished_at for execution time
|
|
158
158
|
executed_at = job.get('started_at') or job.get('finished_at') or job.get('created_at')
|
|
159
|
-
# Job
|
|
160
|
-
|
|
159
|
+
# Job ran successfully if status is done, no_results, or warning
|
|
160
|
+
# (all of these sent network traffic that should be detectable by SIEM)
|
|
161
|
+
job_status = job.get('status', '')
|
|
162
|
+
success = job_status in ('done', 'no_results', 'warning')
|
|
161
163
|
|
|
162
164
|
# Extract target IP from command (common patterns)
|
|
163
165
|
target_ip = None
|
souleyez/docs/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# SoulEyez Documentation
|
|
2
2
|
|
|
3
|
-
**Version:** 2.
|
|
4
|
-
**Last Updated:** January
|
|
3
|
+
**Version:** 2.26.0
|
|
4
|
+
**Last Updated:** January 8, 2026
|
|
5
5
|
**Organization:** CyberSoul Security
|
|
6
6
|
|
|
7
7
|
Welcome to the SoulEyez documentation! This documentation covers architecture, development, user guides, and operational information for the SoulEyez penetration testing platform.
|
|
@@ -22,6 +22,17 @@ This guide walks you through installing souleyez on your system. The process tak
|
|
|
22
22
|
- **RAM Usage**: Running multiple heavy tools (Metasploit, SQLMap, Hashcat) simultaneously requires additional RAM
|
|
23
23
|
- **Disk I/O**: SSD recommended for database operations and log processing
|
|
24
24
|
|
|
25
|
+
> **🐉 Kali Linux Recommended**
|
|
26
|
+
>
|
|
27
|
+
> SoulEyez performs significantly better on **Kali Linux** than other distributions:
|
|
28
|
+
> - All pentesting tools pre-installed and optimized
|
|
29
|
+
> - Metasploit database and RPC already configured
|
|
30
|
+
> - Security-focused kernel and networking stack
|
|
31
|
+
> - No dependency hunting or version conflicts
|
|
32
|
+
> - Wordlists, databases, and tool configs ready to go
|
|
33
|
+
>
|
|
34
|
+
> While Ubuntu and other Debian-based distros are supported, you may experience slower setup times and occasional tool compatibility issues.
|
|
35
|
+
|
|
25
36
|
### Software Requirements
|
|
26
37
|
|
|
27
38
|
- **Operating System**: Linux (Kali Linux recommended, any Debian-based distro supported)
|
|
@@ -40,12 +51,14 @@ pipx is the Python community's recommended way to install CLI applications. It h
|
|
|
40
51
|
# One-time setup
|
|
41
52
|
sudo apt install pipx
|
|
42
53
|
pipx ensurepath
|
|
43
|
-
source ~/.bashrc
|
|
54
|
+
source ~/.bashrc # Kali Linux: use 'source ~/.zshrc' instead
|
|
44
55
|
|
|
45
56
|
# Install SoulEyez
|
|
46
57
|
pipx install souleyez
|
|
47
58
|
```
|
|
48
59
|
|
|
60
|
+
> **Kali Linux users:** Kali uses zsh by default. Use `source ~/.zshrc` instead of `source ~/.bashrc`
|
|
61
|
+
|
|
49
62
|
On first run, SoulEyez will prompt you to install pentesting tools (nmap, sqlmap, gobuster, etc.).
|
|
50
63
|
|
|
51
64
|
```bash
|
souleyez/engine/background.py
CHANGED
|
@@ -1039,7 +1039,8 @@ def _is_true_error_exit_code(rc: int, tool: str) -> bool:
|
|
|
1039
1039
|
# Tools that use non-zero exit codes for non-error conditions
|
|
1040
1040
|
# Parser will determine the actual status based on output
|
|
1041
1041
|
# msf_exploit returns 1 when no session opened (exploit ran but target not vulnerable)
|
|
1042
|
-
|
|
1042
|
+
# nikto returns non-zero when it finds vulnerabilities (not an error!)
|
|
1043
|
+
tools_with_nonzero_success = ['gobuster', 'hydra', 'medusa', 'msf_exploit', 'nikto']
|
|
1043
1044
|
|
|
1044
1045
|
if tool.lower() in tools_with_nonzero_success:
|
|
1045
1046
|
# Let parser determine status
|
|
@@ -1433,6 +1434,21 @@ def _detect_and_recover_stale_jobs() -> int:
|
|
|
1433
1434
|
"status": status,
|
|
1434
1435
|
"parse_result": parse_result
|
|
1435
1436
|
})
|
|
1437
|
+
|
|
1438
|
+
# Mark for auto-chaining if conditions are met
|
|
1439
|
+
try:
|
|
1440
|
+
from souleyez.core.tool_chaining import ToolChaining
|
|
1441
|
+
chaining = ToolChaining()
|
|
1442
|
+
if chaining.is_enabled() and is_chainable(status):
|
|
1443
|
+
_update_job(jid, chainable=True)
|
|
1444
|
+
_append_worker_log(f"job {jid} stale recovery marked as chainable")
|
|
1445
|
+
logger.info("Stale job marked as chainable", extra={
|
|
1446
|
+
"job_id": jid,
|
|
1447
|
+
"tool": tool,
|
|
1448
|
+
"status": status
|
|
1449
|
+
})
|
|
1450
|
+
except Exception as chain_err:
|
|
1451
|
+
_append_worker_log(f"job {jid} stale recovery chainable error: {chain_err}")
|
|
1436
1452
|
except Exception as parse_err:
|
|
1437
1453
|
_append_worker_log(f"job {jid} stale recovery parse exception: {parse_err}")
|
|
1438
1454
|
|
|
@@ -108,6 +108,8 @@ def handle_job_result(job: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
|
|
108
108
|
parse_result = parse_nikto_job(engagement_id, log_path, job)
|
|
109
109
|
elif tool == 'dalfox':
|
|
110
110
|
parse_result = parse_dalfox_job(engagement_id, log_path, job)
|
|
111
|
+
elif tool == 'http_fingerprint':
|
|
112
|
+
parse_result = parse_http_fingerprint_job(engagement_id, log_path, job)
|
|
111
113
|
|
|
112
114
|
# NOTE: Auto-chaining is now handled in background.py after parsing completes
|
|
113
115
|
# This avoids duplicate job creation and gives better control over timing
|
|
@@ -204,6 +206,8 @@ def reparse_job(job_id: int) -> Dict[str, Any]:
|
|
|
204
206
|
parse_result = parse_nikto_job(engagement_id, log_path, job)
|
|
205
207
|
elif tool == 'dalfox':
|
|
206
208
|
parse_result = parse_dalfox_job(engagement_id, log_path, job)
|
|
209
|
+
elif tool == 'http_fingerprint':
|
|
210
|
+
parse_result = parse_http_fingerprint_job(engagement_id, log_path, job)
|
|
207
211
|
else:
|
|
208
212
|
return {'success': False, 'message': f'No parser available for tool: {tool}'}
|
|
209
213
|
|
|
@@ -3068,6 +3072,91 @@ def parse_nikto_job(engagement_id: int, log_path: str, job: Dict[str, Any]) -> D
|
|
|
3068
3072
|
return {'error': str(e)}
|
|
3069
3073
|
|
|
3070
3074
|
|
|
3075
|
+
def parse_http_fingerprint_job(engagement_id: int, log_path: str, job: Dict[str, Any]) -> Dict[str, Any]:
|
|
3076
|
+
"""
|
|
3077
|
+
Parse HTTP fingerprint results.
|
|
3078
|
+
|
|
3079
|
+
Returns fingerprint data for use in auto-chaining context.
|
|
3080
|
+
This enables downstream tools (nikto, nuclei, etc.) to make smarter decisions
|
|
3081
|
+
based on detected WAF, CDN, or managed hosting platform.
|
|
3082
|
+
"""
|
|
3083
|
+
try:
|
|
3084
|
+
from souleyez.parsers.http_fingerprint_parser import (
|
|
3085
|
+
parse_http_fingerprint_output,
|
|
3086
|
+
build_fingerprint_context,
|
|
3087
|
+
get_tool_recommendations
|
|
3088
|
+
)
|
|
3089
|
+
from souleyez.storage.hosts import HostManager
|
|
3090
|
+
from urllib.parse import urlparse
|
|
3091
|
+
|
|
3092
|
+
target = job.get('target', '')
|
|
3093
|
+
|
|
3094
|
+
# Read log file
|
|
3095
|
+
with open(log_path, 'r', encoding='utf-8', errors='replace') as f:
|
|
3096
|
+
output = f.read()
|
|
3097
|
+
|
|
3098
|
+
parsed = parse_http_fingerprint_output(output, target)
|
|
3099
|
+
|
|
3100
|
+
# Extract host from target URL
|
|
3101
|
+
parsed_url = urlparse(target)
|
|
3102
|
+
target_host = parsed_url.hostname or target
|
|
3103
|
+
|
|
3104
|
+
# Update host with fingerprint info if we have useful data
|
|
3105
|
+
if target_host and (parsed.get('server') or parsed.get('managed_hosting')):
|
|
3106
|
+
hm = HostManager()
|
|
3107
|
+
host_data = {
|
|
3108
|
+
'ip': target_host,
|
|
3109
|
+
'status': 'up'
|
|
3110
|
+
}
|
|
3111
|
+
# Store server info in notes or a dedicated field
|
|
3112
|
+
# For now, we just ensure the host exists
|
|
3113
|
+
hm.add_or_update_host(engagement_id, host_data)
|
|
3114
|
+
|
|
3115
|
+
# Build fingerprint context for chaining
|
|
3116
|
+
fingerprint_context = build_fingerprint_context(parsed)
|
|
3117
|
+
|
|
3118
|
+
# Get tool recommendations
|
|
3119
|
+
recommendations = get_tool_recommendations(parsed)
|
|
3120
|
+
|
|
3121
|
+
# Determine status
|
|
3122
|
+
if parsed.get('error'):
|
|
3123
|
+
status = STATUS_ERROR
|
|
3124
|
+
elif parsed.get('managed_hosting') or parsed.get('waf') or parsed.get('cdn'):
|
|
3125
|
+
status = STATUS_DONE # Found useful info
|
|
3126
|
+
elif parsed.get('server'):
|
|
3127
|
+
status = STATUS_DONE
|
|
3128
|
+
else:
|
|
3129
|
+
status = STATUS_NO_RESULTS
|
|
3130
|
+
|
|
3131
|
+
return {
|
|
3132
|
+
'tool': 'http_fingerprint',
|
|
3133
|
+
'status': status,
|
|
3134
|
+
'target': target,
|
|
3135
|
+
'target_host': target_host,
|
|
3136
|
+
# Core fingerprint data
|
|
3137
|
+
'server': parsed.get('server'),
|
|
3138
|
+
'managed_hosting': parsed.get('managed_hosting'),
|
|
3139
|
+
'waf': parsed.get('waf', []),
|
|
3140
|
+
'cdn': parsed.get('cdn', []),
|
|
3141
|
+
'technologies': parsed.get('technologies', []),
|
|
3142
|
+
'status_code': parsed.get('status_code'),
|
|
3143
|
+
# For auto-chaining context
|
|
3144
|
+
'http_fingerprint': fingerprint_context.get('http_fingerprint', {}),
|
|
3145
|
+
'recommendations': recommendations,
|
|
3146
|
+
# Pass through for downstream chains
|
|
3147
|
+
'services': [{
|
|
3148
|
+
'ip': target_host,
|
|
3149
|
+
'port': parsed_url.port or (443 if parsed_url.scheme == 'https' else 80),
|
|
3150
|
+
'service_name': 'https' if parsed_url.scheme == 'https' else 'http',
|
|
3151
|
+
'product': parsed.get('server', ''),
|
|
3152
|
+
}],
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
except Exception as e:
|
|
3156
|
+
logger.error(f"Error parsing http_fingerprint job: {e}")
|
|
3157
|
+
return {'error': str(e)}
|
|
3158
|
+
|
|
3159
|
+
|
|
3071
3160
|
def parse_dalfox_job(engagement_id: int, log_path: str, job: Dict[str, Any]) -> Dict[str, Any]:
|
|
3072
3161
|
"""Parse Dalfox XSS scanner results."""
|
|
3073
3162
|
try:
|
souleyez/main.py
CHANGED
|
@@ -173,7 +173,7 @@ def _check_privileged_tools():
|
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
@click.group()
|
|
176
|
-
@click.version_option(version='2.
|
|
176
|
+
@click.version_option(version='2.26.0')
|
|
177
177
|
def cli():
|
|
178
178
|
"""SoulEyez - AI-Powered Pentesting Platform by CyberSoul Security"""
|
|
179
179
|
from souleyez.log_config import init_logging
|
|
@@ -1388,19 +1388,24 @@ def _run_doctor(fix=False, verbose=False):
|
|
|
1388
1388
|
path_dirs = os.environ.get('PATH', '').split(':')
|
|
1389
1389
|
pipx_bin = str(Path.home() / '.local' / 'bin')
|
|
1390
1390
|
go_bin = str(Path.home() / 'go' / 'bin')
|
|
1391
|
+
|
|
1392
|
+
# Detect shell config file (zsh for Kali, bash for others)
|
|
1393
|
+
shell = os.environ.get('SHELL', '/bin/bash')
|
|
1394
|
+
shell_rc = '~/.zshrc' if 'zsh' in shell else '~/.bashrc'
|
|
1395
|
+
|
|
1391
1396
|
if pipx_bin in path_dirs:
|
|
1392
1397
|
if verbose:
|
|
1393
1398
|
check_pass("PATH includes ~/.local/bin (pipx)")
|
|
1394
1399
|
else:
|
|
1395
1400
|
if Path(pipx_bin).exists() and any(Path(pipx_bin).iterdir()):
|
|
1396
|
-
check_warn("~/.local/bin not in PATH", "Add to
|
|
1401
|
+
check_warn("~/.local/bin not in PATH", f"Add to {shell_rc}: export PATH=\"$HOME/.local/bin:$PATH\"")
|
|
1397
1402
|
|
|
1398
1403
|
if go_bin in path_dirs:
|
|
1399
1404
|
if verbose:
|
|
1400
1405
|
check_pass("PATH includes ~/go/bin")
|
|
1401
1406
|
else:
|
|
1402
1407
|
if Path(go_bin).exists() and any(Path(go_bin).iterdir()):
|
|
1403
|
-
check_warn("~/go/bin not in PATH", "Add to
|
|
1408
|
+
check_warn("~/go/bin not in PATH", f"Add to {shell_rc}: export PATH=\"$HOME/go/bin:$PATH\"")
|
|
1404
1409
|
|
|
1405
1410
|
# Check database is writable
|
|
1406
1411
|
if db_path.exists():
|
|
@@ -1430,8 +1435,10 @@ def _run_doctor(fix=False, verbose=False):
|
|
|
1430
1435
|
# Section 7: MSF Database (if msfconsole available)
|
|
1431
1436
|
if shutil.which('msfconsole'):
|
|
1432
1437
|
click.echo(click.style("Metasploit", bold=True))
|
|
1438
|
+
# Check user config first, then system-wide config (Kali uses system-wide)
|
|
1433
1439
|
msf_db = Path.home() / '.msf4' / 'database.yml'
|
|
1434
|
-
|
|
1440
|
+
system_msf_db = Path('/usr/share/metasploit-framework/config/database.yml')
|
|
1441
|
+
if msf_db.exists() or system_msf_db.exists():
|
|
1435
1442
|
check_pass("MSF database configured")
|
|
1436
1443
|
else:
|
|
1437
1444
|
check_fail("MSF database not initialized", "msfdb init")
|
|
@@ -1513,6 +1520,98 @@ def tutorial():
|
|
|
1513
1520
|
run_tutorial()
|
|
1514
1521
|
|
|
1515
1522
|
|
|
1523
|
+
@cli.command('install-desktop')
|
|
1524
|
+
@click.option('--remove', is_flag=True, help='Remove the desktop shortcut')
|
|
1525
|
+
def install_desktop(remove):
|
|
1526
|
+
"""Install SoulEyez desktop shortcut in Applications menu.
|
|
1527
|
+
|
|
1528
|
+
Creates a .desktop file so SoulEyez appears in your
|
|
1529
|
+
Applications > Security menu with its icon.
|
|
1530
|
+
"""
|
|
1531
|
+
import shutil
|
|
1532
|
+
from importlib import resources
|
|
1533
|
+
|
|
1534
|
+
applications_dir = Path.home() / '.local' / 'share' / 'applications'
|
|
1535
|
+
icons_dir = Path.home() / '.local' / 'share' / 'icons'
|
|
1536
|
+
desktop_file = applications_dir / 'souleyez.desktop'
|
|
1537
|
+
icon_dest = icons_dir / 'souleyez.png'
|
|
1538
|
+
|
|
1539
|
+
if remove:
|
|
1540
|
+
# Remove desktop shortcut
|
|
1541
|
+
removed = False
|
|
1542
|
+
if desktop_file.exists():
|
|
1543
|
+
desktop_file.unlink()
|
|
1544
|
+
click.echo(click.style(" Removed desktop shortcut", fg='green'))
|
|
1545
|
+
removed = True
|
|
1546
|
+
if icon_dest.exists():
|
|
1547
|
+
icon_dest.unlink()
|
|
1548
|
+
click.echo(click.style(" Removed icon", fg='green'))
|
|
1549
|
+
removed = True
|
|
1550
|
+
if removed:
|
|
1551
|
+
click.echo(click.style("\nSoulEyez removed from Applications menu.", fg='cyan'))
|
|
1552
|
+
else:
|
|
1553
|
+
click.echo(click.style("No desktop shortcut found.", fg='yellow'))
|
|
1554
|
+
return
|
|
1555
|
+
|
|
1556
|
+
click.echo(click.style("\nInstalling SoulEyez desktop shortcut...\n", fg='cyan', bold=True))
|
|
1557
|
+
|
|
1558
|
+
# Create directories
|
|
1559
|
+
applications_dir.mkdir(parents=True, exist_ok=True)
|
|
1560
|
+
icons_dir.mkdir(parents=True, exist_ok=True)
|
|
1561
|
+
|
|
1562
|
+
# Find and copy icon
|
|
1563
|
+
try:
|
|
1564
|
+
# Try importlib.resources first (Python 3.9+)
|
|
1565
|
+
try:
|
|
1566
|
+
from importlib.resources import files
|
|
1567
|
+
icon_source = files('souleyez.assets').joinpath('souleyez-icon.png')
|
|
1568
|
+
with open(icon_source, 'rb') as src:
|
|
1569
|
+
icon_data = src.read()
|
|
1570
|
+
except (ImportError, TypeError, FileNotFoundError):
|
|
1571
|
+
# Fallback: find icon relative to this file
|
|
1572
|
+
icon_source = Path(__file__).parent / 'assets' / 'souleyez-icon.png'
|
|
1573
|
+
with open(icon_source, 'rb') as src:
|
|
1574
|
+
icon_data = src.read()
|
|
1575
|
+
|
|
1576
|
+
with open(icon_dest, 'wb') as dst:
|
|
1577
|
+
dst.write(icon_data)
|
|
1578
|
+
click.echo(click.style(" Installed icon", fg='green'))
|
|
1579
|
+
except Exception as e:
|
|
1580
|
+
click.echo(click.style(f" Warning: Could not copy icon: {e}", fg='yellow'))
|
|
1581
|
+
icon_dest = "utilities-terminal" # Fallback to system icon
|
|
1582
|
+
|
|
1583
|
+
# Create .desktop file
|
|
1584
|
+
desktop_content = f"""[Desktop Entry]
|
|
1585
|
+
Name=SoulEyez
|
|
1586
|
+
Comment=AI-Powered Penetration Testing Platform
|
|
1587
|
+
Exec=souleyez interactive
|
|
1588
|
+
Icon={icon_dest}
|
|
1589
|
+
Terminal=true
|
|
1590
|
+
Type=Application
|
|
1591
|
+
Categories=Security;System;Network;
|
|
1592
|
+
Keywords=pentest;security;hacking;nmap;metasploit;
|
|
1593
|
+
"""
|
|
1594
|
+
|
|
1595
|
+
desktop_file.write_text(desktop_content)
|
|
1596
|
+
click.echo(click.style(" Created desktop entry", fg='green'))
|
|
1597
|
+
|
|
1598
|
+
# Update desktop database (optional, may not be available)
|
|
1599
|
+
try:
|
|
1600
|
+
import subprocess
|
|
1601
|
+
subprocess.run(['update-desktop-database', str(applications_dir)],
|
|
1602
|
+
capture_output=True, check=False)
|
|
1603
|
+
except Exception:
|
|
1604
|
+
pass # Not critical if this fails
|
|
1605
|
+
|
|
1606
|
+
click.echo()
|
|
1607
|
+
click.echo(click.style("SoulEyez added to Applications menu!", fg='green', bold=True))
|
|
1608
|
+
click.echo()
|
|
1609
|
+
click.echo("You can find it under:")
|
|
1610
|
+
click.echo(click.style(" Applications > Security > SoulEyez", fg='cyan'))
|
|
1611
|
+
click.echo()
|
|
1612
|
+
click.echo("To remove: souleyez install-desktop --remove")
|
|
1613
|
+
|
|
1614
|
+
|
|
1516
1615
|
def main():
|
|
1517
1616
|
"""Main entry point."""
|
|
1518
1617
|
cli()
|