Detection rules › Splunk
Windows Mail Protocol In Non-Common Process Path
The following analytic detects a Windows application establishing an SMTP connection from a non-common installation path. It leverages Sysmon EventCode 3 to identify processes not typically associated with email clients (e.g., Thunderbird, Outlook) making SMTP connections. This activity is significant as adversaries, including malware like AgentTesla, use such connections for Command and Control (C2) communication to exfiltrate stolen data. If confirmed malicious, this behavior could lead to unauthorized data exfiltration, including sensitive information like desktop screenshots, browser data, and system details, compromising the affected host.
Known false positives
- Third party email or SMTP based applications will trigger this. Apply additional filters as needed. Also consider excluding known email or any SMTP based clients installed outside of the Program Files and Windows directories.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 3: Network connection |
Rule body
name: Windows Mail Protocol In Non-Common Process Path
id: ac3311f5-661d-4e99-bd1f-3ec665b05441
version: 12
creation_date: '2022-09-21'
modification_date: '2026-05-13'
author: Teoderick Contreras, Splunk
status: production
type: Anomaly
description: The following analytic detects a Windows application establishing an SMTP connection from a non-common installation path. It leverages Sysmon EventCode 3 to identify processes not typically associated with email clients (e.g., Thunderbird, Outlook) making SMTP connections. This activity is significant as adversaries, including malware like AgentTesla, use such connections for Command and Control (C2) communication to exfiltrate stolen data. If confirmed malicious, this behavior could lead to unauthorized data exfiltration, including sensitive information like desktop screenshots, browser data, and system details, compromising the affected host.
data_source:
- Sysmon EventID 3
search: |
`sysmon`
EventCode=3
NOT Image IN(
"C:\\Program Files \(x86\)\\*",
"C:\\Program Files\\*",
"C:\\Windows\\System32\\*",
"C:\\Windows\\SysWOW64\\*"
)
(
DestinationPortName="smtp"
OR
DestinationPort IN (25, 587)
)
| 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_mail_protocol_in_non_common_process_path_filter`
how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name and sysmon eventcode = 3 connection events from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the Sysmon TA.
known_false_positives: Third party email or SMTP based applications will trigger this. Apply additional filters as needed. Also consider excluding known email or any SMTP based clients installed outside of the Program Files and Windows directories.
references:
- https://malpedia.caad.fkie.fraunhofer.de/details/win.agent_tesla
intermediate_findings:
entities:
- field: dest
type: system
score: 20
message: a process $process_name$ is having a SMTP connection to $dest$ in $dest_ip$
analytic_story:
- AgentTesla
asset_type: Endpoint
mitre_attack_id:
- T1071.003
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: endpoint
security_domain: endpoint
Stages and Predicates
Stage 1: search
`sysmon`
EventCode=3
NOT Image IN(
"C:\\Program Files \(x86\)\\*",
"C:\\Program Files\\*",
"C:\\Windows\\System32\\*",
"C:\\Windows\\SysWOW64\\*"
)
(
DestinationPortName="smtp"
OR
DestinationPort IN (25, 587)
)
Stage 2: stats
| 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
Stage 3: search
| `security_content_ctime(firstTime)`
Stage 4: search
| `security_content_ctime(lastTime)`
Stage 5: search
| `windows_mail_protocol_in_non_common_process_path_filter`
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Image | in | "C:\\Program Files \(x86\)\\*", "C:\\Program Files\\*", "C:\\Windows\\SysWOW64\\*", "C:\\Windows\\System32\\*" | excludes:Image |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
DestinationPort | in |
| field:"DestinationPort" kind:in |
DestinationPortName | eq |
| field:"DestinationPortName" kind:eq |
EventCode | eq |
| field:"EventID" kind:eq value:"3" |