System32 executables from non-standard paths

I have no qualms about boiling a small ocean if it means detecting malware. I wrote earlier about some individual occurrences of malware that use legitimate system32 executables in non-standard paths for DLL side-loading. A colleague asked why we couldn't do all the checks at one time so we worked on a method to do just that. It turns out that there are over 600 executables in system32. The first thing I tried was just to put them all into a big search and be done with it. You can try it if you want but I had no luck getting Splunk to run a search string that large. So we converted the list to a csv. To get the filenames from the inputlookup to expand to the search we want I had to use the following format and a header value of "process_path". You'll see the reason for the header and the *\ in a little bit.

process_path
*\agentservice.exe
*\aitstatic.exe
*\ald.exe


The way inputlookup is expanded the search string will become:

(process_path=*\\agentservice.exe OR process_path=*\\aitstatic.exe OR ..... )
Splunk helpfully escapes the \ providing the other one that we need for the search.

This with our filters constructs the search for all 600+ files if they aren't in a standard location. I have left out some filters for some other paths and some filenames that are common in other areas.




Wrap up:
This search takes a long time to run as will most searches where there is no nice string to match on. It does work however and detects the technique.

Why not filter for only executions with netconn? This particular malware didn't do C2 from the side-loaded dll so that wouldn't have caught the target technique. It is probably a good idea for another search though.



Comments

  1. Nice work. Can you share the csv file? I tried this but returned huge list of false positives that i can't tune.

    ReplyDelete

Post a Comment

Popular posts from this blog

Misleading extensions Xls.exe Doc.exe Pdf.exe

Netconn from suspicious directories

Powershell DNS C2 Notes