Home Cyber Security News JavaScript Obfuscation Now Often Used By Hackers To Hide Malware

JavaScript Obfuscation Now Often Used By Hackers To Hide Malware

by Abeerah Hashim
JavaScript malware obfuscation

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.

You may also like

Latest Hacking News

Privacy Preference Center


The __cfduid cookie is used to identify individual clients behind a shared IP address and apply security settings on a per-client basis.

cookie_notice_accepted and gdpr[allowed_cookies] are used to identify the choices made from the user regarding cookie consent.

For example, if a visitor is in a coffee shop where there may be several infected machines, but the specific visitor's machine is trusted (for example, because they completed a challenge within your Challenge Passage period), the cookie allows Cloudflare to identify that client and not challenge them again. It does not correspond to any user ID in your web application, and does not store any personally identifiable information.

__cfduid, cookie_notice_accepted, gdpr[allowed_cookies]


DoubleClick by Google refers to the DoubleClick Digital Marketing platform which is a separate division within Google. This is Google’s most advanced advertising tools set, which includes five interconnected platform components.

DoubleClick Campaign Manager: the ad-serving platform, called an Ad Server, that delivers ads to your customers and measures all online advertising, even across screens and channels.

DoubleClick Bid Manager – the programmatic bidding platform for bidding on high-quality ad inventory from more than 47 ad marketplaces including Google Display Network.

DoubleClick Ad Exchange: the world’s largest ad marketplace for purchasing display, video, mobile, Search and even Facebook inventory.

DoubleClick Search: is more powerful than AdWords and used for purchasing search ads across Google, Yahoo, and Bing.

DoubleClick Creative Solutions: for designing, delivering and measuring rich media (video) ads, interactive and expandable ads.



The _ga is asssociated with Google Universal Analytics - which is a significant update to Google's more commonly used analytics service. This cookie is used to distinguish unique users by assigning a randomly generated number as a client identifier. It is included in each page request in a site and used to calculate visitor, session and campaign data for the sites analytics reports. By default it is set to expire after 2 years, although this is customisable by website owners.

The _gat global object is used to create and retrieve tracker objects, from which all other methods are invoked. Therefore the methods in this list should be run only off a tracker object created using the _gat global variable. All other methods should be called using the _gaq global object for asynchronous tracking.

_gid works as a user navigates between web pages, they can use the gtag.js tagging library to record information about the page the user has seen (for example, the page's URL) in Google Analytics. The gtag.js tagging library uses HTTP Cookies to "remember" the user's previous interactions with the web pages.

_ga, _gat, _gid