Detection rules › Sigma

Potential Data Exfiltration Via Curl.EXE

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Florian Roth (Nextron Systems), Cedric MAURUGEON (Update)
Source
github.com/SigmaHQ/sigma

Detects the execution of the "curl" process with "upload" flags. Which might indicate potential data exfiltration

MITRE ATT&CK coverage

TacticTechniques
Command & ControlT1105 Ingress Tool Transfer
ExfiltrationT1567 Exfiltration Over Web Service

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Potential Data Exfiltration Via Curl.EXE
id: 00bca14a-df4e-4649-9054-3f2aa676bc04
status: test
description: Detects the execution of the "curl" process with "upload" flags. Which might indicate potential data exfiltration
references:
    - https://twitter.com/d1r4c/status/1279042657508081664
    - https://medium.com/@petehouston/upload-files-with-curl-93064dcccc76
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1105/T1105.md#atomic-test-19---curl-upload-file
    - https://curl.se/docs/manpage.html
author: Florian Roth (Nextron Systems), Cedric MAURUGEON (Update)
date: 2020-07-03
modified: 2023-05-02
tags:
    - attack.exfiltration
    - attack.command-and-control
    - attack.t1567
    - attack.t1105
    - detection.threat-hunting
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\curl.exe'
        - Product: 'The curl executable'
    selection_cli:
        - CommandLine|contains:
              - ' --form' # Also covers the "--form-string"
              - ' --upload-file '
              - ' --data '
              - ' --data-' # For flags like: "--data-ascii", "--data-binary", "--data-raw", "--data-urlencode"
        - CommandLine|re: '\s-[FTd]\s' # We use regex to ensure a case sensitive argument detection
    filter_optional_localhost:
        CommandLine|contains:
            - '://localhost'
            - '://127.0.0.1'
    condition: all of selection_* and not 1 of filter_optional_*
falsepositives:
    - Scripts created by developers and admins
level: medium

Stages and Predicates

Stage 0: condition

all of selection_* and not 1 of filter_optional_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\curl.exe'
    - Product: 'The curl executable'

Stage 2: selection_cli

selection_cli:
    - CommandLine|contains:
          - ' --form'
          - ' --upload-file '
          - ' --data '
          - ' --data-'
    - CommandLine|re: '\s-[FTd]\s'

Stage 3: not filter_optional_localhost

filter_optional_localhost:
    CommandLine|contains:
        - '://localhost'
        - '://127.0.0.1'

Exclusions

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

FieldKindExcluded values
CommandLinematch://127.0.0.1
CommandLinematch://localhost

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
  • --data corpus 3 (sigma 3)
  • --data- corpus 2 (sigma 2)
  • --form corpus 2 (sigma 2)
  • --upload-file corpus 2 (sigma 2)
CommandLineregex_match
  • \s-[FTd]\s corpus 2 (sigma 2)
Imageends_with
  • \curl.exe corpus 30 (sigma 30)
Producteq
  • The curl executable corpus 5 (sigma 5)