From 3c242194190f12ceeed520211b56b215ce72b21d Mon Sep 17 00:00:00 2001 From: k4m4 Date: Sun, 17 Feb 2019 02:38:24 +0200 Subject: [PATCH] Add `--kick-all` CLI option (closes #379) --- .DS_Store | Bin 6148 -> 0 bytes kickthemout.py | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 9c7e095a39565e9fec75f52b03c6c0fb8e8f112e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOG-mQ5Uh>?1KDKha!w$4gCQg*$OR+_QIH5?vVNBc8SOA#O9dYt7Ha~YC*`zW?r1Oqv9I!oZ-uJI>qw4Dk=icHTJG|iI zJAc2+Td&iUl>$;g3P=GdAO(J@fcIY7Y@Vnn1*Cu!I4j`ahemhog+pR|Iv8REAWoSM z<2q&uV)F#C7Y>Qc&@8FMq*{#_mUQM@)%C(5G3l@xKCGT>HKABMo%gpWhxJ57DIf(d z6}ZXm!u$W4{=@u#NzzUVNP&N)fK6AM)snANy>;|*-fJ8Ek?u90bT_Vp!VvA4810xF fZ^w60ly%M5Jnw}=V$hinI#E9Zu8T|x{IvpK{InHg diff --git a/kickthemout.py b/kickthemout.py index 56e4459..ccdbff5 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -643,16 +643,13 @@ def main(): os._exit(1) else: - print("\n{}Using interface '{}{}{}' with MAC address '{}{}{}'.\nGateway IP: '{}{}{}' --> Target(s): '{}{}{}'.{}".format( GREEN, RED, defaultInterface, GREEN, RED, defaultInterfaceMac, GREEN, RED, defaultGatewayIP, GREEN, RED, ", ".join(options.targets), GREEN, END)) if options.targets is None and options.scan is False: - try: while True: - optionBanner() header = ('{}kickthemout{}> {}'.format(BLUE, WHITE, END)) @@ -705,7 +702,6 @@ def main(): print(" [{}{}{}] {}{}{}\t{}{}\t{} ({}{}{}){}".format(YELLOW, str(i), WHITE, RED, str(onlineIPs[i]), BLUE, mac, GREEN, vendor, YELLOW, hostname, GREEN, END)) else: - nonInteractiveAttack() @@ -732,6 +728,9 @@ if __name__ == '__main__': parser.add_option('-s', '--scan', action='store_true', default=False, dest='scan', help='perform a quick network scan and exit') + parser.add_option('-a', '--kick-all', action='store_true', default=False, + dest='kick_all', help='perform attack on all online devices') + def targetList(option, opt, value, parser): setattr(parser.values, option.dest, value.split(',')) parser.add_option('-t', '--target', action='callback', @@ -765,7 +764,7 @@ if __name__ == '__main__': print("\n{}ERROR: Argument for number of packets broadcasted per minute must be an integer {}(e.g. {}--packet 60{}).\n".format(RED, END, BLUE, END)) os._exit(1) - if options.targets is None: + if options.targets is None and options.kick_all is False: # set to interactive attack interactive = True global stopAnimation @@ -773,14 +772,20 @@ if __name__ == '__main__': t = threading.Thread(target=scanningAnimation, args=('Scanning your network, hang on...',)) t.daemon = True t.start() - # commence scanning process try: scanNetwork() except KeyboardInterrupt: shutdown() stopAnimation = True - + elif options.targets is None and options.kick_all is True: + # set to non-interactive attack + interactive = False + kickalloff() + os._exit(0) + elif options.targets is not None and options.kick_all is True: + print("\n{}ERROR: Cannot use both {}-a/--kick-all{} and {}-t/--target{} flags in one command.{}\n".format(RED, BLUE, RED, BLUE, RED, END)) + os._exit(1) else: # set to non-interactive attack interactive = False