Making a Fast Port Scanner

前端 未结 9 728
眼角桃花
眼角桃花 2021-02-03 12:48

So I\'m making a port scanner in python...

import socket
ip = \"External IP\"
s = socket.socket(2, 1) #socket.AF_INET, socket.SOCK_STREAM

def porttry(ip, port):         


        
9条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-03 13:47

    socket.setdefualttimeout (time)

    is used to keep trying to connect with port for perticular time...when you send request and there is timeout set for 2 seconds so it will try to connect with port for 2 seconds....if there will be no response from that port in 2 seconds....it will be count as a dead port

提交回复
热议问题