2021-01-16 00:04:22 +03:00
id : 66276b14-32c5-4226-88e3-080dacc31ce1
name : Audit policy manipulation using auditpol utility
description : |
2023-10-06 06:39:59 +03:00
This detects attempts to manipulate audit policies using auditpol command.
This technique was seen in relation to Solorigate attack but the results can indicate potential malicious activity used in different attacks.
2024-05-10 04:24:45 +03:00
The process name in each data source is commented out as an adversary could rename it. It is advisable to keep process name commented but if the results show unrelated false positives, users may want to uncomment it.
2021-01-16 00:18:15 +03:00
Refer to auditpol syntax : https://docs.microsoft.com/windows-server/administration/windows-commands/auditpol
2021-01-23 03:35:38 +03:00
Refer to our M365 blog for details on use during the Solorigate attack :
https://www.microsoft.com/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/
2021-01-16 00:04:22 +03:00
severity : Medium
requiredDataConnectors :
- connectorId : SecurityEvents
dataTypes :
- SecurityEvent
2021-01-21 20:56:29 +03:00
- connectorId : MicrosoftThreatProtection
dataTypes :
- DeviceProcessEvents
2021-01-16 00:04:22 +03:00
queryFrequency : 1d
queryPeriod : 1d
triggerOperator : gt
triggerThreshold : 0
tactics :
- Execution
relevantTechniques :
- T1204
2021-01-23 03:35:38 +03:00
tags :
- Solorigate
2021-03-04 21:54:36 +03:00
- NOBELIUM
2021-01-16 00:04:22 +03:00
query : |
2021-01-16 00:24:22 +03:00
let timeframe = 1d;
2021-01-16 00:04:22 +03:00
let AccountAllowList = dynamic(['SYSTEM']);
let SubCategoryList = dynamic(["Logoff", "Account Lockout", "User Account Management", "Authorization Policy Change"]); // Add any Category in the list to be allowed or disallowed
2021-01-23 03:35:38 +03:00
let tokens = dynamic(["clear", "remove", "success:disable","failure:disable"]);
2021-01-21 20:56:29 +03:00
(union isfuzzy=true
(
2021-01-16 00:04:22 +03:00
SecurityEvent
| where TimeGenerated >= ago(timeframe)
//| where Process =~ "auditpol.exe"
| where CommandLine has_any (tokens)
2021-01-23 03:35:38 +03:00
| where AccountType !~ "Machine" and Account !in~ (AccountAllowList)
2021-01-16 00:04:22 +03:00
| parse CommandLine with * "/subcategory:" subcategorytoken
| extend SubCategory = tostring(split(subcategorytoken, "\"")[1]) , Toggle = tostring(split(subcategorytoken, "\"")[2])
2021-01-23 03:35:38 +03:00
| where SubCategory in~ (SubCategoryList) //use in~ for inclusion or !in~ for exclusion
| where Toggle !in~ ("/failure:disable", " /success:enable /failure:disable") // use this filter if required to exclude certain toggles
2023-10-06 06:21:01 +03:00
| project TimeGenerated, Computer, Account, SubjectDomainName, SubjectUserName, Process, ParentProcessName, CommandLine, SubCategory, Toggle
| extend timestamp = TimeGenerated, AccountName = SubjectUserName, AccountDomain = SubjectDomainName, DeviceName = Computer
2021-01-21 20:56:29 +03:00
),
(
DeviceProcessEvents
| where TimeGenerated >= ago(timeframe)
2021-01-23 03:35:38 +03:00
// | where InitiatingProcessFileName =~ "auditpol.exe"
2021-01-21 20:56:29 +03:00
| where InitiatingProcessCommandLine has_any (tokens)
2021-01-23 03:35:38 +03:00
| where AccountName !in~ (AccountAllowList)
2021-01-21 20:56:29 +03:00
| parse InitiatingProcessCommandLine with * "/subcategory:" subcategorytoken
| extend SubCategory = tostring(split(subcategorytoken, "\"")[1]) , Toggle = tostring(split(subcategorytoken, "\"")[2])
2021-01-23 03:35:38 +03:00
| where SubCategory in~ (SubCategoryList) //use in~ for inclusion or !in~ for exclusion
| where Toggle !in~ ("/failure:disable", " /success:enable /failure:disable") // use this filter if required to exclude certain toggles
2021-01-21 20:56:29 +03:00
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessAccountDomain, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessParentFileName, InitiatingProcessCommandLine, SubCategory, Toggle
2023-10-06 06:21:01 +03:00
| extend timestamp = TimeGenerated, AccountName = InitiatingProcessAccountName, AccountDomain = InitiatingProcessAccountDomain
2021-01-21 20:56:29 +03:00
),
(
Event
| where TimeGenerated > ago(timeframe)
| where Source == "Microsoft-Windows-Sysmon"
| where EventID == 1
| extend EventData = parse_xml(EventData).DataItem.EventData.Data
| mv-expand bagexpansion=array EventData
| evaluate bag_unpack(EventData)
| extend Key=tostring(['@Name']), Value=['#text']
| evaluate pivot(Key, any(Value), TimeGenerated, Source, EventLog, Computer, EventLevel, EventLevelName, EventID, UserName, RenderedDescription, MG, ManagementGroupName, Type, _ResourceId)
2021-01-23 03:35:38 +03:00
// | where OriginalFileName =~ "auditpol.exe"
2021-01-21 20:56:29 +03:00
| where CommandLine has_any (tokens)
2021-01-23 03:35:38 +03:00
| where User !in~ (AccountAllowList)
2021-01-21 20:56:29 +03:00
| parse CommandLine with * "/subcategory:" subcategorytoken
| extend SubCategory = tostring(split(subcategorytoken, "\"")[1]) , Toggle = tostring(split(subcategorytoken, "\"")[2])
2021-01-23 03:35:38 +03:00
| where SubCategory in~ (SubCategoryList) //use in~ for inclusion or !in~ for exclusion
| where Toggle !in~ ("/failure:disable", " /success:enable /failure:disable") // use this filter if required to exclude certain toggles
2023-10-06 06:21:01 +03:00
| project TimeGenerated, Computer, User, Process, ParentImage, CommandLine, SubCategory, Toggle
| extend timestamp = TimeGenerated, AccountName = tostring(split(User, @'\')[1]), AccountUPNSuffix = tostring(split(User, @'\')[0]), DeviceName = Computer
2021-01-21 20:56:29 +03:00
)
)
2023-12-15 07:47:06 +03:00
| extend Account = strcat(AccountDomain, "\\", AccountName)
2021-01-16 00:04:22 +03:00
entityMappings :
- entityType : Account
fieldMappings :
2023-12-15 07:47:06 +03:00
- identifier : FullName
columnName : Account
2023-10-06 06:21:01 +03:00
- identifier : Name
columnName : AccountName
- identifier : NTDomain
columnName : AccountDomain
2021-01-16 00:04:22 +03:00
- entityType : Host
fieldMappings :
2023-10-06 06:21:01 +03:00
- identifier : HostName
columnName : DeviceName
2024-05-10 05:36:09 +03:00
version : 1.2 .3
2022-10-31 15:37:11 +03:00
kind : Scheduled
metadata :
source :
kind : Community
author :
2023-10-06 06:24:06 +03:00
name : Microsoft Security Research
2022-10-31 15:37:11 +03:00
support :
tier : Community
categories :
domains : [ "Security - Others" ]