This script is used to scan a range of user-defined ports on a host. It reports which ports are open or closed. Its design is simple and readable.
🌍 Available languages | ESPAÑOL 🔁 ENGLISH
- User inputs: host and port range.
- Shows the result of each port (OPEN ✅ / CLOSED ❌).
- Prints a final summary listing open ports.
- Only performs TCP scanning (no UDP).
- No services detected: only open or closed port.
- Python 3.x
- No extra packages required.
Clone the repository and run the script from the terminal:
python port_scanner.py❗You will be prompted for target IP and a port range
If you want to compare the script results with the current network activity on your machine, run in the CMD terminal:
netstat -bThis lists active connections and the executables using them.
However, if you only need ports and states (no executables), you can use:
netstat -an- Use small ranges to reduce scan time.
- Be aware that firewalls or security tools may block or log your scans.
- Increase/decrease the settimeout() value depending on network latency.
- Maybe you need administrator/root privileges to scan lower ports (<1024).