def scan(self):
self.result = []
_gate_way = '.'.join(self.current_ip.split('.')[:3])
# gate_way = _gate_way+'.1' # pyflakes says this is not used
if self.alert:
console.show_activity('Scanning.....')
for x in range(1, 256):
ip = '{}.{}'.format(_gate_way, x)
self.thread_limit.acquire()
threading.Thread(target=self.pscan, args=(ip, self.port),
name='PortScanner').start()
thread_list = [x for x in threading.enumerate() if x.name == 'PortScanner']
for _ in thread_list:
_.join()
if self.alert:
if self.result:
console.hud_alert(' '.join(self.result), 'success', 1)
else:
console.hud_alert('Not found', 'error', 1)
console.hide_activity()
return self.result
评论列表
文章目录