def scan_port(target, port, timeout=1): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(timeout) result = sock.connect_ex((target, port ...
Single-threaded Port Scanner – Simple and easy to read, scans one port at a time. Multi-threaded Port Scanner – Same concept, but uses threads for much faster scans. A port scanner is a tool that ...