diff --git a/etc/checksum/md5sum.md5 b/etc/checksum/md5sum.md5 index c854908..6e8ce1d 100644 --- a/etc/checksum/md5sum.md5 +++ b/etc/checksum/md5sum.md5 @@ -86,7 +86,7 @@ c4ac50a3f3550c62219e7e4f38d4b496 ./lib/plugins/1024.py 35dc8b7da4becb60662aab3c48a9210b ./lib/plugins/openxchange.py 353db8b22c031433ea73a12943927557 ./lib/plugins/clipbucket.py ce3b79dc80e369ffd55d2cbe90e6a0ab ./lib/plugins/mssqlreportmanager.py -b5ff3286060c0bbc0fe1f0f591131c9c ./lib/attacks/gist_lookup/__init__.py +9976a90f1b54439ead699c9e94591662 ./lib/attacks/gist_lookup/__init__.py 86224bd899c2a2438042cbdc077dc4cc ./lib/attacks/clickjacking_scan/__init__.py d41d8cd98f00b204e9800998ecf8427e ./lib/attacks/__init__.py 4c644b0e3a62b6c1528d34a04837aa35 ./lib/attacks/sqlmap_scan/__init__.py @@ -97,12 +97,12 @@ d41d8cd98f00b204e9800998ecf8427e ./lib/attacks/__init__.py f87f388a9ded1cd8a7e333353652c4df ./lib/attacks/xss_scan/__init__.py 6b8ad5d11aa7f1e2b5f993ca3dde1975 ./lib/attacks/nmap_scan/__init__.py 216999fa0e84866d5c1d96d5676034e4 ./lib/attacks/nmap_scan/nmap_opts.py -8ef704ee0460fdec5ea03f47036664fe ./lib/header_check/__init__.py +58fc608d8936c34a364dd1cbf6d9f157 ./lib/header_check/__init__.py d2f8777360a73a412ef158eff2fdf631 ./lib/core/common.py 4433353fb5c55578391d8b4006191ee8 ./lib/core/errors.py 38d8ce4aec42ec147b44a36c69b15ea8 ./lib/core/parse.py d41d8cd98f00b204e9800998ecf8427e ./lib/core/__init__.py -62f71741205d25ab425f5ef32b39423a ./lib/core/settings.py +695cac06efac7a656e1abc4c75c314b3 ./lib/core/settings.py de4254c5e40f7aa4fb81e0608f758a2c ./lib/core/decorators.py 9a02e5b913d210350545ac26510a63c9 ./var/search/__init__.py 83928f6c090722d87a905a447cb51aed ./var/search/selenium_search.py diff --git a/lib/attacks/gist_lookup/__init__.py b/lib/attacks/gist_lookup/__init__.py index 9b13276..2836445 100644 --- a/lib/attacks/gist_lookup/__init__.py +++ b/lib/attacks/gist_lookup/__init__.py @@ -113,7 +113,6 @@ def check_files_for_information(data_to_search, query): ) -# @lib.core.decorators.tail_call_optimized def github_gist_search_main(query, **kwargs): """ main function for searching Gists @@ -121,7 +120,7 @@ def github_gist_search_main(query, **kwargs): proxy = kwargs.get("proxy", None) agent = kwargs.get("agent", None) verbose = kwargs.get("verbose", False) - page_set = kwargs.get("page_set", 10) + page_set = kwargs.get("page_set", 5) # there seems to be a recursion issue in this function, # so until I get this figured out, we're going to change @@ -155,4 +154,4 @@ def github_gist_search_main(query, **kwargs): except Exception as e: lib.core.settings.logger.exception(lib.core.settings.set_color( "Gist search has failed with error '{}'...".format(str(e)), level=50 - )) \ No newline at end of file + )) diff --git a/lib/core/settings.py b/lib/core/settings.py index 8a6cc7e..e62c266 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -45,7 +45,7 @@ CLONE = "https://github.com/ekultek/zeus-scanner.git" ISSUE_LINK = "https://github.com/ekultek/zeus-scanner/issues" # current version -VERSION = "1.4.2.{}".format(PATCH_ID) +VERSION = "1.4.3.{}".format(PATCH_ID) # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} diff --git a/lib/header_check/__init__.py b/lib/header_check/__init__.py index 91a4bd6..90f4d53 100644 --- a/lib/header_check/__init__.py +++ b/lib/header_check/__init__.py @@ -1,10 +1,14 @@ import os import re +import time import importlib import unicodedata from xml.dom import minidom -from requests.exceptions import ConnectionError +from requests.exceptions import ( + ConnectionError, + ReadTimeout +) from var.auto_issue.github import request_issue_creation from lib.core.common import ( @@ -113,7 +117,7 @@ def detect_protection(url, status, html, headers, **kwargs): return None except Exception as e: - if "Read timed out." or "Connection reset by peer" in str(e): + if any(err in str(e) for err in ["Read timed out.", "Connection reset by peer"]): logger.warning(set_color( "detection request failed, assuming no protection and continuing...", level=30 )) @@ -248,6 +252,7 @@ def main_header_check(url, **kwargs): identify_plugins = kwargs.get("identify_plugins", True) show_description = kwargs.get("show_description", False) + default_sleep_time = 5 protection = {"hostname": url} definition = { "x-xss": ("protection against XSS attacks", "XSS"), @@ -260,9 +265,9 @@ def main_header_check(url, **kwargs): "content-security": ("header protection against multiple attack types", "ALL") } - req, status, html, headers = get_page(url, proxy=proxy, agent=agent, xforward=xforward) - try: + req, status, html, headers = get_page(url, proxy=proxy, agent=agent, xforward=xforward) + logger.info(set_color( "detecting target charset..." )) @@ -356,6 +361,27 @@ def main_header_check(url, **kwargs): logger.error(set_color( "unable to retrieve headers for site '{}'...".format(url.strip()), level=40 )) + except ConnectionError: + logger.warning(set_color( + "target actively refused the connection, sleeping for {}s and retrying...".format( + default_sleep_time + ), level=30 + )) + time.sleep(default_sleep_time) + main_header_check( + url, proxy=proxy, agent=agent, xforward=xforward, show_description=show_description, + identify_plugins=identify_plugins, identify_waf=identify_waf, verbose=verbose + ) + except ReadTimeout: + logger.error(set_color( + "meta-data retrieval failed due to target URL timing out, skipping...", level=40 + )) except KeyboardInterrupt: if not pause(): - shutdown() \ No newline at end of file + shutdown() + except Exception as e: + logger.exception(set_color( + "meta-data retrieval failed with unexpected error '{}'...".format( + str(e) + ), level=50 + )) \ No newline at end of file