- Overview
- Features
- Requirements
- Installation
- Usage
- Output
- Examples
- Security Considerations
- Troubleshooting
- Contributing
- License
- Technical Documentation
IP Range Scanner is a powerful Python tool designed to scan ranges of IP addresses for web servers and collect their HTML titles. It supports concurrent scanning, multiple protocols (HTTP/HTTPS), custom port configurations, and provides comprehensive logging and CSV export capabilities.
- Concurrent Scanning: Utilizes multi-threading for efficient scanning of large IP ranges
- Protocol Support: Handles both HTTP and HTTPS protocols
- Flexible Input: Supports both command-line arguments and interactive input
- Comprehensive Logging: Detailed logging with both file and console output
- Data Export: Automatic CSV export of scan results
- Input Validation: Robust IP address and range validation
- Configurable Settings: Customizable timeout, worker threads, and ports
- Error Handling: Comprehensive error handling and graceful exits
- Python 3.7+
- Required packages:
requests>=2.26.0 beautifulsoup4>=4.9.3
-
Clone the repository:
git clone https://github.com/9de/IP-Range-Web-Title-Checker.git cd ip-scanner
-
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install required packages:
pip install -r requirements.txt
python ip_scanner.py --start-ip START_IP --end-ip END_IP [OPTIONS]
Simply run:
python ip_scanner.py
Option | Description | Default |
---|---|---|
--start-ip |
Starting IP address | Required |
--end-ip |
Ending IP address | Required |
--ports |
Ports to scan (space-separated) | 80 443 |
--timeout |
Request timeout in seconds | 5 |
--workers |
Number of concurrent workers | 10 |
--output |
Output CSV filename | scan_results_[timestamp].csv |
- Location:
scan_[timestamp].log
- Format:
YYYY-MM-DD HH:MM:SS - LEVEL - MESSAGE
- Location:
scan_results_[timestamp].csv
- Columns:
- IP Address
- URL
- HTML Title
-
Basic scan with default options:
python ip_scanner.py --start-ip 192.168.1.1 --end-ip 192.168.1.255
-
Custom port scan:
python ip_scanner.py --start-ip 10.0.0.1 --end-ip 10.0.0.100 --ports 80 8080 8443
-
Adjusted performance settings:
python ip_scanner.py --start-ip 172.16.0.1 --end-ip 172.16.255.255 --timeout 3 --workers 20
- Network Policies: Ensure compliance with network policies before scanning
- Rate Limiting: Be aware of potential rate limiting on target networks
- Legal Implications: Obtain necessary permissions before scanning non-owned networks
- SSL Verification: Default SSL verification is enabled for security
-
Connection Timeouts
- Increase timeout value using
--timeout
- Reduce number of workers using
--workers
- Increase timeout value using
-
Memory Issues
- Reduce the IP range size
- Decrease number of concurrent workers
-
Permission Errors
- Ensure write permissions for log and CSV files
- Run with appropriate privileges
Set environment variable for detailed logging:
export IP_SCANNER_DEBUG=1 # On Windows: set IP_SCANNER_DEBUG=1
Main class handling the scanning operations.
class IPScanner:
def __init__(self, timeout: int = 5, max_workers: int = 10)
def setup_logging(self)
def get_html_title(self, url: str) -> Optional[str]
def validate_ip_range(self, start_ip: str, end_ip: str) -> bool
def scan_ip(self, ip: str, ports: List[int]) -> List[Tuple[str, str, str]]
def scan_ip_range(self, start_ip: str, end_ip: str, ports: List[int]) -> List[Tuple[str, str, str]]
def save_results(self, results: List[Tuple[str, str, str]], filename: str)
- User input validation
- IP range conversion
- Concurrent scanning
- Result collection
- Data export
- Thread pool for concurrent scanning
- Configurable timeout and worker count
- Efficient IP address handling
- Minimal memory footprint
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
- Follow PEP 8 guidelines
- Include type hints
- Add unit tests for new features
- Update documentation
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is provided for educational and legitimate network administration purposes only. Users are responsible for ensuring compliance with applicable laws and regulations.
For bug reports and feature requests, please use the GitHub issue tracker.
For questions and discussions:
- GitHub Discussions