Suspected Lateral Movement from Compromised Host

Detects potential lateral movement or post-compromise activity by correlating alerts where the host.ip of one alert matches the source.ip of a subsequent alert. This behavior may indicate a compromised host being used to authenticate to another system or resource, including cloud services.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2025/12/31"
 3maturity = "production"
 4updated_date = "2025/12/31"
 5
 6[rule]
 7author = ["Elastic"]
 8description = """
 9Detects potential lateral movement or post-compromise activity by correlating alerts where the host.ip of one alert matches
10the source.ip of a subsequent alert. This behavior may indicate a compromised host being used to authenticate to another system
11or resource, including cloud services.
12"""
13from = "now-30m"
14interval = "29m"
15language = "esql"
16license = "Elastic License v2"
17name = "Suspected Lateral Movement from Compromised Host"
18risk_score = 73
19rule_id = "171a4981-9c1a-4a03-9028-21cff4b27b38"
20severity = "high"
21tags = ["Use Case: Threat Detection", "Rule Type: Higher-Order Rule", "Resources: Investigation Guide"]
22timestamp_override = "event.ingested"
23type = "esql"
24
25query = '''
26from .alerts-security.*
27
28// any alerts excluding deprecated, low severity and threat_match rules
29| where kibana.alert.rule.name is not null and kibana.alert.risk_score > 21 and
30        kibana.alert.rule.type != "threat_match" and
31        not kibana.alert.rule.name like "Deprecated - *"
32
33// alerts with existing source.ip or host.ip
34| eval alert_source_ip = CASE(source.ip is not null, source.ip, null),
35       alert_host_ip = CASE(host.ip is not null and source.ip is null, host.ip, null)
36
37| eval Esql.source_ip = COALESCE(alert_source_ip, alert_host_ip)
38| where Esql.source_ip is not null and Esql.source_ip != "127.0.0.1" and Esql.source_ip != "::1"
39
40| stats Esql.alerts_count = COUNT(*),
41        Esql.event_module_distinct_count = COUNT_DISTINCT(event.module),
42        Esql.host_id_distinct_count = COUNT_DISTINCT(host.id),
43        Esql.rule_name_distinct_count = COUNT_DISTINCT(kibana.alert.rule.name),
44        Esql.event_module_values = VALUES(event.module),
45        Esql.message_values = VALUES(message),
46        Esql.rule_name = VALUES(kibana.alert.rule.name),
47        Esql.event_action_values = VALUES(event.action),
48        Esql.event_category_values = VALUES(event.category),
49        Esql.process_executable_values = VALUES(process.executable),
50        Esql.process_cmdline_values = VALUES(process.command_line),
51        Esql.file_path_values = VALUES(file.path),
52        Esql.host_id_values = VALUES(host.id),
53        Esql.host_ip_values = VALUES(host.ip),
54        Esql.destination_ip_values = VALUES(destination.ip),
55        Esql.user_name_values = VALUES(user.name),
56        SRC_IP = VALUES(source.ip)
57        by Esql.source_ip
58
59// filter for different alerts from multiple hosts and where the host.ip of one alert matches the source.ip of the other alert
60| eval concat_ip_values = MV_CONCAT(TO_STRING(Esql.host_ip_values), ",")
61| eval host_ip_equal_to_source_ip =LOCATE(concat_ip_values, TO_STRING(Esql.source_ip))
62| where Esql.rule_name_distinct_count >= 2 and Esql.host_id_distinct_count >= 2 and host_ip_equal_to_source_ip > 0 and SRC_IP is not null and Esql.alerts_count <= 100
63| KEEP Esql.*
64'''
65note = """## Triage and analysis
66
67> **Disclaimer**:
68> 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.
69
70### Investigating Suspected Lateral Movement from Compromised Host
71
72The detection rule uses alert data to determine when multiple alerts from different integrations involving the same user.name are triggered.
73
74### Possible investigation steps
75
76- Review the alert details to identify the specific host involved and the different modules and rules that triggered the alert.
77- Examine the timeline of the alerts to understand the sequence of events and determine if there is a pattern or progression in the tactics used.
78- Correlate the alert data with other logs and telemetry from the host, such as process creation, network connections, and file modifications, to gather additional context.
79- Investigate any known vulnerabilities or misconfigurations on the host that could have been exploited by the adversary.
80- Check for any indicators of compromise (IOCs) associated with the alerts, such as suspicious IP addresses, domains, or file hashes, and search for these across the network.
81- Assess the impact and scope of the potential compromise by determining if other hosts or systems have similar alerts or related activity.
82
83### False positive analysis
84
85- Vulnerability scanners.
86- Jump hosts, NAT gateways and proxies.
87
88### Response and remediation
89
90- Isolate the affected host from the network immediately to prevent further lateral movement by the adversary.
91- Conduct a thorough forensic analysis of the host to identify the specific vulnerabilities exploited and gather evidence of the attack phases involved.
92- Remove any identified malicious software or unauthorized access tools from the host, ensuring all persistence mechanisms are eradicated.
93- Apply security patches and updates to the host to address any exploited vulnerabilities and prevent similar attacks.
94- Restore the host from a known good backup if necessary, ensuring that the backup is free from compromise.
95- Monitor the host and network for any signs of re-infection or further suspicious activity, using enhanced logging and alerting based on the identified attack patterns.
96- Escalate the incident to the appropriate internal or external cybersecurity teams for further investigation and potential legal action if the attack is part of a larger campaign."""

Triage and analysis

Disclaimer: 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.

Investigating Suspected Lateral Movement from Compromised Host

The detection rule uses alert data to determine when multiple alerts from different integrations involving the same user.name are triggered.

Possible investigation steps

  • Review the alert details to identify the specific host involved and the different modules and rules that triggered the alert.
  • Examine the timeline of the alerts to understand the sequence of events and determine if there is a pattern or progression in the tactics used.
  • Correlate the alert data with other logs and telemetry from the host, such as process creation, network connections, and file modifications, to gather additional context.
  • Investigate any known vulnerabilities or misconfigurations on the host that could have been exploited by the adversary.
  • Check for any indicators of compromise (IOCs) associated with the alerts, such as suspicious IP addresses, domains, or file hashes, and search for these across the network.
  • Assess the impact and scope of the potential compromise by determining if other hosts or systems have similar alerts or related activity.

False positive analysis

  • Vulnerability scanners.
  • Jump hosts, NAT gateways and proxies.

Response and remediation

  • Isolate the affected host from the network immediately to prevent further lateral movement by the adversary.
  • Conduct a thorough forensic analysis of the host to identify the specific vulnerabilities exploited and gather evidence of the attack phases involved.
  • Remove any identified malicious software or unauthorized access tools from the host, ensuring all persistence mechanisms are eradicated.
  • Apply security patches and updates to the host to address any exploited vulnerabilities and prevent similar attacks.
  • Restore the host from a known good backup if necessary, ensuring that the backup is free from compromise.
  • Monitor the host and network for any signs of re-infection or further suspicious activity, using enhanced logging and alerting based on the identified attack patterns.
  • Escalate the incident to the appropriate internal or external cybersecurity teams for further investigation and potential legal action if the attack is part of a larger campaign.

Related rules

to-top