Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions autosploit/main.py
Original file line numberDiff line numberDiff line change
@@ -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,
Expand All@@ -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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space after you ?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? you mean after the you[y/N] part?

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()
Expand Down
18 changes: 15 additions & 3 deletions lib/banner.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import os
import random

VERSION = "2.0"
Expand All@@ -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


Expand DownExpand Up@@ -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)()
4 changes: 3 additions & 1 deletion lib/cmdline/cmd.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion lib/output.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ def warning(text):

defmisc_info(text):
print(
"[\033[96mi\033[0m]{}".format(
"[\033[90mi\033[0m]{}".format(
text
)
)