Detection rules › Sigma

Portable Gpg.EXE Execution

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

Detects the execution of "gpg.exe" from uncommon location. Often used by ransomware and loaders to decrypt/encrypt data.

MITRE ATT&CK coverage

TacticTechniques
ImpactT1486 Data Encrypted for Impact

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Portable Gpg.EXE Execution
id: 77df53a5-1d78-4f32-bc5a-0e7465bd8f41
status: test
description: Detects the execution of "gpg.exe" from uncommon location. Often used by ransomware and loaders to decrypt/encrypt data.
references:
    - https://www.trendmicro.com/vinfo/vn/threat-encyclopedia/malware/ransom.bat.zarlock.a
    - https://securelist.com/locked-out/68960/
    - https://github.com/redcanaryco/atomic-red-team/blob/c4097dc7ed14d7f7d08c89d148c4307097e8c294/atomics/T1486/T1486.md
author: frack113, Nasreddine Bencherchali (Nextron Systems)
date: 2023-08-06
modified: 2023-11-10
tags:
    - attack.impact
    - attack.t1486
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        - Image|endswith:
              - '\gpg.exe'
              - '\gpg2.exe'
        - OriginalFileName: 'gpg.exe'
        - Description: 'GnuPG’s OpenPGP tool'
    filter_main_legit_location:
        Image|contains:
            - ':\Program Files (x86)\GNU\GnuPG\bin\'
            - ':\Program Files (x86)\GnuPG VS-Desktop\'
            - ':\Program Files (x86)\GnuPG\bin\'
            - ':\Program Files (x86)\Gpg4win\bin\'
    condition: selection and not 1 of filter_main_*
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_*

Stage 1: selection

selection:
    - Image|endswith:
          - '\gpg.exe'
          - '\gpg2.exe'
    - OriginalFileName: 'gpg.exe'
    - Description: 'GnuPG’s OpenPGP tool'

Stage 2: not filter_main_legit_location

filter_main_legit_location:
    Image|contains:
        - ':\Program Files (x86)\GNU\GnuPG\bin\'
        - ':\Program Files (x86)\GnuPG VS-Desktop\'
        - ':\Program Files (x86)\GnuPG\bin\'
        - ':\Program Files (x86)\Gpg4win\bin\'

Exclusions

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

FieldKindExcluded values
Imagematch:\Program Files (x86)\GNU\GnuPG\bin\
Imagematch:\Program Files (x86)\GnuPG VS-Desktop\
Imagematch:\Program Files (x86)\GnuPG\bin\
Imagematch:\Program Files (x86)\Gpg4win\bin\

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
Descriptioneq
  • GnuPG’s OpenPGP tool corpus 4 (sigma 4)
Imageends_with
  • \gpg.exe corpus 4 (sigma 4)
  • \gpg2.exe corpus 4 (sigma 4)
OriginalFileNameeq
  • gpg.exe corpus 2 (sigma 2)