Hi! this is a basic implementation for Network scanner (it might not be sutiable for Every scenarios)
This code uses the socket module to create a TCP connection to each port on the specified remote host. If the connection is successful, it means that the port is open and the script prints out a message indicating that. The script also times how long it takes to scan all ports and prints out that information at the end.
Again, please ensure that you have permission and legal rights before scanning any network !