From 20fb86f74276f9d484cc756582ed5744394c7887 Mon Sep 17 00:00:00 2001 From: Yun Zheng Hu Date: Sat, 18 Dec 2021 14:32:27 +0100 Subject: [PATCH] Also process files with the .zip extension --- log4j-finder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/log4j-finder.py b/log4j-finder.py index 656940d..8ca4cc8 100755 --- a/log4j-finder.py +++ b/log4j-finder.py @@ -56,7 +56,7 @@ except ImportError: log = logging.getLogger(__name__) # Java Archive Extensions -JAR_EXTENSIONS = (".jar", ".war", ".ear") +JAR_EXTENSIONS = (".jar", ".war", ".ear", ".zip") # Filenames to find and MD5 hash (also recursively in JAR_EXTENSIONS) # Currently we just look for JndiManager.class @@ -175,6 +175,9 @@ def iter_jarfile(fobj, parents=None, stats=None): log.debug(f"{fobj}: {e}") except zipfile.BadZipFile as e: log.debug(f"{fobj}: {e}") + except RuntimeError as e: + # RuntimeError: File 'encrypted.zip' is encrypted, password required for extraction + log.debug(f"{fobj}: {e}") def red(s):