A fast and efficient IPv4 ping sweep tool written in Python. This utility allows you to quickly discover active hosts within a specified network range by performing concurrent ICMP echo requests (pings). It's built to be cross-platform and utilizes Python's standard library features for robust network scanning.
- Concurrent Scanning: Leverages
concurrent.futures.ThreadPoolExecutorto send pings to multiple hosts simultaneously, drastically reducing scan time for large networks. - Cross-Platform Compatibility: Automatically adapts
pingcommand syntax for Windows, Linux, and macOS. - CIDR Support: Accepts network ranges in standard CIDR notation (e.g.,
192.168.1.0/24). - Robust IP/Network Handling: Uses Python's built-in
ipaddressmodule for accurate network parsing and host iteration. - Clear Output: Provides real-time updates of reachable hosts and a summary at the end.
- Error Handling: Catches and reports invalid network inputs or issues with the
pingcommand itself. - Configurable: Allows setting timeout for individual pings and the number of concurrent workers.
- System
pingUtility: This tool relies on your operating system's nativepingcommand being available in your system's PATH. - Firewalls: Host-based firewalls (e.g., Windows Firewall,
ufwon Linux) or network firewalls may block ICMP traffic, leading to hosts appearing "offline" even if they are active. - Permissions: While running
pingusually doesn't require root/administrator privileges, some highly restricted environments might behave differently.
No special installation is needed beyond a standard Python 3 environment. All dependencies are part of Python's standard library.
Simply download the ping_sweep.py file and place it in your desired project directory.
from ping_sweep import ping_sweep