Detect Compiled HTML File in IBM QRadar
Adversaries may abuse Compiled HTML files (.chm) to conceal malicious code. CHM files are commonly distributed as part of the Microsoft HTML Help system and are compressed compilations of HTML documents, images, and scripting languages such as VBA, JScript, Java, and ActiveX. CHM content is displayed using underlying components of the Internet Explorer browser loaded by the HTML Help executable program (hh.exe). A custom CHM file containing embedded payloads could be delivered to a victim then triggered by User Execution. CHM execution may also bypass application control on older and/or unpatched systems. Groups known to abuse CHM files include OilRig, Dark Caracal, Silence, APT41, and APT38.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1218 System Binary Proxy Execution
- Sub-technique
- T1218.001 Compiled HTML File
- Canonical reference
- https://attack.mitre.org/techniques/T1218/001/
QRadar Detection Query
SELECT
DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
logsourcename(logsourceid) AS log_source,
username,
"Image" AS process_image,
"CommandLine" AS command_line,
"ParentImage" AS parent_image,
"ParentCommandLine" AS parent_command_line,
CASE
WHEN LOWER("ParentImage") SIMILAR TO '%(winword|excel|outlook|powerpnt|wscript|cscript|mshta)\.exe' THEN 1
ELSE 0
END AS suspicious_parent,
CASE
WHEN "CommandLine" SIMILAR TO '%(http://|https://|\\\\[a-zA-Z])%' THEN 1
ELSE 0
END AS remote_load,
CASE
WHEN LOWER("Image") SIMILAR TO '%(cmd|powershell|wscript|cscript|mshta|rundll32|regsvr32|certutil)\.exe'
AND LOWER("ParentImage") SIMILAR TO '%\\hh\.exe' THEN 1
ELSE 0
END AS suspicious_child,
(CASE WHEN LOWER("ParentImage") SIMILAR TO '%(winword|excel|outlook|powerpnt|wscript|cscript|mshta)\.exe' THEN 1 ELSE 0 END +
CASE WHEN "CommandLine" SIMILAR TO '%(http://|https://|\\\\[a-zA-Z])%' THEN 1 ELSE 0 END +
CASE WHEN LOWER("Image") SIMILAR TO '%(cmd|powershell|wscript|cscript|mshta|rundll32|regsvr32|certutil)\.exe' AND LOWER("ParentImage") SIMILAR TO '%\\hh\.exe' THEN 1 ELSE 0 END) AS risk_score
FROM events
WHERE
LOGSOURCETYPEID IN (12, 13, 14, 15)
AND (
(LOWER("Image") SIMILAR TO '%\\hh\.exe'
AND (
"CommandLine" SIMILAR TO '%(ms-its:|mk:@MSITStore|http://|https://|\\\\[a-zA-Z])%'
OR LOWER("ParentImage") SIMILAR TO '%(winword|excel|outlook|powerpnt|cmd|wscript|cscript|mshta)\.exe'
)
)
OR (
LOWER("ParentImage") SIMILAR TO '%\\hh\.exe'
AND LOWER("Image") SIMILAR TO '%(cmd|powershell|wscript|cscript|mshta|rundll32|regsvr32|certutil)\.exe'
)
)
AND QIDNAME(qid) IN ('Process Launch', 'Process Create', 'Windows Process Created')
ORDER BY starttime DESC
LAST 24 HOURS Detects CHM file abuse via hh.exe by correlating process creation events from Windows Security (EventID 4688) or Sysmon (EventID 1) log sources in QRadar. Identifies hh.exe executed with suspicious protocols (ms-its:, mk:@MSITStore, remote URLs) or spawned by Office/script interpreters, as well as hh.exe acting as parent to known LOLBin processes. A composite risk score aggregates suspicious indicators for analyst triage.
Data Sources
Required Tables
False Positives & Tuning
- Enterprise software packages that ship with CHM help documentation and launch hh.exe during installation or when a user clicks the Help menu item
- IT asset management or configuration management tools that programmatically invoke hh.exe to display context-sensitive help tied to internal documentation systems
- Legacy line-of-business applications built on older Windows SDK patterns that use HtmlHelp() API calls from cmd.exe batch wrapper scripts
Other platforms for T1218.001
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1CHM Execution via hh.exe with Embedded Script
Expected signal: Sysmon Event ID 1: Process Create with Image=hh.exe, CommandLine containing 'ms-its:' and '.chm'. Security Event ID 4688 if command line auditing is enabled. Any child process creation (if CHM contains script) will also appear as Sysmon Event ID 1 with ParentImage=hh.exe.
- Test 2CHM File Spawning PowerShell
Expected signal: Sysmon Event ID 1 for hh.exe, then a child Sysmon Event ID 1 for powershell.exe with ParentImage=hh.exe. The suspicious child process relationship is the primary detection indicator. Security Event ID 4688 for both processes if command line auditing is on.
- Test 3CHM File Opened from Email Attachment Location
Expected signal: Sysmon Event ID 11: File Create in the Outlook temp path. Sysmon Event ID 1: hh.exe with the Outlook temp path in its command line. File System: CHM file written to Content.Outlook directory.
References (7)
- https://attack.mitre.org/techniques/T1218/001/
- https://oddvar.moe/2017/08/13/bypassing-device-guard-umci-using-chm-cve-2017-8625/
- https://docs.microsoft.com/previous-versions/windows/desktop/htmlhelp/microsoft-html-help-1-4-sdk
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1218.001/T1218.001.md
- https://www.trendmicro.com/en_us/research.html
- https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-8625
- https://www.welivesecurity.com/wp-content/uploads/2020/06/ESET_InvisiMole.pdf
Unlock Pro Content
Get the full detection package for T1218.001 including response playbook, investigation guide, and atomic red team tests.