HTA
An HTML Application (HTA) is a Microsoft Windows program that combines HTML, Dynamic HTML, and scripting languages supported by Internet Explorer, such as VBScript or JScript, to create a desktop application-like interface
HTML Application
The LOLBINS tool mshta is used to execute HTA files. It can be executed by itself or automatically from Internet Explorer.
In the following example, we will use an ActiveXObject in our payload as proof of concept to execute cmd.exe.
Consider the following HTML code.
Then serve the payload.hta from a web server, this could be done from the attacking machine as follows,
On the victim machine, visit the malicious link http://ATTACKER_IP.37:8090/payload.hta
Malicious HTA
Another way to generate and serve malicious HTA files using the Metasploit framework.
We can create a reverse shell payload as follows,
On the victim machine, once we visit the malicious HTA file that was provided as a URL by Metasploit, we should receive a reverse connection.