forked from p15670423/monkey
parent
48875b003a
commit
20fff43fa9
|
@ -44,9 +44,9 @@ class NetworkRange(object, metaclass=ABCMeta):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_range_obj(address_str):
|
def get_range_obj(address_str):
|
||||||
address_str = address_str.strip()
|
|
||||||
if not address_str: # Empty string
|
if not address_str: # Empty string
|
||||||
return None
|
return None
|
||||||
|
address_str = address_str.strip()
|
||||||
if NetworkRange.check_if_range(address_str):
|
if NetworkRange.check_if_range(address_str):
|
||||||
return IpRange(ip_range=address_str)
|
return IpRange(ip_range=address_str)
|
||||||
if -1 != address_str.find('/'):
|
if -1 != address_str.find('/'):
|
||||||
|
|
|
@ -34,6 +34,7 @@ class NetworkScanner(object):
|
||||||
LOG.info("Found local IP addresses of the machine: %r", self._ip_addresses)
|
LOG.info("Found local IP addresses of the machine: %r", self._ip_addresses)
|
||||||
# for fixed range, only scan once.
|
# for fixed range, only scan once.
|
||||||
self._ranges = [NetworkRange.get_range_obj(address_str=x) for x in WormConfiguration.subnet_scan_list]
|
self._ranges = [NetworkRange.get_range_obj(address_str=x) for x in WormConfiguration.subnet_scan_list]
|
||||||
|
self._ranges = list(filter(None, self._ranges))
|
||||||
if WormConfiguration.local_network_scan:
|
if WormConfiguration.local_network_scan:
|
||||||
self._ranges += get_interfaces_ranges()
|
self._ranges += get_interfaces_ranges()
|
||||||
self._ranges += self._get_inaccessible_subnets_ips()
|
self._ranges += self._get_inaccessible_subnets_ips()
|
||||||
|
|
Loading…
Reference in New Issue