<div dir="ltr">Another handy one to find where it's hiding, since it can be bundled inside other JARs:<div>find / -name *.jar | xargs strings -f | grep -i log4j<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 14, 2021 at 6:57 AM Doug McIntyre <<a href="mailto:merlyn@geeks.org">merlyn@geeks.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Dec 13, 2021 at 11:38:04AM -0800, Owen DeLong via NANOG wrote:<br>
> > On Dec 11, 2021, at 04:11 , Nick Hilliard <<a href="mailto:nick@foobar.org" target="_blank">nick@foobar.org</a>> wrote:<br>
...<br>
> > <a href="https://logging.apache.org/log4j/2.x/security.html" rel="noreferrer" target="_blank">https://logging.apache.org/log4j/2.x/security.html</a><br>
> > <br>
> > 1. upgrade log4j to 2.15.0 and restart all java apps<br>
> > 2. start java with "-D log4j2.formatMsgNoLookups=true" (v2.10+ only)<br>
> > 3. start java with "LOG4J_FORMAT_MSG_NO_LOOKUPS=true" environment variable (v2.10+ only)<br>
> > 4. zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class<br>
> > <br>
> > There's a lot of scanning going on at the moment, so if you have an exposed java instance running something which includes log4j2, you may already be compromised.<br>
> > <br>
> > Nick<br>
> <br>
> Alternatively, this incantation solved the problem on my linux server:<br>
> <br>
> rpm -e log4j12 ant-apache-log4j log4j<br>
<br>
<br>
There are many software setups that bundle their own log4j.jar without<br>
bothering to go through the OS package manager....<br>
<br>
$ rpm -qa | fgrep log4j<br>
$<br>
<br>
$ find / -name log4j*jar<br>
....system/log4j/log4j/log4j/1.2.17/log4j-1.2.17.jar<br>
<br>
(obviously an old system due to the commands used and version found,<br>
and nor will it get patches available because of vendor...).<br>
<br>
Sorta like playing whack-a-mole with jquery.js (another package with<br>
lots of security history that seems to be copied _everywhere_ without<br>
registring it with the OS package manager). <br>
<br>
So, the exercise becomes _finding_ the software that uses it, and then<br>
doing the configs that defang JNDI everywhere you find it.<br>
<br>
</blockquote></div>