From 15699e832503fffebd2c1075397c24e87f788fd9 Mon Sep 17 00:00:00 2001 From: detourbr Date: Sun, 26 Mar 2017 17:44:19 +0200 Subject: [PATCH 1/3] Network detection issue fixed --- kickthemout.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/kickthemout.py b/kickthemout.py index 64b4190..1f3828c 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -298,19 +298,14 @@ def getDefaultInterface(returnNet=False): if netmask < 16: return None return net - for network, netmask, _, interface, address in scapy.config.conf.route.routes: - if network == 0 or interface == 'lo' or address == '127.0.0.1' or address == '0.0.0.0': - continue - if netmask <= 0 or netmask == 0xFFFFFFFF: - continue - net = to_CIDR_notation(network, netmask) - if interface != scapy.config.conf.iface: - continue - if net: - if returnNet: - return net - else: - return interface + iface_routes = [route for route in scapy.config.conf.route.routes if route[3] == scapy.config.conf.iface ] + network, netmask, _, interface, address = max(iface_routes, key=lambda item:item[1]) + net = to_CIDR_notation(network, netmask) + if net: + if returnNet: + return net + else: + return interface def getGatewayIP(): try: From 1ef18eac104272807210f9b6537603a78ccb732a Mon Sep 17 00:00:00 2001 From: Nikolaos Kamarinakis Date: Sat, 20 May 2017 01:26:34 +0300 Subject: [PATCH 2/3] Change pip command in readme --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 710419a..25552b9 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ MacOS Installation If you would like to install KickThemOut on a Mac, please run the following:: - $ sudo python -m pip install pcapy + $ pip install pcapy $ brew install libdnet scapy nmap From 62f3cabe1da27c2411ab0a42ef7e2828365e27ef Mon Sep 17 00:00:00 2001 From: Nikolaos Kamarinakis Date: Sat, 20 May 2017 01:27:26 +0300 Subject: [PATCH 3/3] Fix pip command in readme --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 25552b9..f3e654e 100644 --- a/README.rst +++ b/README.rst @@ -41,7 +41,7 @@ MacOS Installation If you would like to install KickThemOut on a Mac, please run the following:: - $ pip install pcapy + $ sudo pip install pcapy $ brew install libdnet scapy nmap @@ -51,7 +51,7 @@ If you would like to install KickThemOut on a Mac, please run the following:: $ cd kickthemout/ - $ sudo python -m pip install -r requirements.txt + $ sudo pip install -r requirements.txt **NOTE**: You need to have `Homebrew `_ installed before running the Mac OS installation.