From ea884a8138d23bda0b0d709735ea61079cbab128 Mon Sep 17 00:00:00 2001 From: ekultek Date: Tue, 17 Oct 2017 09:05:10 -0500 Subject: [PATCH] some updates that include a script to re-install a dependency that tends to fail, and fix a proxy configuration issue --- etc/scripts/fix_pie.sh | 5 +++++ lib/core/settings.py | 4 +++- var/google_search/search.py | 9 ++------- zeus.py | 22 +++++++++++++++++++++- 4 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 etc/scripts/fix_pie.sh diff --git a/etc/scripts/fix_pie.sh b/etc/scripts/fix_pie.sh new file mode 100644 index 0000000..0fa15dc --- /dev/null +++ b/etc/scripts/fix_pie.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +sudo rm -rf /tmp.x0-lock +sudo apt-get purge --yes --force-yes xvfb +sudo apt-get install --yes --force-yes xvfb \ No newline at end of file diff --git a/lib/core/settings.py b/lib/core/settings.py index c82be3f..acc31fe 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -23,7 +23,7 @@ except NameError: # clone link CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.0.50" +VERSION = "1.0.51" # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} # version string formatting @@ -54,6 +54,8 @@ URL_QUERY_REGEX = re.compile(r"(.*)[?|#](.*){1}\=(.*)") URL_REGEX = re.compile(r"((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)") # geckodriver version information path, grabs the file that was installed on your system GECKO_VERSION_INFO_PATH = "{}/bin/version_info".format(os.getcwd()) +# attempt to fix the program install error +FIX_PROGRAM_INSTALL_PATH = "{}/etc/scripts/fix_pie.sh".format(os.getcwd()) # path to the auto clean tool CLEANUP_TOOL_PATH = "{}/etc/scripts/cleanup.sh".format(os.getcwd()) # paths to sqlmap and nmap diff --git a/var/google_search/search.py b/var/google_search/search.py index 47be528..1a68112 100644 --- a/var/google_search/search.py +++ b/var/google_search/search.py @@ -229,6 +229,7 @@ def parse_search_results( proxy_string_info = "setting proxy to {}..." if proxy_string is not None: + proxy_string = proxy_string_to_dict(proxy_string) proxy_string_info = proxy_string_info.format( ''.join(proxy_string.keys()) + "://" + ''.join(proxy_string.values())) else: @@ -244,13 +245,7 @@ def parse_search_results( try: query_url = get_urls(query, url_to_search, verbose=verbose, user_agent=user_agent, proxy=proxy_string) except Exception as e: - if "WebDriverException" in str(e): - logger.exception(set_color( - "it seems that you exited the browser, please allow the browser " - "to complete it's run so that Zeus can bypass captchas and API " - "calls", level=50 - )) - elif "'/usr/lib/firefoxdriver/webdriver.xpi'" in str(e): + if "'/usr/lib/firefoxdriver/webdriver.xpi'" in str(e): logger.fatal(set_color( "firefox was not found in the default location on your system, " "check your installation and make sure it is in /usr/lib, if you " diff --git a/zeus.py b/zeus.py index fab0247..8bfc7fb 100755 --- a/zeus.py +++ b/zeus.py @@ -50,7 +50,8 @@ from lib.core.settings import ( fix_log_file, DEFAULT_USER_AGENT, SPIDER_LOG_PATH, - CLEANUP_TOOL_PATH + CLEANUP_TOOL_PATH, + FIX_PROGRAM_INSTALL_PATH ) if __name__ == "__main__": @@ -703,6 +704,25 @@ if __name__ == "__main__": "along with a new user-agent (--random-agent/--agent).", level=50 )) shutdown() + elif "Program install error!" in str(e): + do_fix = prompt( + "seems the program is having some trouble installing would you like " + "to try and automatically fix this issue", opts="yN" + ) + if do_fix.lower().startswith("y"): + logger.info(set_color( + "attempting to reinstall failing dependency..." + )) + subprocess.call(["sudo", "sh", FIX_PROGRAM_INSTALL_PATH]) + logger.info(set_color( + "successfully installed, you should be good to re-run Zeus..." + )) + shutdown() + else: + logger.info(set_color( + "you can automatically try and re-install Xvfb to fix the problem..." + )) + shutdown() else: logger.exception(set_color( "ran into exception '{}' exception has been saved to log file...".format(e), level=50