This script provides functionality to manage TCP ports on your localhost. It allows you to scan for open ports, open and listen on specific ports, and close those ports when you're done.
- Port Scanning: Check which ports in a specified range are open.
- Open Port: Open a specific port and listen for incoming connections.
- Close Port: Close a specific port that was previously opened.
- Python 3.x
python scanner.py s <hostname> <start_port> <end_port>
python scanner.py s localhost 1 500
python scanner.py o <hostname> <port>
python scanner.py o localhsot 133
- Connect a client to that port first
python client.py
Enter server port<int>: 133
- send close from client and scanner to close that port