System Binary Proxy Execution: Compiled HTML File

Adversaries may abuse Compiled HTML files (.chm) to conceal malicious code. CHM files are commonly distributed as part of the Microsoft HTML Help system. CHM files are compressed compilations of various content such as HTML documents, images, and scripting/web related programming languages such VBA, JScript, Java, and ActiveX. [1] CHM content is displayed using underlying components of the Internet Explorer browser [2] loaded by the HTML Help executable program (hh.exe). [3]

A custom CHM file containing embedded payloads could be delivered to a victim then triggered by User Execution. CHM execution may also bypass application application control on older and/or unpatched systems that do not account for execution of binaries through hh.exe. [4] [5]

ID: T1218.001
Sub-technique of:  T1218
Tactic: Defense Evasion
Platforms: Windows
Defense Bypassed: Application control, Digital Certificate Validation
Contributors: Rahmat Nurfauzi, @infosecn1nja, PT Xynexis International
Version: 2.1
Created: 23 January 2020
Last Modified: 18 October 2023

Procedure Examples

ID Name Description
G0082 APT38

APT38 has used CHM files to move concealed payloads.[6]

G0096 APT41

APT41 used compiled HTML (.chm) files for targeting.[7]

S0373 Astaroth

Astaroth uses ActiveX objects for file execution and manipulation. [8]

G0070 Dark Caracal

Dark Caracal leveraged a compiled HTML file that contained a command to download and run an executable.[9]

G0049 OilRig

OilRig has used a CHM payload to load and execute another malicious file once delivered to a victim.[10]

G0091 Silence

Silence has weaponized CHM files in their phishing campaigns.[11][12][13][14]

Mitigations

ID Mitigation Description
M1038 Execution Prevention

Consider using application control to prevent execution of hh.exe if it is not required for a given system or network to prevent potential misuse by adversaries.

M1021 Restrict Web-Based Content

Consider blocking download/transfer and execution of potentially uncommon file types known to be used in adversary campaigns, such as CHM files

Detection

ID Data Source Data Component Detects
DS0017 Command Command Execution

Monitor executed commands and arguments that may forge SAML tokens with any permissions claims and lifetimes if they possess a valid SAML token-signing certificate.[15]

DS0022 File File Creation

Monitor presence and use of CHM files, especially if they are not typically used within an environment.

DS0009 Process Process Creation

Monitor and analyze the execution and arguments of hh.exe. [4] Compare recent invocations of hh.exe with prior history of known good arguments to determine anomalous and potentially adversarial activity (ex: obfuscated and/or malicious commands). Non-standard process execution trees may also indicate suspicious or malicious behavior, such as if hh.exe is the parent process for suspicious processes and activity relating to other adversarial techniques.

Note: Event IDs are for Sysmon (Event ID 1 - process create) and Windows Security Log (Event ID 4688 - a new process has been created). The Analytic looks for the creation of any HTML Help Executable ( hh.exe ) processes. Adversaries may hide malicious code in .chm compiled help files; whenever a user tries to open one of these files, Windows executes the HTML Help Executable. Therefore, if there are legitimate uses of compiled help files in your environment, this analytic may lead to false positives and will require additional tuning.

Analytic 1 - Compiled HTML Access

(source="WinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode="1") OR (source="WinEventLog:Security" EventCode="4688") Image="C:\Windows\syswow64\hh.exe" OR Image="C:\Windows\system32\hh.exe"

References