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).
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.
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.
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.
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.
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.
Similar Threats
⚠️
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 FreeFree 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.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.