Detection rules › Elastic

Potential Ransomware Note File

Time window
1m
Source
github.com/elastic/protections-artifacts

Identifies the execution of Windows utilities to tamper with system recovery settings and subsequently followed by the creation of a file with a name and file header content similar to common Ransomware notes files. This may indicate a Ransomware attack behavior.

MITRE ATT&CK coverage

TacticTechniques
Impact

Rule body

[rule]
description = """
Identifies the execution of Windows utilities to tamper with system recovery settings and subsequently followed by the
creation of a file with a name and file header content similar to common Ransomware notes files. This may indicate a
Ransomware attack behavior.
"""
id = "5dba1130-72df-46f1-b581-18d9c866cb23"
license = "Elastic License v2"
name = "Potential Ransomware Note File"
os_list = ["windows"]
version = "1.0.31"

query = '''
sequence with maxspan=60s
 [process where event.action == "start" and
  (
    (process.pe.original_file_name == "wmic.exe" and process.command_line : "*shadowcopy*" and process.command_line : "*delete*") or
    (process.pe.original_file_name == "VSSADMIN.EXE" and process.command_line : "*shadows*" and process.command_line : ("*delete*", "*resize*")) or
    (process.pe.original_file_name == "bcdedit.exe" and process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*")) or
    (process.pe.original_file_name == "WBADMIN.EXE" and process.command_line : ("*catalog*", "*systemstatebackup*") and process.command_line : "*delete*") or
    (process.pe.original_file_name == "iCACLS.EXE" and process.command_line : ("*/deny*S-1-1-0*", "*?:\\*\" /grant*Everyone:F*"))
  ) and
  not process.parent.executable :
                 ("?:\\Program Files (x86)\\Faronics\\Deep Freeze\\*\\DFServ.exe",
                  "C:\\Program Files\\RecoveryConsole\\BackupFP.exe")]
 [file where event.action == "creation" and file.extension : ("hta", "txt", "readme") and
  ( 
   /* ransom note header file content */
    file.Ext.header_bytes :
           ("416c6c20796f75722066696c65*",
            "2d002d002d003d003d003d0020005700",
            "596f7572206e6574776f726b20686173",
            "54006f00200064006500630072007900",
            "3a3a3a204772656574696e6773203a3a",
            "49742773206e6f74206c61746520746f",
            "5f5f5f5f5f202020202020205f5f205f",
            "546865206e6574776f726b206973204c",
            "415454454e54494f4e210d0a0d0a446f",
            "4f6f6f70732120416c6c20796f757220",
            "2d2d2d2d2d2d2d2d2d2d2d205b205765",
            "2a2d2a414c4c2046494c4553204f4e20",
            "3c68746d6c3e0d0a3c686561643e0d0a",
            "3c21444f43545950452068746d6c3e0d",
            "efbbbf3c21444f43545950452068746d",
            "4c6f636b426974*",
            "486920436f6d70616e792c0d0a0d0a45",
            "2020202020207e2b2020202020202020",
            "41766f734c6f636b6572*") or
       /* ransom file name keywords */      
    file.name : ("*read*me*", "*unlock*", "*@*", "*RECOVER*", "*decrypt*", "*restore*file*", "*FILES_BACK*")
  ) and
  not (process.executable : "?:\\Program Files\\TortoiseSVN\\bin\\TSVNCache.exe" and file.name : "README.txt") and
  not (process.executable : "?:\\Windows\\System32\\svchost.exe" and user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20")) and
  not process.executable :
              ("?:\\WINDOWS\\System32\\msiexec.exe",
               "?:\\WINDOWS\\Sys*\\Robocopy.exe",
               "?:\\Program Files\\7-Zip\\7z.exe",
               "?:\\Windows\\Installer\\MSI*.tmp",
               "?:\\Program Files\\PaperCut Print Deploy Client\\updater.exe",
               "?:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe",
               "?:\\Windows\\ccmcache\\*\\npp.*.exe",
               "?:\\Windows\\OEM\\VmAgentPackageExtractor\\PackageExtractor.exe",
               "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
               "?:\\Program Files (x86)\\Kaseya\\*\\KaUsrTsk.exe",
               "?:\\Program Files (x86)\\Kaseya\\*\\AgentMon.exe",
               "?:\\Program Files (x86)\\Egnyte\\Egnyte WebEdit\\client.exe") and
  not file.path : "?:\\Program Files (x86)\\Titus\\BACKUP\\readme.txt" and 
  not (process.executable : "C:\\WindowsAzure\\GuestAgent_*\\WaAppAgent.exe" and file.path : "C:\\WINDOW~1\\GUESTA~*\\FindVolume\\DATALOSS_WARNING_README.txt") and 
  not (process.executable : "C:\\ProWin22\\32bit\\ProSeriesBackgroundUpdater.exe" and file.path : "C:\\ProWin22\\bgupdate\\working\\32bit\\taxdataconversion\\README.txt")
  ]
'''

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

