File Transfer Utility Launched from Unusual Parent
This rule leverages ESQL to detect the execution of unusual file transfer utilities on Linux systems. Attackers may use these utilities to exfiltrate data from a compromised system. ESQL rules have limited fields available in its alert documents. Make sure to review the original documents to aid in the investigation of this alert.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/02/21"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2026/09/18"
6
7[rule]
8author = ["Elastic"]
9description = """
10This rule leverages ESQL to detect the execution of unusual file transfer utilities on Linux systems. Attackers may use
11these utilities to exfiltrate data from a compromised system. ESQL rules have limited fields available in its alert
12documents. Make sure to review the original documents to aid in the investigation of this alert.
13"""
14from = "now-61m"
15interval = "1h"
16language = "esql"
17license = "Elastic License v2"
18name = "File Transfer Utility Launched from Unusual Parent"
19note = """ ## Triage and analysis
20
21> **Disclaimer**:
22> 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.
23
24### Investigating File Transfer Utility Launched from Unusual Parent
25
26File transfer utilities like scp, ftp, and rsync are essential for data movement in Linux environments. However, adversaries can exploit these tools to exfiltrate sensitive data. The detection rule identifies suspicious executions of these utilities by monitoring process activities, focusing on rare occurrences and unique agent IDs, which may indicate unauthorized data transfers. This helps in early detection of potential data breaches.
27
28### Possible investigation steps
29
30- Review the process.command_line field to understand the exact command executed and assess if it aligns with typical usage patterns or if it appears suspicious.
31- Examine the process.parent.executable field to determine the parent process that initiated the file transfer utility, which may provide insights into whether the execution was part of a legitimate workflow or potentially malicious activity.
32- Check the agent.id field to identify the specific host involved in the alert and correlate it with other security events or logs from the same host to gather additional context.
33- Investigate the @timestamp field to verify the timing of the event and cross-reference with any known scheduled tasks or user activities that could explain the execution.
34- Analyze the host.os.type field to confirm the operating system and ensure that the alert pertains to a Linux environment, as expected by the rule.
35
36### False positive analysis
37
38- Routine administrative tasks using file transfer utilities may trigger alerts. Regularly scheduled backups or updates using scp, rsync, or ftp should be documented and excluded from alerts by creating exceptions for known scripts or cron jobs.
39- Automated system updates or patches that utilize these utilities can be mistaken for suspicious activity. Identify and whitelist the processes and command lines associated with these updates to prevent false positives.
40- Internal data transfers between trusted servers for legitimate business purposes might be flagged. Establish a list of trusted agent IDs and exclude them from the rule to avoid unnecessary alerts.
41- Development and testing environments often use these utilities for transferring test data. Ensure that these environments are recognized and excluded by specifying their hostnames or IP addresses in the rule configuration.
42- User-initiated file transfers for legitimate reasons, such as data analysis or reporting, can be misinterpreted. Educate users to notify the security team of such activities in advance, allowing for temporary exceptions to be made.
43
44### Response and remediation
45
46- Immediately isolate the affected Linux system from the network to prevent further data exfiltration and unauthorized access.
47- Terminate any suspicious file transfer processes identified by the alert, such as scp, ftp, or rsync, to halt ongoing data transfers.
48- Conduct a thorough review of the process command lines and parent executables to identify any malicious scripts or unauthorized software that initiated the file transfer.
49- Change credentials and access keys associated with the compromised system to prevent further unauthorized access.
50- Escalate the incident to the security operations team for a deeper forensic analysis to determine the extent of the breach and identify any additional compromised systems.
51- Implement network monitoring to detect any further attempts of unauthorized file transfers or suspicious activities from the affected system.
52- Update and enhance endpoint detection and response (EDR) solutions to improve detection capabilities for similar threats in the future.
53"""
54risk_score = 47
55rule_id = "8eeeda11-dca6-4c3e-910f-7089db412d1c"
56setup = """## Setup
57
58This rule requires data coming in from one of the following integrations:
59- Elastic Defend
60
61### Elastic Defend Integration Setup
62Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
63
64#### Prerequisite Requirements:
65- Fleet is required for Elastic Defend.
66- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
67
68#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
69- Go to the Kibana home page and click "Add integrations".
70- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
71- Click "Add Elastic Defend".
72- Configure the integration name and optionally add a description.
73- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
74- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
75- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
76- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
77For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
78- Click "Save and Continue".
79- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
80For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
81"""
82severity = "medium"
83tags = [
84 "Domain: Endpoint",
85 "OS: Linux",
86 "Use Case: Threat Detection",
87 "Tactic: Exfiltration",
88 "Tactic: Execution",
89 "Data Source: Elastic Defend",
90 "Resources: Investigation Guide",
91 "Noise: Medium",
92 "Performance: Normal",
93 "Rule Type: ES|QL",
94 "Platform: Linux",
95]
96timestamp_override = "event.ingested"
97type = "esql"
98query = '''
99from logs-endpoint.events.process-* metadata _id, _index, _version
100| mv_expand event.action
101| where
102 host.os.type == "linux" and
103 event.type == "start" and
104 event.action == "exec" and
105 process.name in ("scp", "ftp", "sftp", "vsftpd", "sftp-server", "rsync") and (
106 (process.parent.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish")) or
107 (
108 process.parent.name like ".*" or
109 process.parent.name like "*.elf" or
110 process.parent.name like "*.sh" or
111 process.parent.name like "*.py" or
112 process.parent.name like "*.rb" or
113 process.parent.name like "*.pl" or
114 process.parent.name like "*.lua*" or
115 process.parent.name like "*.php*" or
116 process.parent.name like "*.js"
117 ) or
118 (
119 process.parent.executable like "/tmp/*" or
120 process.parent.executable like "/var/tmp/*" or
121 process.parent.executable like "/dev/shm/*" or
122 process.parent.executable like "./*" or
123 process.parent.executable like "/run/*" or
124 process.parent.executable like "/var/run/*" or
125 process.parent.executable like "/boot/*" or
126 process.parent.executable like "/sys/*" or
127 process.parent.executable like "/lost+found/*" or
128 process.parent.executable like "/proc/*" or
129 process.parent.executable like "/var/mail/*" or
130 process.parent.executable like "/var/www/*" or
131 process.parent.executable like "/home/*" or
132 process.parent.executable like "/root/*"
133 )
134 )
135
136| keep
137 @timestamp,
138 _id,
139 _index,
140 _version,
141 host.os.type,
142 event.type,
143 event.action,
144 process.name,
145 process.parent.name,
146 process.parent.executable,
147 process.executable,
148 agent.id,
149 host.name,
150 data_stream.dataset,
151 data_stream.namespace
152
153| stats
154 Esql.event_count = count(),
155 Esql.agent_id_count_distinct = count_distinct(agent.id),
156 Esql.host_name_values = values(host.name),
157 Esql.agent_id_values = values(agent.id),
158 Esql.data_stream_dataset_values = values(data_stream.dataset),
159 Esql.data_stream_namespace_values = values(data_stream.namespace)
160
161 by process.executable, process.parent.executable
162
163| where
164 Esql.agent_id_count_distinct == 1 and
165 Esql.event_count < 5
166| sort Esql.event_count asc
167
168// Extract unique values to ECS fields for alerts exclusion
169| eval agent.id = mv_min(Esql.agent_id_values),
170 host.name = mv_min(Esql.host_name_values)
171
172| keep agent.id, host.name, process.executable, process.parent.executable, Esql.*
173'''
174
175[[rule.threat]]
176framework = "MITRE ATT&CK"
177
178[[rule.threat.technique]]
179id = "T1048"
180name = "Exfiltration Over Alternative Protocol"
181reference = "https://attack.mitre.org/techniques/T1048/"
182
183[rule.threat.tactic]
184id = "TA0010"
185name = "Exfiltration"
186reference = "https://attack.mitre.org/tactics/TA0010/"
187
188[[rule.threat]]
189framework = "MITRE ATT&CK"
190
191[[rule.threat.technique]]
192id = "T1059"
193name = "Command and Scripting Interpreter"
194reference = "https://attack.mitre.org/techniques/T1059/"
195
196[[rule.threat.technique.subtechnique]]
197id = "T1059.004"
198name = "Unix Shell"
199reference = "https://attack.mitre.org/techniques/T1059/004/"
200
201[rule.threat.tactic]
202id = "TA0002"
203name = "Execution"
204reference = "https://attack.mitre.org/tactics/TA0002/"
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 File Transfer Utility Launched from Unusual Parent
File transfer utilities like scp, ftp, and rsync are essential for data movement in Linux environments. However, adversaries can exploit these tools to exfiltrate sensitive data. The detection rule identifies suspicious executions of these utilities by monitoring process activities, focusing on rare occurrences and unique agent IDs, which may indicate unauthorized data transfers. This helps in early detection of potential data breaches.
Possible investigation steps
- Review the process.command_line field to understand the exact command executed and assess if it aligns with typical usage patterns or if it appears suspicious.
- Examine the process.parent.executable field to determine the parent process that initiated the file transfer utility, which may provide insights into whether the execution was part of a legitimate workflow or potentially malicious activity.
- Check the agent.id field to identify the specific host involved in the alert and correlate it with other security events or logs from the same host to gather additional context.
- Investigate the @timestamp field to verify the timing of the event and cross-reference with any known scheduled tasks or user activities that could explain the execution.
- Analyze the host.os.type field to confirm the operating system and ensure that the alert pertains to a Linux environment, as expected by the rule.
False positive analysis
- Routine administrative tasks using file transfer utilities may trigger alerts. Regularly scheduled backups or updates using scp, rsync, or ftp should be documented and excluded from alerts by creating exceptions for known scripts or cron jobs.
- Automated system updates or patches that utilize these utilities can be mistaken for suspicious activity. Identify and whitelist the processes and command lines associated with these updates to prevent false positives.
- Internal data transfers between trusted servers for legitimate business purposes might be flagged. Establish a list of trusted agent IDs and exclude them from the rule to avoid unnecessary alerts.
- Development and testing environments often use these utilities for transferring test data. Ensure that these environments are recognized and excluded by specifying their hostnames or IP addresses in the rule configuration.
- User-initiated file transfers for legitimate reasons, such as data analysis or reporting, can be misinterpreted. Educate users to notify the security team of such activities in advance, allowing for temporary exceptions to be made.
Response and remediation
- Immediately isolate the affected Linux system from the network to prevent further data exfiltration and unauthorized access.
- Terminate any suspicious file transfer processes identified by the alert, such as scp, ftp, or rsync, to halt ongoing data transfers.
- Conduct a thorough review of the process command lines and parent executables to identify any malicious scripts or unauthorized software that initiated the file transfer.
- Change credentials and access keys associated with the compromised system to prevent further unauthorized access.
- Escalate the incident to the security operations team for a deeper forensic analysis to determine the extent of the breach and identify any additional compromised systems.
- Implement network monitoring to detect any further attempts of unauthorized file transfers or suspicious activities from the affected system.
- Update and enhance endpoint detection and response (EDR) solutions to improve detection capabilities for similar threats in the future.
Related rules
- Curl or Wget Egress Network Connection via LoLBin
- LLM-Based Curl Activity Triage
- Potential Malware-Driven SSH Brute Force Attempt
- AWS EC2 LOLBin Execution via SSM SendCommand
- At Job Created or Modified