Fixed horrible bug where we would return more victims than we needed to

This commit is contained in:
Daniel Goldberg 2019-09-23 17:45:17 +03:00
parent ccc6c50a7f
commit c76cc72821
1 changed files with 2 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class NetworkScanner(object):
# check before running scans
if stop_callback and stop_callback():
LOG.debug("Got stop signal")
break
return
results = pool.map(self.scan_machine, victim_chunk)
resulting_victims = [x for x in results if x] # filter out dead addresses
@ -123,8 +123,7 @@ class NetworkScanner(object):
if victims_count >= max_find:
LOG.debug("Found max needed victims (%d), stopping scan", max_find)
break
return
if WormConfiguration.tcp_scan_interval:
# time.sleep uses seconds, while config is in milliseconds
time.sleep(WormConfiguration.tcp_scan_interval / float(1000))