LoFP LoFP / false positives may occur if there are legitimate accounts with the privilege to drop files in the root of the c drive. it's recommended to verify the legitimacy of such actions and the accounts involved.

Techniques

Sample rules

Windows Admin Permission Discovery

Description

This analytic is developed to identify suspicious file creation in the root drive (C:). This tactic was observed in NjRAT as a means to ascertain whether its malware instance running on the compromised host possesses administrative privileges. The methodology involves an attempt to create a ‘win.dat’ file in the C:\ directory. If this file is successfully created, it serves as an indicator that the process indeed holds administrative privileges. This anomaly detection mechanism serves as a valuable pivot point for detecting NjRAT and other malware strains employing similar techniques to assess the privileges of their running malware instances, without using token privilege API calls or PowerShell commandlets.

Detection logic


|tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Filesystem where Filesystem.file_name IN ("*.exe", "*.dll", "*.sys", "*.com", "*.vbs", "*.vbe", "*.js", "*.bat", "*.cmd", "*.pif", "*.lnk", "*.dat") by Filesystem.dest Filesystem.file_create_time Filesystem.process_id Filesystem.process_guid Filesystem.file_name Filesystem.file_path Filesystem.user 
| `drop_dm_object_name(Filesystem)` 
| eval dropped_file_path = split(file_path, "\\") 
| eval dropped_file_path_split_count = mvcount(dropped_file_path) 
| eval root_drive = mvindex(dropped_file_path,0) 
| where LIKE(root_drive, "C:") AND dropped_file_path_split_count = 2 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_admin_permission_discovery_filter`