103. Hunting for Paper Werewolf: PowerModul

Hello everyone! Are you ready to keep hunting for Paper Werewolf? I hope you are! This time let's look at PowerModul. We keep looking into this report, by the way.

PowerModul is a PowerShell script, which enables the adversary to receive and execute additional scripts from the C&C server. It's embedded in the “UserCache.ini” file as a Base64-encoded string:

$base = "[base64-encoded string]"; $base64 = [System.Convert]::FromBase64String($base); $code = [System.Text.Encoding]::UTF8.GetString($base64); iex $code;

To catch such activity, we should look into the Scriptblock. Usually, if you see "FromBase64String" and "iex" together - it's most likely suspicious activity, so it's great candidate for hunting:

event_type: "ScriptExecutionWin"

AND

script_text: ("FromBase64String" AND "iex")

If we look at the decoded script, we can also see multiple hunting opportunities. For example, abusing System.Net.WebClient:

event_type: "ScriptExecutionWin"

AND

script_text: ("system.net.webclient" AND "downloadstring")

Another interesting part is related to system information collection, we can use it to build our query as well:

event_type: "ScriptExecutionWin"

AND

script_text: ("username" AND "computername" AND "win32_operatingsystem" AND "win32_volume")

It's not all, we'll keep looking at Paper Werewolf!

See you tomorrow!

Comments

Popular posts from this blog

082. Huniting for Malicious Browser Extensions

033. Free Google Threat Intelligence Course

163. A Curious Case of Iediagcmd.exe Abuse