file_deletion_via_cmd_via_cmdline


Description

Detects "cmd" utilization to self-delete files in some critical Windows destinations. License: https://github.com/Neo23x0/sigma/blob/master/LICENSE.Detection.Rules.md.

Query · yara_l

events:
(re.regex($selection.target.process.command_line, `.*cmd.*`) and ($selection.metadata.product_event_type = "4688" or $selection.metadata.product_event_type = "1") and (re.regex($selection.target.process.command_line, `.*/c.*`) or re.regex($selection.target.process.command_line, `.*ping 127\.0\.0\.1.*`) or re.regex($selection.target.process.command_line, `.*&.*`) or re.regex($selection.target.process.command_line, `.*del.*`) or re.regex($selection.target.process.command_line, `.*/f.*`) or re.regex($selection.target.process.command_line, `.*/q.*`)) and (re.regex($selection.target.process.command_line, `.*\\Windows\\Temp.*`) or re.regex($selection.target.process.command_line, `.*\\AppData\\Roaming\\Microsoft.*`)))

  condition:
    $selection
Raw source file_deletion_via_cmd_via_cmdline · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule file_deletion_via_cmd_via_cmdline {
 meta:
    author = "Ariel Millahuel"
    description = "Detects \"cmd\" utilization to self-delete files in some critical Windows destinations.  License: https://github.com/Neo23x0/sigma/blob/master/LICENSE.Detection.Rules.md."
    reference = "https://tdm.socprime.com/tdm/info/qCfuC2GC1Se7"
    version = "0.01"
    created = "2019/11/20"
    category = "process_creation"
    product = "windows"
    mitre = "defense_evasion, t1070, t1070.004"

  events:
(re.regex($selection.target.process.command_line, `.*cmd.*`) and ($selection.metadata.product_event_type = "4688" or $selection.metadata.product_event_type = "1") and (re.regex($selection.target.process.command_line, `.*/c.*`) or re.regex($selection.target.process.command_line, `.*ping 127\.0\.0\.1.*`) or re.regex($selection.target.process.command_line, `.*&.*`) or re.regex($selection.target.process.command_line, `.*del.*`) or re.regex($selection.target.process.command_line, `.*/f.*`) or re.regex($selection.target.process.command_line, `.*/q.*`)) and (re.regex($selection.target.process.command_line, `.*\\Windows\\Temp.*`) or re.regex($selection.target.process.command_line, `.*\\AppData\\Roaming\\Microsoft.*`)))

  condition:
    $selection
}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.