Potential File Transfer via Curl for Windows
Identifies Curl for Windows making an HTTP request. Adversaries could abuse Curl to download files or upload data to a remote URL.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/02/03"
3integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
4maturity = "production"
5updated_date = "2025/03/20"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies Curl for Windows making an HTTP request. Adversaries could abuse Curl to download files or upload data to a
11remote URL.
12"""
13from = "now-9m"
14index = [
15 "endgame-*",
16 "logs-crowdstrike.fdr*",
17 "logs-endpoint.events.process-*",
18 "logs-m365_defender.event-*",
19 "logs-sentinel_one_cloud_funnel.*",
20 "logs-system.security*",
21 "logs-windows.forwarded*",
22 "logs-windows.sysmon_operational-*",
23 "winlogbeat-*",
24]
25language = "eql"
26license = "Elastic License v2"
27name = "Potential File Transfer via Curl for Windows"
28note = """## Triage and analysis
29
30### Investigating Potential File Transfer via Curl for Windows
31
32This rule identifies the use of Curl for Windows to download files from a remote URL or post data to a remote site.
33
34#### Possible investigation steps
35
36- 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.
37- Identify the user account that performed the action and whether it should perform this kind of action.
38- Contact the account owner and confirm whether they are aware of this activity.
39- Investigate other alerts associated with the user/host during the past 48 hours.
40- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
41- Examine the details of the dropped file, and whether it was executed.
42- Check the reputation of the domain or IP address used to host the downloaded file or if the user downloaded the file from an internal system.
43- Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
44
45### False positive analysis
46
47- This activity is unusual but can be done by administrators. Benign true positives (B-TPs) can be added as exceptions if necessary.
48
49### Response and remediation
50
51- Initiate the incident response process based on the outcome of the triage.
52- Isolate the involved host to prevent further post-compromise behavior.
53- If the triage identified malware, search the environment for additional compromised hosts.
54 - Implement temporary network rules, procedures, and segmentation to contain the malware.
55 - Stop suspicious processes.
56 - Immediately block the identified indicators of compromise (IoCs).
57 - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
58- Remove and block malicious artifacts identified during triage.
59- 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.
60- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
61- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
62- 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).
63"""
64references = ["https://attack.mitre.org/techniques/T1105/"]
65risk_score = 21
66rule_id = "2e0051cb-51f8-492f-9d90-174e16b5e96b"
67severity = "low"
68tags = [
69 "Domain: Endpoint",
70 "OS: Windows",
71 "Use Case: Threat Detection",
72 "Tactic: Command and Control",
73 "Data Source: Elastic Endgame",
74 "Data Source: Elastic Defend",
75 "Data Source: Windows Security Event Logs",
76 "Data Source: Microsoft Defender for Endpoint",
77 "Data Source: SentinelOne",
78 "Data Source: Crowdstrike",
79 "Data Source: Sysmon",
80 "Resources: Investigation Guide",
81]
82timestamp_override = "event.ingested"
83type = "eql"
84
85query = '''
86process where host.os.type == "windows" and event.type == "start" and
87 process.executable : (
88 "?:\\Windows\\System32\\curl.exe",
89 "?:\\Windows\\SysWOW64\\curl.exe"
90 ) and
91 process.command_line : "*http*" and
92 process.parent.name : (
93 "cmd.exe", "powershell.exe",
94 "rundll32.exe", "explorer.exe",
95 "conhost.exe", "forfiles.exe",
96 "wscript.exe", "cscript.exe",
97 "mshta.exe", "hh.exe", "mmc.exe"
98 ) and
99 not (
100 user.id == "S-1-5-18" and
101 /* Don't apply the user.id exclusion to Sysmon for compatibility */
102 not event.dataset : ("windows.sysmon_operational", "windows.sysmon")
103 ) and
104 /* Exclude System Integrity Processes for Sysmon */
105 not ?winlog.event_data.IntegrityLevel == "System"
106'''
107
108
109[[rule.threat]]
110framework = "MITRE ATT&CK"
111[[rule.threat.technique]]
112id = "T1105"
113name = "Ingress Tool Transfer"
114reference = "https://attack.mitre.org/techniques/T1105/"
115
116
117[rule.threat.tactic]
118id = "TA0011"
119name = "Command and Control"
120reference = "https://attack.mitre.org/tactics/TA0011/"
toml
Triage and analysis
Investigating Potential File Transfer via Curl for Windows
This rule identifies the use of Curl for Windows to download files from a remote URL or post data to a remote site.
Possible investigation steps
- 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.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
- Examine the details of the dropped file, and whether it was executed.
- Check the reputation of the domain or IP address used to host the downloaded file or if the user downloaded the file from an internal system.
- Retrieve the files' SHA-256 hash values using the PowerShell
Get-FileHash
cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
False positive analysis
- This activity is unusual but can be done by administrators. Benign true positives (B-TPs) can be added as exceptions if necessary.
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.
- Remove and block malicious artifacts identified during triage.
- 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.
- 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
- Attempt to Establish VScode Remote Tunnel
- Potential File Download via a Headless Browser
- Potential File Transfer via Certreq
- Potential Remote Desktop Tunneling Detected
- Remote File Download via Desktopimgdownldr Utility