[ad_1]
By Guilherme Venere, Ismael Valenzuela, Carlos Diaz, Cesar Vargas, Leandro Costantino, Juan Olle, Jose Luis Sanchez Martinez, AC3 Workforce
Collaborators: ATR Workforce (Steve Povolny, Douglas McKee, Mark Bereza), Frederick Home (FireEye)
On this put up we need to present how an endpoint answer with performant reminiscence scanning capabilities can successfully detect energetic exploitation eventualities and complement community safety capabilities your organization has carried out.
Background
As it’s turning into the norm currently, a brand new vulnerability affecting a broadly used library was not too long ago launched simply in time for the Holidays. As detailed in our ATR weblog, CVE-2021-44228 reported a vulnerability within the Log4J Java library affecting purposes and websites utilizing the library to carry out logging.
This vulnerability permits an attacker to coerce the susceptible website or utility to load and execute a malicious Java code from an untrusted distant location. Assault vectors are diverse however the most typical is related to the attacker sending crafted strings as a part of a community protocol to the goal machine, like for instance a modified HTTP Header despatched as a part of a POST request.
That’s the reason many defenders are focusing their efforts on detecting the malicious strings by the community site visitors. Nevertheless, community signatures may be bypassed and there are studies confirming menace actors are adapting their community assaults with numerous types of obfuscation to defeat community scanning. The next picture exhibits a number of the present obfuscation strategies which have been noticed or reported associated to this assault.

Supply: https://github.com/mcb2Eexe/Log4j2-Obfucation
This doesn’t imply that community safety options will not be helpful in opposition to this assault. Community safety platforms present a primary layer of protection and needs to be used as a part of a defensible safety structure (safety threat therapy technique), augmented by further layers of safety, detection, visibility, and response. Fashionable endpoint options are uniquely positioned to enhance network-based capabilities with in-depth host-based visibility of system processes, like in-memory scanning and speedy response orchestration. This mix leads to a strong protection in opposition to threats like Log4Shell.
‘I See You’: Reminiscence Scanning #FTW
To know how reminiscence scanning will help complement the community safety platforms after a connection arrives to the endpoint and defeating the obfuscation layers, let’s check out the diagram beneath, describing the stream of execution for a typical internet based mostly Log4J assault.

Let’s define what occurs:
In Step 1, an attacker sends a specifically crafted string to the online server internet hosting the susceptible utility. This string, as now we have seen, may be obfuscated to bypass network-based signatures.
In Step 2, the appliance proceeds to de-obfuscate this string to load it in reminiscence. As soon as loaded into reminiscence, the appliance initiates a LDAP connection to request the deal with of the place the malicious class is situated.
In Step 3, the attacker-controlled LDAP server responds with the situation of the malicious Class file by indicating the HTTP URL deal with of the place it’s hosted.
In Step 4, the susceptible utility will proceed to provoke a obtain for that malicious class file.
In Step 5, the susceptible utility will load and run the malicious class file from step 4.
At this second, the attacker achieves code execution on the goal, leaving traces which will present visibility on this exercise for the defender. For instance, spawning further processes or touching information and registry keys after an exploitation
With this in thoughts, let’s think about we may set off a reminiscence scan sooner or later on this execution stream to detect the presence of the malicious code. Usually, scanning the reminiscence of an endpoint is pricey from a processing perspective, subsequently it’s not one thing that may be finished constantly and even fairly often, however below particular circumstances it may be achieved with precision.
So, suppose we may set off a reminiscence scan at any level after step (2). We might have a excessive likelihood to seek out the de-obfuscated string used inside the course of reminiscence at the moment. If the reminiscence is scanned after the malicious class file is downloaded, that content material would even be obtainable for scanning in its de-obfuscated type.
Such prospects make the reminiscence signature performant, and environment friendly, given the timing of the detection primarily is determined by the set off used to begin the reminiscence scan.
These technical capabilities are potential in ENS, allow us to present you ways to try this!
Endpoint Safety Knowledgeable Guidelines meets Reminiscence Scan
In ENS (Endpoint Safety) 10.7 replace 4 and above, there’s a highly effective safety function obtainable to each defender, and WE completely find it irresistible, which is the power to set off a reminiscence scan from an Knowledgeable Rule.
We’ve got talked about Knowledgeable Guidelines earlier than, these are customizable entry management guidelines which the end-user makes use of to detect suspicious exercise not generally seen by different scanners. McAfee Enterprise additionally supplies neighborhood Knowledgeable Guidelines mapped to the MITRE ATT&CK Matrix by our public GitHub.
The function we’re taken with now’s the power to set off a reminiscence scan when an Knowledgeable Rule fires. That will permit us to focus on the purposes susceptible to Log4J and establish the second they’re being exploited.
Take into account the next rule:

