This Python script allows you to scan a given IP range to check if a specific port (e.g., port 8443) is open for each IP. It then saves the IP addresses with an open port to a CSV file.
The script uses the socket
library to establish a TCP connection to each IP address in the specified range on the specified port. If the connection is successful, it means the port is open, and the IP address is recorded in the CSV file.
- Python 3.x
-
Clone the repository to your local machine:git clone https://github.com/rick001/ip-scanner.git
-
Navigate to the project directory: cd ip-range-port-scanner
-
Execute the Python script: python ip_scanner.py
-
When prompted, enter the IP range you want to scan in CIDR notation (e.g., 1.2.0.0/24).
-
The script will scan all the IP addresses in the range for port 8443. If an IP address has the port open, it will be displayed on the screen.
-
The results will be saved in a CSV file named
open_ports.csv
in the same directory.
Note: Ensure you have the necessary permissions and authorization to perform network scanning. Unauthorized scanning can have serious legal consequences.