MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / print_results

Function print_results

actions/Scanner.py:153–171  ·  view source on GitHub ↗

Print scan results in a formatted way

(results)

Source from the content-addressed store, hash-verified

151 return results
152
153def print_results(results):
154 """Print scan results in a formatted way"""
155 print("\n" + "="*80)
156 print("SCAN RESULTS")
157 print("="*80)
158
159 for device in results:
160 print(f"\nIP Address: {device['ip']}")
161 print(f"MAC Address: {device['mac']}")
162 print(f"Vendor: {device['vendor']}")
163 print(f"Hostname: {device['hostname']}")
164
165 if device['open_ports']:
166 print("Open Ports:")
167 for port in device['open_ports']:
168 print(f" - {port['port']}/{port['protocol']}: {port['service']}")
169 else:
170 print("Open Ports: None found")
171 print("-" * 80)
172
173def save_results(results, filename='scan_results.json'):
174 """Save results to JSON file"""

Callers 1

Scanner.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected