Patch for right determination of IPprefix if have more than one network interface.

This commit is contained in:
AMednyy 2013-11-09 12:54:27 +04:00
parent 0b264e4aff
commit c20bbef81b

View file

@ -905,6 +905,9 @@ def main():
#Find the gateway and interface
ipr = Popen(['/sbin/ip', 'route'], stdout=PIPE, stderr=DN)
ipr = ipr.communicate()[0]
iprs = ipr.split('\n')
for route in range(1,len(iprs)):
iprs[route]=iprs[route].split()
ipr = repr(ipr).split(' ')
routerIP = ipr[2]
IPprefix = ipr[8][2:]
@ -912,7 +915,11 @@ def main():
interface = args.interface
else:
interface = ipr[4]
for ip in iprs:
for i in ip:
if i == interface:
IPprefix=ip[0]
break
if args.ipaddress:
victimIP = args.ipaddress
else: