Link to home
Start Free TrialLog in
Avatar of rwheeler23
rwheeler23Flag for United States of America

asked on

How do I look for vulnerabilities to Log4Shell?

How do I scan for Log4Shell? I see all these reports about Log4Shell but nothing tells me how to scan for it or remove it. Do I simply load the latest version of Java?

Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Cisco have released what products are affected and also released Snort rules

https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-log4j-qRuKNEbd#vp

and here is the vulnerability

https://logging.apache.org/log4j/2.x/security.html#:~:text=Fixed%20in%20Log4j%202.15.0

You can also see the files in this article

https://community.ui.com/questions/UniFi-Controller-security-concern-zero-day-Log4j-exploit/007103a6-823b-4316-ae76-17942539208c#answer/e10b8e76-d34a-4c1d-beba-31971b69a6bd

if you want to update yourself homebrew, but you are probably waiting until vendors have supplied upates.

A Python script has been developed here for you to check devices

https://gist.github.com/byt3bl33d3r/46661bc206d323e6770907d259e009b6
Avatar of dpearson
dpearson

To fix this you need to get the latest log4j library:
https://logging.apache.org/log4j/2.x/download.html

You want version 2.15.0 - which only came out a day or two ago.

So don't upgrade Java (that won't help).  Upgrade log4j.
There are other more complex solutions if you can't upgrade log4j for some reason, but that's the simplest.
And just to be clear this is a server side fix.  If you're just an end user there's no vulnerability here.  You need to be running a web site written in Java with logging enabled.
Avatar of rwheeler23

ASKER

I have dozens of host servers with hundreds of images within each server. That has me concerned. We are a VM Ware shop.
I downloaded version 2.15.0 but it talks about verifying the download with keys. From where do I get the keys?
The keys are here:
https://downloads.apache.org/logging/KEYS

but it's largely a theoretical risk where you need to verify with keys - that's in case you might be downloading the files from a non apache server by mistake.  I would grab the files and get them out as quick as you can - because the log4j attack is a far from theoretical risk.
This is what I was trying to find this morning. I have 14 days to give this a try.
It's free after the trial, the only difference is the Feed from the Community is slower to update, but at present you may find a delay with many vendors!

oh if you don't have a vulnerability scanner, it may surprise you what you find on your network - be warned!

Cisco have updated Snort, and have fixes available and Ubiquiti have just issued a fix as well.
I bet it will be interesting what it finds. Will it take into account the harware firewall that is in place?
it will scan everything (if it can), and categorise into high, medium and low, CVEs !

where there is a port open it will scan it!

and as you are a VMware shop be surprised for some results there as well!

(if you need to discuss them I would recommend posting a new question!)

You may get - SSL/TLS: Report Vulnerable Cipher Suites for HTTPS
That is where the vulnerability mgmt tool comes in like this. That is probably the first source you want to check if there is signature for the hunting. Like the use of Carbon Black in below link.
Caveat is the observed alerts will trigger based on file access of the vulnerable Log4j core library, and therefore will not alert on an already loaded library until reboot or a process restart that forces a reload of the affected library.

https://community.carbonblack.com/t5/Documentation-Downloads/Log4Shell-Log4j-Remote-Code-Execution-CVE-2021-44228/ta-p/109134

That said, this vulnerability is far real and serious as expert shared, so let's go broader in coverage of option for hunting in:

1) finding potentially vulnerable software


2) detecting exploitation attempts
3) vulnerability testing
As @depearson mentioned, this is a server side fix, fixed in v2.15, so just check your versions to ensure you have 2.15 installed.
Do I need to have Java installed to run these jar files? With which one do I start?
ASKER CERTIFIED SOLUTION
Avatar of btan
btan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do I need to have Java installed to run these jar files? With which one do I start?

This vulnerability is just in Java (specifically one library commonly used in Java applications).  So if your servers do not already have Java installed you have nothing to worry about.

However, if you have Java installed on your servers you likely also have at least one copy of this library somewhere.  Just search for log4j*.jar and anywhere you find it, swap for the matching file from the log4j 2.15.0 distribution.
To share more insight.

To check whether your application is likely affected you must verify:
  • Log4j version – all 2.x versions before 2.15.0 are affected
  • JVM version - if lower than:
    • Java 6 – 6u212
    • Java 7 – 7u202
    • Java 8 – 8u192
    • Java 11 - 11.0.2
If both are true, your Log4j version is older than 2.15.0 and your Java version patch level is older than listed above, you’re almost certainly affected. 
  • JVM version - if lower than:
    • Java 6 – 6u212
    • Java 7 – 7u202
    • Java 8 – 8u192
    • Java 11 - 11.0.2

We also saw this list of Java versions posted online as being particularly vulnerable, but I have to say we run on Java 14 currently and could reproduce the attack.  So it does not appear to be complete.

I would suggest focusing on just this one rule:
  • Log4j version – all 2.x versions before 2.15.0 are affected
and upgrading to 2.15.0 immediately, no matter what version of Java you are running.

If for some reason you cannot do that, there are also ways to configure the logging to block the exploit, but they are more complex than a library upgrade.

Agree with expert as key is the jar file shared in this discussion
It has found Apache.Arrow.dll in the Visual Studio 2019 folder
com.sap.apache.abdera.rs.jar in the SAP Business Objects folder
Hundreds of files like tp.apache.cxf.bundle.biprs-2.3.8-core-nu also in the SAP Business Objects folder

are these of any concern?

need to search for the JndiLookup.class in jar file. pls see
https://www.windows-commandline.com/search-classes-in-jar-file/
Keep an eye on this document which is being updated and growing

https://www.techsolvency.com/story-so-far/cve-2021-44228-log4j-log4shell/

PS If you are a VMware shop you will need to apply workarounds, no patches yet!
What do they mean by saying add the java binary files folder to PATH environment variables?

forfiles /S /M *.jar /C "cmd /c jar -tvf @file | findstr /C:"Logger.class"

Open in new window

I am getting this message
 Access is denied for "C:\Users\Rich\AppData\Local\ElevatedDiagnostics\".
You set the PATH var so that you dont need to spell out the full path to the file.
Set the PATH environment variable if you want to be able to conveniently run the executables (javac.exe, java.exe, javadoc.exe, and so on) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as:
C:\Java\jdk1.7.0\bin\javac MyClass.java

Open in new window

Access denied as you are not the administrator. Run in administrator account instead. 
Reach out to 3rd party Application Support and ask for a fix or a workaround.

On Windows
Until then run the below command to identify if there are any files with log4j as a jar file
Get-ChildItem 'C:\'  -Filter 'log4j*.jar' -rec -force -ea 0

You can refer https://github.com/NCSC-NL/log4shell/tree/main/software consolidated list of all known 3rd party applications, impacted services with a link to workaround\fix from providers. Managed by NCSC