Skip to main content

Boteraser | Website and Server Security Solutions

HTML5 Encoding

Malware

⚠️ Overview

HTML5 Encoding is not a distinct malware family but rather a technique or obfuscation method used within various malware strains—first documented in 2019 by Malwarebytes as a way to hide malicious scripts in HTML5 canvas elements and Web Workers. No single threat actor or operation is tied to it; it is categorized as an evasion technique (T1027.001 in MITRE ATT&CK for obfuscated files or information).

🔧 Technical Capabilities

The method encodes malicious payloads—often JavaScript, VBScript, or PowerShell—within HTML5 audio or video tags using base64 or custom base encodings, leveraging the onerror or onload event handlers to trigger execution. Attack vectors include phishing emails with HTML attachments or malicious advertisements (malvertising) that load encoded scripts from remote servers. C2 infrastructure is typically embedded within the encoded payload as a URL string, decoded at runtime. Persistence is achieved through scheduled tasks or registry run keys written by the decoded script. Evasion techniques include using window.atob for decoding to avoid static signature detection, and dynamic code generation via eval() or Function() constructors to bypass application whitelisting.

📜 History & Notable Incidents

The technique appeared in a 2019 campaign by the TA544 group targeting Italian users with HTML attachments that encoded AgentTesla and FormBook payloads, as reported by Proofpoint. No specific CVEs are associated with HTML5 encoding itself, but it has been used in conjunction with CVE-2021-40444 (MSHTML remote code execution) in some campaigns. No law enforcement actions have targeted the technique directly.

🔍 Detection Indicators

Network IOCs include JavaScript files with unusually long base64 strings inside or tags, and HTTP POST requests to IP addresses on non-standard ports (e.g., 8080, 8443). Behavioral signatures include WScript or PowerShell spawning from a browser process or HTML application (HTA). Registry keys such as HKCUSoftwareMicrosoftWindowsCurrentVersionRun with a value containing mshta.exe or rundll32.exe and an encoded argument may indicate infection.

☠️ Risk & Impact

The encoding technique itself causes no direct damage but enables delivery of second-stage payloads—typically information stealers like AgentTesla or remote access trojans—leading to credential theft, data exfiltration, and potential lateral movement. Affected sectors include finance, healthcare, and manufacturing, based on phishing campaign targeting patterns.

🛡️ Mitigation

Defenses include disabling unnecessary scripting in email clients, deploying email security gateways that scan HTML attachments for encoded base64 strings, and using endpoint detection rules that flag child processes of web browsers executing encoded script engines (e.g., cscript.exe or mshta.exe). MITRE ATT&CK technique T1027.001 (Obfuscated Files or Information) provides detection guidance; SIEM rules based on base64 decode counts over 10× in a single file are recommended.

⚠️

Malware Families Commonly Operate Through Automated Botnets

Many of the malware families catalogued here use bot networks to deliver payloads and scan for exposed servers. Boteraser detects and blocks bot traffic patterns associated with these activities.

Check My Site for Free

Free to start  ·  Cancel anytime

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the malware listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

✓