Neo23x0/log4shell-detector

find command reports [wj]ar as listing log4j, but manual inspection diverges

Opened this issue · 0 comments

Hi there,

many thanks again for all the hard work!

The following command returns several matches for a Java program on a machine we have:

find . -name '*[wj]ar' -print -exec sh -c 'jar tvf {} | grep log4j' \;

But, a manual inspection of those matched files shows empty grep results. For example, the following file matches:

./lib/xml.jar

If I run jar tvf on that, then I get the output in the attached file:

https://www.dropbox.com/s/snzdgxzlx9fhucy/lib_xml_jar_tvf.txt?dl=0

Running this through grep log4j returns an empty result:

me@host:/opt/IBM/SPSS/Concurrent_Licensing_Tools/sentinellm/JRE$ jar tvf ./lib/xml.jar | grep log4j

me@host:/opt/IBM/SPSS/Concurrent_Licensing_Tools/sentinellm/JRE$

I am not a pro with the find command, so not sure how to adjust it.

Best wishes and many thanks,
Rob