Detection rules › Sigma

Microsoft IIS Connection Strings Decryption

Status
test
Severity
high
Log source
category process_creation, product windows
Author
Tim Rauch, Elastic (idea)
Source
github.com/SigmaHQ/sigma

Detects use of aspnet_regiis to decrypt Microsoft IIS connection strings. An attacker with Microsoft IIS web server access via a webshell or alike can decrypt and dump any hardcoded connection strings, such as the MSSQL service account password using aspnet_regiis command.

MITRE ATT&CK coverage

TacticTechniques
Credential Access

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Microsoft IIS Connection Strings Decryption
id: 97dbf6e2-e436-44d8-abee-4261b24d3e41
status: test
description: Detects use of aspnet_regiis to decrypt Microsoft IIS connection strings. An attacker with Microsoft IIS web server access via a webshell or alike can decrypt and dump any hardcoded connection strings, such as the MSSQL service account password using aspnet_regiis command.
references:
    - https://www.elastic.co/guide/en/security/current/microsoft-iis-connection-strings-decryption.html
author: Tim Rauch, Elastic (idea)
date: 2022-09-28
modified: 2022-12-30
tags:
    - attack.credential-access
    - attack.t1003
logsource:
    category: process_creation
    product: windows
detection:
    selection_name:
        - Image|endswith: '\aspnet_regiis.exe'
        - OriginalFileName: 'aspnet_regiis.exe'
    selection_args:
        CommandLine|contains|all:
            - 'connectionStrings'
            - ' -pdf'
    condition: all of selection*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection_name

selection_name:
    - Image|endswith: '\aspnet_regiis.exe'
    - OriginalFileName: 'aspnet_regiis.exe'

Stage 2: selection_args

selection_args:
    CommandLine|contains|all:
        - 'connectionStrings'
        - ' -pdf'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -pdf
  • connectionStrings
field:"CommandLine" kind:match
Imageends_with
  • \aspnet_regiis.exe
field:"Image" kind:ends_with value:"\aspnet_regiis.exe"
OriginalFileNameeq
  • aspnet_regiis.exe corpus 3 (elastic 2, sigma 1)
field:"OriginalFileName" kind:eq value:"aspnet_regiis.exe"