Detection rules › Sigma

Suspicious File Encoded To Base64 Via Certutil.EXE

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

Detects the execution of certutil with the "encode" flag to encode a file to base64 where the extensions of the file is suspicious

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Suspicious File Encoded To Base64 Via Certutil.EXE
id: ea0cdc3e-2239-4f26-a947-4e8f8224e464
related:
    - id: e62a9f0c-ca1e-46b2-85d5-a6da77f86d1a
      type: derived
status: test
description: Detects the execution of certutil with the "encode" flag to encode a file to base64 where the extensions of the file is suspicious
references:
    - https://www.virustotal.com/gui/file/35c22725a92d5cb1016b09421c0a6cdbfd860fd4778b3313669b057d4a131cb7/behavior
    - https://www.virustotal.com/gui/file/427616528b7dbc4a6057ac89eb174a3a90f7abcf3f34e5a359b7a910d82f7a72/behavior
    - https://www.virustotal.com/gui/file/34de4c8beded481a4084a1fd77855c3e977e8ac643e5c5842d0f15f7f9b9086f/behavior
    - https://www.virustotal.com/gui/file/4abe1395a09fda06d897a9c4eb247278c1b6cddda5d126ce5b3f4f499e3b8fa2/behavior
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-15
modified: 2024-03-05
tags:
    - attack.stealth
    - attack.t1027
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\certutil.exe'
        - OriginalFileName: 'CertUtil.exe'
    selection_cli:
        CommandLine|contains|windash: '-encode'
    selection_extension:
        CommandLine|contains:
            - '.acl'
            - '.bat'
            - '.doc'
            - '.gif'
            - '.jpeg'
            - '.jpg'
            - '.mp3'
            - '.pdf'
            - '.png'
            - '.ppt'
            - '.tmp'
            - '.xls'
            - '.xml'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_certutil_encode_susp_extensions/info.yml

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\certutil.exe'
    - OriginalFileName: 'CertUtil.exe'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains|windash: '-encode'

Stage 3: selection_extension

selection_extension:
    CommandLine|contains:
        - '.acl'
        - '.bat'
        - '.doc'
        - '.gif'
        - '.jpeg'
        - '.jpg'
        - '.mp3'
        - '.pdf'
        - '.png'
        - '.ppt'
        - '.tmp'
        - '.xls'
        - '.xml'

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
  • -encode transforms: windash corpus 3 (sigma 3)
  • .acl
  • .bat corpus 11 (sigma 9, elastic 1, kusto 1)
  • .doc corpus 4 (sigma 4)
  • .gif corpus 8 (sigma 8)
  • .jpeg corpus 6 (sigma 6)
  • .jpg corpus 7 (sigma 7)
  • .mp3 corpus 2 (sigma 2)
  • .pdf corpus 3 (sigma 3)
  • .png corpus 7 (sigma 7)
  • .ppt corpus 4 (sigma 4)
  • .tmp corpus 3 (sigma 3)
  • .xls corpus 4 (sigma 4)
  • .xml corpus 6 (sigma 4, splunk 2)
Imageends_with
  • \certutil.exe corpus 43 (sigma 43)
OriginalFileNameeq
  • CertUtil.exe corpus 21 (sigma 14, splunk 6, elastic 1)