diff --git a/etc/checksum/md5sum.md5 b/etc/checksum/md5sum.md5 index 2217e8e..68f6c6f 100644 --- a/etc/checksum/md5sum.md5 +++ b/etc/checksum/md5sum.md5 @@ -1,4 +1,4 @@ -f7dfe15a281f72ff02f937a51838c614 ./zeus.py +1d2385527ffff7ac671f186bf8c4d92a ./zeus.py 4b32db388e8acda35570c734d27c950c ./etc/scripts/launch_sqlmap.sh 6ad5f22ec4a6f8324bfb1b01ab6d51ec ./etc/scripts/cleanup.sh 155c9482f690f1482f324a7ffd8b8098 ./etc/scripts/fix_pie.sh @@ -52,8 +52,8 @@ d41d8cd98f00b204e9800998ecf8427e ./lib/attacks/whois_lookup/__init__.py a0b5265f235a266f7a48874c3d1e08f9 ./lib/attacks/intel_me/__init__.py 1faa2b5dfad6eb538bbfe42942d2a9da ./lib/core/errors.py d41d8cd98f00b204e9800998ecf8427e ./lib/core/__init__.py -ecb1912f467c0c3d6fc58975f9317126 ./lib/core/settings.py -623830ef2e6f389c961edcb5bc135132 ./lib/header_check/__init__.py +f95463ef8eac7c5255d1093a5e20b5a6 ./lib/core/settings.py +c265970650a068c0f0cdfcdb756c9914 ./lib/header_check/__init__.py d41d8cd98f00b204e9800998ecf8427e ./var/google_search/__init__.py e9f1e2624154401840b0b118216ba82e ./var/google_search/search.py d41d8cd98f00b204e9800998ecf8427e ./var/__init__.py diff --git a/lib/core/settings.py b/lib/core/settings.py index f9f48dd..fb5f28c 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -44,7 +44,7 @@ PATCH_ID = str(subprocess.check_output(["git", "rev-parse", "origin/master"]))[: CLONE = "https://github.com/ekultek/zeus-scanner.git" # current version -VERSION = "1.1.22".format(PATCH_ID) +VERSION = "1.1.23.{}".format(PATCH_ID) # colors to output depending on the version VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30} @@ -495,20 +495,20 @@ def write_to_log_file(data_to_write, path, filename): os.getcwd() ))) + 1) ) + to_search = filename.split("-")[0] + amount = len([f for f in os.listdir(path) if to_search in f]) + new_filename = "{}({}).{}".format( + filename.split("-")[0], amount, filename.split(".")[-1] + ) with open(full_file_path, "a+") as log: data = re.sub(r'\s+', '', log.read()) if re.match(r'^<.+>$', data): # matches HTML and XML try: log.write(etree.tostring(data_to_write, pretty_print=True)) except TypeError: - # usually happens when the file already exists - # TODO:/ skip writing to the file, or write to the file with a (1), (2), etc at the end - logger.warning(set_color( - "unable to serialize {} data, writing as plain text...".format( - filename.split(".")[-1].upper() - ), level=30 - )) - log.write(data_to_write) + return write_to_log_file(data_to_write, path, new_filename) + elif amount > 0: + return write_to_log_file(data_to_write, path, new_filename) else: if isinstance(data_to_write, list): for item in data_to_write: @@ -770,7 +770,7 @@ def check_for_protection(protected, attack_type): check if the provided target URL has header protection against an attack type """ items = [item.lower() for item in protected] - if attack_type in items: + if attack_type in items or "all" in items: protected.clear() # clear the set logger.warning(set_color( "provided target seems to have protection against this attack type...", level=30 diff --git a/zeus.py b/zeus.py index 0946cc2..23a7938 100755 --- a/zeus.py +++ b/zeus.py @@ -589,10 +589,16 @@ if __name__ == "__main__": "try updating the timeout with the --time-sec flag (IE --time-sec 10)", level=50 )) shutdown() - else: + elif "No such file or directory" in str(e): + logger.exception(e) logger.fatal(set_color( "provided file does not exist, make sure you have the full path...", level=50 )) + else: + logger.exception(set_color( + "Zeus has hit an unexpected error and cannot continue, error code '{}'...".format(e), level=50 + )) + request_issue_creation() except KeyboardInterrupt: logger.error(set_color( "user aborted process...", level=40