Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Endpoint Security

Legacy Windows Tool MSHTA Fuels Surge in Silent Malware Attacks

Attackers are increasingly abusing Microsoft’s decades-old MSHTA utility to stealthily deliver stealers, loaders, and persistent malware through phishing, fake software downloads, and LOLBIN-based attack chains.

Windows security

Good intentions can have unintended consequences. MSHTA is an example.

MSHTA (Microsoft HTML Application) has been a part of Windows since 1999 and the release of Win98 SE and Internet Explorer 5.0. It has remained part of Windows throughout, including the latest current releases. It also continues to run with the Edge browser through the IE mode. The purpose is to conform to Microsoft’s policy of prioritizing backward compatibility.

Over the years, legitimate use of MSHTA has declined. Abuse, however, has grown. MSHTA is increasingly used by bad actors as a Living-off-the-Land binary (LOLBIN) to silently deliver a growing range of malware – ranging from commodity stealers and loaders to advanced and persistent malware such as PurpleFox

Since the start of this year, BitDefender has detected a dramatic rise in MSHTA-related activity. The firm believes this reflects increased threat actor use rather than renewed administrative adoption.

MSHTA

MSHTA is designed to execute HTML application (HTA) files, which are programs written in HTML, VBScript or JavaScript. An HTA file loaded from an offsite server can be manipulated to run VBScript in memory. The local server would only see the activity of a trusted and MS-signed binary, not what is happening in memory. Because of that trust and the continued legitimate use, it would be difficult to block automatically. The result is that invisible malicious code could be introduced, and that code could then download further LOLBIN components ultimately leading to the implementation of dangerous malware.

“MSHTA provides attackers with a built-in, Microsoft-signed utility that can retrieve and execute remote script content during the initial or intermediate stages of an infection chain,” reports BitDefender.

Attackers start the process through basic social engineering.

Advertisement. Scroll to continue reading.

Delivering malware

One common abuse of MSHTA detected by BitDefender involved the use of the HTA CountLoader to deliver the Lumma and Amatera stealers. In one Lumma campaign, victims were targeted through messages, social media posts, or SEO-poisoned websites that promise free or cracked software.

If successfully phished, the victim would execute a setup file which is really a Python interpreter, and load Python runtime. The downloaded ‘free software’ archive includes all the necessary scripts together with an MSHTA executable to contact the attacker’s C2 and retrieve the HTA loader.

The HTA then decodes the next payload and launches it. This downloads and executes the stealer.

The Emmenhtal loader was also observed in delivering Lumma and other stealers. This campaign started with phishing messages via Discord. The victim is tricked into visiting a page designed to hijack the clipboard and trick the user into executing a malicious command line as part of a fake human verification process. If the user is subsequently further tricked into pressing Win + R to open the Run dialog, followed by Ctrl + V and Enter to paste and execute the command, then explorer.exe seems to legitimately launch MSHTA.

Ultimately, a PowerShell script is downloaded from a remote location and runs in memory without saving the script to disk.

Other MSHTA-driven campaigns have included the delivery of ClipBanker and PurpleFox. ClipBanker is a malware family primarily designed to replace wallet addresses in the clipboard to steal cryptocurrency. “In this infection chain, MSHTA is used as an early-stage execution mechanism that launches a remote HTA and quickly transitions to PowerShell-based persistence and payload delivery,” explains BitDefender.

PurpleFox is a more advanced and persistent malware family that has been active since 2018. “One of its long-standing delivery methods, however, has remained consistent: launching msiexec from an MSHTA command line in order to download and execute an MSI package disguised as a .png file,” says BitDefender.

While the report gives details of IOCs, It is clear that social engineering is a vital part of MSHTA abuse – but the uptick in that abuse also demonstrates that social engineering remains effective. 

“The main defense against this type of attack is user awareness,” said Silviu Stahie, Security Analyst at Bitdefender. “If we can convince people to stop running commands in their terminals, in PowerShell and stuff like that, we could solve most of these issues. The same goes for downloading cracked applications, pirated games. There’s a good chance you’re going to get infected in this way. I would say over 90% of attacks would stop the next day, if we just stop falling for these attacks.”

Defending against MSHTA abuse should obviously include user awareness training, but technical mitigations are also important. “Protection needs to cover multiple points in the attack chain, from attack surface reduction to pre-execution detection and runtime behavioral blocking,” warn the researchers. 

“As for organizations,” continued Stahie, “blocking all these legacy binaries should be the default stance. Unless you have some critical application that still needs access to MSHTA users should not have access to it. It should be blocked in firewalls.”

Related: Infostealers: The Silent Smash-and-Grab Driving Modern Cybercrime

Related: Cloned AI Tool Sites Distribute Malware in ‘InstallFix’ Campaign

Related: RATs in the Machine: Inside a Pakistan-Linked Cyber Assault on India

Related: Living off the AI: The Next Evolution of Attacker Tradecraft

Written By

Kevin Townsend is a Senior Contributor at SecurityWeek. He has been writing about high tech issues since before the birth of Microsoft. For the last 15 years he has specialized in information security; and has had many thousands of articles published in dozens of different magazines – from The Times and the Financial Times to current and long-gone computer magazines.

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Organizations are investing heavily in third-party risk management, but breaches, delays, and blind spots continue to persist. Join this live webinar as we examine the gap between how organizations think their third-party risk programs are performing and what’s actually happening in practice.

Register

Delve into big-picture strategies to reduce attack surfaces, improve patch management, conduct post-incident forensics, and tools and tricks needed in a modern organization.

Register

People on the Move

Tim Byrd has been appointed Chief Information Security Officer at First Citizens Bank.

IRONSCALES has named Steve McKenzie as Chief Operating Officer.

Silvio Pappalardo has joined AuthMind as Chief Revenue Officer.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.