Example #1
0
def options():
    if vpn:
        vpncheck()
    if fresh:
        os.system("rm -r output")
        newpath = r"output"
        os.makedirs(newpath)
    if install or upgrade:
        upgradeFiles()
    else:
        if domain:
            if quick:
                amass()
                subfinder()
            elif bruteforce:
                massdns()
                sublist3r()
                enumall()
                amass()
                subfinder()
            else:
                sublist3r(True)
                enumall()
                knockpy()
                amass()
                subfinder()
            subdomainfile()
            if notify:
                notified()
        else:
            warning("\nPlease provide a domain. Ex. -d example.com")
    colored("\nAll your subdomain are belong to us", colorama.Fore.BLUE)
Example #2
0
def banner():
    warning("""
         ___/ /__  __ _  ___ _(_)__  ___ ___/ /
        / _  / _ \/  ' \/ _ `/ / _ \/ -_) _  /
        \_,_/\___/_/_/_/\_,_/_/_//_/\__/\_,_/
    {}\t\t\tgithub.com/cakinney{}""".format(colorama.Fore.BLUE,
                                            colorama.Style.RESET_ALL))
    globpath = "*.csv"
    globpath2 = "*.lst"
    if (next(glob.iglob(globpath), None)) or (next(glob.iglob(globpath2),
                                                   None)):
        info(
            "\nThe following files may be left over from failed domained attempts:"
        )
        for file in glob.glob(globpath):
            info("  - {}".format(file))
        for file in glob.glob(globpath2):
            info("  - {}".format(file))
        signal(SIGALRM, lambda x: 1 / 0)
        try:
            alarm(5)
            RemoveQ = input("\nWould you like to remove the files? [y/n]: ")
            if RemoveQ.lower() == "y":
                os.system("rm *.csv")
                os.system("rm *.lst")
                info("\nFiles removed\nStarting domained...")
                time.sleep(5)
            else:
                info("\nThank you.\nPlease wait...")
                time.sleep(1)
        except:
            info("\n\nStarting domained...")
Example #3
0
def amass(rerun=0):
    if which("amass"):
        info("\n\nRunning Amass \n")
        amassFileName = "{}_amass.txt".format(output_base)
        amassCmd = "amass enum -d {} -o {}".format(domain, amassFileName)
        debug("\nRunning Command: {}".format(amassCmd))
        os.system(amassCmd)
        info("\nAmass Complete")
        time.sleep(1)
    else:
        warning("\n\nmass is not currently in your $PATH \n")
        if check_gopath("amass", "github.com/OWASP/Amass/...") and rerun != 1:
            amass(rerun=1)
Example #4
0
def subfinder(rerun=0):
    if which("subfinder"):
        info("\n\nRunning Subfinder \n")
        subfinderFileName = "{}_subfinder.txt".format(output_base)
        subfinderCmd = "subfinder -d {} -o {}".format(domain,
                                                      subfinderFileName)
        debug("\nRunning Command: {}".format(subfinderCmd))
        os.system(subfinderCmd)
        info("\nsubfinder Complete")
        time.sleep(1)
    else:
        warning("\n\nubfinder is not currently in your $PATH \n")
        if check_gopath("subfinder",
                        "github.com/subfinder/subfinder") and rerun != 1:
            subfinder(rerun=1)
Example #5
0
def check_gopath(cmd, install_repo):
    if os.environ["GOPATH"]:
        execs = os.listdir(os.path.join(os.environ["GOPATH"], "bin"))
    if cmd in execs:
        warning(
            "\nFound '{}' in your $GOPATH/bin folder please add this to your $PATH"
            .format(cmd))
    else:
        ans = input(
            "\n{}{} does not appear to be installed, would you like to run `go get -u -v {}`? [y/N]{}"
            .format(colorama.Fore.RED, cmd, install_repo,
                    colorama.Style.RESET_ALL))

        if ans.lower() == "y":
            info("\nInstalling {}".format(install_repo))
            os.system("go get -u -v {}".format(install_repo))
            return True
Example #6
0
def health_check(args=''):

    executor = ChorusExecutor()
    if args == '' or args == None:
        args = "checkos"
    if "help" not in args:
        logger.info(bold("Running \"atk %s\" Command:" % args))
    command = "source ~/.bashrc && %s %s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "health_lib/atk"), args)
    ret, stdout, stderr = executor.run(command + " 2>&1")
    if "Warning" in stdout:
        logger.warning(stdout)
        logger.warning(warning("You have warning during health_check which might cause\n"\
                       + "problem when you use alpine chorus, we recommand you\n"\
                       + "resolve these problem before using alpine chorus."))
    return ret, stdout, stderr
Example #7
0
def health_check(args=''):

    executor = ChorusExecutor()
    if args == '' or args == None:
        args = "checkos"
    if "help" not in args:
        logger.info(bold("Running \"atk %s\" Command:" % args))
    command = "source ~/.bashrc && %s %s" % (os.path.join(
        os.path.dirname(os.path.abspath(__file__)), "health_lib/atk"), args)
    ret, stdout, stderr = executor.run(command + " 2>&1")
    if "Warning" in stdout:
        logger.warning(stdout)
        logger.warning(warning("You have warning during health_check which might cause\n"\
                       + "problem when you use alpine chorus, we recommand you\n"\
                       + "resolve these problem before using alpine chorus."))
    return ret, stdout, stderr
Example #8
0
def vpncheck():
    vpnck = requests.get("https://ifconfig.co/json")
    # Change "City" to your city")
    if "City" in vpnck.text:
        warning("\nNot connected via VPN ")
        warning("\n{}".format(vpnck.content))
        warning("\nQuitting domained... ")
        quit()
    else:
        info("\nConnected via VPN ")
        info("\n{}".format(vpnck.content))
        time.sleep(5)
Example #9
0
def upgradeFiles():
    """Upgrade all the required files
    """
    binpath = os.path.join(SCRIPT_PATH, "bin")
    old_wd = os.getcwd()
    if not os.path.exists(binpath):
        os.makedirs(binpath)
    else:
        debug("Removing old bin directory: {}".format(binpath))
        os.system("rm -rf {}".format(binpath))
        os.makedirs(binpath)
    info("Changing into domained home: {}".format(SCRIPT_PATH))
    os.chdir(SCRIPT_PATH)
    unameChk = subprocess.check_output(["uname", "-am"]).decode("utf-8")

    if "kali" not in unameChk:
        warning("\nKali Linux Recommended!")
        warning(
            "Please install ldns (https://www.nlnetlabs.nl/documentation/ldns, 'apt install libldns-dev') and Go (https://golang.org, 'apt install golang')"
        )
        time.sleep(3)
    else:
        dependenciesInstall = "apt install libldns-dev golang"
        info("\nInstalling dependencies (ldns, Go) ")
        os.system(dependenciesInstall)
        info("\nDependencies Installed\n")

    sublist3rUpgrade = (
        "git clone https://github.com/aboul3la/Sublist3r.git ./bin/Sublist3r")
    info("\nInstalling Sublist3r ")
    os.system(sublist3rUpgrade)
    subInstallReq = "pip install -r bin/Sublist3r/requirements.txt"
    os.system(subInstallReq)
    info("Sublist3r Installed\n")

    eyeWitnessUpgrade = "git clone https://github.com/FortyNorthSecurity/EyeWitness.git ./bin/EyeWitness"
    info("\nInstalling EyeWitness" + eyeWitnessUpgrade)
    os.system(eyeWitnessUpgrade)
    eyeInstallReq = "bash bin/EyeWitness/setup/setup.sh"
    debug("\nRunning Command: ")
    os.system(eyeInstallReq)
    info("\nEyeWitness Installed\n")

    enumallUpgrade = "git clone https://github.com/jhaddix/domain.git ./bin/domain"
    info("\nInstalling Enumall ")
    info("\nenumall Installed\n")
    os.system(enumallUpgrade)

    knockpyUpgrade = "git clone https://github.com/guelfoweb/knock.git ./bin/knockpy"
    info("\nInstalling Knock ")
    os.system(knockpyUpgrade)
    info("\nKnockpy Installed\n")

    sublstUpgrade = "git clone https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056 ./bin/sublst"
    info("\nCopying JHaddix All Domain List: ")
    info("\nJHaddix All Domain List Installed\n")
    os.system(sublstUpgrade)
    SLsublstUpgrade = "wget -O ./bin/sublst/sl-domains.txt https://github.com/danielmiessler/SecLists/raw/master/Discovery/DNS/sortedcombined-knock-dnsrecon-fierce-reconng.txt"
    info("\nCopying SecList Domain List ")
    info("\nSecList Domain List Installed\n")
    os.system(SLsublstUpgrade)

    subbruteUpgrade = "git clone https://github.com/TheRook/subbrute.git ./bin/subbrute"
    info("\nInstalling Subbrute ")
    os.system(subbruteUpgrade)
    info("\nSubbrute Installed\n")

    amassUpgrade = "GO111MODULE=on go get -v -u github.com/OWASP/Amass/v3/..."
    info("\nInstalling Amass ")
    os.system(amassUpgrade)
    subfinderUpgrade = "GO111MODULE=on go get -u -v github.com/projectdiscovery/subfinder/cmd/subfinder"
    info("\nInstalling Subfinder ")
    os.system(subfinderUpgrade)
    massdnsUpgrade = "git clone --branch v0.2 --single-branch https://github.com/blechschmidt/massdns ./bin/massdns"
    info("\nInstalling massdns ")
    os.system(massdnsUpgrade)
    massdnsMake = "make -C ./bin/massdns"
    os.system(massdnsMake)
    info("\nMassdns Installed\n")
    os.system("cp ./bin/subbrute/resolvers.txt ./")

    if "kali" in unameChk:
        reconNGInstall = "apt-get install recon-ng"
        info("\nInstalling Recon-ng ")
        os.system(reconNGInstall)
        info("\nRecon-ng Installed\n")
    else:
        info("Please install Recon-ng - https://bitbucket.org/LaNMaSteR53/")

    info("\nAll tools installed ")
    debug("Changing back to old working directory: {}".format(old_wd))
    os.chdir(old_wd)