Detection rules › Sigma

Suspicious Curl.EXE Download

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

Detects a suspicious curl process start on Windows and outputs the requested document to a local file

MITRE ATT&CK coverage

TacticTechniques
Command & ControlT1105 Ingress Tool Transfer

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Suspicious Curl.EXE Download
id: e218595b-bbe7-4ee5-8a96-f32a24ad3468
related:
    - id: bbeaed61-1990-4773-bf57-b81dbad7db2d # Basic curl execution
      type: derived
    - id: 9a517fca-4ba3-4629-9278-a68694697b81 # Curl download
      type: similar
status: test
description: Detects a suspicious curl process start on Windows and outputs the requested document to a local file
references:
    - https://twitter.com/max_mal_/status/1542461200797163522
    - https://web.archive.org/web/20200128160046/https://twitter.com/reegun21/status/1222093798009790464
    - https://github.com/pr0xylife/Qakbot/blob/4f0795d79dabee5bc9dd69f17a626b48852e7869/Qakbot_AA_23.06.2022.txt
    - https://www.volexity.com/blog/2022/07/28/sharptongue-deploys-clever-mail-stealing-browser-extension-sharpext/
    - https://github.com/redcanaryco/atomic-red-team/blob/0f229c0e42bfe7ca736a14023836d65baa941ed2/atomics/T1105/T1105.md#atomic-test-18---curl-download-file
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2020-07-03
modified: 2023-02-21
tags:
    - attack.command-and-control
    - attack.t1105
logsource:
    category: process_creation
    product: windows
detection:
    selection_curl:
        - Image|endswith: '\curl.exe'
        - Product: 'The curl executable'
    selection_susp_locations:
        CommandLine|contains:
            - '%AppData%'
            - '%Public%'
            - '%Temp%'
            - '%tmp%'
            - '\AppData\'
            - '\Desktop\'
            - '\Temp\'
            - '\Users\Public\'
            - 'C:\PerfLogs\'
            - 'C:\ProgramData\'
            - 'C:\Windows\Temp\'
    selection_susp_extensions:
        CommandLine|endswith:
            - '.dll'
            - '.gif'
            - '.jpeg'
            - '.jpg'
            - '.png'
            - '.temp'
            - '.tmp'
            - '.txt'
            - '.vbe'
            - '.vbs'
    filter_optional_git_windows:
        # Example FP
        #   CommandLine: "C:\Program Files\Git\mingw64\bin\curl.exe" --silent --show-error --output C:/Users/test/AppData/Local/Temp/gfw-httpget-jVOEoxbS.txt --write-out %{http_code} https://gitforwindows.org/latest-tag.txt
        ParentImage: 'C:\Program Files\Git\usr\bin\sh.exe'
        Image: 'C:\Program Files\Git\mingw64\bin\curl.exe'
        CommandLine|contains|all:
            - '--silent --show-error --output '
            - 'gfw-httpget-'
            - 'AppData'
    condition: selection_curl and 1 of selection_susp_* and not 1 of filter_optional_*
falsepositives:
    - Unknown
level: high
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_curl_susp_download/info.yml
simulation:
    - type: atomic-red-team
      name: Curl Download File
      technique: T1105
      atomic_guid: 2b080b99-0deb-4d51-af0f-833d37c4ca6a

Stages and Predicates

Stage 0: condition

selection_curl and 1 of selection_susp_* and not 1 of filter_optional_*

Stage 1: selection_curl

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

Stage 2: selection_susp_locations

selection_susp_locations:
    CommandLine|contains:
        - '%AppData%'
        - '%Public%'
        - '%Temp%'
        - '%tmp%'
        - '\AppData\'
        - '\Desktop\'
        - '\Temp\'
        - '\Users\Public\'
        - 'C:\PerfLogs\'
        - 'C:\ProgramData\'
        - 'C:\Windows\Temp\'

Stage 3: selection_susp_extensions

selection_susp_extensions:
    CommandLine|endswith:
        - '.dll'
        - '.gif'
        - '.jpeg'
        - '.jpg'
        - '.png'
        - '.temp'
        - '.tmp'
        - '.txt'
        - '.vbe'
        - '.vbs'

Stage 4: not filter_optional_git_windows

filter_optional_git_windows:
    ParentImage: 'C:\Program Files\Git\usr\bin\sh.exe'
    Image: 'C:\Program Files\Git\mingw64\bin\curl.exe'
    CommandLine|contains|all:
        - '--silent --show-error --output '
        - 'gfw-httpget-'
        - 'AppData'

Exclusions

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

FieldKindExcluded values
CommandLinematch--silent --show-error --output
CommandLinematchAppData
CommandLinematchgfw-httpget-
ImageeqC:\Program Files\Git\mingw64\bin\curl.exe
ParentImageeqC:\Program Files\Git\usr\bin\sh.exe

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
CommandLineends_with
  • .dll corpus 7 (sigma 7)
  • .gif corpus 3 (sigma 3)
  • .jpeg corpus 3 (sigma 3)
  • .jpg corpus 2 (sigma 2)
  • .png corpus 3 (sigma 3)
  • .temp corpus 2 (sigma 2)
  • .tmp corpus 2 (sigma 2)
  • .txt corpus 4 (sigma 4)
  • .vbe corpus 7 (sigma 7)
  • .vbs corpus 7 (sigma 7)
CommandLinematch
  • %AppData% corpus 13 (sigma 11, chronicle 2)
  • %Public% corpus 7 (sigma 5, chronicle 2)
  • %Temp% corpus 16 (sigma 13, chronicle 2, kusto 1)
  • %tmp% corpus 15 (sigma 13, chronicle 2)
  • C:\PerfLogs\ corpus 2 (sigma 2)
  • C:\ProgramData\ corpus 6 (sigma 6)
  • C:\Windows\Temp\ corpus 7 (sigma 7)
  • \AppData\ corpus 8 (sigma 8)
  • \Desktop\ corpus 13 (sigma 13)
  • \Temp\ corpus 5 (sigma 5)
  • \Users\Public\ corpus 17 (sigma 17)
Imageends_with
  • \curl.exe corpus 30 (sigma 30)
Producteq
  • The curl executable corpus 5 (sigma 5)