| ID | Technique | Tactic |
|---|---|---|
| T1562.001 | Disable or Modify Tools | Defense Evasion |
Detection: Powershell Disable Security Monitoring
Description
The following analytic identifies attempts to disable Windows Defender
real-time behavior monitoring via PowerShell commands. It detects the use of specific
Set-MpPreference parameters that disable various security features. This activity
is significant as it is commonly used by malware such as RATs, bots, or Trojans
to evade detection by disabling antivirus protections. If confirmed malicious, this
action could allow an attacker to operate undetected, leading to potential data
exfiltration, further system compromise, or persistent access within the environment.
Search
1
2| tstats `security_content_summariesonly`
3 count min(_time) as firstTime
4 max(_time) as lastTime
5from datamodel=Endpoint.Processes where
6`process_powershell`
7Processes.process="*Set-MpPreference*"
8(
9 Processes.process IN (
10 "*DisableArchiveScanning*",
11 "*DisableBehaviorMonitoring*",
12 "*DisableBlockAtFirstSeen*",
13 "*DisableCatchupFullScan*",
14 "*DisableCatchupQuickScan*",
15 "*DisableIOAVProtection*",
16 "*DisableRealtimeMonitoring*",
17 "*DisableRemovableDriveScanning*",
18 "*DisableRestorePoint*",
19 "*DisableScanningMappedNetworkDrivesForFullScan*",
20 "*DisableScanningNetworkFiles*",
21 "*DisableScriptScanning*",
22 "*drdsc*",
23 "*dsnf *",
24 "*drtm *",
25 "*dioavp *",
26 "*dscrptsc *",
27 "*dbaf *",
28 "*darchsc *",
29 "*dcfsc *",
30 "*dbm *"
31 )
32 Processes.process IN (
33 "* $true*",
34 "* 1*"
35 )
36)
37OR
38(
39 Processes.process = "*PUAProtection*"
40 Processes.process = "*disable*"
41)
42OR
43(
44 Processes.process = "*CloudBlockLevel*"
45 Processes.process IN (
46 "* $false*",
47 "* 0*"
48 )
49)
50by Processes.action Processes.dest Processes.original_file_name Processes.parent_process
51 Processes.parent_process_exec Processes.parent_process_guid Processes.parent_process_id
52 Processes.parent_process_name Processes.parent_process_path Processes.process Processes.process_exec
53 Processes.process_guid Processes.process_hash Processes.process_id Processes.process_integrity_level
54 Processes.process_name Processes.process_path Processes.user Processes.user_id Processes.vendor_product
55
56
57| `drop_dm_object_name(Processes)`
58
59| `security_content_ctime(firstTime)`
60
61| `security_content_ctime(lastTime)`
62
63| `powershell_disable_security_monitoring_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| CrowdStrike ProcessRollup2 | N/A | 'crowdstrike:events:sensor' |
'crowdstrike' |
| Sysmon EventID 1 | 'XmlWinEventLog' |
'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational' |
|
| Windows Event Log Security 4688 | 'XmlWinEventLog' |
'XmlWinEventLog:Security' |
Macros Used
| Name | Value |
|---|---|
| process_powershell | (Processes.process_name=pwsh.exe OR Processes.process_name=powershell.exe OR Processes.process_name=powershell_ise.exe OR Processes.original_file_name=pwsh.dll OR Processes.original_file_name=PowerShell.EXE OR Processes.original_file_name=powershell_ise.EXE) |
| powershell_disable_security_monitoring_filter | search * |
powershell_disable_security_monitoring_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
| Setting | Value |
|---|---|
| Disabled | true |
| Cron Schedule | 0 * * * * |
| Earliest Time | -70m@m |
| Latest Time | -10m@m |
| Schedule Window | auto |
| Creates Notable | Yes |
| Rule Title | %name% |
| Rule Description | %description% |
| Notable Event Fields | user, dest |
| Creates Risk Event | True |
Implementation
The detection is based on data that originates from Endpoint Detection
and Response (EDR) agents. These agents are designed to provide security-related
telemetry from the endpoints where the agent is installed. To implement this search,
you must ingest logs that contain the process GUID, process name, and parent process.
Additionally, you must ingest complete command-line executions. These logs must
be processed using the appropriate Splunk Technology Add-ons that are specific to
the EDR product. The logs must also be mapped to the Processes node of the Endpoint
data model. Use the Splunk Common Information Model (CIM) to normalize the field
names and speed up the data modeling process.
Known False Positives
Limited false positives. However, tune based on scripts that may perform this action.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message:
Windows Defender Real-time Behavior Monitoring disabled on $dest$
| Risk Object | Risk Object Type | Risk Score | Threat Objects |
|---|---|---|---|
| dest | system | 25 | No Threat Objects |
References
Detection Testing
| Test Type | Status | Dataset | Source | Sourcetype |
|---|---|---|---|---|
| Validation | ✅ Passing | N/A | N/A | N/A |
| Unit | ✅ Passing | Dataset | XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
XmlWinEventLog |
| Integration | ✅ Passing | Dataset | XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
XmlWinEventLog |
Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
Source: GitHub | Version: 11