A fast and efficient IP address scanner written in Python that can ping multiple IP addresses concurrently and generate detailed reports.
- Concurrent Scanning: Uses ThreadPoolExecutor for fast parallel ping operations
- CIDR Support: Scan entire subnets using CIDR notation (e.g., 192.168.1.0/24)
- Cross-Platform: Works on Windows, Linux, and macOS
- Detailed Reports: Generates timestamped result files with availability statistics
- Real-time Output: Shows live progress during scanning
- Standalone Executable: Can be compiled to a single executable file
- Python 3.8 or higher
- pip (Python package installer)
- Clone or download this repository
- Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install pyinstaller
python main.py <ip_or_cidr># Scan a single IP address
python main.py 192.168.1.1
# Scan a subnet
python main.py 192.168.1.0/24д
# Scan a larger network
python main.py 10.0.0.0/16After compilation (see Build section):
./dist/ip_scanner <ip_or_cidr>The scanner provides:
- Real-time status updates during scanning
- Final summary with available and unavailable IPs
- Availability percentage
- Timestamped result file (
result_YYYY-MM-DD HH:MM:SS.txt)
[+] Ping 254 addresses from 192.168.1.0/24...
[+] Available: 192.168.1.1
[+] Available: 192.168.1.5
[-] Unavailable: 192.168.1.2
...
--- Results ---
✅ Available (15):
192.168.1.1
192.168.1.5
...
❌ Unavailable (239):
192.168.1.2
192.168.1.3
...
📊 Availability: 5.91%
To create a standalone executable:
# Activate virtual environment
source venv/bin/activate
# Compile the script
pyinstaller --onefile --name ip_scanner main.pyThe executable will be created in the dist/ directory.
You can adjust the MAX_WORKERS constant in main.py to optimize performance:
- Increase for faster scanning (more concurrent threads)
- Decrease if you experience network issues or want to be more conservative
The scanner uses different ping commands optimized for each operating system:
- Windows:
ping -n 1 -w 1000 - Linux:
ping -c 1 -W 1 - macOS:
ping -c 1 -W 1000
ipaddress: Standard library for IP network operationssubprocess: Standard library for executing ping commandsplatform: Standard library for OS detectionconcurrent.futures: Standard library for concurrent executiondatetime: Standard library for timestamping
- Main Thread: Orchestrates the scanning process
- Worker Threads: Execute ping commands concurrently
- Result Collection: Gathers and processes results in real-time
- File I/O: Writes results to timestamped files
The scanner includes robust error handling for:
- Invalid IP addresses or CIDR notation
- Network timeouts and failures
- File system errors
- Invalid command line arguments
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
This tool is intended for legitimate network administration and security testing purposes only. Always ensure you have proper authorization before scanning any network that you don't own or manage.