Windows File Transfer Protocol In Non-Common Process Path

Original Source: [splunk source]
Name:Windows File Transfer Protocol In Non-Common Process Path
id:0f43758f-1fe9-470a-a9e4-780acc4d5407
version:3
date:2024-09-30
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("*\\program files*", "*\\windows\\system32\\*","*\\windows\\SysWOW64\\*")) (DestinationPortName="ftp" OR DestinationPort=21)
| stats count min(_time) as firstTime max(_time) as lastTime by Image DestinationPort DestinationPortName DestinationHostname DestinationIp SourcePort SourcePortName Protocol SourceHostname dest user
| `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 application may use this network protocol as part of its feature. Filter is needed.
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$") 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)`'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
tags:
  analytic_story:
    - 'AgentTesla'
    - 'Snake Keylogger'
  asset_type:Endpoint
  confidence:30
  impact:30
  message:a process $Image$ is having a FTP connection to $DestinationHostname$ in $dest$
  mitre_attack_id:
    - 'T1071.003'
    - 'T1071'
  observable:
    name:'dest'
    type:'Hostname'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'Image'
    - 'DestinationPort'
    - 'DestinationPortName'
    - 'DestinationHostname'
    - 'SourceHostname'
    - 'SourcePort'
    - 'SourcePortName'
    - 'Protocol'
    - 'DestinationIp'
    - 'dest'
    - 'user'
  risk_score:9
  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
  update_timestamp: True
manual_test:None

Related Analytic Stories


Snake Keylogger

AgentTesla