406. Threat Actors Embed Malicious HTA into LNK Files

Hello everyone!

Today we'll look at the Execution (TA0002) and Stealth (TA0005) tactics, along with different implementations of the PowerShell (T1059.001), JavaScript (T1059.007), and Mshta (T1218.005) techniques.

Our examples come from this report on the activity of Kimsuky (also tracked as Monolithic Werewolf). Let's start with the malicious shortcut files distributed by the attackers. Since the malicious code was embedded directly within the LNK file itself, mshta.exe was launched with the shortcut as its argument, giving us a useful detection opportunity:

event_type: "processcreatewin"

AND

proc_file_path: "mshta.exe"

AND

cmdline: *.lnk

The malicious code acted as a dropper that created the following files on the compromised system:

%APPDATA%\Microsoft\Windows\Templates\Templates.js

%APPDATA%\Microsoft\Windows\Templates\Templates.ps1

The first file was responsible for launching the second. In this case, we can proactively hunt for this activity by looking for processes that reference this directory:

event_type: "processcreatewin"

AND

proc_file_path: ("powershell.exe" OR "wscript.exe" OR "cscript.exe")

AND

cmdline: "Microsoft\\Windows\\Templates"

See you soon!

Comments

Popular posts from this blog

391. Hunting for TeamPCP's Stealer

343. Ransomware Gangs Abuse SystemSettingsAdminFlows to Evade Defenses

013. It Can Remove Rootkits. And Your EDR!