Detection rules › Kusto

Dev-0270 Registry IOC - September 2022

Status
available
Severity
high
Time window
6h
Source
github.com/Azure/Azure-Sentinel

The query below identifies modification of registry by Dev-0270 actor to disable security feature as well as to add ransom notes

MITRE ATT&CK coverage

TacticTechniques
ImpactT1486 Data Encrypted for Impact

Event coverage

Rule body kusto

id: 2566e99f-ad0f-472a-b9ac-d3899c9283e6
name: Dev-0270 Registry IOC - September 2022
description: | 
  'The query below identifies modification of registry by Dev-0270 actor to disable security feature as well as to add ransom notes'
severity: High 
requiredDataConnectors:
  - connectorId: SecurityEvents
    dataTypes:
      - SecurityEvent
  - connectorId: WindowsSecurityEvents
    dataTypes:
      - SecurityEvent
  - connectorId: MicrosoftThreatProtection
    dataTypes:
      - DeviceProcessEvents
queryFrequency: 6h 
queryPeriod: 6h 
triggerOperator: gt 
triggerThreshold: 0 
status: Available
tactics: 
  - Impact
relevantTechniques:
  - T1486
tags:
  - Dev-0270
query: |
  (union isfuzzy=true
  (SecurityEvent
  | where EventID == 4688
  | where (CommandLine has_all  ('reg', 'add', 'HKLM\\SOFTWARE\\Policies\\', '/v','/t', 'REG_DWORD', '/d', '/f') and CommandLine has_any('DisableRealtimeMonitoring', 'UseTPMKey', 'UseTPMKeyPIN', 'UseAdvancedStartup', 'EnableBDEWithNoTPM', 'RecoveryKeyMessageSource'))
    or CommandLine has_all ('reg', 'add', 'HKLM\\SOFTWARE\\Policies\\', '/v','/t', 'REG_DWORD', '/d', '/f', 'RecoveryKeyMessage', 'Your drives are Encrypted!', '@')
  | project TimeGenerated, Computer, Account, AccountDomain, ProcessName, ProcessNameFullPath = NewProcessName, EventID, Activity, CommandLine, EventSourceName, Type
  ),
  (DeviceProcessEvents 
  | where (InitiatingProcessCommandLine has_all(@'"reg"', 'add', @'"HKLM\SOFTWARE\Policies\', '/v','/t', 'REG_DWORD', '/d', '/f') 
     and InitiatingProcessCommandLine has_any('DisableRealtimeMonitoring', 'UseTPMKey', 'UseTPMKeyPIN', 'UseAdvancedStartup', 'EnableBDEWithNoTPM', 'RecoveryKeyMessageSource') ) 
     or InitiatingProcessCommandLine has_all('"reg"', 'add', @'"HKLM\SOFTWARE\Policies\', '/v','/t', 'REG_DWORD', '/d', '/f', 'RecoveryKeyMessage', 'Your drives are Encrypted!', '@')
  | extend Account = strcat(InitiatingProcessAccountDomain, @'\', InitiatingProcessAccountName), Computer = DeviceName
   )
   )
  | extend HostName = tostring(split(Computer, ".")[0]), DomainIndex = toint(indexof(Computer, '.'))
  | extend HostNameDomain = iff(DomainIndex != -1, substring(Computer, DomainIndex + 1), Computer)
  | extend AccountName = tostring(split(Account, @'\')[1]), AccountNTDomain = tostring(split(Account, @'\')[0])
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: Account
      - identifier: Name
        columnName: AccountName
      - identifier: NTDomain
        columnName: AccountNTDomain
  - entityType: Host
    fieldMappings:
      - identifier: FullName
        columnName: Computer
      - identifier: HostName
        columnName: HostName
      - identifier: DnsDomain
        columnName: HostNameDomain
version: 1.0.3
kind: Scheduled

Stages and Predicates

union isfuzzy=true (2 sources)

Each leg below queries one source; the rule matches if any leg does. Sources: SecurityEvent, DeviceProcessEvents

Leg 1: SecurityEvent

SecurityEvent
| where EventID == 4688
| where (CommandLine has_all  ('reg', 'add', 'HKLM\\SOFTWARE\\Policies\\', '/v','/t', 'REG_DWORD', '/d', '/f') and CommandLine has_any('DisableRealtimeMonitoring', 'UseTPMKey', 'UseTPMKeyPIN', 'UseAdvancedStartup', 'EnableBDEWithNoTPM', 'RecoveryKeyMessageSource'))
  or CommandLine has_all ('reg', 'add', 'HKLM\\SOFTWARE\\Policies\\', '/v','/t', 'REG_DWORD', '/d', '/f', 'RecoveryKeyMessage', 'Your drives are Encrypted!', '@')
| project TimeGenerated, Computer, Account, AccountDomain, ProcessName, ProcessNameFullPath = NewProcessName, EventID, Activity, CommandLine, EventSourceName, Type

Leg 2: DeviceProcessEvents

DeviceProcessEvents 
| where (InitiatingProcessCommandLine has_all(@'"reg"', 'add', @'"HKLM\SOFTWARE\Policies\', '/v','/t', 'REG_DWORD', '/d', '/f') 
   and InitiatingProcessCommandLine has_any('DisableRealtimeMonitoring', 'UseTPMKey', 'UseTPMKeyPIN', 'UseAdvancedStartup', 'EnableBDEWithNoTPM', 'RecoveryKeyMessageSource') ) 
   or InitiatingProcessCommandLine has_all('"reg"', 'add', @'"HKLM\SOFTWARE\Policies\', '/v','/t', 'REG_DWORD', '/d', '/f', 'RecoveryKeyMessage', 'Your drives are Encrypted!', '@')
| extend Account = strcat(InitiatingProcessAccountDomain, @'\', InitiatingProcessAccountName), Computer = DeviceName

Applied to the combined result

| extend HostName = tostring(split(Computer, ".")[0]), DomainIndex = toint(indexof(Computer, '.'))
| extend HostNameDomain = iff(DomainIndex != -1, substring(Computer, DomainIndex + 1), Computer)
| extend AccountName = tostring(split(Account, @'\')[1]), AccountNTDomain = tostring(split(Account, @'\')[0])

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
  • /d corpus 4 (sigma 3, kusto 1)
  • /f corpus 7 (sigma 5, splunk 1, kusto 1)
  • /t corpus 2 (splunk 1, kusto 1)
  • /v corpus 5 (sigma 4, kusto 1)
  • @ corpus 3 (elastic 1, splunk 1, kusto 1)
  • DisableRealtimeMonitoring corpus 3 (sigma 2, kusto 1)
  • EnableBDEWithNoTPM corpus 3 (sigma 2, kusto 1)
  • HKLM\\SOFTWARE\\Policies\\
  • REG_DWORD corpus 3 (sigma 1, chronicle 1, kusto 1)
  • RecoveryKeyMessage corpus 3 (sigma 2, kusto 1)
  • RecoveryKeyMessageSource corpus 3 (sigma 2, kusto 1)
  • UseAdvancedStartup corpus 3 (sigma 2, kusto 1)
  • UseTPMKey corpus 3 (sigma 2, kusto 1)
  • UseTPMKeyPIN corpus 3 (sigma 2, kusto 1)
  • Your drives are Encrypted!
  • add corpus 34 (sigma 26, splunk 4, chronicle 2, kusto 2)
  • reg corpus 7 (sigma 5, splunk 1, kusto 1)
EventIDeq
  • 4688 transforms: cased corpus 313 (splunk 283, kusto 30)
InitiatingProcessCommandLinematch
  • "HKLM\SOFTWARE\Policies\
  • "reg" corpus 7 (sigma 5, splunk 1, kusto 1)
  • /d corpus 4 (sigma 3, kusto 1)
  • /f corpus 7 (sigma 5, splunk 1, kusto 1)
  • /t corpus 2 (splunk 1, kusto 1)
  • /v corpus 5 (sigma 4, kusto 1)
  • @ corpus 3 (elastic 1, splunk 1, kusto 1)
  • DisableRealtimeMonitoring corpus 3 (sigma 2, kusto 1)
  • EnableBDEWithNoTPM corpus 3 (sigma 2, kusto 1)
  • REG_DWORD corpus 3 (sigma 1, chronicle 1, kusto 1)
  • RecoveryKeyMessage corpus 3 (sigma 2, kusto 1)
  • RecoveryKeyMessageSource corpus 3 (sigma 2, kusto 1)
  • UseAdvancedStartup corpus 3 (sigma 2, kusto 1)
  • UseTPMKey corpus 3 (sigma 2, kusto 1)
  • UseTPMKeyPIN corpus 3 (sigma 2, kusto 1)
  • Your drives are Encrypted!
  • add corpus 34 (sigma 26, splunk 4, chronicle 2, kusto 2)

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
Accountextend
AccountDomainproject
Activityproject
CommandLineproject
Computerextend
EventIDproject
EventSourceNameproject
ProcessNameproject
ProcessNameFullPathproject
TimeGeneratedproject
Typeproject
DomainIndexextend
HostNameextend
HostNameDomainextend
AccountNTDomainextend
AccountNameextend