I have not written the source code of port_scanner.py. Source: https://www.geeksforgeeks.org/port-scanner-using-python/