print '[+]正在处理扫描信息.'
while threading.activeCount() != 1: #避免线程还没有运行完就提前输出不全的结果
time.sleep(1)
if not obj_ping.udp_info:
print '\n'
print '=' * 20
print '[+]未发现在线主机.'
else:
print '\n'
print '=' * 20
for ip_a in sorted(obj_ping.udp_info.keys()):
print '[+]主机 %s 在线.' % ip_a
if args.scan: #是否启动端口扫描
if not args.timeout and not args.retry:
obj_port = Port_Scan(args)
elif args.timeout and not args.retry:
obj_port = Port_Scan(args,timeout=args.timeout)
elif not args.timeout and args.retry:
obj_port = Port_Scan(args,retry=args.retry)
else:
obj_port = Port_Scan(args,args.timeout,args.retry)
ip_list,port_list = obj_port.targets
if ip_list and port_list:
if args.SYN:
for dst in ip_list:
print '[!]扫描...',dst
for port in port_list:
t = threading.Thread(target=obj_port.syn_port_scan,args=(dst,int(port)))
t.start()
print '[+]正在处理扫描信息.'
while threading.activeCount() != 1: #避免线程还没有运行完就提前输出不全的结果
time.sleep(1)
if not obj_port.syn_port_dict:
print '\n'
print '=' * 20
print '[+]未发现开放TCP端口.'
else:
print '\n'
print '=' * 20
for k,v in obj_port.syn_port_dict.items():
print '[+]主机 %s 开放的TCP端口有:%s' % (k,str(v))
elif args.ACK:
pass #基本不能使用
elif args.FIN:
pass #基本不能使用
elif args.UPORT:
for dst in ip_list:
print '[!]扫描...',dst
for port in port_list:
t = threading.Thread(target=obj_port.udp_port_scan,args=(dst,int(port)))
t.start()
print '[+]正在处理扫描信息.'
while threading.activeCount() != 1: #避免线程还没有运行完就提前输出不全的结果
time.sleep(1)