Latest alertCVE-2018-11776 in Apache Struts Confirmed Exploited in the WildRead
Search all news in the platform

Detection rule

Windows Defender Definition Files Removed

HighTest-data validatedSigmaHQ (community)T1685

Overview

Adversaries may disable security tools to avoid possible detection of their tools and activities by removing Windows Defender Definition Files

Rule id
9719a8aa-401c-41af-8108-ced7ec9cd75c
ATT&CK techniques
T1685 Disable or Modify Tools
Severity
High
Confidence
Low
Origin
SigmaHQ (community)
SigmaHQ status
test
Used in defense packs
n0n, The Gentlemen, qilin, INC Ransom, Akira, safepay, Play, braincipher, majinahanashi

Validation

  1. ExperimentalSyntax checked only. Not yet tested on events.
  2. Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
  3. 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) · 9719a8aa-401c-41af-8108-ced7ec9cd75c

Download
title: Windows Defender Definition Files Removed
id: 9719a8aa-401c-41af-8108-ced7ec9cd75c
status: test
description: Adversaries may disable security tools to avoid possible detection of their tools and activities by removing Windows Defender Definition Files
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1562.001/T1562.001.md
    - https://unit42.paloaltonetworks.com/unit42-gorgon-group-slithering-nation-state-cybercrime/
author: frack113
date: 2021-07-07
modified: 2023-07-18
tags:
    - attack.defense-impairment
    - attack.t1685
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\MpCmdRun.exe'
        - OriginalFileName: MpCmdRun.exe
    selection_cli:
        CommandLine|contains|all:
            - ' -RemoveDefinitions'
            - ' -All'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

QRadar 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 '%\mpcmdrun.exe' OR LOWER("Process Name") LIKE '%\mpcmdrun.exe') OR Filename='MpCmdRun.exe') AND (LOWER(Command) LIKE '% -removedefinitions%' AND LOWER(Command) LIKE '% -all%')

QRadar CRE

Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.

Rule name
OffSet7: Windows Defender Definition Files Removed
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:Windows Defender Definition Files Removed: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 Name ends with: \MpCmdRun.exe
    • Filename is equal to (case-insensitive): MpCmdRun.exe
  • BB:OffSet7:Windows Defender Definition Files Removed:selection_cli (match)
    All test lines must match (AND).
    • Command contains: -RemoveDefinitions, -All

Main rule, option A (building blocks)

  1. 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
  2. when an event matches the condition built from these building blocks: (ALL of [BB:OffSet7:Windows Defender Definition Files Removed:selection_img, BB:OffSet7:Windows Defender Definition Files Removed:selection_cli])

Main rule, option B (AQL filter test)

  1. when the event matches this AQL filter query: devicetype=12 AND ((LOWER("Process Path") LIKE '%\mpcmdrun.exe' OR LOWER("Process Name") LIKE '%\mpcmdrun.exe') OR Filename='MpCmdRun.exe') AND (LOWER(Command) LIKE '% -removedefinitions%' AND LOWER(Command) LIKE '% -all%')

Rule response

  • Severity 7, 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.

(Image="*\\MpCmdRun.exe" OR OriginalFileName="MpCmdRun.exe") CommandLine="* -RemoveDefinitions*" CommandLine="* -All*"

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

[Windows Defender Definition Files Removed]
description = Adversaries may disable security tools to avoid possible detection of their tools and activities by removing Windows Defender Definition Files
search = (Image="*\\MpCmdRun.exe" OR OriginalFileName="MpCmdRun.exe") CommandLine="* -RemoveDefinitions*" CommandLine="* -All*"

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 "\\MpCmdRun.exe" or TargetProcessFileOriginalName =~ "MpCmdRun.exe") and (TargetProcessCommandLine contains " -RemoveDefinitions" and TargetProcessCommandLine contains " -All")

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 "\\MpCmdRun.exe" or ProcessVersionInfoOriginalFileName =~ "MpCmdRun.exe") and (ProcessCommandLine contains " -RemoveDefinitions" and ProcessCommandLine contains " -All")

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:*\\MpCmdRun.exe OR process.pe.original_file_name:MpCmdRun.exe) AND (process.command_line:*\ \-RemoveDefinitions* AND process.command_line:*\ \-All*)

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:"*\\MpCmdRun.exe" or process.pe.original_file_name:"MpCmdRun.exe") and (process.command_line:"* -RemoveDefinitions*" and process.command_line:"* -All*")

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, "\\MpCmdRun.exe") or process.pe.original_file_name=="MpCmdRun.exe") and process.command_line like "* -RemoveDefinitions*" and process.command_line like "* -All*"

Required telemetry

Log source
product: windows · category: process_creation
Fields used
CommandLine Image OriginalFileName

False positives

  • Unknown

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/process_creation/proc_creation_win_mpcmdrun_remove_windows_defender_definition.yml
Upstream commit
9688134317a2
Licence
Detection Rule License (DRL) 1.1

Version history

  1. Version 1Imported from SigmaHQ
  2. OffSet7 build · SigmaHQ 9688134317a2

Related rules