Windows: Detect sftp.exe used as a LOLBIN via -D option
Alerts on Windows executions of sftp.exe using the -D flag with a path argument.
- Product
- windows
- Category
- process_creation
- Author
- Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2022-11-10
- Updated
- 2026-07-31
ATT&CK techniques
Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags process executions where the Image ends with sftp.exe and the CommandLine includes the -D option followed by a path, indicating potential LOLBIN abuse. Attackers can use legitimate binaries like sftp.exe to proxy execution steps or access attacker-controlled file paths while blending into normal activity. The detection relies on Windows process creation telemetry with access to the executed binary name and full command line.
Reporting behind it
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows: Detect sftp.exe used as a LOLBIN via -D option"
id: 801f1bdd-ef20-48bc-b6cc-0069039fbe31
status: test
description: This rule flags process executions where the Image ends with sftp.exe and the CommandLine includes the -D option followed by a path, indicating potential LOLBIN abuse. Attackers can use legitimate binaries like sftp.exe to proxy execution steps or access attacker-controlled file paths while blending into normal activity. The detection relies on Windows process creation telemetry with access to the executed binary name and full command line.
references:
- https://github.com/LOLBAS-Project/LOLBAS/pull/264
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_lolbin_sftp.yml
author: Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2022-11-10
tags:
- attack.execution
- attack.stealth
- attack.t1218
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: \sftp.exe
CommandLine|contains:
- " -D .."
- " -D C:\\"
condition: selection
falsepositives:
- Unknown
level: medium
license: DRL-1.1
related:
- id: a85ffc3a-e8fd-4040-93bf-78aff284d801
type: derived