result=s.connect_ex((ip,port))
if result==0:
lock.acquire()
print '%s'%ip+',%s端口通过...'%port+'\n'
lock.release()
s.close()
else:
print '%s'%ip+',%s端口异常'%port+'...\n'
def ip_scan(ip):
print"""
*****************************************
端口号为 21,22,23,3389,1521,3940... for i in list1:
thread.start_new_thread(socket_port,(ip,int(i)))
print "扫描端口完成