LoFP LoFP / false positives are possible if legitimate users are executing applications from file paths that are not permitted by applocker. it is recommended to investigate the context of the application execution to determine if it is malicious or not. modify the threshold as needed to reduce false positives.

Techniques

Sample rules

Windows AppLocker Execution from Uncommon Locations

Description

This analytic is designed to identify executions of applications or scripts from uncommon or suspicious file paths, which could be indicative of malware or unauthorized activity. By leveraging a simple statistical model, the query analyzes the frequency of application executions across different file paths. It calculates the average (avg) number of executions per file path and uses the standard deviation (stdev) to measure the variation or dispersion of the execution counts from the average. A file path is considered uncommon or suspicious if the number of executions from it is significantly higher than what is expected based on the calculated average and standard deviation. Specifically, the analytic flags any file path from which the number of executions exceeds the upper bound, defined as the average plus two times the standard deviation (avg+stdev*2). This approach helps in pinpointing anomalies in application execution patterns, potentially uncovering malicious activities or policy violations.

Detection logic

`applocker` 
| spath input=UserData_Xml 
| rename RuleAndFileData.* as *, Computer as dest, TargetUser AS user 
| stats count min(_time) as firstTime max(_time) as lastTime by dest, PolicyName, RuleId, user, TargetProcessId, FilePath, FullFilePath 
| eventstats avg(count) as avg, stdev(count) as stdev 
| eval upperBound=(avg+stdev*2), anomaly=if(count > upperBound, "Yes", "No") 
| where anomaly="Yes" 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_applocker_execution_from_uncommon_locations_filter`