Example #1
0
 def removeSymlink():
     clearTerm()
     modules.createNewLine()
     modules.printBlue(col,"This option will remove the symlink created in option [7].")
     modules.printBlue(col,"If you haven't used option [7], then this isn't necessary.")
     modules.printBlue(col,"However, this should be safe to run.")
     modules.printBlue(col,"Unless you already have another airscript-ng in /usr/local/bin.")
     modules.createNewLine()
     try:
         if modules.yesNo("Remove the symbolic link?",col):
             if functions.checkExistingSymlink():
                 modules.createNewLine()
                 modules.printSuccess(col, "Found airscript-ng in /usr/local/bin.")
                 if bashReturnValue("rm -f /usr/local/bin/airscript-ng") == "0":
                     modules.printSuccess(col, "Successfully deleted the symlink.")
                     modules.printGreen(col, "Typing 'airscript-ng' will no longer invoke it.")
                 else:
                     raise ValueError
             else:
                 raise FileNotFoundError
     except(FileNotFoundError):
         modules.createNewLine()
         modules.printYellow(col, "Symlink not found. No need to remove anything.")
     except(ValueError):
         modules.createNewLine()
         modules.printYellow(col, "An error occured while removing the symlink.")
         modules.printYellow(col, "Try running this manually: unlink /usr/local/bin/airscript-ng")
     finally:
         functions.menuOrExit()
Example #2
0
 def fetchGitHubDeps():
     clearTerm()
     try:
         modules.createNewLine()
         modules.printBlue(
             col,
             "This will clone aircrack-ng, reaver, pixiewps and mdk4 from GitHub."
         )
         modules.printBlue(
             col,
             "This is not normally required, as the script will automatically get"
         )
         modules.printBlue(
             col,
             "any missing dependencies from git.kali.org. However, you can get them"
         )
         modules.printBlue(
             col, "from GitHub instead of git.kali.org, if you want.")
         modules.createNewLine()
         modules.printYellow(
             col,
             "Warning: This may result in compatibility or instability issues!"
         )
         modules.printYellow(
             col,
             "Warning: Compilation may take longer due to different procedures."
         )
         modules.createNewLine()
         if modules.yesNo("Confirm download from GitHub?", col):
             modules.cloneAircrackGitHub()
             modules.cloneReaverGitHub()
             modules.clonePixiewpsGitHub()
             modules.cloneMDK4Deps()
             modules.createNewLine()
             modules.printSuccess(col,
                                  "Successfully built all dependencies.")
     except (KeyboardInterrupt, EOFError, Exception):
         modules.createNewLine()
     finally:
         functions.menuOrExit()
Example #3
0
 def createSymlink():
     clearTerm()
     modules.createNewLine()
     modules.printBlue(col,"Creating a symbolic link allows you to run airscript-ng from anywhere.")
     modules.printBlue(col,"Essentially, this adds an entry in /usr/local/bin.")
     modules.printBlue(col,"Next time you want to run airscript-ng, just type 'airscript-ng'.")
     modules.printBlue(col,"You can run this from anywhere, any folder you want.")
     modules.printBlue(col,"If you change your mind, you can always delete this using option [8].")
     modules.createNewLine()
     try:
         if sys.argv[0].lower().startswith("./"):
             FILE_NAME = sys.argv[0][2:]
         elif sys.argv[0].lower().startswith("/usr/local/bin/"):
             raise TypeError
         else:
             FILE_NAME = sys.argv[0]
         if modules.yesNo("Create the symbolic link?",col):
             if not functions.checkExistingSymlink():
                 modules.createNewLine()
                 modules.printSuccess(col, "Adding Symbolic link -> /usr/local/bin/airscript-ng")
                 if bashReturnValue("ls /usr/local/bin") == "0":
                     if bashReturnValue("echo $PATH | grep \"/usr/local/bin\"") == "0":
                         if bashReturnValue("ln -sf $(find $(pwd) -name {}) /usr/local/bin/airscript-ng".format(FILE_NAME)) == "0":
                             modules.printSuccess(col, "Successfully created the symlink.")
                             modules.printGreen(col, "Now you can type 'airscript-ng' from anywhere.")
                             modules.printGreen(col, "Go ahead, quit and try typing: airscript-ng")
                         else:
                             raise ValueError
                     else:
                         raise FileNotFoundError
                 else:
                     raise NotADirectoryError
             else:
                 raise FileExistsError
     except(FileExistsError):
         modules.createNewLine()
         modules.printYellow(col, "Symbolic link already exists. Will not overwrite.")
         modules.printYellow(col, "Is this an error? You can delete the link manually.")
         modules.printYellow(col, "Try running this: unlink /usr/local/bin/airscript-ng")
     except(ValueError):
         modules.createNewLine()
         modules.printYellow(col, "An error occured while creating the symlink.")
         modules.printYellow(col, "Run this manually:")
         modules.printYellow(col, "ln -sf $(find $(pwd) -name {}) /usr/local/bin/airscript-ng".format(
             FILE_NAME))
     except(FileNotFoundError):
         modules.createNewLine()
         modules.printYellow(col, "Unable to find /usr/local/bin in the $PATH env variable.")
         modules.printYellow(col, "If $PATH doesn't exist, then how are you running this?")
         modules.printYellow(col, "Otherwise, you can add to your $PATH variable by following this guide.")
         modules.printYellow(col, "Visit: https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix")
     except(NotADirectoryError):
         modules.createNewLine()
         modules.printYellow(col, "Unable to find the /usr/local/bin directory.")
         modules.printYellow(col, "Please choose a linux distro that utilises this directory.")
         modules.printYellow(col, "Otherwise, I can't add the Symlink.")
     except(TypeError):
         modules.createNewLine()
         modules.printYellow(col, "Wrong method of invocation.")
         modules.printYellow(col, "You're probably running this using 'airscript-ng'.")
         modules.printYellow(col, "That won't work. You'll have to run it manually for this occasion.")
         modules.printYellow(col, "Please head to where Airscript-ng is stored.")
         modules.printYellow(col, "Then run it manually with: ./airscript-ng")
         modules.printYellow(col, "If you're confused, please consult the README.md file.")
     finally:
         functions.menuOrExit()