Detection rules › Sigma
Suspicious Environment Variable Has Been Registered
Detects the creation of user-specific or system-wide environment variables via the registry. Which contains suspicious commands and strings
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | No specific technique |
| Stealth | No specific technique |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 13 | RegistryEvent (Value Set) |
Rule body yaml
title: Suspicious Environment Variable Has Been Registered
id: 966315ef-c5e1-4767-ba25-fce9c8de3660
status: test
description: Detects the creation of user-specific or system-wide environment variables via the registry. Which contains suspicious commands and strings
references:
- https://infosec.exchange/@sbousseaden/109542254124022664
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-12-20
modified: 2023-08-17
tags:
- attack.persistence
- attack.stealth
logsource:
product: windows
category: registry_set
detection:
selection_main:
TargetObject|contains: '\Environment\'
selection_details:
- Details:
- 'powershell'
- 'pwsh'
- Details|contains:
# Add more suspicious strings in env variables below
- '\AppData\Local\Temp\'
- 'C:\Users\Public\'
# Base64 MZ Header
- 'TVqQAAMAAAAEAAAA' # MZ..........
- 'TVpQAAIAAAAEAA8A'
- 'TVqAAAEAAAAEABAA'
- 'TVoAAAAAAAAAAAAA'
- 'TVpTAQEAAAAEAAAA'
# Base64 Invoke- (UTF-8)
- 'SW52b2tlL'
- 'ludm9rZS'
- 'JbnZva2Ut'
# Base64 Invoke- (UTF-16LE)
- 'SQBuAHYAbwBrAGUALQ'
- 'kAbgB2AG8AawBlAC0A'
- 'JAG4AdgBvAGsAZQAtA'
- Details|startswith: # https://gist.github.com/Neo23x0/6af876ee72b51676c82a2db8d2cd3639
- 'SUVY'
- 'SQBFAF'
- 'SQBuAH'
- 'cwBhA'
- 'aWV4'
- 'aQBlA'
- 'R2V0'
- 'dmFy'
- 'dgBhA'
- 'dXNpbm'
- 'H4sIA'
- 'Y21k'
- 'cABhAH'
- 'Qzpc'
- 'Yzpc'
condition: all of selection_*
falsepositives:
- Unknown
level: high
Stages and Predicates
Stage 0: condition
all of selection_*Stage 1: selection_main
selection_main:
TargetObject|contains: '\Environment\'
Stage 2: selection_details
selection_details:
- Details:
- 'powershell'
- 'pwsh'
- Details|contains:
- '\AppData\Local\Temp\'
- 'C:\Users\Public\'
- 'TVqQAAMAAAAEAAAA'
- 'TVpQAAIAAAAEAA8A'
- 'TVqAAAEAAAAEABAA'
- 'TVoAAAAAAAAAAAAA'
- 'TVpTAQEAAAAEAAAA'
- 'SW52b2tlL'
- 'ludm9rZS'
- 'JbnZva2Ut'
- 'SQBuAHYAbwBrAGUALQ'
- 'kAbgB2AG8AawBlAC0A'
- 'JAG4AdgBvAGsAZQAtA'
- Details|startswith:
- 'SUVY'
- 'SQBFAF'
- 'SQBuAH'
- 'cwBhA'
- 'aWV4'
- 'aQBlA'
- 'R2V0'
- 'dmFy'
- 'dgBhA'
- 'dXNpbm'
- 'H4sIA'
- 'Y21k'
- 'cABhAH'
- 'Qzpc'
- 'Yzpc'
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.
| Field | Kind | Values |
|---|---|---|
Details | eq |
|
Details | match |
|
Details | starts_with |
|
TargetObject | match |
|