hiding_files_with_attribexe


Description

Detects usage of attrib.exe to hide files from users. License: https://github.com/Neo23x0/sigma/blob/master/LICENSE.Detection.Rules.md.

Query · yara_l

events:
((re.regex($selection.target.process.file.full_path, `.*\\attrib\.exe`) and re.regex($selection.target.process.command_line, `.* \+h .*`) and ($selection.metadata.product_event_type = "4688" or $selection.metadata.product_event_type = "1")) and not ((re.regex($selection.target.process.command_line, `.*\\desktop\.ini .*`) or (re.regex($selection.principal.process.file.full_path, `.*\\cmd\.exe`) and re.regex($selection.target.process.command_line, `\+R \+H \+S \+A \\.*\.cui`) and re.regex($selection.principal.process.command_line, `C:\\WINDOWS\\system32\\.*\.bat`)))))

  condition:
    $selection
Raw source hiding_files_with_attribexe · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule hiding_files_with_attribexe {
 meta:
    author = "Sami Ruohonen"
    description = "Detects usage of attrib.exe to hide files from users.  License: https://github.com/Neo23x0/sigma/blob/master/LICENSE.Detection.Rules.md."
    reference = "https://tdm.socprime.com/tdm/info/jQlXqmmOmwCE"
    version = "0.01"
    created = "2021-03-09"
    category = "process_creation"
    product = "windows"
    mitre = "defense_evasion, persistence, t1158"

  events:
((re.regex($selection.target.process.file.full_path, `.*\\attrib\.exe`) and re.regex($selection.target.process.command_line, `.* \+h .*`) and ($selection.metadata.product_event_type = "4688" or $selection.metadata.product_event_type = "1")) and not ((re.regex($selection.target.process.command_line, `.*\\desktop\.ini .*`) or (re.regex($selection.principal.process.file.full_path, `.*\\cmd\.exe`) and re.regex($selection.target.process.command_line, `\+R \+H \+S \+A \\.*\.cui`) and re.regex($selection.principal.process.command_line, `C:\\WINDOWS\\system32\\.*\.bat`)))))

  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.