How kartik2005221/omni-scanner works
Project type and purpose
• Type: A standalone, command-line network-scanning tool written in Python.
• Purpose: Discover devices on a local network, perform pings, traceroutes, and advanced Nmap scans via an interactive menu.
File structure
• Top-level scripts:
• main.py – entrypoint that drives the interactive menu.
• installer.py – sets up prerequisites (Python deps and OS tools).
• OS_scripts/ – wrappers for platform-specific commands (Linux: arp-scan, Windows: Npcap).
• utils/ – collection of utility modules:
• menu_utils.py – builds and handles the CLI menu.
• module_installer_utils.py – assists installer.py.
• administrative_utils.py – handles privilege checks and environment detection.
• common_utils.py – logging, parsing, data‐format helpers.
• documentation_utils.py – rendering results or exporting reports.
• Configuration: requirements.txt, no database or external config files.
• Media: Screenshots only for documentation.
README for additional insights
• Architecture is not explicitly described, but features map clearly to modules: ARP scans, ping, traceroute, Nmap integration.
• Dependencies: Python 3.8+, Nmap, arp-scan/Npcap.
a. Main components
1. User Interface (CLI)
– main.py + menu_utils.py
2. Core Logic Layer
– Utility modules in utils/ (administrative, common, documentation)
3. OS Abstraction Layer
– OS_scripts/linux.py and OS_scripts/windows.py
4. External Tools
– arp-scan (Linux), Npcap (Windows), ping, traceroute, nmap
5. Installer
– installer.py + module_installer_utils.py
b. Relationships & interactions
• User issues commands via CLI → main.py calls menu_utils → dispatches to specific scan functions in the Core Logic Layer.
• Core Logic calls OS Abstraction Layer to execute platform-specific commands.
• OS Abstraction Layer invokes External Tools and returns raw output.
• Core Logic parses output (via common_utils), formats results (documentation_utils) and prints to console.
• administrative_utils ensures necessary privileges or environment checks at startup.
• installer.py can be run separately to detect/install missing dependencies via module_installer_utils.
c. Architectural patterns / design principles
• Layered architecture: UI → Core Logic → OS Abstraction → External tools
• Modularity: Each utility has a single responsibility (e.g., menu vs. parsing vs. permissions).
• Platform abstraction: OS_scripts isolate Windows vs. Linux commands.
d. Key technologies & libraries
• Python 3.8+
• argparse or custom input loop for CLI
• System calls (subprocess) to invoke external tools
• External tools: nmap, arp-scan, ping, traceroute, Windows Npcap