Detecting Low Prevalence DLL Loaded From Process In User Downloads Directory
Query designed to detect low prevalence DLLs loaded from processes in the user's Downloads folder:
// Define a set of DLLs loaded from the user's Downloads folder
let LoadedDLLs = (
DeviceImageLoadEvents
| where InitiatingProcessFolderPath matches regex @"(?i)\\Users\\[^\\] +\\Downloads\\(.*)?"
| where FolderPath matches regex @"(?i)\\Users\\[^\\] +\\Downloads\\(.*)?"
| where FileName endswith ".dll"
| distinct SHA1
// The FileProfile() function has a limit of 1000 lookups per query
| invoke FileProfile("SHA1", 1000)
);
DeviceImageLoadEvents
| where InitiatingProcessFolderPath matches regex @"(?i)\\Users\\[^\\] +\\Downloads\\(.*)?"
| where FolderPath matches regex @"(?i)\\Users\\[^\\] +\\Downloads\\(.*)?"
| where FileName endswith ".dll"
| join kind=inner (LoadedDLLs) on SHA1
// Optionally, you can add a filter on the GlobalPrevalence column to reduce the number of results
// | where GlobalPrevalence < 500
// | order by GlobalPrevalence asc
| project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FolderPath, FileName, SHA1, GlobalPrevalence
| order by Timestamp descBelow is a more extended version of the above query:
As usual, tweak it further based on your specific needs!
PreviousDetecting Silent cmd.exe Execution With Redirected STDERR & STDOUTNextDetecting Virtual Drive Mounted From Archive
Last updated