T1505.002

Transport Agent

Adversaries abuse Microsoft Exchange transport agents to establish persistent access and intercept email traffic. Transport agents are .NET assemblies registered with Exchange that process all email passing through the transport pipeline. Turla's LightNeuron malware is the canonical example — registered as a transport agent on Exchange, it intercepted and exfiltrated email content and received commands via steganographic images in email attachments, achieving complete mailbox surveillance.

Microsoft Sentinel / Defender
kusto
// T1505.002 — Exchange Transport Agent persistence detection
// Transport agents are .NET DLLs registered in Exchange configuration
// Part 1: Detect new DLL drops in Exchange transport agent directories
let ExchangeAgentDrop = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified")
| where FolderPath has_any (
    "\\Microsoft\\Exchange Server\\",
    "\\Exchange Server\\",
    "\\v15\\Bin\\",
    "\\TransportRoles\\",
    "\\FrontEnd\\TransportAgent\\"
  )
| where FileName endswith ".dll"
| where InitiatingProcessFileName !in~ ("exsetup.exe", "updateexchangesetup.exe",
                                         "ExchangeSetup.exe", "msiexec.exe", "setup.exe")
| extend DetectionType = "Exchange_Transport_DLL_Write"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Part 2: Detect Exchange transport pipeline process spawning OS commands
let ExchangeChildProc = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("EdgeTransport.exe", "MSExchangeTransport.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "wscript.exe", "cscript.exe",
                      "certutil.exe", "bitsadmin.exe", "mshta.exe", "rundll32.exe", "net.exe")
| extend DetectionType = "Exchange_Transport_OS_Command"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
// Part 3: Detect Install-TransportAgent or New-TransportAgentConnector PowerShell commands
let ExchangeAgentPS = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any ("Install-TransportAgent", "Enable-TransportAgent",
                                    "New-TransportAgentConnector", "Set-TransportAgent")
| extend DetectionType = "Exchange_Transport_Agent_Install"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionType;
union ExchangeAgentDrop, ExchangeChildProc, ExchangeAgentPS
| sort by Timestamp desc
critical severity high confidence

Data Sources

File: File Creation Process: Process Creation Microsoft Defender for Endpoint

Required Tables

DeviceFileEvents DeviceProcessEvents

False Positives

  • Legitimate Exchange transport agent installations for anti-spam, DLP, or email archiving solutions (Mimecast, Proofpoint, Microsoft journaling agents)
  • Exchange cumulative update installation writing DLLs to Exchange directories
  • IT administrators deploying custom transport agents for compliance journaling or email routing
  • Third-party email security products that register as transport agents

Unlock Pro Content

Get the full detection package for T1505.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections