diff --git a/autosploit/main.py b/autosploit/main.py index a42d8a9..58e7694 100644 --- a/autosploit/main.py +++ b/autosploit/main.py @@ -1,12 +1,15 @@ import sys +import psutil + from lib.cmdline.cmd import AutoSploitParser from lib.term.terminal import AutoSploitTerminal from lib.output import ( info, warning, error, - prompt + prompt, + misc_info ) from lib.settings import ( logo, @@ -26,32 +29,47 @@ def main(): logo() info("welcome to autosploit, give us a little bit while we configure") - info("checking for services") + misc_info("checking for disabled services") # according to ps aux, postgre and apache2 are the names of the services service_names = ("postgres", "apache2") for service in list(service_names): while not check_services(service): - choice = prompt("it appears that service {} is not enabled, would you like us to enable it for you[y/N]".format(service)) + choice = prompt( + "it appears that service {} is not enabled, would you like us to enable it for you[y/N]".format( + service.title() + ) + ) if choice.lower().startswith("y"): - if "postgre" in service: - cmdline("sudo bash {}".format(START_POSTGRESQL_PATH)) - else: - cmdline("sudo bash {}".format(START_APACHE_PATH)) + try: + if "postgre" in service: + cmdline("sudo bash {}".format(START_POSTGRESQL_PATH)) + else: + cmdline("sudo bash {}".format(START_APACHE_PATH)) + # moving this back because it was funky to see it each run + info("services started successfully") + # this tends to show up when trying to start the services + # I'm not entirely sure why, but this fixes it + except psutil.NoSuchProcess: + pass else: - error("service {} is required to be started for autosploit to run, exiting".format(service.title())) + error( + "service {} is required to be started for autosploit to run successfully (you can do it manually " + "by using the command `sudo service {} start`), exiting".format( + service.title(), service + ) + ) sys.exit(1) - info("services started successfully") if len(sys.argv) > 1: info("attempting to load API keys") loaded_tokens = load_api_keys() AutoSploitParser().parse_provided(opts) - info("checking if there are multiple exploit files") + misc_info("checking if there are multiple exploit files") loaded_exploits = load_exploits(EXPLOIT_FILES_PATH) AutoSploitParser().single_run_args(opts, loaded_tokens, loaded_exploits) else: warning("no arguments have been parsed, defaulting to terminal session. press 99 to quit and help to get help") - info("checking if there are multiple exploit files") + misc_info("checking if there are multiple exploit files") loaded_exploits = load_exploits(EXPLOIT_FILES_PATH) info("attempting to load API keys") loaded_tokens = load_api_keys() diff --git a/lib/banner.py b/lib/banner.py index eba935c..323fe52 100644 --- a/lib/banner.py +++ b/lib/banner.py @@ -1,3 +1,4 @@ +import os import random VERSION = "2.0" @@ -8,9 +9,9 @@ def banner_1(line_sep="#--", space=" " * 30): {sep1}Author : Vector/NullArray | _ |_ _| |_ ___| __|___| |___|_| |_ {sep1}Twitter: @Real__Vector | | | | _| . |__ | . | | . | | _| {sep1}Type : Mass Exploiter |__|__|___|_| |___|_____| _|_|___|_|_| -{sep1}Version: {v_num} |_| +{sep1}Version: {v_num}{spacer} |_| ##############################################\033[0m - """.format(sep1=line_sep, v_num=VERSION, space_sep=space) + """.format(sep1=line_sep, v_num=VERSION, space_sep=space, spacer=" " * 8) return banner @@ -114,4 +115,15 @@ def banner_main(): banner_5, banner_4, banner_3, banner_2, banner_1 ] - return random.choice(banners)() + if os.getenv("Graffiti", False): + return banner_5() + elif os.getenv("AutosploitOG", False): + return banner_1() + elif os.getenv("Nuclear", False): + return banner_4() + elif os.getenv("SploitaSaurusRex", False): + return banner_3() + elif os.getenv("Autosploit2", False): + return banner_2() + else: + return random.choice(banners)() diff --git a/lib/cmdline/cmd.py b/lib/cmdline/cmd.py index 2ac9968..ec0d9ea 100644 --- a/lib/cmdline/cmd.py +++ b/lib/cmdline/cmd.py @@ -19,9 +19,11 @@ def __init__(self): @staticmethod def optparser(): + """ - the options object for our parser + the options function for our parser, it will put everything into play """ + parser = argparse.ArgumentParser( usage="python autosploit.py -[c|z|s|a] -[q] QUERY\n" "{spacer}[-C] WORKSPACE LHOST LPORT [-e]\n" diff --git a/lib/output.py b/lib/output.py index f31ebb7..5dddebf 100644 --- a/lib/output.py +++ b/lib/output.py @@ -35,7 +35,7 @@ def warning(text): def misc_info(text): print( - "[\033[96mi\033[0m] {}".format( + "[\033[90mi\033[0m] {}".format( text ) ) \ No newline at end of file