12-12-2021 12:52 PM
I am wanting to use XQL and file search to identify any effected machines. searching for files that contain the word log4j results in exceeding maximum results. Has any one developed a query for this yet thats more accurate?
12-13-2021 01:59 AM
Hi @GarethDavies , I'd suggest you to use the file hashes instead of file names to search for the vulnerable libraries to narrow down to the exact list.
If your search results are still exceeding maximum results, please consider searching via subsets of hosts by OS type, or a subset of hashes at a time. This is dependent of your search results, and I recommend you to tune it as you dig around.
12-13-2021 03:56 AM
Cortex XDR does not collect content of the files as telemetry data. Which means that you cannot search particular string which is in file by XQL.
But you can write a python script for file content check and upload and execute via Action Center or execute command from action center again.
grep -inR "log4j" /var/www
But please be aware, This action will be pretty exhaustive and might create so much Disk IO.
12-13-2021 10:15 AM
Any chance you could give an example XQL query that would let me load 30+ hashes into one search?
12-13-2021 11:19 PM - edited 12-13-2021 11:28 PM
Hi @benjamin.murray fresh off the press from Palo Alto Network's Managed Threat Hunting team, you've the query that you're looking for in the section Hunting for Log4Shell in Your Network Section A. Search for the phrase "Attempt to target all hosts that contain a file that matches the SHA256 hash of the Log4j vulnerable versions.". This will only detect any invocation/use of the vulnerable libraries. For searching for the presence of the same, you'd can use the method @etugriceri suggested for searching via Action Center or Python script with the well-known hashes.
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!