Potential Data Exfiltration Through Curl
Detects the use of curl to upload an archived file to an internet server. Threat actors often will collect data on a system and compress it in an archive file before exfiltrating the file back to their C2 server for review. Many threat actors have been seen utilizing curl to upload this archive file with the collected data to do this. Use of curl in this way while not inherently malicious should be considered highly abnormal and suspicious activity.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/04/29"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2025/04/29"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects the use of curl to upload an archived file to an internet server. Threat actors often will collect data on a
11system and compress it in an archive file before exfiltrating the file back to their C2 server for review. Many threat
12actors have been seen utilizing curl to upload this archive file with the collected data to do this. Use of curl in this
13way while not inherently malicious should be considered highly abnormal and suspicious activity.
14"""
15from = "now-9m"
16index = ["logs-endpoint.events.process*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Potential Data Exfiltration Through Curl"
20references = ["https://everything.curl.dev/usingcurl/uploads"]
21risk_score = 47
22rule_id = "be70614d-4295-473c-a953-582aef41c865"
23setup = """## Setup
24
25This rule requires data coming in from Elastic Defend.
26
27### Elastic Defend Integration Setup
28Elastic 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.
29
30#### Prerequisite Requirements:
31- Fleet is required for Elastic Defend.
32- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
33
34#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
35- Go to the Kibana home page and click "Add integrations".
36- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
37- Click "Add Elastic Defend".
38- Configure the integration name and optionally add a description.
39- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
40- 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).
41- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
42- 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.
43For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
44- Click "Save and Continue".
45- 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.
46For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
47
48Elastic Defend integration does not collect environment variable logging by default.
49In order to capture this behavior, this rule requires a specific configuration option set within the advanced settings of the Elastic Defend integration.
50 #### To set up environment variable capture for an Elastic Agent policy:
51- Go to “Security → Manage → Policies”.
52- Select an “Elastic Agent policy”.
53- Click “Show advanced settings”.
54- Scroll down or search for “linux.advanced.capture_env_vars”.
55- Enter the names of environment variables you want to capture, separated by commas.
56- For this rule the linux.advanced.capture_env_vars variable should be set to "HTTP_PROXY,HTTPS_PROXY,ALL_PROXY".
57- Click “Save”.
58After saving the integration change, the Elastic Agents running this policy will be updated and the rule will function properly.
59For more information on capturing environment variables refer to the [helper guide](https://www.elastic.co/guide/en/security/current/environment-variable-capture.html).
60"""
61severity = "medium"
62tags = [
63 "Domain: Endpoint",
64 "OS: Linux",
65 "Use Case: Threat Detection",
66 "Tactic: Exfiltration",
67 "Data Source: Elastic Defend",
68]
69timestamp_override = "event.ingested"
70type = "eql"
71query = '''
72process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and process.name == "curl" and
73process.parent.executable != null and (process.args in ("-F", "-T", "-d") or process.args like "--data*") and
74process.command_line like~ ("*@/*.zip*", "*@/*.gz*", "*@/*.tgz*", "*b64=@*", "*=<*") and
75process.command_line like~ "*http*"
76'''
77
78[[rule.threat]]
79framework = "MITRE ATT&CK"
80
81 [rule.threat.tactic]
82 name = "Exfiltration"
83 id = "TA0010"
84 reference = "https://attack.mitre.org/tactics/TA0010/"
85
86 [[rule.threat.technique]]
87 name = "Exfiltration Over Alternative Protocol"
88 id = "T1048"
89 reference = "https://attack.mitre.org/techniques/T1048/"
References
Related rules
- Unusual File Transfer Utility Launched
- Potential Data Splitting Detected
- Potential Hex Payload Execution via Command-Line
- Potential Hex Payload Execution via Common Utility
- Potential Backdoor Execution Through PAM_EXEC