Building a port scanner

Now that we know the basics of socket programming, let's build a port scanner.

Ports are to computers what entrances are to houses. A computer has 65,535 ports through which it can communicate with the outside world. Most of the ports are closed by default. However, typically computers need to keep certain ports open for other computers on the network to connect and communicate.

A port scanner then is software that scans all the ports of a computer to find out which ports of the computer are open and listening for incoming communications. Port scanning is used by network administrators to strengthen their security regimes, but it is also used by hackers to look for entry points to break into a computer.

Before you ...

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.