JavaScript Obfuscation Now Often Used By Hackers To Hide Malware

Researchers have spotted frequent occurrences of JavaScript obfuscation in regular sites that hackers have also picked up to hide malware. They noticed the frequent use of “packer” software for such malicious purposes.

JavaScript Obfuscation For Malware

Researchers from Akamai have shared insights regarding the rise in JavaScript obfuscation by hackers to evade malware detection.

As elaborated in their post, they analyzed over 10,000 malicious JavaScript samples and found more than 25% of them obfuscated. The samples analyzed ranged from malware droppers and phishing pages to cryptominers and scammers’ malware.

Nonetheless, such obfuscation isn’t downright nasty since many businesses also adopt this technique for code privacy. According to the researchers, roughly 0.5% of the top 20,000 websites (according to Alexa.com rankings) employ code obfuscation to some extent. That is why software, known as “packers”, exist to compress heavy JavaScript codes.

Defining Packers, Akamai’s post reads,

Software packing is a method of compressing or encrypting code that makes it unreadable or non-debuggable. As a result, the code changes in an attempt to avoid signature- or hash-based detection.

Certainly, packers aren’t a new thing; rather they previously caught attention in 2008 as well when researchers from Secureworks highlighted the “Packer 2.0” conundrum. Regarding the need for this technique, they stated in their post,

Many Web 2.0 features are packaged together with a consistent API and distributed as a JavaScript “library”. However, these libraries have to be loaded and reinterpreted for every page that uses a feature implemented in the library, and these libraries can be relatively large for web content — tens or hundreds of kilobytes.
Although other, generally better, methods exist for reducing the number of bytes downloaded, the use of JavaScript “packers” has become accepted and widespread.

Detecting Packaged Malware

Although, malware obfuscation often effectively bypasses detection. However, Akamai researchers have devised how to detect obfuscated malware too.

They haven’t shared the details yet as they will present their study at the SecTor 2021 conference. Yet, they quickly explained that the technique focuses on the packer’s JavaScript detection functionality. As stated,

Research… introduces a technique that profiles the unique functionality of packers to detect JavaScript prior to it being obfuscated, regardless of the original code. That way, any JavaScript code that represents a threat — like phishing, malware droppers, or scammers — will be detected based on the  techniques the packer introduces.

It was through this profiling that they spotted 25% of malicious codes hidden via obfuscation. The researchers believe that this technique might facilitate in prompt detection of obfuscated malware in real-time.

Let us know your thoughts in the comments.

Related posts

Sweet Security Introduces Evolutionary Leap in Cloud Detection and Response, Releasing First Unified Detection & Response Platform

Anti-Spam WordPress Plugin Vulnerabilities Risked 200K+ Websites

RomCom Exploits Zero Days In Recent Backdoor Campaigns