[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"


[threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

[process where event.action == "start" and
  (
    (process.pe.original_file_name == "wmic.exe" and process.command_line : "*shadowcopy*" and process.command_line : "*delete*") or
    (process.pe.original_file_name == "VSSADMIN.EXE" and process.command_line : "*shadows*" and process.command_line : ("*delete*", "*resize*")) or
    (process.pe.original_file_name == "bcdedit.exe" and process.command_line : ("*bootstatuspolicy*", "*recoveryenabled*")) or
    (process.pe.original_file_name == "WBADMIN.EXE" and process.command_line : ("*catalog*", "*systemstatebackup*") and process.command_line : "*delete*") or
    (process.pe.original_file_name == "iCACLS.EXE" and process.command_line : ("*/deny*S-1-1-0*", "*?:\\*\" /grant*Everyone:F*"))
  ) and
  not process.parent.executable :
                 ("?:\\Program Files (x86)\\Faronics\\Deep Freeze\\*\\DFServ.exe",
                  "C:\\Program Files\\RecoveryConsole\\BackupFP.exe")]

Stage 2: file

[file where event.action == "creation" and file.extension : ("hta", "txt", "readme") and
  (
    file.Ext.header_bytes :
           ("416c6c20796f75722066696c65*",
            "2d002d002d003d003d003d0020005700",
            "596f7572206e6574776f726b20686173",
            "54006f00200064006500630072007900",
            "3a3a3a204772656574696e6773203a3a",
            "49742773206e6f74206c61746520746f",
            "5f5f5f5f5f202020202020205f5f205f",
            "546865206e6574776f726b206973204c",
            "415454454e54494f4e210d0a0d0a446f",
            "4f6f6f70732120416c6c20796f757220",
            "2d2d2d2d2d2d2d2d2d2d2d205b205765",
            "2a2d2a414c4c2046494c4553204f4e20",
            "3c68746d6c3e0d0a3c686561643e0d0a",
            "3c21444f43545950452068746d6c3e0d",
            "efbbbf3c21444f43545950452068746d",
            "4c6f636b426974*",
            "486920436f6d70616e792c0d0a0d0a45",
            "2020202020207e2b2020202020202020",
            "41766f734c6f636b6572*") or
    file.name : ("*read*me*", "*unlock*", "*@*", "*RECOVER*", "*decrypt*", "*restore*file*", "*FILES_BACK*")
  ) and
  not (process.executable : "?:\\Program Files\\TortoiseSVN\\bin\\TSVNCache.exe" and file.name : "README.txt") and
  not (process.executable : "?:\\Windows\\System32\\svchost.exe" and user.id : ("S-1-5-18", "S-1-5-19", "S-1-5-20")) and
  not process.executable :
              ("?:\\WINDOWS\\System32\\msiexec.exe",
               "?:\\WINDOWS\\Sys*\\Robocopy.exe",
               "?:\\Program Files\\7-Zip\\7z.exe",
               "?:\\Windows\\Installer\\MSI*.tmp",
               "?:\\Program Files\\PaperCut Print Deploy Client\\updater.exe",
               "?:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe",
               "?:\\Windows\\ccmcache\\*\\npp.*.exe",
               "?:\\Windows\\OEM\\VmAgentPackageExtractor\\PackageExtractor.exe",
               "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
               "?:\\Program Files (x86)\\Kaseya\\*\\KaUsrTsk.exe",
               "?:\\Program Files (x86)\\Kaseya\\*\\AgentMon.exe",
               "?:\\Program Files (x86)\\Egnyte\\Egnyte WebEdit\\client.exe") and
  not file.path : "?:\\Program Files (x86)\\Titus\\BACKUP\\readme.txt" and
  not (process.executable : "C:\\WindowsAzure\\GuestAgent_*\\WaAppAgent.exe" and file.path : "C:\\WINDOW~1\\GUESTA~*\\FindVolume\\DATALOSS_WARNING_README.txt") and
  not (process.executable : "C:\\ProWin22\\32bit\\ProSeriesBackgroundUpdater.exe" and file.path : "C:\\ProWin22\\bgupdate\\working\\32bit\\taxdataconversion\\README.txt")
  ]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.parent.executablewildcard?:\Program Files (x86)\Faronics\Deep Freeze\*\DFServ.exe, C:\Program Files\RecoveryConsole\BackupFP.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Program Files (x86)\Faronics\Deep Freeze\*\DFServ.exe" field:"process.parent.executable" value:"C:\Program Files\RecoveryConsole\BackupFP.exe"
file.nameeqREADME.txtexcludes:file.name field:"file.name" value:"README.txt"
process.executableeq?:\Program Files\TortoiseSVN\bin\TSVNCache.exeexcludes:process.executable field:"process.executable" value:"?:\Program Files\TortoiseSVN\bin\TSVNCache.exe"
file.patheqC:\ProWin22\bgupdate\working\32bit\taxdataconversion\README.txtexcludes:file.path field:"file.path" value:"C:\ProWin22\bgupdate\working\32bit\taxdataconversion\README.txt"
process.executableeqC:\ProWin22\32bit\ProSeriesBackgroundUpdater.exeexcludes:process.executable field:"process.executable" value:"C:\ProWin22\32bit\ProSeriesBackgroundUpdater.exe"
file.pathwildcardC:\WINDOW~1\GUESTA~*\FindVolume\DATALOSS_WARNING_README.txtexcludes:file.path field:"file.path" value:"C:\WINDOW~1\GUESTA~*\FindVolume\DATALOSS_WARNING_README.txt"
process.executablewildcardC:\WindowsAzure\GuestAgent_*\WaAppAgent.exeexcludes:process.executable field:"process.executable" value:"C:\WindowsAzure\GuestAgent_*\WaAppAgent.exe"
process.executableeq?:\Windows\System32\svchost.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\svchost.exe"
user.ideqS-1-5-18, S-1-5-19, S-1-5-20excludes:user.id field:"user.id" value:"S-1-5-18" field:"user.id" value:"S-1-5-19" field:"user.id" value:"S-1-5-20"
file.patheq?:\Program Files (x86)\Titus\BACKUP\readme.txtexcludes:file.path field:"file.path" value:"?:\Program Files (x86)\Titus\BACKUP\readme.txt"
process.executablewildcard?:\WINDOWS\System32\msiexec.exe, ?:\WINDOWS\Sys*\Robocopy.exe, ?:\Program Files\7-Zip\7z.exe, ?:\Windows\Installer\MSI*.tmp, ?:\Program Files\PaperCut Print Deploy Client\updater.exe, ?:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe, ?:\Windows\ccmcache\*\npp.*.exe, ?:\Windows\OEM\VmAgentPackageExtractor\PackageExtractor.exe, ?:\Program Files\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Kaseya\*\KaUsrTsk.exe, ?:\Program Files (x86)\Kaseya\*\AgentMon.exe, ?:\Program Files (x86)\Egnyte\Egnyte WebEdit\client.exeexcludes:process.executable

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • creation corpus 58 (elastic 58)
  • start corpus 391 (elastic 391)
field:"EventType" kind:eq
file.Ext.header_byteswildcard
  • 2020202020207e2b2020202020202020
  • 2a2d2a414c4c2046494c4553204f4e20
  • 2d002d002d003d003d003d0020005700
  • 2d2d2d2d2d2d2d2d2d2d2d205b205765
  • 3a3a3a204772656574696e6773203a3a
  • 3c21444f43545950452068746d6c3e0d
  • 3c68746d6c3e0d0a3c686561643e0d0a
  • 415454454e54494f4e210d0a0d0a446f
  • 416c6c20796f75722066696c65*
  • 41766f734c6f636b6572*
  • 486920436f6d70616e792c0d0a0d0a45
  • 49742773206e6f74206c61746520746f
  • 4c6f636b426974*
  • 4f6f6f70732120416c6c20796f757220
  • 54006f00200064006500630072007900
  • 546865206e6574776f726b206973204c
  • 596f7572206e6574776f726b20686173
  • 5f5f5f5f5f202020202020205f5f205f
  • efbbbf3c21444f43545950452068746d
field:"file.Ext.header_bytes" kind:wildcard
file.extensionwildcard
  • hta corpus 20 (elastic 20)
  • readme
  • txt corpus 4 (elastic 4)
field:"file.extension" kind:wildcard
file.namewildcard
  • *@*
  • *FILES_BACK*
  • *RECOVER*
  • *decrypt*
  • *read*me* corpus 3 (elastic 3)
  • *restore*file* corpus 3 (elastic 3)
  • *unlock*
field:"file.name" kind:wildcard
process.command_linewildcard
  • */deny*S-1-1-0* corpus 2 (elastic 2)
  • *?:\*" /grant*Everyone:F* corpus 2 (elastic 2)
  • *bootstatuspolicy* corpus 10 (elastic 8, sigma 1, splunk 1)
  • *catalog* corpus 12 (elastic 8, sigma 3, splunk 1)
  • *delete* corpus 31 (sigma 16, elastic 8, splunk 6, kusto 1)
  • *recoveryenabled* corpus 10 (elastic 8, sigma 1, splunk 1)
  • *resize* corpus 9 (elastic 5, sigma 3, splunk 1)
  • *shadowcopy* corpus 13 (elastic 7, sigma 3, splunk 3)
  • *shadows* corpus 11 (elastic 8, sigma 3)
  • *systemstatebackup* corpus 8 (elastic 8)
field:"CommandLine" kind:wildcard
process.pe.original_file_nameeq
  • VSSADMIN.EXE corpus 12 (elastic 9, sigma 3)
  • WBADMIN.EXE corpus 19 (elastic 11, sigma 6, splunk 2)
  • bcdedit.exe corpus 13 (elastic 11, sigma 2)
  • iCACLS.EXE corpus 5 (elastic 4, sigma 1)
  • wmic.exe corpus 80 (sigma 38, elastic 24, splunk 18)
field:"OriginalFileName" kind:eq