Tracking Malicious Files with Favicons

Image
In today's post, we're diving into the world of favicons and their role in malware detection with VirusTotal Enterprise. If you read my last blog, you’ll remember we explored using VirusTotal Diff to track down new iterations of DarkGate malware. Though it might seem like I live and breathe VirusTotal, I assure you there are other tools I use. However, I do find these ad-hoc workflows interesting, and although I rarely document them, I'm making another post. Imagine you’re part of a product company that distributes a high volume of binaries, software, and various other items across a vast amount of websites. Often, third-party partners host legitimate versions of these products on their sites and SEO boosts. Unfortunately, this widespread distribution gives attackers a chance to mimic your products by using similar file names and even your company's favicon to deceive users. This is by no means a novel or new technique, in fact, it's quite trivial in my opinion, w

Creating Windows Defender Exclusions


Something interesting I've come across, admittedly only a handful of times, is that the `MpPreference` cmdlet is being used in nefarious ways. Specifically, this involves instances where Domain Admin accounts have been compromised, and they are being to create exclusions that bypass Windows Defender detections. 

The `MpPreference` cmdlet family is related to Windows Defender. There are 12 different cmdlets in this family, but I've really only encountered `Add-MpPreference` in the wild. On that note, this is not referring to Windows Defender for Endpoint, ATP, or whatever it was called before that.

One important aspect of using MpPreference is that it requires some form of an elevated account to create the exclusions.

I first came across this technique when I observed a script being executed after a DA pushed a GPO that did a few interesting things. This script disabled AVs, EDRs, backups, grabbed a malicious executable from a network share, and cleared audit logs. The fact that the script also disabled Windows Defender caught my attention, as this was not a common occurrence or really something I was aware of at the time. 

There are four different exclusions that can be used with the Add-MpPreference cmdlet:

-   ExclusionExtension
-   ExclusionIP
-   ExclusionPath
-   ExclusionProcess

An attacker can now use the `Add-MpPreference` cmdlet to write any extension, path, process, or IP to these locations; bypassing Windows Defender. I conducted a search to determine if this technique was being used in the wild, and I found one instance of an administrator using a third-party file backup software.

This led me to the idea of enumerating any previously written exclusions in an environment and then writing to them to bypass Defender. Which can be accomplished through Get-MpPreference and doesn't require an elevated account to use. A simple and likely undetected PowerShell script, such as the one shown below, could be used for this purpose:

Get-MpPreference | Select-Object -Property ExclusionExtension,ExclusionPath,ExclusionProcess,ExclusionIP | Format-table -Wrap

Because these exclusions cover multiple different areas, there are no restrictions on writing to these. An attacker with knowledge of any of these exclusions would be able to execute arbitrary files from here and evade defender. Therefore, it's important to verify any use of the `MpPreference` cmdlets, including the applications that are written and the account being used. 

Solo + Finn 23

Comments

Popular posts from this blog

Certifried Red Team Operator

VirusTotal Enterprise - Starting Workflow