Beispiel #1
0
 def silentExit():
     clearTerm()
     if modules.startNetworkManager():
         bashRun("rm ./HANDSHAKES/TEMP_DUMP_* 2>/dev/null")
         print("\n[{}+{}] Detected network-manager as inactive,"
               " restarted it.".format(col.green, col.endl))
         print("[{}+{}] Internet connection may take up"
               " to 10 seconds to come back.\n".format(col.green, col.endl))
     modules.normalQuit(0)
Beispiel #2
0
def mainMenu():
    try:
        clearTerm()
        #Check if user has root permissions.
        if os.getuid() != 0:
            print("{}[?]{} Please make sure you have followed the steps:\n".format(
                col.yellow_deep,
                col.endl))
            print("\t{0}->{1} [{0}i{1}] Made script executable with '{2}sudo chmod +x {3}{1}' ".format(
                col.blue,
                col.endl,
                col.red,
                sys.argv[0]))
            print("\t{0}->{1} [{0}i{1}] Ran it with '{2}sudo {3}{1}' \n".format(
                col.blue,
                col.endl,
                col.red,
                scriptInvocation))
            print(modules.returnYellow(col, "\tAlternatively,"))
            print("\t{0}->{1} [{0}i{1}] If you have symlinked the program, just do '{2}sudo airscript-ng{1}' \n".format(
                col.blue,
                col.endl,
                col.red))
            modules.normalQuit(1)
        print("Hello {}{}{}!\n".format(col.yellow,userName,col.endl))
        displayWarranty() #Display the warranty information, as recommened by the GPLv3 license.
        print("{0}Your CPU{1}: {2}{3}{1}".format(col.red,col.endl,col.green,cpuModel))
        print("{0}Your OS{1}: {2}{3}{1}".format(col.red,col.endl,col.green,userDistro))
        print("{0}Your Kernel{1}: {2}{3}{1}".format(col.red,col.endl,col.green,userKernel))
        print("{0}Your Architecture{1}: {2}{3}\\{4}{1}".format(col.red,col.endl,col.green,userArch,userArchDpkg))
        print("{0}Dependencies{1}: {2}{3}{1}".format(col.red,col.endl,col.green,dependenciesInstalled()))
        print("{0}Script version{1}: {2}{3}{1}".format(col.red,col.endl,col.green,scriptVersion))
        #A 2d list spanning across multiple lines that stores all the info for the menu.
        #Probably not the most efficient solution here, but its simple to maintain.
        menuTextItemArray = \
    [[col.pink_deep,'Aircrack-ng to crack WPA/WPA2','1','main.aircrackng'],
    [col.blue_deep,'Reaver with pixie dust to crack WPS','2','main.reaver'],
    [col.endl_deep,'Host a Evil-Twin/MITM AP to phish credentials, sniff traffic and more.','3','main.EvilTwinFakeAP'],
    [col.red_deep,'Crack an existing WPA/WPA2 handshake using CPU/GPU.','4','main.crackCaptureFile'],
    [col.green_deep,'Use mdk4 to create a beacon flood, denial-of-service and more.','5','main.mdk4'],
    [col.yellow_deep,'Manipulate the system\'s WiFi-cards with manual control.','6','functions.manualCardControl'],
    [col.blue_deep,'Download and build the dependencies from GitHub.','7','functions.fetchGitHubDeps'],
    [col.yellow_deep,'Update/upgrade all system packages and this script','8','functions.updateAptPackagesFull'],
    [col.green_deep,'Setup Hashcat and Hashcat-utils to use GPU for cracking','9','functions.hashcatDownloadFunction'],
    [col.light_blue,'Add a symlink to invoke from anywhere','10','main.createSymlink'],
    [col.pink_deep,'Delete the symlink from option [10]','11','main.removeSymlink'],
    [col.black_deep,'Turn the colors on/off','12','functions.switchColors'],
    [col.endl_deep,'If apt is broken, use this to fix it','13','functions.revertKaliSources'],
    [col.red_deep,'Delete the folder containing dependencies.','14','functions.removeResidualFiles'],
    [col.highlight+'\n','Exit \033[0m'+col.endl,'99','functions.silentExit']]
        #The menu, in short.
        print("\n%s[?] %sWhat tool would you like to use? Please run as root." %(col.yellow_deep,col.endl))
        print("\n{}-----------------------------------------ATTACKS-----------------------------------------{}\n".format(
            col.yellow_deep,
            col.endl))
        for i in range(1,int(menuTextItemArray[-2][2])+2):
            print("%sType [%s] - %s" %(menuTextItemArray[i-1][0],menuTextItemArray[i-1][2],menuTextItemArray[i-1][1]))
            if i == 6:
                print("\n{}----------------------------------------DOWNLOADS----------------------------------------{}\n".format(
                    col.green_deep,
                    col.endl))
            if i == 9:
                print("\n{}--------------------------------------INSTALLATIONS--------------------------------------{}\n".format(
                    col.blue_deep,
                    col.endl))
        while True:
            mainMenuChoice = input('\n|%sMENU%s|(Choose an option) >>' %(col.red,col.endl))
            for n in menuTextItemArray:
                if mainMenuChoice == n[2]:
                    functionLocation = n[3].split(".")[1]
                    if n[3].split(".")[0] == 'main':
                        getattr(main,functionLocation)()
                    elif n[3].split(".")[0] == 'functions':
                        getattr(functions,functionLocation)()
            mainMenu()
    except(KeyboardInterrupt,EOFError):
        try:
            mainMenu()
        except(KeyboardInterrupt,EOFError):
            mainMenu()