From 7dc6d9b5100d60a9f00c7c795c9f663d14a055b5 Mon Sep 17 00:00:00 2001 From: ekultek Date: Sat, 9 Sep 2017 15:43:03 -0500 Subject: [PATCH] minor fix --- lib/settings.py | 14 ++++++++++++-- zeus.py | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/settings.py b/lib/settings.py index 9588273..c6b1807 100644 --- a/lib/settings.py +++ b/lib/settings.py @@ -17,7 +17,7 @@ import bin.unzip_gecko # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.5.b0e" +VERSION = "1.0.6.b0e" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting @@ -279,4 +279,14 @@ def get_random_dork(filename="{}/etc/dorks.txt"): grab a random dork from the file """ with open(filename.format(os.getcwd())) as dorks: - return random.choice(dorks.readlines()) \ No newline at end of file + return random.choice(dorks.readlines()) + + +def update_zeus(): + can_update = True if ".git" in os.listdir(os.getcwd()) else False + if can_update: + return os.system("git pull origin master") + else: + logger.fatal(set_color( + "no git repository found in directory, unable to update automatically..." + )) \ No newline at end of file diff --git a/zeus.py b/zeus.py index 959e2d4..23fb987 100644 --- a/zeus.py +++ b/zeus.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import os import time import optparse import subprocess @@ -26,7 +25,8 @@ from lib.settings import ( URL_LOG_PATH, replace_http, prompt, - get_random_dork + get_random_dork, + update_zeus ) if __name__ == "__main__": @@ -87,6 +87,8 @@ if __name__ == "__main__": help="Show the arguments that the sqlmap API understands") misc.add_option("--batch", dest="runInBatch", action="store_true", help="Skip the questions and run in default batch mode") + misc.add_option("--update", dest="updateZeus", action="store_true", + help="Update to the latest development version") parser.add_option_group(mandatory) parser.add_option_group(attacks) @@ -114,6 +116,15 @@ if __name__ == "__main__": ) shutdown() + # update the program + if opt.updateZeus: + logger.info(set_color( + "update in progress..." + )) + update_zeus() + shutdown() + + def __find_running_opts(): """ display the running options if verbose is used