Detection rules › Sigma

Suspicious DLL Loaded via CertOC.EXE

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

Detects when a user installs certificates by using CertOC.exe to load the target DLL file.

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Suspicious DLL Loaded via CertOC.EXE
id: 84232095-ecca-4015-b0d7-7726507ee793
related:
    - id: 242301bc-f92f-4476-8718-78004a6efd9f
      type: similar
status: test
description: Detects when a user installs certificates by using CertOC.exe to load the target DLL file.
references:
    - https://twitter.com/sblmsrsn/status/1445758411803480072?s=20
    - https://github.com/elastic/protections-artifacts/commit/746086721fd385d9f5c6647cada1788db4aea95f#diff-fe98e74189873d6df72a15df2eaa0315c59ba9cdaca93ecd68afc4ea09194ef2
    - https://lolbas-project.github.io/lolbas/Binaries/Certoc/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-02-15
modified: 2024-03-05
tags:
    - attack.stealth
    - attack.t1218
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\certoc.exe'
        - OriginalFileName: 'CertOC.exe'
    selection_cli:
        CommandLine|contains|windash: ' -LoadDLL '
    selection_paths:
        CommandLine|contains:
            - '\Appdata\Local\Temp\'
            - '\Desktop\'
            - '\Downloads\'
            - '\Users\Public\'
            - 'C:\Windows\Tasks\'
            - 'C:\Windows\Temp\'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\certoc.exe'
    - OriginalFileName: 'CertOC.exe'

Stage 2: selection_cli

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

Stage 3: selection_paths

selection_paths:
    CommandLine|contains:
        - '\Appdata\Local\Temp\'
        - '\Desktop\'
        - '\Downloads\'
        - '\Users\Public\'
        - 'C:\Windows\Tasks\'
        - 'C:\Windows\Temp\'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -LoadDLL transforms: windash corpus 2 (sigma 2)
  • C:\Windows\Tasks\
  • C:\Windows\Temp\ corpus 7 (sigma 7)
  • \Appdata\Local\Temp\ corpus 28 (sigma 26, elastic 2)
  • \Desktop\ corpus 13 (sigma 13)
  • \Downloads\ corpus 15 (sigma 14, elastic 1)
  • \Users\Public\ corpus 18 (sigma 17, elastic 1)
field:"CommandLine" kind:match
Imageends_with
  • \certoc.exe corpus 10 (sigma 10)
field:"Image" kind:ends_with value:"\certoc.exe"
OriginalFileNameeq
  • CertOC.exe corpus 9 (sigma 6, elastic 3)
field:"OriginalFileName" kind:eq value:"CertOC.exe"