aerenn adlı üyeden alıntı: mesajı görüntüle
Kodu paylaşırsanız yardımcı olayım
#
import socket
def port_scan(host, port):
    try:
        s = socket.socket()
        s.connect((host, port))
        return True
    
    except:
        return False

host = input("IP GİRİN : ")
start_port = int(input("İlk Portu Girin :"))
end_port = int(input("Son Portu Girin :"))
for port in range(start_port, end_port+1):
    if port_scan(host, port):
        print("Port" , port, "Açık")
    else:
        print("Port" , port, "Kapalı")