mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 23:04:24 +01:00
Added in some range checking for dash notation
This commit is contained in:
@@ -78,6 +78,8 @@ class InputHelper(object):
|
|||||||
ports = arguments.port.split(",")
|
ports = arguments.port.split(",")
|
||||||
elif "-" in arguments.port:
|
elif "-" in arguments.port:
|
||||||
tmp_ports = arguments.port.split("-")
|
tmp_ports = arguments.port.split("-")
|
||||||
|
if int(tmp_ports[0]) >= int(tmp_ports[1]):
|
||||||
|
raise Exception("Invalid range provided")
|
||||||
ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1))
|
ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1))
|
||||||
else:
|
else:
|
||||||
ports = [arguments.port]
|
ports = [arguments.port]
|
||||||
@@ -144,6 +146,7 @@ class InputHelper(object):
|
|||||||
else:
|
else:
|
||||||
exclusions.add(ips)
|
exclusions.add(ips)
|
||||||
|
|
||||||
|
# difference operation
|
||||||
targets -= exclusions
|
targets -= exclusions
|
||||||
|
|
||||||
if arguments.command:
|
if arguments.command:
|
||||||
|
|||||||
Reference in New Issue
Block a user