This is a simple port scanner made in Python.
You can enter an IPv4 address and a port range, and the program will scan and show which ports are open.
- Checks if the IP address format is correct
- Checks if the port range format is correct
- Scans all ports in the selected range
- Shows all open ports
- Shows how long the scan took
- Easy to use and simple to read
- Make sure Python 3 is installed.
- Save the file as port_scanner.py.
- Open your terminal.
- Run the program using:
python3 port_scanner.py
Enter the IP address.
Enter the port range (example: 1-1000).
Example::
#Please Enter your IP address that you want to scan: 192.168.1.10
#Perfect! Valid IP_address '192.168.1.10', Your IP is scanning :)
#Please Enter your port range that you want to scan i.e (int)-(int):: 1-100
Possible Output::
port 22 is open on 192.168.1.10
port 80 is open on 192.168.1.10
Scan Completed in 2.45 seconds
Why I Built This
I built this tool to learn more about networking and Python socket programming.
It helped me understand how ports work and how to scan them safely.
Author
Sachin Shrestha (2025)
GitHub: https://github.com/sachingoray/Python-port-scanner
LinkedIn: https://www.linkedin.com/in/sachin-shrestha-989756181/