#!/bin/python3
import socket 
from datetime import datetime

ip = input("Digite o IP\n|>")

inicio = datetime.now()

for porta in range(1,65536):
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

    socket.setdefaulttimeout(0.5)
    
    if (sock.connect_ex((ip,porta)) == 0):
        print("[+] Porta TCP Aberta:", porta)
        sock.close()

final = datetime.now()
tempoTotal = (final - inicio)

print("\nTempo de duração do Scan:", tempoTotal)
