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

Function check_requirements

actions/Scanner.py:8–22  ·  view source on GitHub ↗

Check if required tools are installed

()

Source from the content-addressed store, hash-verified

6from typing import List, Dict
7
8def check_requirements():
9 """Check if required tools are installed"""
10 tools = ['nmap', 'arp-scan']
11 missing = []
12
13 for tool in tools:
14 try:
15 subprocess.run([tool, '--version'], capture_output=True, check=True)
16 except (subprocess.CalledProcessError, FileNotFoundError):
17 missing.append(tool)
18
19 if missing:
20 print(f"Error: Missing required tools: {', '.join(missing)}")
21 print("Install with: sudo apt install nmap arp-scan")
22 sys.exit(1)
23
24def run_arp_scan(interface='eth0'):
25 """Run ARP scan to discover devices on local network"""

Callers 1

scan_networkFunction · 0.85

Calls 3

appendMethod · 0.80
exitMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected