Detection rules › Elastic

Attempt to Hide Files via Registry Modification

Source
github.com/elastic/protections-artifacts

This rule detects the modification of registry settings that control how files are visualized to the user via Explorer. Some malwares will modify those entries to hide malware related files.

MITRE ATT&CK coverage

Rule body

[rule]
description = """
This rule detects the modification of registry settings that control how files are visualized to the user via Explorer.
Some malwares will modify those entries to hide malware related files.
"""
id = "4f7b1362-1299-4ce7-8e02-03b74dad4eb1"
license = "Elastic License v2"
name = "Attempt to Hide Files via Registry Modification"
os_list = ["windows"]
version = "1.0.6"

query = '''
registry where event.action == "modification" and process.executable != null and
 registry.key like "S-*\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced" and
 (
  (registry.value == "HideFileExt" and registry.data.strings == "1") or
  (registry.value == "Hidden" and registry.data.strings == "2") or
  (registry.value == "ShowSuperHidden" and registry.data.strings == "0")
  ) and
  not process.executable :
                ("C:\\Windows\\system32\\svchost.exe",
                 "C:\\Windows\\explorer.exe",
                 "C:\\Windows\\regedit.exe",
                 "C:\\Windows\\System32\\runonce.exe",
                 "C:\\Windows\\System32\\ShellAppRuntime.exe",
                 "C:\\Windows\\ImmersiveControlPanel\\SystemSettings.exe",
                 "C:\\Windows\\System32\\SystemPropertiesPerformance.exe",
                 "C:\\Windows\\System32\\SystemPropertiesAdvanced.exe",
                 "C:\\Windows\\System32\\SystemPropertiesComputerName.exe",
                 "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                 "C:\\Program Files\\KEYENCE\\IM Editor2\\IMController.exe",
                 "C:\\Program Files\\Streamline3\\1.7.1.2\\pxsvc.exe", 
                 "C:\\Windows\\System32\\reg.exe", 
                 "C:\\Windows\\System32\\regsvr32.exe",
                 "C:\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
                 "C:\\ADP SmartCompliance PowerTool\\Compliance.exe",
                 "D:\\USMT\\X64\\loadstate.exe",
                 "C:\\Program Files\\*.exe", 
                 "C:\\Program Files (x86)\\*.exe") and
not (process.code_signature.subject_name : ("Cyberdigm. Corp.", "CYBERDIGM CO., LTD.", "Electronic Arts, Inc.") and process.code_signature.trusted == true)
'''

min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"

[[threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"
[[threat.technique.subtechnique]]
id = "T1564.001"
name = "Hidden Files and Directories"
reference = "https://attack.mitre.org/techniques/T1564/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Stage 1: registry

registry where event.action == "modification" and process.executable != null and
 registry.key like "S-*\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced" and
 (
  (registry.value == "HideFileExt" and registry.data.strings == "1") or
  (registry.value == "Hidden" and registry.data.strings == "2") or
  (registry.value == "ShowSuperHidden" and registry.data.strings == "0")
  ) and
  not process.executable :
                ("C:\\Windows\\system32\\svchost.exe",
                 "C:\\Windows\\explorer.exe",
                 "C:\\Windows\\regedit.exe",
                 "C:\\Windows\\System32\\runonce.exe",
                 "C:\\Windows\\System32\\ShellAppRuntime.exe",
                 "C:\\Windows\\ImmersiveControlPanel\\SystemSettings.exe",
                 "C:\\Windows\\System32\\SystemPropertiesPerformance.exe",
                 "C:\\Windows\\System32\\SystemPropertiesAdvanced.exe",
                 "C:\\Windows\\System32\\SystemPropertiesComputerName.exe",
                 "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                 "C:\\Program Files\\KEYENCE\\IM Editor2\\IMController.exe",
                 "C:\\Program Files\\Streamline3\\1.7.1.2\\pxsvc.exe", 
                 "C:\\Windows\\System32\\reg.exe", 
                 "C:\\Windows\\System32\\regsvr32.exe",
                 "C:\\$WINDOWS.~BT\\Sources\\SetupPlatform.exe",
                 "C:\\ADP SmartCompliance PowerTool\\Compliance.exe",
                 "D:\\USMT\\X64\\loadstate.exe",
                 "C:\\Program Files\\*.exe", 
                 "C:\\Program Files (x86)\\*.exe") and
not (process.code_signature.subject_name : ("Cyberdigm. Corp.", "CYBERDIGM CO., LTD.", "Electronic Arts, Inc.") and process.code_signature.trusted == true)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqCyberdigm. Corp., CYBERDIGM CO., LTD., Electronic Arts, Inc.excludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"Cyberdigm. Corp." field:"process.code_signature.subject_name" value:"CYBERDIGM CO., LTD." field:"process.code_signature.subject_name" value:"Electronic Arts, Inc."
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.executablewildcardC:\Windows\system32\svchost.exe, C:\Windows\explorer.exe, C:\Windows\regedit.exe, C:\Windows\System32\runonce.exe, C:\Windows\System32\ShellAppRuntime.exe, C:\Windows\ImmersiveControlPanel\SystemSettings.exe, C:\Windows\System32\SystemPropertiesPerformance.exe, C:\Windows\System32\SystemPropertiesAdvanced.exe, C:\Windows\System32\SystemPropertiesComputerName.exe, C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, C:\Program Files\KEYENCE\IM Editor2\IMController.exe, C:\Program Files\Streamline3\1.7.1.2\pxsvc.exe, C:\Windows\System32\reg.exe, C:\Windows\System32\regsvr32.exe, C:\$WINDOWS.~BT\Sources\SetupPlatform.exe, C:\ADP SmartCompliance PowerTool\Compliance.exe, D:\USMT\X64\loadstate.exe, C:\Program Files\*.exe, C:\Program Files (x86)\*.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • modification corpus 72 (elastic 72)
field:"EventType" kind:eq value:"modification"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
registry.data.stringseq
  • 0 corpus 18 (elastic 15, sigma 3)
  • 1 corpus 20 (elastic 16, splunk 2, kusto 2)
  • 2 corpus 4 (elastic 3, sigma 1)
field:"Details" kind:eq
registry.keywildcard
  • S-*\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
field:"TargetObject" kind:wildcard value:"S-*\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
registry.valueeq
  • Hidden
  • HideFileExt
  • ShowSuperHidden
field:"registry_value_name" kind:eq