Detection rules › Sigma

File Encryption/Decryption Via Gpg4win From Suspicious Locations

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

Detects usage of Gpg4win to encrypt/decrypt files located in potentially suspicious locations.

MITRE ATT&CK coverage

TacticTechniques
ExecutionNo specific technique

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: File Encryption/Decryption Via Gpg4win From Suspicious Locations
id: e1e0b7d7-e10b-4ee4-ac49-a4bda05d320d
status: test
description: Detects usage of Gpg4win to encrypt/decrypt files located in potentially suspicious locations.
references:
    - https://blogs.vmware.com/security/2022/11/batloader-the-evasive-downloader-malware.html
    - https://news.sophos.com/en-us/2022/01/19/zloader-installs-remote-access-backdoors-and-delivers-cobalt-strike/
author: Nasreddine Bencherchali (Nextron Systems), X__Junior (Nextron Systems)
date: 2022-11-30
modified: 2023-08-09
tags:
    - attack.execution
logsource:
    category: process_creation
    product: windows
detection:
    selection_metadata:
        - Image|endswith:
              - '\gpg.exe'
              - '\gpg2.exe'
        - Product: 'GNU Privacy Guard (GnuPG)'
        - Description: 'GnuPG’s OpenPGP tool'
    selection_cli:
        CommandLine|contains: '-passphrase'
    selection_paths:
        CommandLine|contains:
            - ':\PerfLogs\'
            - ':\Temp\'
            - ':\Users\Public\'
            - ':\Windows\Temp\'
            - '\AppData\Local\Temp\'
            - '\AppData\Roaming\'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_metadata

selection_metadata:
    - Image|endswith:
          - '\gpg.exe'
          - '\gpg2.exe'
    - Product: 'GNU Privacy Guard (GnuPG)'
    - Description: 'GnuPG’s OpenPGP tool'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains: '-passphrase'

Stage 3: selection_paths

selection_paths:
    CommandLine|contains:
        - ':\PerfLogs\'
        - ':\Temp\'
        - ':\Users\Public\'
        - ':\Windows\Temp\'
        - '\AppData\Local\Temp\'
        - '\AppData\Roaming\'

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
  • -passphrase
  • :\PerfLogs\ corpus 11 (sigma 11)
  • :\Temp\ corpus 14 (sigma 14)
  • :\Users\Public\ corpus 18 (sigma 18)
  • :\Windows\Temp\ corpus 16 (sigma 16)
  • \AppData\Local\Temp\ corpus 26 (sigma 26)
  • \AppData\Roaming\ corpus 16 (sigma 16)
Descriptioneq
  • GnuPG’s OpenPGP tool corpus 4 (sigma 4)
Imageends_with
  • \gpg.exe corpus 4 (sigma 4)
  • \gpg2.exe corpus 4 (sigma 4)
Producteq
  • GNU Privacy Guard (GnuPG)