Detection rules › Sigma

Hiding Files with Attrib.exe

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Sami Ruohonen
Source
github.com/SigmaHQ/sigma

Detects usage of attrib.exe to hide files from users.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Hiding Files with Attrib.exe
id: 4281cb20-2994-4580-aa63-c8b86d019934
status: test
description: Detects usage of attrib.exe to hide files from users.
references:
    - https://unit42.paloaltonetworks.com/unit42-sure-ill-take-new-combojack-malware-alters-clipboards-steal-cryptocurrency/
    - https://www.uptycs.com/blog/lolbins-are-no-laughing-matter
author: Sami Ruohonen
date: 2019-01-16
modified: 2023-03-14
tags:
    - attack.stealth
    - attack.t1564.001
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\attrib.exe'
        - OriginalFileName: 'ATTRIB.EXE'
    selection_cli:
        CommandLine|contains: ' +h '
    filter_main_msiexec:
        CommandLine|contains: '\desktop.ini '
    filter_optional_intel:
        ParentImage|endswith: '\cmd.exe'
        CommandLine: '+R +H +S +A \\\*.cui'
        ParentCommandLine: 'C:\\WINDOWS\\system32\\\*.bat'
    condition: all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - IgfxCUIService.exe hiding *.cui files via .bat script (attrib.exe a child of cmd.exe and igfxCUIService.exe is the parent of the cmd.exe)
    - Msiexec.exe hiding desktop.ini
level: medium

Stages and Predicates

Stage 0: condition

all of selection_* and not 1 of filter_main_* and not 1 of filter_optional_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\attrib.exe'
    - OriginalFileName: 'ATTRIB.EXE'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains: ' +h '

Stage 3: not filter_main_msiexec

filter_main_msiexec:
    CommandLine|contains: '\desktop.ini '

Stage 4: not filter_optional_intel

filter_optional_intel:
    ParentImage|endswith: '\cmd.exe'
    CommandLine: '+R +H +S +A \\\*.cui'
    ParentCommandLine: 'C:\\WINDOWS\\system32\\\*.bat'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
CommandLinematch\desktop.ini
CommandLineeq+R +H +S +A \\\*.cui
ParentCommandLineeqC:\\WINDOWS\\system32\\\*.bat
ParentImageends_with\cmd.exe

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • +h corpus 2 (sigma 2)
Imageends_with
  • \attrib.exe corpus 5 (sigma 5)
OriginalFileNameeq
  • ATTRIB.EXE corpus 5 (sigma 3, elastic 2)