forked from p34709852/monkey
Agent: fix network_range.py to generate a correct range object for ip strings with /32 cidr notation
This will fix the case where user inputs 10.0.0.10/32 expecting 10.0.0.10 getting scanned, but getting an error instead
This commit is contained in:
parent
913ba02e0b
commit
4bc07442ac
|
@ -44,9 +44,11 @@ class NetworkRange(object, metaclass=ABCMeta):
|
||||||
if not address_str: # Empty string
|
if not address_str: # Empty string
|
||||||
return None
|
return None
|
||||||
address_str = address_str.strip()
|
address_str = address_str.strip()
|
||||||
|
if address_str.endswith("/32"):
|
||||||
|
address_str = address_str[:-3]
|
||||||
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 "/" in address_str:
|
||||||
return CidrRange(cidr_range=address_str)
|
return CidrRange(cidr_range=address_str)
|
||||||
return SingleIpRange(ip_address=address_str)
|
return SingleIpRange(ip_address=address_str)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue