def portscanudp (port):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
global checklist
con = s.connect((target, port))
k=0
for i in checklist:
if str(port)==checklist[i]['port']:
k=1
x = str(port) + ",," + str(socket.getservbyport(port, 'udp'))+",,"+'udp'+",,"+'old'
if(k==0):
x = str(port) + ',,' + str(socket.getservbyport(port, 'udp')) + ',,' + 'udp'+",,"+'new'
list.append(x)
con.close()
except:
pass
评论列表
文章目录