Detection rules › Splunk
Windows File Transfer Protocol In Non-Common Process Path
The following analytic detects FTP connections initiated by processes located in non-standard installation paths on Windows systems. It leverages Sysmon EventCode 3 to identify network connections where the process image path does not match common directories like "Program Files" or "Windows\System32". This activity is significant as FTP is often used by adversaries and malware, such as AgentTesla, for Command and Control (C2) communications to exfiltrate stolen data. If confirmed malicious, this could lead to unauthorized data transfer, exposing sensitive information and compromising the integrity of the affected host.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Command & Control | T1071.003 Application Layer Protocol: Mail Protocols |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 3 | Network connection |
Rule body splunk
name: Windows File Transfer Protocol In Non-Common Process Path
id: 0f43758f-1fe9-470a-a9e4-780acc4d5407
version: 11
creation_date: '2022-09-21'
modification_date: '2026-05-13'
author: Teoderick Contreras, Splunk
status: production
type: Anomaly
description: The following analytic detects FTP connections initiated by processes located in non-standard installation paths on Windows systems. It leverages Sysmon EventCode 3 to identify network connections where the process image path does not match common directories like "Program Files" or "Windows\System32". This activity is significant as FTP is often used by adversaries and malware, such as AgentTesla, for Command and Control (C2) communications to exfiltrate stolen data. If confirmed malicious, this could lead to unauthorized data transfer, exposing sensitive information and compromising the integrity of the affected host.
data_source:
- Sysmon EventID 3
search: |
`sysmon`
EventCode=3
NOT Image IN(
"C:\\Program Files \(x86\)\\*",
"C:\\Program Files\\*",
"C:\\Windows\\System32\\*",
"C:\\Windows\\SysWOW64\\*"
)
(
DestinationPortName="ftp"
OR
DestinationPort=21
)
| stats count min(_time) as firstTime
max(_time) as lastTime
by action app dest dest_ip dest_port direction dvc protocol protocol_version
src src_ip src_port transport user vendor_product process_name
process_exec process_guid process_id
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_file_transfer_protocol_in_non_common_process_path_filter`
how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name and sysmon eventcode = 3 connection events from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA.
known_false_positives: Third party FTP based applications will trigger this. Apply additional filters as needed. Also consider excluding known FTP based clients installed outside of the Program Files and Windows directories.
references:
- https://malpedia.caad.fkie.fraunhofer.de/details/win.agent_tesla
drilldown_searches:
- name: View the detection results for - "$dest$"
search: '%original_detection_search% | search dest = "$dest$"'
earliest_offset: $info_min_time$
latest_offset: $info_max_time$
- name: View risk events for the last 7 days for - "$dest$"
search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") | 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)`'
earliest_offset: 7d
latest_offset: "0"
intermediate_findings:
entities:
- field: dest
type: system
score: 20
message: a process $process_name$ is having a FTP connection to $dest$ in $dest_ip$
analytic_story:
- AgentTesla
- Snake Keylogger
- Hellcat Ransomware
asset_type: Endpoint
mitre_attack_id:
- T1071.003
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: endpoint
security_domain: endpoint
tests:
- name: True Positive Test
attack_data:
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/agent_tesla/agent_tesla_ftp/sysmon.log
source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
sourcetype: XmlWinEventLog
test_type: unit
Stages and Predicates
Stage 1: search
`sysmon`
EventCode=3
NOT Image IN(
"C:\\Program Files \(x86\)\\*",
"C:\\Program Files\\*",
"C:\\Windows\\System32\\*",
"C:\\Windows\\SysWOW64\\*"
)
(
DestinationPortName="ftp"
OR
DestinationPort=21
)
Stage 2: stats
| stats count min(_time) as firstTime
max(_time) as lastTime
by action app dest dest_ip dest_port direction dvc protocol protocol_version
src src_ip src_port transport user vendor_product process_name
process_exec process_guid process_id
Stage 3: search
| `security_content_ctime(firstTime)`
Stage 4: search
| `security_content_ctime(lastTime)`
Stage 5: search
| `windows_file_transfer_protocol_in_non_common_process_path_filter`
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
Image | in | "C:\\Program Files \(x86\)\\*", "C:\\Program Files\\*", "C:\\Windows\\SysWOW64\\*", "C:\\Windows\\System32\\*" |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
DestinationPort | eq |
|
DestinationPortName | eq |
|
EventCode | eq |
|