-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_orchestrator.py
More file actions
71 lines (58 loc) · 2.37 KB
/
Copy pathdebug_orchestrator.py
File metadata and controls
71 lines (58 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python3
"""
Debug script to test orchestrator port scan extraction.
"""
import sys
import os
sys.path.insert(0, os.path.dirname(__file__))
from pgdn_scanner.scanners.scan_orchestrator import ScanOrchestrator
import json
def debug_orchestrator():
"""Debug orchestrator port scan extraction."""
print("🔍 Debug Orchestrator Port Scan")
print("=" * 50)
# Create orchestrator
config = {
'orchestrator': {
'enabled_scanners': ['port_scan'],
'use_external_tools': False
}
}
orchestrator = ScanOrchestrator(config)
orchestrator._enabled_scanners_set = True
orchestrator.enabled_scanners = ['port_scan']
# Test target
target = "sui-mainnet.interestlabs.io"
print(f"🎯 Target: {target}")
print()
# Run the scan
print("🚀 Running orchestrator scan...")
result = orchestrator.scan(
target=target,
ports=[22, 80, 3306],
scan_level=1,
nmap_args="-sV"
)
print("\n📊 Orchestrator Result:")
print("=" * 50)
print(json.dumps(result, indent=2, default=str))
# Check if we have the expected enhanced data
if result.get('data'):
for item in result['data']:
if item.get('scan_type') == 'port_scan':
port_result = item['result']
print(f"\n🔍 Port Scan Result Analysis:")
print(f" Open ports: {port_result.get('open_ports', [])}")
print(f" Service banners: {len(port_result.get('service_banners', {}))}")
print(f" TLS info: {len(port_result.get('tls_info', {}))}")
print(f" Services detected: {len(port_result.get('services_detected', []))}")
print(f" Has scan statistics: {'scan_statistics' in port_result}")
print(f" Has scan configuration: {'scan_configuration' in port_result}")
print(f" Has port details: {'port_details' in port_result}")
if port_result.get('services_detected'):
print(f"\n📋 Services Detected:")
for service in port_result['services_detected']:
print(f" Port {service['port']}: {service['service']} (confidence: {service['confidence']})")
print("\n✅ Debug complete!")
if __name__ == "__main__":
debug_orchestrator()