This Python script serves as a simple ethical hacking experiment, allowing users to scan ports on a specified IP address to identify open ports. It utilizes the socket module to create TCP sockets and establish connections to each port within a specified range.
- Python 3.x
- Clone the repository or download the Python script.
- Open a terminal or command prompt.
- Navigate to the directory containing the Python script.
- Run the script by executing the command:
python port_scanner.py
- Follow the prompts to enter the target IP address.
- The script will scan ports 1 to 1024 on the specified IP address and display the results.
- The socket module is used for creating network sockets, allowing the script to establish TCP connections to each port.
- TCP (Transmission Control Protocol) connections are established to determine whether each port on the target IP address is open or closed.
- The script utilizes error handling to gracefully handle exceptions such as KeyboardInterrupt and socket errors.
- pycharm
This script is intended for educational purposes only. Do not use it for any malicious activities. Always seek permission before scanning ports on a network or IP address.