Detection rules › Sigma

Office Macro File Creation

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

Detects the creation of a new office macro files on the systems

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1566.001 Phishing: Spearphishing Attachment

Event coverage

ProviderEventTitle
SysmonEvent ID 11FileCreate

Rule body yaml

title: Office Macro File Creation
id: 91174a41-dc8f-401b-be89-7bfc140612a0
related:
    - id: 0e29e3a7-1ad8-40aa-b691-9f82ecd33d66
      type: similar
status: test
description: Detects the creation of a new office macro files on the systems
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1566.001/T1566.001.md
    - https://learn.microsoft.com/en-us/deployoffice/compat/office-file-format-reference
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-01-23
modified: 2026-01-09
tags:
    - attack.initial-access
    - attack.t1566.001
logsource:
    category: file_event
    product: windows
detection:
    selection:
        TargetFilename|endswith:
            - '.docm'
            - '.dotm'
            - '.xlsm'
            - '.xltm'
            - '.potm'
            - '.pptm'
    filter_main_office:
        Image|startswith:
            - 'C:\Program Files\Microsoft Office\'
            - 'C:\Program Files (x86)\Microsoft Office\'
        Image|endswith:
            - '\WINWORD.EXE'
            - '\EXCEL.EXE'
            - '\POWERPNT.EXE'
        TargetFilename|contains: '\~$' # Temporary files created by Office applications
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Very common in environments that rely heavily on macro documents
level: low

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_*

Stage 1: selection

selection:
    TargetFilename|endswith:
        - '.docm'
        - '.dotm'
        - '.xlsm'
        - '.xltm'
        - '.potm'
        - '.pptm'

Stage 2: not filter_main_office

filter_main_office:
    Image|startswith:
        - 'C:\Program Files\Microsoft Office\'
        - 'C:\Program Files (x86)\Microsoft Office\'
    Image|endswith:
        - '\WINWORD.EXE'
        - '\EXCEL.EXE'
        - '\POWERPNT.EXE'
    TargetFilename|contains: '\~$'

Exclusions

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

FieldKindExcluded values
Imageends_with\EXCEL.EXE
Imageends_with\POWERPNT.EXE
Imageends_with\WINWORD.EXE
Imagestarts_withC:\Program Files (x86)\Microsoft Office\
Imagestarts_withC:\Program Files\Microsoft Office\
TargetFilenamematch\~$

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
TargetFilenameends_with
  • .docm corpus 4 (sigma 4)
  • .dotm corpus 4 (sigma 4)
  • .potm corpus 3 (sigma 3)
  • .pptm corpus 3 (sigma 3)
  • .xlsm corpus 4 (sigma 4)
  • .xltm corpus 4 (sigma 4)