Techniques
Sample rules
Windows Run Key Self Registration From User Writable Path
- source: splunk
- technicques:
Description
The following analytic detects a binary located in a user-writable directory (C:\Users, C:\ProgramData or C:\PerfLogs) that registers itself for persistence by writing its own path into a CurrentVersion Run registry key. This activity is significant because malware delivered through ClickFix-style remote MSI installations (such as NodeJS based loaders or DeElevate64.exe) commonly drops its payload into the user profile and then adds itself to the Run key to survive reboots. If confirmed malicious, this could allow an attacker to maintain persistent access to the endpoint every time the user logs in.
Detection logic
`sysmon`
EventCode=13
registry_path = "*\\Microsoft\\Windows\\CurrentVersion\\Run*"
process_path IN ("*:\\Users\\*", "*:\\ProgramData\\*", "*:\\PerfLogs\\*")
NOT process_name IN (
"Amazon WorkDocs Companion.exe",
"Balto.exe",
"GoToForTeams.exe",
"IWDesktop.exe",
"JTTray.exe",
"Microsoft.SharePoint.exe",
"OfficeAtHandForTeams.exe",
"OneDrive.Sync.Service.exe",
"opera.exe",
"Print to Fax.exe",
"QSHelper.exe",
"RingCentralForTeams.exe",
"UniKeyNT.exe"
)
| where lower(process_path)=lower(replace(registry_value_data,"[\x22\x27]",""))
| stats count min(_time) as firstTime
max(_time) as lastTime
by dest user process_guid process_id process_name process_path
registry_path registry_value_name registry_value_data
vendor_product
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_run_key_self_registration_from_user_writable_path_filter`