Process Doppelganging
Adversaries may inject malicious code into process via process doppelganging in order to evade process-based defenses as well as possibly elevate privileges. Process doppelganging abuses Windows Transactional NTFS (TxF) to perform a fileless variation of process injection. The technique involves four steps: Transact (create a TxF transaction and overwrite a legitimate executable with malicious code), Load (create a shared section from the modified file), Rollback (undo the file changes, removing malicious code from disk), and Animate (create a process from the tainted memory section). This evades detection because the malicious code never exists on disk in its final form and the technique avoids highly-monitored API functions like NtUnmapViewOfSection.
// Detect Process Doppelganging via NTFS Transaction API usage
// Key APIs: CreateFileTransacted, NtCreateSection, RollbackTransaction, NtCreateProcessEx
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any ("CreateFileTransacted", "NtCreateSection", "RollbackTransaction", "NtCreateProcessEx")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName
| sort by Timestamp desc
| union (
// Detect suspicious process creation where the image file doesn't match expected
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("svchost.exe", "explorer.exe", "notepad.exe", "cmd.exe")
| where InitiatingProcessFileName !in~ ("services.exe", "svchost.exe", "explorer.exe", "winlogon.exe", "userinit.exe", "System")
| where ProcessVersionInfoProductName == "" or isempty(ProcessVersionInfoProductName)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, ProcessVersionInfoProductName
)
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Legitimate applications using NTFS Transactions for atomic file operations (rare in modern software)
- Windows Update and installer processes using transactional file operations
- Database applications using TxF for data integrity
- Enterprise backup software using NTFS transactions for consistent snapshots
References (5)
- https://attack.mitre.org/techniques/T1055/013/
- https://www.blackhat.com/docs/eu-17/materials/eu-17-Liberman-Lost-In-Transaction-Process-Doppelganging.pdf
- https://hshrzd.wordpress.com/2017/12/18/process-doppelganging-a-new-way-to-impersonate-a-process/
- https://msdn.microsoft.com/library/windows/desktop/bb968806.aspx
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1055.013/T1055.013.md
Unlock Pro Content
Get the full detection package for T1055.013 including response playbook, investigation guide, and atomic red team tests.