Identifier / Programs / Windows
sftp.exe
Secure File Transfer Program. Interactive program to copy files between hosts over SSH. For non-interactive file transfers, see scp or rsync. tldr-pages
LOLBAS Execute 2 Sigma rules name it 2 ATT&CK techniques 2 documented commands 3 known copies with hashes
How sftp.exe is abused
Execute T1202 Indirect Command Execution
-oExecute T1202 Indirect Command Execution
-dEach abuse is LOLBAS's category and the options and words it uses; the full write-up is on LOLBAS's page for sftp.exe.
2 documented commands
Execute T1202 Indirect Command Execution User privileges
Spawns ssh.exe which in turn spawns the specified command line. See also this project's entry for ssh.exe.
sftp -o ProxyCommand="{CMD}" .IdentifyTrips 2 Sigma rules: mediumIndirect Command Execution via SFTP ProxyCommand by Swachchhanda Shrawan Poudel (Nextron Systems); mediumProgram Executed Using Proxy/Local Command Via SSH.EXE by frack113, Nasreddine Bencherchali
Execute T1202 Indirect Command Execution User privileges
Spawns ssh.exe which in turn spawns the specified command line. See also this project's entry for ssh.exe.
sftp -D "{CMD}"IdentifyTrips no Sigma process-creation rule.
1 of the 2 commands the identifier reads trips a Sigma process-creation rule; 1 trips none. These commands and their descriptions are from LOLBAS’s entry for sftp.exe, by Swachchhanda Shrawan Poudel, at commit 2056cb766250 of 2026-09-26, under the GPL-3.0 and LOLBAS’s notice, with no warranty. Changed: Markdown is shown formatted. The source is in lolbas-gtfobins-commands.json.gz, and the full entry is on LOLBAS’s page for sftp.exe. The identifier reads each with LOLBAS’s placeholders filled in: a URL as https://example.com/file, a share as \\192.0.2.10\share\file, a path as C:\Data\file and a command as calc.exe.
What detects it
Is it the real sftp.exe?
C:\Windows\system32\OpenSSH\3 known copies
8.1.0.1 · C:\Windows\system32\OpenSSH\sftp.exe · signed by Microsoft Windows
a354eb6416ab635ab8059fe07fb87488793eee30fab09429e00974dbf38f90c18.1.0.1 · C:\WINDOWS\system32\OpenSSH\sftp.exe · signed by Microsoft Windows
aa70945b455d361549c7483b0c25757601d83a8d75ecc6f4571a61a62752509d7.7.2.1 · C:\Windows\system32\OpenSSH\sftp.exe · signed by Microsoft Windows
7651a9e5721c2fcee4c34a253062914ab93c7b3b415d313658b058aed4f2fde2From the file’s version info and the copies recorded by xCyclopedia (MIT). A copy in another folder, signed by someone else or with another hash is not necessarily malicious, but it is worth a closer look. In Ceplin, "<sha256>".whatis() says which known copy a hash is.
Everyday use
Connect to a remote server and enter an interactive command mode
sftp remote_user@remote_hostIdentifyConnect using an alternate port
sftp -P remote_port remote_user@remote_hostIdentifyConnect using a predefined host (in ~/.ssh/config)
sftp hostIdentifyNone of the 3 examples the identifier reads matches LOLBAS abuse or trips a Sigma process-creation rule.