Threat Intel URL Indicator Match
This rule is triggered when a URL indicator from the Threat Intel Filebeat module or integrations has a match against an event that contains URL data, like DNS events, network logs, etc.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/05/22"
3maturity = "production"
4updated_date = "2024/06/10"
5
6[transform]
7[[transform.osquery]]
8label = "Osquery - Retrieve DNS Cache"
9query = "SELECT * FROM dns_cache"
10
11[[transform.osquery]]
12label = "Osquery - Retrieve All Services"
13query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
14
15[[transform.osquery]]
16label = "Osquery - Retrieve Services Running on User Accounts"
17query = """
18SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
19NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
20user_account == null)
21"""
22
23[[transform.osquery]]
24label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
25query = """
26SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
27services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
28authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
29"""
30
31
32[rule]
33author = ["Elastic"]
34description = """
35This rule is triggered when a URL indicator from the Threat Intel Filebeat module or integrations has a match against an
36event that contains URL data, like DNS events, network logs, etc.
37"""
38from = "now-65m"
39index = ["auditbeat-*", "endgame-*", "filebeat-*", "logs-*", "packetbeat-*", "winlogbeat-*"]
40interval = "1h"
41language = "kuery"
42license = "Elastic License v2"
43name = "Threat Intel URL Indicator Match"
44note = """## Triage and Analysis
45
46### Investigating Threat Intel URL Indicator Match
47
48Threat Intel indicator match rules allow matching from a local observation, such as an endpoint event that records a file hash with an entry of a file hash stored within the Threat Intel integrations index.
49
50Matches are based on threat intelligence data that's been ingested during the last 30 days. Some integrations don't place expiration dates on their threat indicators, so we strongly recommend validating ingested threat indicators and reviewing match results. When reviewing match results, check associated activity to determine whether the event requires additional investigation.
51
52This rule is triggered when a URL indicator from the Threat Intel Filebeat module or a threat intelligence integration matches against an event that contains URL data, like DNS events, network logs, etc.
53
54> **Note**:
55> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
56
57#### Possible investigation steps
58
59- Investigate the URL, which can be found in the `threat.indicator.matched.atomic` field:
60 - Identify the type of malicious activity related to the URL (phishing, malware, etc.).
61 - Check the reputation of the IP address in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
62 - Execute a WHOIS lookup to retrieve information about the domain registration and contacts to report abuse.
63 - If dealing with a phishing incident:
64 - Contact the user to gain more information around the delivery method, information sent, etc.
65 - Analyze whether the URL is trying to impersonate a legitimate address. Look for typosquatting, extra or unusual subdomains, or other anomalies that could lure the user.
66 - Investigate the phishing page to identify which information may have been sent to the attacker by the user.
67- Identify the process responsible for the connection, and 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.
68- Retrieve the involved process executable and examine the host for derived artifacts that indicate suspicious activities:
69 - Analyze the process executable using a private sandboxed analysis system.
70 - Observe and collect information about the following activities in both the sandbox and the alert subject host:
71 - Attempts to contact external domains and addresses.
72 - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process' `process.entity_id`.
73 - Examine the DNS cache for suspicious or anomalous entries.
74 - $osquery_0
75 - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
76 - Examine the host services for suspicious or anomalous entries.
77 - $osquery_1
78 - $osquery_2
79 - $osquery_3
80- Using the data collected through the analysis, scope users targeted and other machines infected in the environment.
81
82### False Positive Analysis
83
84- False positives might occur after large and publicly written campaigns if curious employees interact with attacker infrastructure.
85- Some feeds may include internal or known benign addresses by mistake (e.g., 8.8.8.8, google.com, 127.0.0.1, etc.). Make sure you understand how blocking a specific domain or address might impact the organization or normal system functioning.
86
87### Response and Remediation
88
89- Initiate the incident response process based on the outcome of the triage.
90- Isolate the involved host to prevent further post-compromise behavior.
91- If the triage identified malware, search the environment for additional compromised hosts.
92 - Implement temporary network rules, procedures, and segmentation to contain the malware.
93 - Stop suspicious processes.
94 - Immediately block the identified indicators of compromise (IoCs).
95 - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
96- Consider reporting the address for abuse using the provided contact information.
97- Remove and block malicious artifacts identified during triage.
98- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
99- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
100- 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).
101"""
102references = [
103 "https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-threatintel.html",
104 "https://www.elastic.co/guide/en/security/master/es-threat-intel-integrations.html",
105 "https://www.elastic.co/security/tip",
106]
107risk_score = 99
108rule_id = "f3e22c8b-ea47-45d1-b502-b57b6de950b3"
109setup = """## Setup
110
111This rule needs threat intelligence indicators to work.
112Threat intelligence indicators can be collected using an [Elastic Agent integration](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html#agent-ti-integration),
113the [Threat Intel module](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html#ti-mod-integration),
114or a [custom integration](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html#custom-ti-integration).
115
116More information can be found [here](https://www.elastic.co/guide/en/security/current/es-threat-intel-integrations.html).
117"""
118severity = "critical"
119tags = ["OS: Windows", "Data Source: Elastic Endgame", "Rule Type: Threat Match"]
120threat_index = ["filebeat-*", "logs-ti_*"]
121threat_indicator_path = "threat.indicator"
122threat_language = "kuery"
123threat_query = """
124@timestamp >= "now-30d/d" and event.module:(threatintel or ti_*) and threat.indicator.url.full:* and not
125labels.is_ioc_transform_source:"true"
126"""
127timeline_id = "495ad7a7-316e-4544-8a0f-9c098daee76e"
128timeline_title = "Generic Threat Match Timeline"
129timestamp_override = "event.ingested"
130type = "threat_match"
131
132query = '''
133url.full:*
134'''
135
136
137[[rule.threat_filters]]
138
139[rule.threat_filters."$state"]
140store = "appState"
141[rule.threat_filters.meta]
142disabled = false
143key = "event.category"
144negate = false
145type = "phrase"
146[rule.threat_filters.meta.params]
147query = "threat"
148[rule.threat_filters.query.match_phrase]
149"event.category" = "threat"
150[[rule.threat_filters]]
151
152[rule.threat_filters."$state"]
153store = "appState"
154[rule.threat_filters.meta]
155disabled = false
156key = "event.kind"
157negate = false
158type = "phrase"
159[rule.threat_filters.meta.params]
160query = "enrichment"
161[rule.threat_filters.query.match_phrase]
162"event.kind" = "enrichment"
163[[rule.threat_filters]]
164
165[rule.threat_filters."$state"]
166store = "appState"
167[rule.threat_filters.meta]
168disabled = false
169key = "event.type"
170negate = false
171type = "phrase"
172[rule.threat_filters.meta.params]
173query = "indicator"
174[rule.threat_filters.query.match_phrase]
175"event.type" = "indicator"
176[[rule.threat_mapping]]
177
178[[rule.threat_mapping.entries]]
179field = "url.full"
180type = "mapping"
181value = "threat.indicator.url.full"
182
183[[rule.threat_mapping]]
184
185[[rule.threat_mapping.entries]]
186field = "url.original"
187type = "mapping"
188value = "threat.indicator.url.original"
Triage and Analysis
Investigating Threat Intel URL Indicator Match
Threat Intel indicator match rules allow matching from a local observation, such as an endpoint event that records a file hash with an entry of a file hash stored within the Threat Intel integrations index.
Matches are based on threat intelligence data that's been ingested during the last 30 days. Some integrations don't place expiration dates on their threat indicators, so we strongly recommend validating ingested threat indicators and reviewing match results. When reviewing match results, check associated activity to determine whether the event requires additional investigation.
This rule is triggered when a URL indicator from the Threat Intel Filebeat module or a threat intelligence integration matches against an event that contains URL data, like DNS events, network logs, etc.
Note: This investigation guide uses the Osquery Markdown Plugin introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
Possible investigation steps
- Investigate the URL, which can be found in the
threat.indicator.matched.atomic
field:- Identify the type of malicious activity related to the URL (phishing, malware, etc.).
- Check the reputation of the IP address in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
- Execute a WHOIS lookup to retrieve information about the domain registration and contacts to report abuse.
- If dealing with a phishing incident:
- Contact the user to gain more information around the delivery method, information sent, etc.
- Analyze whether the URL is trying to impersonate a legitimate address. Look for typosquatting, extra or unusual subdomains, or other anomalies that could lure the user.
- Investigate the phishing page to identify which information may have been sent to the attacker by the user.
- Identify the process responsible for the connection, and 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.
- Retrieve the involved process executable and examine the host for derived artifacts that indicate suspicious activities:
- Analyze the process executable using a private sandboxed analysis system.
- Observe and collect information about the following activities in both the sandbox and the alert subject host:
- Attempts to contact external domains and addresses.
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process'
process.entity_id
. - Examine the DNS cache for suspicious or anomalous entries.
- $osquery_0
- Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process'
- Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
- Examine the host services for suspicious or anomalous entries.
- $osquery_1
- $osquery_2
- $osquery_3
- Attempts to contact external domains and addresses.
- Using the data collected through the analysis, scope users targeted and other machines infected in the environment.
False Positive Analysis
- False positives might occur after large and publicly written campaigns if curious employees interact with attacker infrastructure.
- Some feeds may include internal or known benign addresses by mistake (e.g., 8.8.8.8, google.com, 127.0.0.1, etc.). Make sure you understand how blocking a specific domain or address might impact the organization or normal system functioning.
Response and Remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Consider reporting the address for abuse using the provided contact information.
- Remove and block malicious artifacts identified during triage.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- 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).
References
Related rules
- Threat Intel Hash Indicator Match
- Threat Intel IP Address Indicator Match
- Threat Intel Windows Registry Indicator Match
- Deprecated - Threat Intel Filebeat Module (v8.x) Indicator Match
- Deprecated - Threat Intel Indicator Match