Although Rig EK is the dominant one in the market right now, our sources from the RSA FraudAction Intelligence team indicate that Magnitude EK is still being used by some private groups and not offered anymore for the wider community of fraudsters in the underground crimeware markets. This is an interesting fact, since it shows us that Magnitude EK is not yet to lose its relevancy; moreover – threat actors are using it privately for specific campaigns.
It’s important to note that although Magnitude EK, just as any other exploit kit, may be packed and shipped with a variety of exploits targeting various software components (usually tracked by CVE numbers, as long as the vulnerability had been previously reported and documented), additional EK related elements tend to be shared between many different gates, regardless of the exploited vulnerability or delivered malware variant.
These shared EK elements include the landing pages, JavaScript obfuscation method and shellcode delivered upon successful exploitation.
Security researchers tend to focus on the detection, analysis and dissection of these specific elements, as their presence in your network serves as a generic indication for malicious activity, regardless of the exploited software vulnerability which may vary significantly between different network configurations.
Today we chose to focus on a specific variant of Magnitude EK in order to demonstrate the shared behavior which we expect to find in additional variants.
The analyzed PCAP file can be found in VirusTotal using the following MD5 hash: 6129fee0eae386e8c5040a2e63c20f44.
Network Detection
You can see below how the malicious traffic looks in RSA NetWitness® Logs and Packets after applying the appropriate query. This query should be used only as a quick pivot to find malicious leads to investigate, then drill deeper to validate malicious activity, assuming the appropriate meta keys are enabled:
“service = 80 && action = 'get' && referer exists && filename regex '[0-9|a-z]{8,32}' && query contains 'win%20'”
Related indicators of compromise were added to Live, you can find them under the threat description: ‘magnitude-ek’.
In addition we will release a dedicated LUA parser for enhanced detection results.
Now let’s take a closer look under the hood of the Magnitude EK.
The Infection Chain
Stage 0
The first file loaded from the EK is a small obfuscated JavaScript which sends the screen color depth and dimensions to load the next file. It sends the details as parameters in a GET request and receives back the next stage.
Stage 1
The script retrieved in this stage contains a list of Kaspersky’s Virtual Keyboard Plugin API calls, iterates over them and tries to create an ActiveX object. In each iteration, if an object is successfully created, this indicates the product is installed on the victim’s computer, and a flag that holds the “object’s creation fail” Boolean value changes from ‘true’ to ‘false’. Finally, if the “object’s creation fail” was indeed set to ‘false’, stage 2 is called.
Stage 2
The second HTML has 2 main functionalities:
Stage 2 Flash payload ActionScript:
The capabilities class is the most relevant library that’s loaded here. This class is for the ongoing communication with the gate, since this class can provide details about the system and runtime environment of the host application where the Flash file is being executed. Here, the ActionScript retrieves the Flash player’s platform and version and sends the information to another URL, to trigger the second Flash file that can be potentially exploited.
In the following image taken from Wireshark, we can see that Flash file being loaded by the small Flash loader whose ActionScript we saw earlier in stage 2. As mentioned, the newly downloaded Flash file can potentially trigger a Flash exploit in order to run malicious code and deliver the final payload:
JavaScript Analysis
The script loaded in stage 3 contains ~500 lines of code and of course is obfuscated. We will focus on some key points:
So, let’s begin:
Once we extract the shellcode and open it in IDA, we can see some interesting strings, such as a string that contains the command line that will execute the final payload and another that contains a gate URL:
Next, we will start debugging and single stepping through the code. Here are key steps inside the shellcode:
In conclusion, we see that this variant of Magnitude Exploit Kit has used several techniques and known vulnerabilities in order to achieve infection of the targeted machine and includes profiling prior to potential infection. Magnitude EK is not as dominant as before in public usage, but is still in use, mostly by private and closed groups of financially motivated cyber criminals.
References:
https://support.kaspersky.com/12945
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html
https://www.fireeye.com/blog/threat-research/2016/04/cve-2016-1019_a_new.html
https://www.fireeye.com/blog/threat-research/2015/08/cve-2015-2419_inte.html
https://www.proofpoint.com/us/threat-insight/post/killing-zero-day-in-the-egg
http://mcdermottcybersecurity.com/articles/windows-x64-shellcode
http://www.malware-traffic-analysis.net/2016/04/15/index.html
https://msdn.microsoft.com/en-us/library/windows/desktop/yftk84kt(v=vs.94).aspx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.