Skip to content

Commit b73faf5

Browse files
shashank-elastictradebot-elastic
authored andcommitted
Update investigation guides (#5112)
(cherry picked from commit 657b504)
1 parent 8595869 commit b73faf5

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

rules/windows/defense_evasion_posh_defender_tampering.toml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2024/09/11"
33
integration = ["windows"]
44
maturity = "production"
5-
updated_date = "2025/09/03"
5+
updated_date = "2025/09/15"
66

77
[rule]
88
author = ["Elastic"]
@@ -15,6 +15,50 @@ index = ["winlogbeat-*", "logs-windows.powershell*"]
1515
language = "kuery"
1616
license = "Elastic License v2"
1717
name = "PowerShell Script with Windows Defender Tampering Capabilities"
18+
note = """ ## Triage and analysis
19+
20+
> **Disclaimer**:
21+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
22+
23+
### Investigating PowerShell Script with Windows Defender Tampering Capabilities
24+
25+
PowerShell is a powerful scripting language used for task automation and configuration management in Windows environments. Adversaries exploit PowerShell to disable Windows Defender features, reducing detection risks. The detection rule identifies scripts attempting to modify Defender settings, such as disabling real-time monitoring, by analyzing script block text for specific cmdlets and parameters, while excluding legitimate processes and users.
26+
27+
### Possible investigation steps
28+
29+
- Examine the script content that triggered the detection; look for suspicious DLL imports, collection or exfiltration capabilities, suspicious functions, encoded or compressed data, and other potentially malicious characteristics.
30+
- Investigate the script execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
31+
- Examine the script's execution context, such as the user account, privileges, the role of the system on which it was executed, and any relevant timestamps.
32+
- Investigate other alerts associated with the user/host during the past 48 hours.
33+
- Evaluate whether the user needs to use PowerShell to complete tasks.
34+
- Investigate the origin of the PowerShell script, including its source, download method, and any associated URLs or IP addresses.
35+
- Use the Get-MpPreference cmdlet to check defender settings for the host. Revert them to the desired state if needed.
36+
- Check for Files written and executed after the settings were changed.
37+
38+
### False positive analysis
39+
40+
- Legitimate administrative scripts may trigger the rule if they use Set-MpPreference cmdlets for valid configuration changes. To handle this, review the script's purpose and source, and consider adding exceptions for trusted scripts or users.
41+
- Automated system management tools might use similar cmdlets for routine maintenance. Identify these tools and exclude their processes or directories from the rule to prevent unnecessary alerts.
42+
- Security software updates or installations could temporarily disable certain Defender features. Monitor these activities and whitelist known update processes to avoid false positives.
43+
- PowerShell scripts executed by system administrators for troubleshooting may appear suspicious. Verify the user ID and script content, and exclude known administrator accounts from the rule if they frequently perform such tasks.
44+
45+
### Response and remediation
46+
47+
- Initiate the incident response process based on the outcome of the triage.
48+
- If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
49+
- Isolate the involved hosts to prevent further post-compromise behavior.
50+
- If the triage identified malware, search the environment for additional compromised hosts.
51+
- Implement temporary network rules, procedures, and segmentation to contain the malware.
52+
- Stop suspicious processes.
53+
- Immediately block the identified indicators of compromise (IoCs).
54+
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
55+
- Remove and block malicious artifacts identified during triage.
56+
- Reimage the host operating system or restore the compromised files to clean versions.
57+
- Restrict PowerShell usage outside of IT and engineering business units using GPOs, AppLocker, Intune, or similar software.
58+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
59+
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
60+
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
61+
"""
1862
risk_score = 21
1963
rule_id = "c124dc1b-cef2-4d01-8d74-ff6b0d5096b6"
2064
setup = """## Setup
@@ -42,6 +86,7 @@ tags = [
4286
"Use Case: Threat Detection",
4387
"Tactic: Defense Evasion",
4488
"Data Source: PowerShell Logs",
89+
"Resources: Investigation Guide",
4590
]
4691
timestamp_override = "event.ingested"
4792
type = "query"

0 commit comments

Comments
 (0)