Detection rules › Sigma

Set Suspicious Files as System Files Using Attrib.EXE

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects the usage of attrib with the "+s" option to set scripts or executables located in suspicious locations as system files to hide them from users and make them unable to be deleted with simple rights. The rule limits the search to specific extensions and directories to avoid FPs

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Set Suspicious Files as System Files Using Attrib.EXE
id: efec536f-72e8-4656-8960-5e85d091345b
related:
    - id: bb19e94c-59ae-4c15-8c12-c563d23fe52b
      type: derived
status: test
description: |
    Detects the usage of attrib with the "+s" option to set scripts or executables located in suspicious locations as system files to hide them from users and make them unable to be deleted with simple rights. The rule limits the search to specific extensions and directories to avoid FPs
references:
    - https://app.any.run/tasks/c28cabc8-a19f-40f3-a78b-cae506a5c0d4
    - https://app.any.run/tasks/cfc8870b-ccd7-4210-88cf-a8087476a6d0
    - https://unit42.paloaltonetworks.com/unit42-sure-ill-take-new-combojack-malware-alters-clipboards-steal-cryptocurrency/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-06-28
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: ' +s'
    selection_paths:
        CommandLine|contains:
            - ' %' # Custom Environment variable
            - '\Users\Public\'
            - '\AppData\Local\'
            - '\ProgramData\'
            - '\Downloads\'
            - '\Windows\Temp\'
    selection_ext:
        CommandLine|contains:
            - '.bat'
            - '.dll'
            - '.exe'
            - '.hta'
            - '.ps1'
            - '.vbe'
            - '.vbs'
    filter_optional_installer:
        CommandLine|contains|all:
            - '\Windows\TEMP\'
            - '.exe'
    condition: all of selection* and not 1 of filter_optional_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection* 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: ' +s'

Stage 3: selection_paths

selection_paths:
    CommandLine|contains:
        - ' %'
        - '\Users\Public\'
        - '\AppData\Local\'
        - '\ProgramData\'
        - '\Downloads\'
        - '\Windows\Temp\'

Stage 4: selection_ext

selection_ext:
    CommandLine|contains:
        - '.bat'
        - '.dll'
        - '.exe'
        - '.hta'
        - '.ps1'
        - '.vbe'
        - '.vbs'

Stage 5: not filter_optional_installer

filter_optional_installer:
    CommandLine|contains|all:
        - '\Windows\TEMP\'
        - '.exe'

Exclusions

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

FieldKindExcluded values
CommandLinematch.exe
CommandLinematch\Windows\TEMP\

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
  • %
  • +s
  • .bat corpus 11 (sigma 9, elastic 1, kusto 1)
  • .dll corpus 16 (sigma 16)
  • .exe corpus 5 (sigma 5)
  • .hta corpus 6 (sigma 6)
  • .ps1 corpus 4 (sigma 3, elastic 1)
  • .vbe corpus 5 (sigma 5)
  • .vbs corpus 7 (sigma 7)
  • \AppData\Local\ corpus 10 (sigma 10)
  • \Downloads\ corpus 14 (sigma 14)
  • \ProgramData\ corpus 3 (sigma 3)
  • \Users\Public\ corpus 17 (sigma 17)
  • \Windows\Temp\ corpus 12 (sigma 12)
Imageends_with
  • \attrib.exe corpus 5 (sigma 5)
OriginalFileNameeq
  • ATTRIB.EXE corpus 5 (sigma 3, elastic 2)