From 9c87603a9ed6b14c65a3d1f46fab165613470ebb Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 24 Jan 2021 16:57:52 +0100 Subject: [PATCH 1/2] added gateway option --- kickthemout.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kickthemout.py b/kickthemout.py index afeafd4..1aa89fb 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -184,6 +184,8 @@ def getDefaultInterfaceMAC(): # retrieve gateway IP def getGatewayIP(): global stopAnimation + if options.gateway: + return options.gateway try: getGateway, timeout = sr1(IP(dst="github.com", ttl=0) / ICMP() / "XXXXXXXXXXX", verbose=False, timeout=4) if timeout: @@ -740,6 +742,12 @@ if __name__ == '__main__': callback=targetList, type='string', dest='targets', help='specify target IP address(es) and perform attack') + # def setGateway(option, opt, value, parser): + # setattr(parser.values, option.dest, value) + parser.add_option('-g', '--gateway', action='callback', + callback=(lambda option, opt, value, parser: setattr(parser.values, option.dest, value)), type='string', + dest='gateway', help='specify gateway IP address') + (options, argv) = parser.parse_args() try: From 1812f2af5318751160fcfdb6266f1ffad684337a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 24 Jan 2021 17:01:18 +0100 Subject: [PATCH 2/2] removed commented function and trailing spaces --- kickthemout.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kickthemout.py b/kickthemout.py index 1aa89fb..4e59644 100644 --- a/kickthemout.py +++ b/kickthemout.py @@ -27,7 +27,7 @@ def shutdown(): logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy! try: - from scapy.config import conf + from scapy.config import conf conf.ipv6_enabled = False from scapy.all import * import scan, spoof, nmap @@ -580,7 +580,7 @@ def kickalloff(): hostname = "N/A" vendor = resolveMac(mac) print(" [{}{}{}] {}{}{}\t{}{}\t{} ({}{}{}){}".format(YELLOW, str(i), WHITE, RED, str(onlineIPs[i]), BLUE, mac, GREEN, vendor, YELLOW, hostname, GREEN, END)) - + if options.packets is not None: print("\n{}Spoofing started... {}( {} pkts/min )".format(GREEN, END, str(options.packets))) else: @@ -685,14 +685,14 @@ def 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 - + print("\nOnline IPs: ") for i in range(len(onlineIPs)): mac = "" @@ -742,8 +742,6 @@ if __name__ == '__main__': callback=targetList, type='string', dest='targets', help='specify target IP address(es) and perform attack') - # def setGateway(option, opt, value, parser): - # setattr(parser.values, option.dest, value) parser.add_option('-g', '--gateway', action='callback', callback=(lambda option, opt, value, parser: setattr(parser.values, option.dest, value)), type='string', dest='gateway', help='specify gateway IP address')