Fix ValueError #284

Scapy return a new tuple for routes : (dst_int, msk_int, gw_str, iff, ifaddr, metric), so fix the code.
This commit is contained in:
Urgau 2018-04-29 22:39:05 +02:00 committed by GitHub
parent 7930fefb73
commit 2991496ee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,7 @@ def getDefaultInterface(returnNet=False):
return net
iface_routes = [route for route in scapy.config.conf.route.routes if route[3] == scapy.config.conf.iface and route[1] != 0xFFFFFFFF]
network, netmask, _, interface, address = max(iface_routes, key=lambda item:item[1])
network, netmask, _, interface, address, _ = max(iface_routes, key=lambda item:item[1])
net = to_CIDR_notation(network, netmask)
if net:
if returnNet:
@ -785,4 +785,4 @@ if __name__ == '__main__':
# set to non-interactive attack
interactive = False
main()
main()