|
| 1 | +name: Curl Execution with Percent Encoded URL |
| 2 | +id: 9a8d5516-4c5e-11ef-9d42-acde48001122 |
| 3 | +version: 1 |
| 4 | +date: '2026-02-02' |
| 5 | +author: Nasreddine Bencherchali, Splunk |
| 6 | +status: production |
| 7 | +type: Anomaly |
| 8 | +description: | |
| 9 | + The following analytic detects the execution of the curl utility where the command line includes percent-encoded characters and explicit file output options (such as -o or --output). |
| 10 | + It leverages process execution telemetry from Endpoint Detection and Response (EDR) data sources to identify curl commands that may be using URL encoding to obfuscate download locations or payload paths. |
| 11 | + This behavior is notable because percent-encoded URLs are commonly used by adversaries to evade simple string-based detections, hide malicious infrastructure, or bypass network security controls. |
| 12 | + When combined with file download behavior, this activity may indicate malware staging, payload retrieval, or secondary tool deployment. |
| 13 | + Analysts should review the decoded URL, destination host, parent process, and downloaded file to determine whether the activity is authorized or malicious. |
| 14 | + The analytic calculates the number of percent (%) characters in the curl command line and triggers when a threshold of three or more is met, indicating potential URL encoding. |
| 15 | + Adjust the threshold as needed based on your environment and tuning requirements. |
| 16 | +data_source: |
| 17 | + - CrowdStrike ProcessRollup2 |
| 18 | + - Sysmon EventID 1 |
| 19 | + - Sysmon for Linux EventID 1 |
| 20 | + - Windows Event Log Security 4688 |
| 21 | +search: | |
| 22 | + | tstats `security_content_summariesonly` |
| 23 | + count min(_time) as firstTime |
| 24 | + max(_time) as lastTime |
| 25 | + from datamodel=Endpoint.Processes where |
| 26 | + ( |
| 27 | + Processes.process_name IN ("curl.exe", "curl") |
| 28 | + OR |
| 29 | + Processes.original_file_name="curl.exe" |
| 30 | + ) |
| 31 | + Processes.process IN ( |
| 32 | + "* --output *", |
| 33 | + "* -o *" /* Covers both options since the search is case insensitive */, |
| 34 | + ) |
| 35 | + Processes.process IN ("*%*") |
| 36 | + by Processes.action Processes.dest Processes.original_file_name |
| 37 | + Processes.parent_process Processes.parent_process_exec |
| 38 | + Processes.parent_process_guid Processes.parent_process_id |
| 39 | + Processes.parent_process_name Processes.parent_process_path |
| 40 | + Processes.process Processes.process_exec Processes.process_guid |
| 41 | + Processes.process_hash Processes.process_id |
| 42 | + Processes.process_integrity_level Processes.process_name |
| 43 | + Processes.process_path Processes.user |
| 44 | + Processes.user_id Processes.vendor_product |
| 45 | +
|
| 46 | + | `drop_dm_object_name(Processes)` |
| 47 | +
|
| 48 | + ``` |
| 49 | + Count the number of % characters in the process command line. |
| 50 | + Change this threshold based on your environment and tuning needs. |
| 51 | + ``` |
| 52 | + | eval percent_count = mvcount(split(process, "%")) - 1 |
| 53 | + | where percent_count >= 3 |
| 54 | +
|
| 55 | + | `security_content_ctime(firstTime)` |
| 56 | + | `security_content_ctime(lastTime)` |
| 57 | + | `curl_execution_with_percent_encoded_url_filter` |
| 58 | +how_to_implement: | |
| 59 | + The detection is based on data that originates from Endpoint Detection |
| 60 | + and Response (EDR) agents. These agents are designed to provide security-related |
| 61 | + telemetry from the endpoints where the agent is installed. To implement this search, |
| 62 | + you must ingest logs that contain the process GUID, process name, and parent process. |
| 63 | + Additionally, you must ingest complete command-line executions. These logs must |
| 64 | + be processed using the appropriate Splunk Technology Add-ons that are specific to |
| 65 | + the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` |
| 66 | + data model. Use the Splunk Common Information Model (CIM) to normalize the field |
| 67 | + names and speed up the data modeling process. |
| 68 | +known_false_positives: | |
| 69 | + No false positives have been identified at this time. |
| 70 | +references: |
| 71 | + - https://github.com/nasbench/Misc-Research/blob/main/LOLBINs/Curl.md |
| 72 | + - https://attack.mitre.org/techniques/T1027/ |
| 73 | + - https://attack.mitre.org/techniques/T1105/ |
| 74 | + - https://curl.se/docs/manpage.html |
| 75 | +drilldown_searches: |
| 76 | + - name: View the detection results for - "$user$" and "$dest$" |
| 77 | + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' |
| 78 | + earliest_offset: $info_min_time$ |
| 79 | + latest_offset: $info_max_time$ |
| 80 | + - name: View risk events for the last 7 days for - "$user$" and "$dest$" |
| 81 | + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", "$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' |
| 82 | + earliest_offset: $info_min_time$ |
| 83 | + latest_offset: $info_max_time$ |
| 84 | +rba: |
| 85 | + message: An instance of $parent_process_name$ spawning $process_name$ was identified on endpoint $dest$ by user $user$ with URL-encoded parameters $process$. |
| 86 | + risk_objects: |
| 87 | + - field: user |
| 88 | + type: user |
| 89 | + score: 50 |
| 90 | + - field: dest |
| 91 | + type: system |
| 92 | + score: 50 |
| 93 | + threat_objects: |
| 94 | + - field: parent_process_name |
| 95 | + type: parent_process_name |
| 96 | + - field: process_name |
| 97 | + type: process_name |
| 98 | + - field: process |
| 99 | + type: process |
| 100 | +tags: |
| 101 | + analytic_story: |
| 102 | + - Compromised Windows Host |
| 103 | + - Ingress Tool Transfer |
| 104 | + - Living Off The Land |
| 105 | + asset_type: Endpoint |
| 106 | + mitre_attack_id: |
| 107 | + - T1027 |
| 108 | + - T1105 |
| 109 | + product: |
| 110 | + - Splunk Enterprise |
| 111 | + - Splunk Enterprise Security |
| 112 | + - Splunk Cloud |
| 113 | + security_domain: endpoint |
| 114 | +tests: |
| 115 | + - name: True Positive Test - Sysmon Linux |
| 116 | + attack_data: |
| 117 | + - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1027/url_encoded_curl/linux-sysmon.log |
| 118 | + source: Syslog:Linux-Sysmon/Operational |
| 119 | + sourcetype: sysmon:linux |
| 120 | + - name: True Positive Test - Sysmon Windows |
| 121 | + attack_data: |
| 122 | + - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1027/url_encoded_curl/windows-sysmon.log |
| 123 | + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
| 124 | + sourcetype: XmlWinEventLog |
0 commit comments