Within the instance rule above, we see a piece defining ACTORS (contained in the Course of {…} part) and TARGETS (contained in the Goal {…} part). We outline as actors any course of that could be susceptible to the Log4J exploit. On this case JAVA.EXE for standalone Java purposes and TOMCAT?.EXE for Apache web-based purposes. Both of those processes must load each JAVA.DLL and JVM.DLL to make sure the Java runtime is energetic.
Within the goal part we add any potential payload of the assault. As Knowledgeable Guidelines will not be centered on community site visitors, we have to give attention to the final step of the execution stream, which is when the payload is executed. Further triggers like information or registry keys accessed may be added as extra details about exploits turn into obtainable. We can also have on this part any exclusion of legitimate conduct as proven within the instance above with the “Exclude” on command line parameter. This exclusion is one thing prospects can tailor to their surroundings to keep away from false positives.
This professional rule will set off when any ACTOR course of spawns any of the TARGET payloads. If the rule had been simply that, one may see it will not be too efficient in detecting the exploit and would most likely trigger many false positives.
However discover this line at first of the rule:

This instruction tells ENS 10.7 to provoke a reminiscence scan in opposition to the ACTOR course of which brought about the professional rule to set off, and solely that course of. Now now we have a dependable set off for a performant reminiscence scan, avoiding the efficiency problems with a blind reminiscence scan, and it’s finished at a time very near the preliminary exploitation try, which ensures the de-obfuscated string will likely be in reminiscence.
The second a part of this answer is executed by the AV DAT Engine when it scans the reminiscence of the method which triggered the Knowledgeable Rule. As soon as this string is discovered, a detection will happen, and cleansing will likely be utilized to that course of to aim to cease the exploit from persevering with. In ePO, prospects will see two occasions beneath which point out an exploit try occurred:

The primary occasion highlighted above is the Knowledgeable Rule triggering for a suspicious course of spawning from JAVA.EXE, and the second exhibits the AV DAT detection indicating the reminiscence of that course of had signatures of the exploit.
Word:
IF solely the Knowledgeable Rule detection was current and NOT the JNDI/Log4J-Exploit occasion, it will point out a program has executed kids processes thought of suspicious, and prospects are suggested to assessment the occasion and enhance the Knowledgeable Rule accordingly.
Nevertheless, IF, each the Knowledgeable Rule and JNDI/Log4j-Exploit occasions are triggered for a similar program, now we have confidently detected the presence of the method being exploited.
McAfee Enterprise supplies extra details about our present protection for Log4J vulnerability in KB95901 – McAfee Enterprise protection for Apache Log4j CVE-2021-44228 Distant Code Execution. This text include hyperlinks to obtain the Knowledgeable Rule and the related EXTRA.DAT, in addition to particulars on the way to arrange ePO to make use of them in your surroundings.
Prospects who need to implement this answer are invited to assessment the directions within the KB and related documentation. It’s extremely beneficial to assessment the Knowledgeable Rule and customise it to your surroundings.
Conclusion
To guard an surroundings in opposition to assaults like LOG4J, a layered technique comprised of community safety coupled by focused endpoint reminiscence scans permits defenders to successfully detect and stop the assault execution stream in opposition to susceptible techniques uncovered through community vectors.
Our ENS Knowledgeable Guidelines and Customized Scan reactions are designed to allow defenders with such capabilities to allow them to apply exact countermeasures in opposition to these rising threats.
[ad_2]

