Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socket import *
- def scan():
- a = int(input("Porta inicial: "))
- b = int(input("Porta final: "))
- url = input("URL: ")
- lista = range(a, b+1) #Lista de 75 a 85
- for i in lista:
- a = socket(AF_INET, SOCK_STREAM)
- a.settimeout(0.5)
- b = a.connect_ex((url, i))
- if b != 0:
- print("A porta {} está fechada".format(i))
- else:
- print("\nA porta {} está ABERTA\n".format(i))
- scan() #Chama a função scan
- input("\nAperte ENTER para sair...")
Add Comment
Please, Sign In to add comment