
The LOLBas (Living Off The Land Binaries, Scripts, and Libraries) project documents numerous native Windows tools that can be abused for malicious purposes. These legitimate system components are frequently exploited in red team operations and APT attacks to bypass security controls and perform malicious actions.
ftp.exe is a built-in Windows FTP client, primarily used for FTP connections and file operations.
This tool supports reading and executing commands from a text file. Attackers can exploit the exclamation mark escape feature in the FTP client—by prefixing commands with an exclamation mark (!), local system commands are executed instead of FTP server commands. By crafting a text file containing such escape commands, attackers can bypass traditional process monitoring and achieve covert command execution.
In real-world attacks, abnormal use of these legitimate tools is often highly stealthy and can easily evade simple process-name-based detection methods. Quickly identifying abnormal usage patterns of these tools is crucial for detecting advanced threats.
Write detection rules to identify suspicious command execution behavior via the ftp.exe tool.
When writing detection queries, ensure the IpAddress field is included in the output for further validation.
Data source: Sysmon; sample data:
{ "Channel": "Microsoft-Windows-Sysmon/Operational", "CommandLine": "ftp -s:ftpcommands.txt", "Company": "Microsoft Corporation", "Computer": "DESKTOP-xxxxx", "CurrentDirectory": "C:\\Users\\admin\\", "Description": "File Transfer Program", "EventId": 1, "FileVersion": "10.0.19041.1 (WinBuild.160101.0800)", "Hashes": "MD5=7DB5A93B4113369B03D1F18D8325FEF6,SHA256=9728A3B5755A67A4EBE91A04730EFCC2CABEBACBB41FFCA75A71B42502E3D7D5,IMPHASH=77FB959251723204D9A218FADEE0AF08", "Image": "C:\\Windows\\System32\\ftp.exe", "IntegrityLevel": "Medium", "LogonGuid": "{769c9af7-407c-6867-bd8c-1a0700000000}", "LogonId": "0x71a8cbd", "OriginalFileName": "ftp.exe", "ParentCommandLine": "\"C:\\WINDOWS\\system32\\cmd.exe\" ", "ParentImage": "C:\\Windows\\System32\\cmd.exe", "ParentProcessGuid": "{769c9af7-842d-6867-040b-000000000900}", "ParentProcessId": "100", "ParentUser": "DESKTOP-xxxxx\\admin", "ProcessGuid": "{769c9af7-8446-6867-060b-000000000900}", "ProcessId": "8916", "Product": "Microsoft? Windows? Operating System", "RuleName": "-", "SystemTime": "2025-07-04T07:35:34.1026147Z", "TerminalSessionId": "2", "User": "DESKTOP-xxxxx\\admin", "UtcTime": "2025-07-04 07:35:34.096",}
No fields found