Herpaderping, doppelganging and ghosting abuse the gap between creating an image section and the security callback that inspects the backing file. The attacker maps a payload into a section, then changes, deletes or transacts away the file before scanners read it. The process runs the payload while the file on disk shows something harmless, or nothing at all.
Signals at a Glance
| Signal | Where | ATT&CK |
|---|---|---|
| ProcessTampering: image replaced (herpaderping, doppelganging) | Sysmon 25 | T1055.013 |
| ProcessTampering: image locked for access (ghosting) | Sysmon 25 | T1055.013 |
| Process image path no longer exists or cannot be hashed at start | Sysmon 1, EDR | T1055.013 |
| Executable written, section created and the file overwritten within milliseconds | Sysmon 11, EDR file telemetry | T1055 |
| Transacted file (TxF) or delete-pending handle used to back an image | EDR, ETW Threat-Intelligence | T1055.013 |
Sysmon ProcessTampering
Sysmon Event ID 25 exists for exactly this class of attack. It reports a process whose image has been replaced or is locked for access, with a Type field naming the condition. The event is rare on a healthy host, so collect it in full:
<!-- Sysmon configuration fragment: keep every ProcessTampering event -->
<Sysmon schemaversion="4.90">
<EventFiltering>
<RuleGroup name="tamper" groupRelation="or">
<ProcessTampering onmatch="exclude">
<!-- tune/validate: add only reviewed, well-understood benign images -->
<Image condition="is">C:\Windows\System32\wbem\WmiPrvSE.exe</Image>
</ProcessTampering>
</RuleGroup>
</EventFiltering>
</Sysmon>
<!-- With onmatch="exclude" and a short list, everything else is logged. -->
Treat every Image is replaced and Image is locked for access event as a ticket until proven benign. Some packers and installers can trigger the first; very few legitimate programs trigger the second.
Image and Hash Consistency
When Sysmon 25 is not available, compare what the process was started from with what exists on disk. A process whose image file is missing, zero length or hashes differently from a prior sighting is a strong lead:
// Microsoft Defender XDR (KQL) - process started but its image is gone or unreadable
DeviceProcessEvents
| where Timestamp > ago(1d)
| where isempty(SHA256) or isempty(FolderPath)
| where not(FileName in~ ("MemCompression", "Registry", "System"))
| join kind=leftanti (
DeviceFileEvents
| where ActionType == "FileCreated"
| project DeviceId, FolderPath, FileName
) on DeviceId, FolderPath, FileName
| project Timestamp, DeviceName, FileName, FolderPath, ProcessCommandLine,
InitiatingProcessFileName
// tune/validate: protected and system processes legitimately have no hash.
- Alert on a short chain: file created, section mapped, file overwritten or deleted, then a process created from that section.
- Log executables that are deleted within seconds of the process starting from them; ghosting depends on a delete-pending state.
- Prefer detections tied to process start rather than file scanning, because the file is the part the attacker controls.
- Verify your EDR documents handling for these cases; vendors differ on whether they hook at image-load or at section creation.
Use the Sysmon ProcessTampering event and the SigmaHQ rules built on it, Elastic’s process injection detections, MITRE CAR analytics for image mismatch, and the public proof-of-concept projects only in a lab to validate that your sensors fire. Baseline your own environment — some packers and software protectors trigger Event 25 legitimately.
Build Detections That Fire
Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.
- Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
- Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
- 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Stay ahead of emerging threats. Get notified when we publish new intelligence reports and advisories.
Subscribe to Alerts