Detection rule
Fsutil Suspicious Invocation
Overview
Detects suspicious parameters of fsutil (deleting USN journal, configuring it with small size, etc). Might be used by ransomwares during the attack (seen by NotPetya and others).
- Rule id
add64136-62e5-48ea-807e-88638d02df1e- ATT&CK techniques
- T1070 Indicator Removal, T1485 Data Destruction
- Severity
- High
- Confidence
- Medium
- Origin
- SigmaHQ (community)
- SigmaHQ status
stable- Used in defense packs
- The Gentlemen, qilin, safepay, Play, nightspire, 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.
2 of 2 positive test events matched; 1 of 1 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) · add64136-62e5-48ea-807e-88638d02df1e
title: Fsutil Suspicious Invocation
id: add64136-62e5-48ea-807e-88638d02df1e
status: stable
description: |
Detects suspicious parameters of fsutil (deleting USN journal, configuring it with small size, etc).
Might be used by ransomwares during the attack (seen by NotPetya and others).
references:
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-usn
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070/T1070.md
- https://eqllib.readthedocs.io/en/latest/analytics/c91f422a-5214-4b17-8664-c5fcf115c0a2.html
- https://github.com/albertzsigovits/malware-notes/blob/558898932c1579ff589290092a2c8febefc3a4c9/Ransomware/Lockbit.md
- https://blog.cluster25.duskrise.com/2023/05/22/back-in-black-blackbyte-nt
author: Ecco, E.M. Anhaus, oscd.community
date: 2019-09-26
modified: 2023-09-09
tags:
- attack.impact
- attack.stealth
- attack.t1070
- attack.t1485
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: '\fsutil.exe'
- OriginalFileName: 'fsutil.exe'
selection_cli:
CommandLine|contains:
- 'deletejournal' # usn deletejournal ==> generally ransomware or attacker
- 'createjournal' # usn createjournal ==> can modify config to set it to a tiny size
- 'setZeroData' # file setZeroData ==> empties a file with zeroes
condition: all of selection_*
falsepositives:
- Admin activity
- Scripts and administrative tools used in the monitored environment
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_fsutil_usage/info.ymlQRadar 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("Process Path") LIKE '%\fsutil.exe' OR LOWER("Process Name") LIKE '%\fsutil.exe') OR Filename='fsutil.exe') AND (LOWER(Command) LIKE '%deletejournal%' OR LOWER(Command) LIKE '%createjournal%' OR LOWER(Command) LIKE '%setzerodata%')QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Fsutil Suspicious Invocation- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:Fsutil Suspicious Invocation:selection_img(match)Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.Process Path / Process Nameends with:\fsutil.exeFilenameis equal to (case-insensitive):fsutil.exe
BB:OffSet7:Fsutil Suspicious Invocation:selection_cli(match)All test lines must match (AND).Commandcontains:deletejournal,createjournal,setZeroData
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
(ALL of [BB:OffSet7:Fsutil Suspicious Invocation:selection_img, BB:OffSet7:Fsutil Suspicious Invocation:selection_cli])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND ((LOWER("Process Path") LIKE '%\fsutil.exe' OR LOWER("Process Name") LIKE '%\fsutil.exe') OR Filename='fsutil.exe') AND (LOWER(Command) LIKE '%deletejournal%' OR LOWER(Command) LIKE '%createjournal%' OR LOWER(Command) LIKE '%setzerodata%')
Rule response
- Severity 7, credibility 8, 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.
(Image="*\\fsutil.exe" OR OriginalFileName="fsutil.exe") (CommandLine IN ("*deletejournal*", "*createjournal*", "*setZeroData*"))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
[Fsutil Suspicious Invocation]
description = Detects suspicious parameters of fsutil (deleting USN journal, configuring it with small size, etc).Might be used by ransomwares during the attack (seen by NotPetya and others).
search = (Image="*\\fsutil.exe" OR OriginalFileName="fsutil.exe") (CommandLine IN ("*deletejournal*", "*createjournal*", "*setZeroData*"))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.
imProcessCreate
| where (TargetProcessName endswith "\\fsutil.exe" or TargetProcessFileOriginalName =~ "fsutil.exe") and (TargetProcessCommandLine contains "deletejournal" or TargetProcessCommandLine contains "createjournal" or TargetProcessCommandLine contains "setZeroData")Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where (FolderPath endswith "\\fsutil.exe" or ProcessVersionInfoOriginalFileName =~ "fsutil.exe") and (ProcessCommandLine contains "deletejournal" or ProcessCommandLine contains "createjournal" or ProcessCommandLine contains "setZeroData")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.
(process.executable:*\\fsutil.exe OR process.pe.original_file_name:fsutil.exe) AND (process.command_line:(*deletejournal* OR *createjournal* OR *setZeroData*))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 (process.executable:"*\\fsutil.exe" or process.pe.original_file_name:"fsutil.exe") and (process.command_line like~ ("*deletejournal*", "*createjournal*", "*setZeroData*"))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(process.executable, "\\fsutil.exe") or process.pe.original_file_name=="fsutil.exe") and (process.command_line like "*deletejournal*" or process.command_line like "*createjournal*" or process.command_line like "*setZeroData*")Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageOriginalFileName
False positives
- Admin activity
- Scripts and administrative tools used in the monitored environment
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
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-usn
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1070/T1070.md
- https://eqllib.readthedocs.io/en/latest/analytics/c91f422a-5214-4b17-8664-c5fcf115c0a2.html
- https://github.com/albertzsigovits/malware-notes/blob/558898932c1579ff589290092a2c8febefc3a4c9/Ransomware/Lockbit.md
- https://blog.cluster25.duskrise.com/2023/05/22/back-in-black-blackbyte-nt
Author and attribution
- Author
- Ecco, E.M. Anhaus, oscd.community
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_fsutil_usage.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2