LoFP LoFP / normal application like mmc.exe and other ldap query tool may trigger this detections.

Techniques

Sample rules

SchCache Change By App Connect And Create ADSI Object

Description

This analytic is to detect an application try to connect and create ADSI Object to do LDAP query. Every time an application connects to the directory and attempts to create an ADSI object, the Active Directory Schema is checked for changes. If it has changed since the last connection, the schema is downloaded and stored in a cache on the local computer either in %LOCALAPPDATA%\Microsoft\Windows\SchCache or %systemroot%\SchCache. We found this a good anomaly use case to detect suspicious application like blackmatter ransomware that use ADS object api to execute ldap query. having a good list of ldap or normal AD query tool used within the network is a good start to reduce the noise.

Detection logic

`sysmon` EventCode=11  TargetFilename = "*\\Windows\\SchCache\\*" TargetFilename = "*.sch*" NOT (Image IN ("*\\Windows\\system32\\mmc.exe")) 
|stats count min(_time) as firstTime max(_time) as lastTime by Image TargetFilename EventCode process_id  process_name dest 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `schcache_change_by_app_connect_and_create_adsi_object_filter`