Suspicious HTML File Creation Leading to Potential Payload Delivery
This detection identifies the creation of HTML files with high entropy and large size, followed by execution via a browser process, indicating potential HTML smuggling and malicious payload delivery on Windows systems.
This detection rule identifies a suspicious sequence of events indicative of HTML smuggling, where adversaries embed malicious payloads within seemingly benign HTML files to bypass security filters. The rule focuses on Windows systems and monitors for the creation of HTML files exhibiting characteristics such as high entropy (>=5) and large size (>=150,000 bytes) or very large size (>=1,000,000 bytes) within common download and temporary directories (e.g., Downloads, Content.Outlook, AppData\Local\Temp). Subsequently, it tracks the execution of browser processes (e.g., chrome.exe, firefox.exe, iexplore.exe) opening these HTML files with specific command-line arguments (e.g., –single-argument, -url). The detection aims to uncover initial access attempts, defense evasion, and user execution of malicious files delivered through HTML smuggling techniques.
Attack Chain
- A user receives a phishing email containing a malicious HTML attachment.
- The user opens the attachment, triggering the download of a large HTML file to the Downloads folder.
- The HTML file contains obfuscated JavaScript code that, when executed, reconstructs a malicious payload (e.g., a Cobalt Strike beacon).
- The file is saved with an .htm or .html extension in a temporary or download directory.
- A browser process (chrome.exe, firefox.exe, etc.) is initiated to open the HTML file, often with specific arguments like “–single-argument” or “-url”.
- The browser renders the HTML, executing the embedded JavaScript.
- The JavaScript deobfuscates and executes the smuggled payload, initiating a reverse shell connection to a command-and-control server.
- The attacker gains initial access to the compromised system and can proceed with lateral movement or data exfiltration.
Impact
Successful exploitation via HTML smuggling can lead to initial access to a targeted system, potentially enabling attackers to perform lateral movement, data exfiltration, or ransomware deployment. While the specific number of victims and targeted sectors are not explicitly stated in the source, the technique is broadly applicable and can affect any Windows user who interacts with malicious HTML attachments or downloads from untrusted sources. The consequences of successful exploitation range from data breaches and financial losses to reputational damage and operational disruption.
Recommendation
- Deploy the Sigma rules provided in this brief to your SIEM and tune the file path and browser process filters for your environment.
- Enable file integrity monitoring (FIM) on common download and temporary directories to detect the creation of suspicious HTML files as described in the Sigma rules.
- Implement network egress filtering to block connections to known malicious command-and-control servers and domains to prevent payload execution.
- Educate users about the risks of opening attachments from untrusted sources and train them to recognize phishing emails as outlined in the Overview.
- Utilize endpoint detection and response (EDR) solutions to monitor process execution and network connections for anomalous behavior associated with HTML smuggling.
Detection coverage 3
Suspicious HTML File Creation in Downloads Directory
mediumDetects the creation of HTML files with high entropy or large size in common download directories, potentially indicating HTML smuggling.
Browser Opening HTML File from Suspicious Location
mediumDetects browser processes opening HTML files from common download or temporary directories with specific command-line arguments, indicating potential execution of smuggled payloads.
Internet Explorer Opening HTML File from Suspicious Location
mediumDetects Internet Explorer processes opening HTML files with two arguments from common download or temporary directories.
Detection queries are kept inside the platform. Get full rules →