LoFP LoFP / 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.

Techniques

Sample rules

Windows File Transfer Protocol In Non-Common Process Path

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.

Detection logic

`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`