def run(params):
global verbose
verbose = False
testMethod = "arp"
dstIP = ""
count = 10
interval = 1
if("-m" in params):
testMethod = (params[params.index("-m")+1]).lower()
if("-t" in params):
dstIP = params[params.index("-t")+1]
if("-i" in params):
interval = float(params[params.index("-i")+1])
if("-c" in params):
count = int(params[params.index("-c")+1])
if("-v" in params):
verbose = True
if(dstIP == ""):
sdnpwn.message("No target given, using default gateway", sdnpwn.NORMAL)
try:
dstIP = netifaces.gateways()['default'][netifaces.AF_INET][0]
except:
sdnpwn.message("Could not determine gateway address. Please specify a target using the -t option.", sdnpwn.ERROR)
return
sdnpwn.message("Default gateway detected as " + dstIP, sdnpwn.NORMAL)
try:
if(testForSDN(testMethod, dstIP, count, interval)):
sdnpwn.message("SDN detected!", sdnpwn.SUCCESS)
else:
sdnpwn.message("SDN not detected", sdnpwn.WARNING)
except PermissionError as e:
sdnpwn.message("Needs root!", sdnpwn.ERROR)
评论列表
文章目录