Detect PoWERsheLL mixed case obfuscation using Splunk

Mixed case obfuscation is a good technique if security appliances are case sensitive and a wash if they aren't. But looking at "PoWERsheLL -e"  you know its bad so lets do a quick signature for the case obfuscation to add to our other powershell detections. Of course this ONLY detects the mixed case but this is a valid TTP as it is seen in the wild.


First you will need to profile the existing common case occurrences for your network. Turned out I see just a couple of common ones which will become our filter.

Profile search


So (?i) to do a case insensitive match for powershell and stats does its normal case sensitive aggregation.
Hopefully at this point you have a small filter list.

Now for the real search



Detect the powershell command line, let regex in case sensitive mode be the filter for matches that are common on your network and away you go.
In practice I had only one tune at the top level search and see only a few false positives. The search is light weight enough to do an all-time hunt and then set it however you do reoccurring searches or dashboards.

Good hunting.

References:

https://twitter.com/cyb3rops/status/1225334343838597120

https://twitter.com/anyrun_app/status/1225323429399793666

https://attack.mitre.org/techniques/T1036/



Comments

Popular posts from this blog

Misleading extensions Xls.exe Doc.exe Pdf.exe

Netconn from suspicious directories

Powershell DNS C2 Notes