Installation of Custom Shim Databases
Identifies the installation of custom Application Compatibility Shim databases. This Windows functionality has been abused by attackers to stealthily gain persistence and arbitrary code execution in legitimate Windows processes.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/09/02"
3integration = ["endpoint", "windows"]
4maturity = "production"
5updated_date = "2024/05/21"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies the installation of custom Application Compatibility Shim databases. This Windows functionality has been
11abused by attackers to stealthily gain persistence and arbitrary code execution in legitimate Windows processes.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.registry-*", "winlogbeat-*", "logs-windows.sysmon_operational-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Installation of Custom Shim Databases"
18risk_score = 47
19rule_id = "c5ce48a6-7f57-4ee8-9313-3d0024caee10"
20severity = "medium"
21tags = [
22 "Domain: Endpoint",
23 "OS: Windows",
24 "Use Case: Threat Detection",
25 "Tactic: Persistence",
26 "Data Source: Elastic Defend",
27 "Data Source: Sysmon",
28]
29timestamp_override = "event.ingested"
30type = "eql"
31
32query = '''
33registry where host.os.type == "windows" and event.type in ("creation", "change") and
34 registry.path : "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Custom\\*.sdb" and
35 not process.executable :
36 ("?:\\Program Files (x86)\\DesktopCentral_Agent\\swrepository\\1\\swuploads\\SAP-SLC\\SAPSetupSLC02_14-80001954\\Setup\\NwSapSetup.exe",
37 "?:\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
38 "?:\\Program Files (x86)\\SAP\\SAPsetup\\setup\\NwSapSetup.exe",
39 "?:\\Program Files (x86)\\SAP\\SapSetup\\OnRebootSvc\\NWSAPSetupOnRebootInstSvc.exe",
40 "?:\\Program Files (x86)\\Kaspersky Lab\\Kaspersky Security for Windows Server\\kavfs.exe")
41'''
42
43
44[[rule.threat]]
45framework = "MITRE ATT&CK"
46[[rule.threat.technique]]
47id = "T1546"
48name = "Event Triggered Execution"
49reference = "https://attack.mitre.org/techniques/T1546/"
50[[rule.threat.technique.subtechnique]]
51id = "T1546.011"
52name = "Application Shimming"
53reference = "https://attack.mitre.org/techniques/T1546/011/"
54
55
56
57[rule.threat.tactic]
58id = "TA0003"
59name = "Persistence"
60reference = "https://attack.mitre.org/tactics/TA0003/"
Related rules
- Creation of a Hidden Local User Account
- Execution of Persistent Suspicious Program
- Image File Execution Options Injection
- Installation of Security Support Provider
- Local Scheduled Task Creation