Detection rules › Sigma

Obfuscated IP Download Activity

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

Detects use of an encoded/obfuscated version of an IP address (hex, octal...) in an URL combined with a download command

MITRE ATT&CK coverage

TacticTechniques
DiscoveryNo specific technique

Event coverage

Rule body yaml

title: Obfuscated IP Download Activity
id: cb5a2333-56cf-4562-8fcb-22ba1bca728d
status: test
description: Detects use of an encoded/obfuscated version of an IP address (hex, octal...) in an URL combined with a download command
references:
    - https://h.43z.one/ipconverter/
    - https://twitter.com/Yasser_Elsnbary/status/1553804135354564608
    - https://twitter.com/fr0s7_/status/1712780207105404948
author: Florian Roth (Nextron Systems), X__Junior (Nextron Systems)
date: 2022-08-03
modified: 2026-03-16
tags:
    - attack.discovery
logsource:
    category: process_creation
    product: windows
detection:
    selection_command:
        CommandLine|contains:
            - 'Invoke-WebRequest'
            - 'iwr '
            - 'Invoke-RestMethod'
            - 'irm '
            - 'wget '
            - 'curl '
            - 'DownloadFile'
            - 'DownloadString'
    selection_ip_1:
        CommandLine|contains:
            - ' 0x'
            - '//0x'
            - '.0x'
            - '.00x'
    selection_ip_2:
        CommandLine|contains|all:
            - 'http://%'
            - '%2e'
    selection_ip_3:
        # http://81.4.31754
        - CommandLine|re: 'https?://[0-9]{1,3}\.[0-9]{1,3}\.0[0-9]{3,4}'
        # http://81.293898
        - CommandLine|re: 'https?://[0-9]{1,3}\.0[0-9]{3,7}'
        # http://1359248394
        - CommandLine|re: 'https?://0[0-9]{3,11}'
        # http://0121.04.0174.012
        - CommandLine|re: 'https?://(?:0[0-9]{1,11}\.){3}0[0-9]{1,11}'
        # http://012101076012
        - CommandLine|re: 'https?://0[0-9]{1,11}'
        # For octal format
        - CommandLine|re: ' [0-7]{7,13}'
    filter_main_valid_ip:
        CommandLine|re: 'https?://(?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)(?:\.|\b)){4}'
    condition: selection_command and 1 of selection_ip_* and not 1 of filter_main_*
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

selection_command and 1 of selection_ip_* and not 1 of filter_main_*

Stage 1: selection_command

selection_command:
    CommandLine|contains:
        - 'Invoke-WebRequest'
        - 'iwr '
        - 'Invoke-RestMethod'
        - 'irm '
        - 'wget '
        - 'curl '
        - 'DownloadFile'
        - 'DownloadString'

Stage 2: selection_ip_1

selection_ip_1:
    CommandLine|contains:
        - ' 0x'
        - '//0x'
        - '.0x'
        - '.00x'

Stage 3: selection_ip_2

selection_ip_2:
    CommandLine|contains|all:
        - 'http://%'
        - '%2e'

Stage 4: selection_ip_3

selection_ip_3:
    - CommandLine|re: 'https?://[0-9]{1,3}\.[0-9]{1,3}\.0[0-9]{3,4}'
    - CommandLine|re: 'https?://[0-9]{1,3}\.0[0-9]{3,7}'
    - CommandLine|re: 'https?://0[0-9]{3,11}'
    - CommandLine|re: 'https?://(?:0[0-9]{1,11}\.){3}0[0-9]{1,11}'
    - CommandLine|re: 'https?://0[0-9]{1,11}'
    - CommandLine|re: ' [0-7]{7,13}'

Stage 5: not filter_main_valid_ip

filter_main_valid_ip:
    CommandLine|re: 'https?://(?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)(?:\.|\b)){4}'

Exclusions

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

FieldKindExcluded values
CommandLineregex_matchhttps?://(?:(?:25[0-5]|(?:2[0-4]|1\d|[1-9])?\d)(?:.|\b)){4}

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
  • 0x corpus 2 (sigma 2)
  • %2e corpus 2 (sigma 2)
  • .00x corpus 2 (sigma 2)
  • .0x corpus 2 (sigma 2)
  • //0x corpus 2 (sigma 2)
  • DownloadFile corpus 5 (sigma 4, chronicle 1)
  • DownloadString corpus 8 (sigma 7, kusto 1)
  • Invoke-RestMethod corpus 5 (sigma 5)
  • Invoke-WebRequest corpus 13 (sigma 10, elastic 1, chronicle 1, kusto 1)
  • curl corpus 12 (sigma 11, chronicle 1)
  • http://% corpus 2 (sigma 2)
  • irm corpus 5 (sigma 5)
  • iwr corpus 13 (sigma 11, chronicle 2)
  • wget corpus 8 (sigma 7, chronicle 1)
CommandLineregex_match
  • [0-7]{7,13} corpus 2 (sigma 2)
  • https?://(?:0[0-9]{1,11}.){3}0[0-9]{1,11} corpus 2 (sigma 2)
  • https?://0[0-9]{1,11} corpus 2 (sigma 2)
  • https?://0[0-9]{3,11} corpus 2 (sigma 2)
  • https?://[0-9]{1,3}.0[0-9]{3,7} corpus 2 (sigma 2)
  • https?://[0-9]{1,3}.[0-9]{1,3}.0[0-9]{3,4} corpus 2 (sigma 2)