Detection rule
Suspicious Appended Extension
Overview
Detects file renames where the target filename uses an uncommon double extension. Could indicate potential ransomware activity renaming files and adding a custom extension to the encrypted files, such as ".jpg.crypted", ".docx.locky", etc.
- Rule id
e3f673b3-65d1-4d80-9146-466f8b63fa99- ATT&CK techniques
- T1486 Data Encrypted for Impact
- Severity
- Medium
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- n0n, The Gentlemen, qilin, INC Ransom, Akira, safepay, rhysida, Play, everest, nightspire, braincipher, majinahanashi
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
1 of 1 positive test events matched; 3 of 3 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · e3f673b3-65d1-4d80-9146-466f8b63fa99
title: Suspicious Appended Extension
id: e3f673b3-65d1-4d80-9146-466f8b63fa99
status: test
description: Detects file renames where the target filename uses an uncommon double extension. Could indicate potential ransomware activity renaming files and adding a custom extension to the encrypted files, such as ".jpg.crypted", ".docx.locky", etc.
references:
- https://app.any.run/tasks/d66ead5a-faf4-4437-93aa-65785afaf9e5/
- https://blog.cyble.com/2022/08/10/onyx-ransomware-renames-its-leak-site-to-vsop/
author: frack113
date: 2022-07-16
modified: 2023-11-11
tags:
- attack.impact
- attack.t1486
logsource:
product: windows
category: file_rename
definition: 'Requirements: Microsoft-Windows-Kernel-File Provider with at least the KERNEL_FILE_KEYWORD_RENAME_SETLINK_PATH keyword'
detection:
selection:
SourceFilename|endswith:
- '.doc'
- '.docx'
- '.jpeg'
- '.jpg'
- '.lnk'
- '.pdf'
- '.png'
- '.pst'
- '.rtf'
- '.xls'
- '.xlsx'
TargetFilename|contains:
- '.doc.'
- '.docx.'
- '.jpeg.'
- '.jpg.'
- '.lnk.'
- '.pdf.'
- '.png.'
- '.pst.'
- '.rtf.'
- '.xls.'
- '.xlsx.'
filter_main_generic:
TargetFilename|endswith:
# Note: Please add more used extensions by backup or recovery software
- '.backup'
- '.bak'
- '.old'
- '.orig'
- '.temp'
- '.tmp'
filter_optional_anaconda:
TargetFilename|contains: ':\ProgramData\Anaconda3\'
TargetFilename|endswith: '.c~'
condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
- Backup software
level: mediumQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND ((LOWER(filename) LIKE '%.doc' OR LOWER(filename) LIKE '%.docx' OR LOWER(filename) LIKE '%.jpeg' OR LOWER(filename) LIKE '%.jpg' OR LOWER(filename) LIKE '%.lnk' OR LOWER(filename) LIKE '%.pdf' OR LOWER(filename) LIKE '%.png' OR LOWER(filename) LIKE '%.pst' OR LOWER(filename) LIKE '%.rtf' OR LOWER(filename) LIKE '%.xls' OR LOWER(filename) LIKE '%.xlsx') AND (LOWER(Filename) LIKE '%.doc.%' OR LOWER(Filename) LIKE '%.docx.%' OR LOWER(Filename) LIKE '%.jpeg.%' OR LOWER(Filename) LIKE '%.jpg.%' OR LOWER(Filename) LIKE '%.lnk.%' OR LOWER(Filename) LIKE '%.pdf.%' OR LOWER(Filename) LIKE '%.png.%' OR LOWER(Filename) LIKE '%.pst.%' OR LOWER(Filename) LIKE '%.rtf.%' OR LOWER(Filename) LIKE '%.xls.%' OR LOWER(Filename) LIKE '%.xlsx.%')) AND (NOT((LOWER(Filename) LIKE '%.backup' OR LOWER(Filename) LIKE '%.bak' OR LOWER(Filename) LIKE '%.old' OR LOWER(Filename) LIKE '%.orig' OR LOWER(Filename) LIKE '%.temp' OR LOWER(Filename) LIKE '%.tmp'))) AND (NOT((LOWER(Filename) LIKE '%:\programdata\anaconda3\%' AND LOWER(Filename) LIKE '%.c~')))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Suspicious Appended Extension- Rule type
- Event rule (Local)
- Log source types
- EDR / Sysmon file rename events (Sysmon has no rename event; needs an EDR DSM)
Building blocks
BB:OffSet7:Suspicious Appended Extension:selection(match)All test lines must match (AND).filenameends with:.doc,.docx,.jpeg,.jpg,.lnk,.pdf,.png,.pst,.rtf,.xls,.xlsxFilenamecontains:.doc.,.docx.,.jpeg.,.jpg.,.lnk.,.pdf.,.png.,.pst.,.rtf.,.xls.,.xlsx.
BB:OffSet7:Suspicious Appended Extension:filter_main_generic(exclusion)All test lines must match (AND).Filenameends with:.backup,.bak,.old,.orig,.temp,.tmp
BB:OffSet7:Suspicious Appended Extension:filter_optional_anaconda(exclusion)All test lines must match (AND).Filenamecontains::\ProgramData\Anaconda3\Filenameends with:.c~
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
EDR / Sysmon file rename events (Sysmon has no rename event; needs an EDR DSM) - when an event matches the condition built from these building blocks:
BB:OffSet7:Suspicious Appended Extension:selection AND NOT (ANY of [BB:OffSet7:Suspicious Appended Extension:filter_main_generic]) AND NOT (ANY of [BB:OffSet7:Suspicious Appended Extension:filter_optional_anaconda])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND ((LOWER(filename) LIKE '%.doc' OR LOWER(filename) LIKE '%.docx' OR LOWER(filename) LIKE '%.jpeg' OR LOWER(filename) LIKE '%.jpg' OR LOWER(filename) LIKE '%.lnk' OR LOWER(filename) LIKE '%.pdf' OR LOWER(filename) LIKE '%.png' OR LOWER(filename) LIKE '%.pst' OR LOWER(filename) LIKE '%.rtf' OR LOWER(filename) LIKE '%.xls' OR LOWER(filename) LIKE '%.xlsx') AND (LOWER(Filename) LIKE '%.doc.%' OR LOWER(Filename) LIKE '%.docx.%' OR LOWER(Filename) LIKE '%.jpeg.%' OR LOWER(Filename) LIKE '%.jpg.%' OR LOWER(Filename) LIKE '%.lnk.%' OR LOWER(Filename) LIKE '%.pdf.%' OR LOWER(Filename) LIKE '%.png.%' OR LOWER(Filename) LIKE '%.pst.%' OR LOWER(Filename) LIKE '%.rtf.%' OR LOWER(Filename) LIKE '%.xls.%' OR LOWER(Filename) LIKE '%.xlsx.%')) AND (NOT((LOWER(Filename) LIKE '%.backup' OR LOWER(Filename) LIKE '%.bak' OR LOWER(Filename) LIKE '%.old' OR LOWER(Filename) LIKE '%.orig' OR LOWER(Filename) LIKE '%.temp' OR LOWER(Filename) LIKE '%.tmp'))) AND (NOT((LOWER(Filename) LIKE '%:\programdata\anaconda3\%' AND LOWER(Filename) LIKE '%.c~')))
Rule response
- Severity 5, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
(SourceFilename IN ("*.doc", "*.docx", "*.jpeg", "*.jpg", "*.lnk", "*.pdf", "*.png", "*.pst", "*.rtf", "*.xls", "*.xlsx")) (TargetFilename IN ("*.doc.*", "*.docx.*", "*.jpeg.*", "*.jpg.*", "*.lnk.*", "*.pdf.*", "*.png.*", "*.pst.*", "*.rtf.*", "*.xls.*", "*.xlsx.*")) NOT (TargetFilename IN ("*.backup", "*.bak", "*.old", "*.orig", "*.temp", "*.tmp")) NOT (TargetFilename="*:\\ProgramData\\Anaconda3\\*" TargetFilename="*.c~")Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Suspicious Appended Extension]
description = Detects file renames where the target filename uses an uncommon double extension. Could indicate potential ransomware activity renaming files and adding a custom extension to the encrypted files, such as ".jpg.crypted", ".docx.locky", etc.
search = (SourceFilename IN ("*.doc", "*.docx", "*.jpeg", "*.jpg", "*.lnk", "*.pdf", "*.png", "*.pst", "*.rtf", "*.xls", "*.xlsx")) (TargetFilename IN ("*.doc.*", "*.docx.*", "*.jpeg.*", "*.jpg.*", "*.lnk.*", "*.pdf.*", "*.png.*", "*.pst.*", "*.rtf.*", "*.xls.*", "*.xlsx.*")) NOT (TargetFilename IN ("*.backup", "*.bak", "*.old", "*.orig", "*.temp", "*.tmp")) NOT (TargetFilename="*:\\ProgramData\\Anaconda3\\*" TargetFilename="*.c~")Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imFileEvent
| where ((SrcFilePath endswith ".doc" or SrcFilePath endswith ".docx" or SrcFilePath endswith ".jpeg" or SrcFilePath endswith ".jpg" or SrcFilePath endswith ".lnk" or SrcFilePath endswith ".pdf" or SrcFilePath endswith ".png" or SrcFilePath endswith ".pst" or SrcFilePath endswith ".rtf" or SrcFilePath endswith ".xls" or SrcFilePath endswith ".xlsx") and (TargetFileName contains ".doc." or TargetFileName contains ".docx." or TargetFileName contains ".jpeg." or TargetFileName contains ".jpg." or TargetFileName contains ".lnk." or TargetFileName contains ".pdf." or TargetFileName contains ".png." or TargetFileName contains ".pst." or TargetFileName contains ".rtf." or TargetFileName contains ".xls." or TargetFileName contains ".xlsx.")) and (not((TargetFileName endswith ".backup" or TargetFileName endswith ".bak" or TargetFileName endswith ".old" or TargetFileName endswith ".orig" or TargetFileName endswith ".temp" or TargetFileName endswith ".tmp"))) and (not((TargetFileName contains ":\\ProgramData\\Anaconda3\\" and TargetFileName endswith ".c~")))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceFileEvents
| where ((PreviousFileName endswith ".doc" or PreviousFileName endswith ".docx" or PreviousFileName endswith ".jpeg" or PreviousFileName endswith ".jpg" or PreviousFileName endswith ".lnk" or PreviousFileName endswith ".pdf" or PreviousFileName endswith ".png" or PreviousFileName endswith ".pst" or PreviousFileName endswith ".rtf" or PreviousFileName endswith ".xls" or PreviousFileName endswith ".xlsx") and (FolderPath contains ".doc." or FolderPath contains ".docx." or FolderPath contains ".jpeg." or FolderPath contains ".jpg." or FolderPath contains ".lnk." or FolderPath contains ".pdf." or FolderPath contains ".png." or FolderPath contains ".pst." or FolderPath contains ".rtf." or FolderPath contains ".xls." or FolderPath contains ".xlsx.")) and (not((FolderPath endswith ".backup" or FolderPath endswith ".bak" or FolderPath endswith ".old" or FolderPath endswith ".orig" or FolderPath endswith ".temp" or FolderPath endswith ".tmp"))) and (not((FolderPath contains ":\\ProgramData\\Anaconda3\\" and FolderPath endswith ".c~")))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
((winlog.event_data.SourceFilename:(*.doc OR *.docx OR *.jpeg OR *.jpg OR *.lnk OR *.pdf OR *.png OR *.pst OR *.rtf OR *.xls OR *.xlsx)) AND (file.path:(*.doc.* OR *.docx.* OR *.jpeg.* OR *.jpg.* OR *.lnk.* OR *.pdf.* OR *.png.* OR *.pst.* OR *.rtf.* OR *.xls.* OR *.xlsx.*))) AND (NOT (file.path:(*.backup OR *.bak OR *.old OR *.orig OR *.temp OR *.tmp))) AND (NOT (file.path:*\:\\ProgramData\\Anaconda3\\* AND file.path:*.c\~))Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where ((winlog.event_data.SourceFilename like~ ("*.doc", "*.docx", "*.jpeg", "*.jpg", "*.lnk", "*.pdf", "*.png", "*.pst", "*.rtf", "*.xls", "*.xlsx")) and (file.path like~ ("*.doc.*", "*.docx.*", "*.jpeg.*", "*.jpg.*", "*.lnk.*", "*.pdf.*", "*.png.*", "*.pst.*", "*.rtf.*", "*.xls.*", "*.xlsx.*"))) and (not (file.path like~ ("*.backup", "*.bak", "*.old", "*.orig", "*.temp", "*.tmp"))) and (not (file.path:"*:\\ProgramData\\Anaconda3\\*" and file.path:"*.c~"))Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where (ends_with(winlog.event_data.SourceFilename, ".doc") or ends_with(winlog.event_data.SourceFilename, ".docx") or ends_with(winlog.event_data.SourceFilename, ".jpeg") or ends_with(winlog.event_data.SourceFilename, ".jpg") or ends_with(winlog.event_data.SourceFilename, ".lnk") or ends_with(winlog.event_data.SourceFilename, ".pdf") or ends_with(winlog.event_data.SourceFilename, ".png") or ends_with(winlog.event_data.SourceFilename, ".pst") or ends_with(winlog.event_data.SourceFilename, ".rtf") or ends_with(winlog.event_data.SourceFilename, ".xls") or ends_with(winlog.event_data.SourceFilename, ".xlsx")) and (file.path like "*.doc.*" or file.path like "*.docx.*" or file.path like "*.jpeg.*" or file.path like "*.jpg.*" or file.path like "*.lnk.*" or file.path like "*.pdf.*" or file.path like "*.png.*" or file.path like "*.pst.*" or file.path like "*.rtf.*" or file.path like "*.xls.*" or file.path like "*.xlsx.*") and not (ends_with(file.path, ".backup") or ends_with(file.path, ".bak") or ends_with(file.path, ".old") or ends_with(file.path, ".orig") or ends_with(file.path, ".temp") or ends_with(file.path, ".tmp")) and not (file.path like "*:\\\\ProgramData\\\\Anaconda3\\\\*" and ends_with(file.path, ".c~"))Required telemetry
- Log source
product: windows · category: file_rename · definition: Requirements: Microsoft-Windows-Kernel-File Provider with at least the KERNEL_FILE_KEYWORD_RENAME_SETLINK_PATH keyword- Fields used
SourceFilenameTargetFilename
False positives
- Backup software
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
Author and attribution
- Author
- frack113
- Source
- SigmaHQ ·
rules/windows/file/file_rename/file_rename_win_ransomware.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2