fox-it / log4j-finder

Find vulnerable Log4j2 versions on disk and also inside Java Archive Files (Log4Shell CVE-2021-44228, CVE-2021-45046, CVE-2021-45105)
MIT License
435 stars 97 forks source link

Error with a ZIP file #78

Open tacbuh opened 2 years ago

tacbuh commented 2 years ago

Hello, I have this message :

DEBUG Got <ZipInfo filename='js-sources/tinymce_3.5.9.zip' compress_type=deflate filemode='-rw-rw-r--' file_size=1449915 compress_size=646119>: Bad magic number for central directory, falling back to BytesIO Traceback (most recent call last): File "log4j-finder.py", line 371, in <module> File "log4j-finder.py", line 345, in main File "log4j-finder.py", line 173, in iter_jarfile File "log4j-finder.py", line 173, in iter_jarfile File "log4j-finder.py", line 158, in iter_jarfile File "zipfile.py", line 1225, in __init__ File "zipfile.py", line 1310, in _RealGetContents ValueError: negative seek value -27762772 [9308] Failed to execute script log4j-finder

I tried to exclude the directory or file but nothing works.

tinymce_3.5.9.zip

yunzheng commented 2 years ago

Excluding with --exclude "*/tinymce_3.5.9.zip" should work. I didn't have any issue with the tinymce_3.5.9.zip file btw. Could be related to the Python version.

tacbuh commented 2 years ago

I tried log4j-finder-signed.exe --exclude "*/tinymce_3.5.9.zip" -vv and got the same error

yunzheng commented 2 years ago

Could be because windows use backslash as path separator. Try —exclude “\tinymce_3.5.9.zip” or —exclude “tinymce_3.5.9.zip”

tacbuh commented 2 years ago

I tried both commands but still got the same error.

joeschlimmer-ic commented 2 years ago

@tacbuh you might have a corrupted zip?

tacbuh commented 2 years ago

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives: 1 file, 828806 bytes (810 KiB)

Testing archive: c:\Users\test\Downloads\tinymce_3.5.9.zip

Path = c:\Users\test\Downloads\tinymce_3.5.9.zip Type = zip Physical Size = 828806

Everything is Ok

Folders: 114 Files: 282 Size: 2292647 Compressed: 828806