From 7928e302e83f6f15f7f5395cdc16d6dadb9b7515 Mon Sep 17 00:00:00 2001 From: k4m4 Date: Sun, 22 Jan 2017 11:03:56 +0200 Subject: [PATCH 1/6] Minor Bugfixes --- kickthemout.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kickthemout.py b/kickthemout.py index 40096eb..bcbb9bd 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -22,7 +22,7 @@ except: # User is probably on windows pass if notRoot: - raise SystemExit + sys.exit(1) logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy! try: @@ -31,7 +31,7 @@ try: except: print("\n{0}ERROR: Requirements have not been properly satisfied. Please try running:\n\t{1}$ sudo pip install -r requirements.txt{2}").format(RED, GREEN, END) print("\n{0}If you still get the same error, please submit an issue here:\n\t{1}https://github.com/k4m4/kickthemout/issues\n{2}").format(RED, BLUE, END) - raise SystemExit + sys.exit(1) def heading(): sys.stdout.write(GREEN + """ @@ -259,12 +259,12 @@ def getGatewayIP(): def getDefaultInterfaceMAC(): try: defaultInterfaceMac = get_if_hwaddr(defaultInterface) - return defaultInterfaceMac + return defaultInterfaceMac except: print("\n{0}ERROR: Default Interface MAC Address could not be obtained. Please enter MAC manually.{1}\n").format(RED, END) header = ('{0}kickthemout{1}> {2}Enter MAC Address {3}(MM:MM:MM:SS:SS:SS): '.format(BLUE, WHITE, RED, END)) defaultInterfaceMac = raw_input(header) - return defaultInterfaceMac + return defaultInterfaceMac def resolveMac(mac): try: @@ -292,7 +292,7 @@ def main(): if hostsList[0][0] == defaultGatewayIP: print("\n{0}{1}WARNING: There are {2}0{3} hosts up on you network except your gateway.\n\tYou can't kick anyone off {4}:/{5}\n").format( GREEN, RED, GREEN, RED, GREEN, END) - raise SystemExit + sys.exit(1) else: print( "\n{0}{1}WARNING: There are {2}0{3} hosts up on you network.\n\tIt looks like something went wrong {4}:/{5}").format( @@ -300,7 +300,7 @@ def main(): print( "\n{0}If you are experiencing this error multiple times, please submit an issue here:\n\t{1}https://github.com/k4m4/kickthemout/issues\n{2}").format( RED, BLUE, END) - raise SystemExit + sys.exit(1) try: @@ -314,7 +314,7 @@ def main(): if choice.upper() == 'E' or choice.upper() == 'EXIT': print('\n{0}Thanks for dropping by.' '\nCatch ya later!{1}').format(GREEN, END) - raise SystemExit + sys.exit(1) elif choice == '1': kickoneoff() elif choice == '2': From 1fed412544680e5cb70017e22c08d6be1ee523d5 Mon Sep 17 00:00:00 2001 From: Nikolaos Kamarinakis Date: Wed, 25 Jan 2017 16:57:48 +0200 Subject: [PATCH 2/6] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5986f54..54d7741 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ If you would like to install KickThemOut on a Mac, please run the following:: $ brew install libdnet scapy -Keep in mind that you might be asked to run some commands after executing the previous step. Moving on:: +**Keep in mind** that you might be asked to run some commands after executing the previous step. Moving on:: $ git clone https://github.com/k4m4/kickthemout.git From aeb4d97c39642dc838be711ca6a09aced34d4bc4 Mon Sep 17 00:00:00 2001 From: k4m4 Date: Wed, 25 Jan 2017 17:19:01 +0200 Subject: [PATCH 3/6] scanNetwork() Error Message - Issue #46 --- kickthemout.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kickthemout.py b/kickthemout.py index bcbb9bd..7cadbcf 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -69,7 +69,12 @@ def regenOnlineIPs(): def scanNetwork(): global hostsList - hostsList = scan.scanNetwork() + try: + hostsList = scan.scanNetwork() + except: + print("\n{0}ERROR: Network scanning failed. Please check your requirements configuration.{1}\n").format(RED, END) + sys.exit(1) + regenOnlineIPs() def kickoneoff(): From 8390e92e1a94876e9ca9b3a43accf854e8568b86 Mon Sep 17 00:00:00 2001 From: k4m4 Date: Wed, 25 Jan 2017 17:33:25 +0200 Subject: [PATCH 4/6] Update kickthemout.py --- kickthemout.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kickthemout.py b/kickthemout.py index 7cadbcf..166f19e 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -69,11 +69,7 @@ def regenOnlineIPs(): def scanNetwork(): global hostsList - try: - hostsList = scan.scanNetwork() - except: - print("\n{0}ERROR: Network scanning failed. Please check your requirements configuration.{1}\n").format(RED, END) - sys.exit(1) + hostsList = scan.scanNetwork() regenOnlineIPs() From de20d0ac992e4b649a4bc0418661fbe0557890d0 Mon Sep 17 00:00:00 2001 From: k4m4 Date: Wed, 25 Jan 2017 17:36:59 +0200 Subject: [PATCH 5/6] Update kickthemout.py --- kickthemout.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kickthemout.py b/kickthemout.py index 166f19e..34990af 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -22,7 +22,7 @@ except: # User is probably on windows pass if notRoot: - sys.exit(1) + raise SystemExit logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy! try: @@ -31,7 +31,7 @@ try: except: print("\n{0}ERROR: Requirements have not been properly satisfied. Please try running:\n\t{1}$ sudo pip install -r requirements.txt{2}").format(RED, GREEN, END) print("\n{0}If you still get the same error, please submit an issue here:\n\t{1}https://github.com/k4m4/kickthemout/issues\n{2}").format(RED, BLUE, END) - sys.exit(1) + raise SystemExit def heading(): sys.stdout.write(GREEN + """ @@ -293,7 +293,7 @@ def main(): if hostsList[0][0] == defaultGatewayIP: print("\n{0}{1}WARNING: There are {2}0{3} hosts up on you network except your gateway.\n\tYou can't kick anyone off {4}:/{5}\n").format( GREEN, RED, GREEN, RED, GREEN, END) - sys.exit(1) + raise SystemExit else: print( "\n{0}{1}WARNING: There are {2}0{3} hosts up on you network.\n\tIt looks like something went wrong {4}:/{5}").format( @@ -301,7 +301,7 @@ def main(): print( "\n{0}If you are experiencing this error multiple times, please submit an issue here:\n\t{1}https://github.com/k4m4/kickthemout/issues\n{2}").format( RED, BLUE, END) - sys.exit(1) + raise SystemExit try: @@ -315,7 +315,7 @@ def main(): if choice.upper() == 'E' or choice.upper() == 'EXIT': print('\n{0}Thanks for dropping by.' '\nCatch ya later!{1}').format(GREEN, END) - sys.exit(1) + raise SystemExit elif choice == '1': kickoneoff() elif choice == '2': From b2c866ad682ade709df0fe442298e22e08f3e0ec Mon Sep 17 00:00:00 2001 From: k4m4 Date: Wed, 25 Jan 2017 17:39:42 +0200 Subject: [PATCH 6/6] scanNetwork() Error Message - Issue #46 --- kickthemout.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kickthemout.py b/kickthemout.py index 34990af..81471d6 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -69,7 +69,11 @@ def regenOnlineIPs(): def scanNetwork(): global hostsList - hostsList = scan.scanNetwork() + try: + hostsList = scan.scanNetwork() + except: + print("\n{0}ERROR: Network scanning failed. Please check your requirements configuration.{1}\n").format(RED, END) + raise SystemExit regenOnlineIPs()