Skip to content

Commit b128d49

Browse files
Update latest docs (#6850)
1 parent 5edf8b5 commit b128d49

File tree

31 files changed

+3221
-55
lines changed

31 files changed

+3221
-55
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
[[prebuilt-rule-8-17-12-backup-deletion-with-wbadmin]]
2+
=== Backup Deletion with Wbadmin
3+
4+
Detects use of wbadmin.exe to delete backup catalogs, system state backups, or other backup data. Ransomware and other malware may do this to prevent system recovery.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* endgame-*
11+
* logs-crowdstrike.fdr*
12+
* logs-endpoint.events.process-*
13+
* logs-m365_defender.event-*
14+
* logs-sentinel_one_cloud_funnel.*
15+
* logs-system.security*
16+
* logs-windows.forwarded*
17+
* logs-windows.sysmon_operational-*
18+
* winlogbeat-*
19+
20+
*Severity*: low
21+
22+
*Risk score*: 21
23+
24+
*Runs every*: 5m
25+
26+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
27+
28+
*Maximum alerts per execution*: 100
29+
30+
*References*: None
31+
32+
*Tags*:
33+
34+
* Domain: Endpoint
35+
* OS: Windows
36+
* Use Case: Threat Detection
37+
* Tactic: Impact
38+
* Resources: Investigation Guide
39+
* Data Source: Elastic Endgame
40+
* Data Source: Elastic Defend
41+
* Data Source: Windows Security Event Logs
42+
* Data Source: Microsoft Defender for Endpoint
43+
* Data Source: Sysmon
44+
* Data Source: SentinelOne
45+
* Data Source: Crowdstrike
46+
47+
*Version*: 318
48+
49+
*Rule authors*:
50+
51+
* Elastic
52+
53+
*Rule license*: Elastic License v2
54+
55+
56+
==== Investigation guide
57+
58+
59+
60+
*Triage and analysis*
61+
62+
63+
64+
*Investigating Backup Deletion with Wbadmin*
65+
66+
67+
Windows Server Backup stores the details about your backups (what volumes are backed up and where the backups are located) in a file called a backup catalog, which ransomware victims can use to recover corrupted backup files. Deleting these files is a common step in threat actor playbooks.
68+
69+
This rule identifies the deletion of the backup catalog using the `wbadmin.exe` utility.
70+
71+
72+
*Possible investigation steps*
73+
74+
75+
- Investigate the process 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.
76+
- Identify the user account that performed the action and whether it should perform this kind of action.
77+
- Contact the account owner and confirm whether they are aware of this activity.
78+
- Investigate other alerts associated with the user/host during the past 48 hours.
79+
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
80+
- Check if any files on the host machine have been encrypted.
81+
82+
83+
*False positive analysis*
84+
85+
86+
- Administrators can use this command to delete corrupted catalogs, but overall the activity is unlikely to be legitimate.
87+
88+
89+
*Related rules*
90+
91+
92+
- Third-party Backup Files Deleted via Unexpected Process - 11ea6bec-ebde-4d71-a8e9-784948f8e3e9
93+
- Volume Shadow Copy Deleted or Resized via VssAdmin - b5ea4bfe-a1b2-421f-9d47-22a75a6f2921
94+
- Volume Shadow Copy Deletion via PowerShell - d99a037b-c8e2-47a5-97b9-170d076827c4
95+
- Volume Shadow Copy Deletion via WMIC - dc9c1f74-dac3-48e3-b47f-eb79db358f57
96+
97+
98+
*Response and remediation*
99+
100+
101+
- Initiate the incident response process based on the outcome of the triage.
102+
- Consider isolating the involved host to prevent destructive behavior, which is commonly associated with this activity.
103+
- 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.
104+
- If any other destructive action was identified on the host, it is recommended to prioritize the investigation and look for ransomware preparation and execution activities.
105+
- If any backups were affected:
106+
- Perform data recovery locally or restore the backups from replicated copies (cloud, other servers, etc.).
107+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
108+
- 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).
109+
110+
111+
==== Rule query
112+
113+
114+
[source, js]
115+
----------------------------------
116+
process where host.os.type == "windows" and event.type == "start" and
117+
(process.name : "wbadmin.exe" or ?process.pe.original_file_name == "WBADMIN.EXE") and
118+
process.args : ("catalog", "backup", "systemstatebackup") and process.args : "delete"
119+
120+
----------------------------------
121+
122+
*Framework*: MITRE ATT&CK^TM^
123+
124+
* Tactic:
125+
** Name: Impact
126+
** ID: TA0040
127+
** Reference URL: https://attack.mitre.org/tactics/TA0040/
128+
* Technique:
129+
** Name: Data Destruction
130+
** ID: T1485
131+
** Reference URL: https://attack.mitre.org/techniques/T1485/
132+
* Technique:
133+
** Name: Inhibit System Recovery
134+
** ID: T1490
135+
** Reference URL: https://attack.mitre.org/techniques/T1490/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
[[prebuilt-rule-8-17-12-microsoft-azure-or-mail-sign-in-from-a-suspicious-source]]
2+
=== Microsoft Azure or Mail Sign-in from a Suspicious Source
3+
4+
This rule correlate Azure or Office 356 mail successful sign-in events with network security alerts by source.ip. Adversaries may trigger some network security alerts such as reputation or other anomalies before accessing cloud resources.
5+
6+
*Rule type*: esql
7+
8+
*Rule indices*: None
9+
10+
*Severity*: high
11+
12+
*Risk score*: 73
13+
14+
*Runs every*: 5m
15+
16+
*Searches indices from*: now-60m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
17+
18+
*Maximum alerts per execution*: 100
19+
20+
*References*: None
21+
22+
*Tags*:
23+
24+
* Domain: Cloud
25+
* Domain: SaaS
26+
* Data Source: Azure
27+
* Data Source: Entra ID
28+
* Data Source: Entra ID Sign-in Logs
29+
* Data Source: Microsoft 365
30+
* Data Source: Microsoft 365 Audit Logs
31+
* Use Case: Identity and Access Audit
32+
* Use Case: Threat Detection
33+
* Tactic: Initial Access
34+
* Resources: Investigation Guide
35+
* Rule Type: Higher-Order Rule
36+
37+
*Version*: 2
38+
39+
*Rule authors*:
40+
41+
* Elastic
42+
43+
*Rule license*: Elastic License v2
44+
45+
46+
==== Investigation guide
47+
48+
49+
50+
*Triage and analysis*
51+
52+
53+
54+
*Investigating Microsoft Azure or Mail Sign-in from a Suspicious Source*
55+
56+
57+
58+
*Possible investigation steps*
59+
60+
61+
- Investiguate all the alerts associated with the source.ip.
62+
- Verify the network security alert details associated with this source.ip.
63+
- Verify all sign-in events associated with this source.ip.
64+
- Consider the source IP address and geolocation for the involved user account.
65+
- Consider the device used to sign in. Is it registered and compliant?
66+
- Investigate other alerts associated with the user account during the past 48 hours.
67+
- Contact the account owner and confirm whether they are aware of this activity.
68+
- Check if this operation was approved and performed according to the organization's change management policy.
69+
- If you suspect the account has been compromised, scope potentially compromised assets by tracking servers, services, and data accessed by the account in the last 24 hours.
70+
71+
72+
*Response and remediation*
73+
74+
75+
- Initiate the incident response process based on the outcome of the triage.
76+
- Disable or limit the account during the investigation and response.
77+
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
78+
- Identify the account role in the cloud environment.
79+
- Assess the criticality of affected services and servers.
80+
- Work with your IT team to identify and minimize the impact on users.
81+
- Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
82+
- Identify any regulatory or legal ramifications related to this activity.
83+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
84+
- Check if unauthorized new users were created, remove unauthorized new accounts, and request password resets for other IAM users.
85+
- Consider enabling multi-factor authentication for users.
86+
- Follow security best practices https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices[outlined] by Microsoft.
87+
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
88+
- 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).
89+
90+
==== Setup
91+
92+
93+
The Azure Fleet integration, Office 365 Logs Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
94+
95+
==== Rule query
96+
97+
98+
[source, js]
99+
----------------------------------
100+
FROM logs-*, .alerts-security.*
101+
// query runs every 1 hour looking for activities occured during last 8 hours to match on disparate events
102+
| where @timestamp > NOW() - 8 hours
103+
// filter for Azure or M365 sign-in and External Alerts with source.ip not null
104+
| where TO_IP(source.ip) is not null and (event.dataset in ("o365.audit", "azure.signinlogs") or kibana.alert.rule.name == "External Alerts") and
105+
// exclude private IP ranges
106+
not CIDR_MATCH(TO_IP(source.ip), "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1","FE80::/10", "FF00::/8")
107+
| keep source.ip, event.action, event.outcome, event.dataset, kibana.alert.rule.name, event.category
108+
// split alerts to 3 buckets - M365 mail access, azure sign-in and network related external alerts like NGFW and IDS
109+
| eval mail_access_src_ip = case(event.dataset == "o365.audit" and event.action == "MailItemsAccessed" and event.outcome == "success", TO_IP(source.ip), null),
110+
azure_src_ip = case(event.dataset == "azure.signinlogs" and event.outcome == "success", TO_IP(source.ip), null),
111+
network_alert_src_ip = case(kibana.alert.rule.name == "External Alerts" and not event.dataset in ("o365.audit", "azure.signinlogs"), TO_IP(source.ip), null)
112+
// aggregated alerts count by bucket and by source.ip
113+
| stats total_alerts = count(*), is_mail_access = COUNT_DISTINCT(mail_access_src_ip), is_azure = COUNT_DISTINCT(azure_src_ip), unique_dataset = COUNT_DISTINCT(event.dataset),is_network_alert = COUNT_DISTINCT(network_alert_src_ip), datasets = VALUES(event.dataset), rules = VALUES(kibana.alert.rule.name), cat = VALUES(event.category) by source_ip = TO_IP(source.ip)
114+
// filter for cases where there is a successful sign-in to azure or m365 mail and the source.ip is reported by a network external alert.
115+
| where is_network_alert > 0 and unique_dataset >= 2 and (is_mail_access > 0 or is_azure > 0) and total_alerts <= 100
116+
117+
----------------------------------
118+
119+
*Framework*: MITRE ATT&CK^TM^
120+
121+
* Tactic:
122+
** Name: Initial Access
123+
** ID: TA0001
124+
** Reference URL: https://attack.mitre.org/tactics/TA0001/
125+
* Technique:
126+
** Name: Valid Accounts
127+
** ID: T1078
128+
** Reference URL: https://attack.mitre.org/techniques/T1078/

0 commit comments

Comments
 (0)