Microsoft and Elastic Detail Detection for Windows Process Ghosting Evasion
Patch & Detection Intelligence · 3 sources · Updated 3mo ago · First seen Jun 30, 2022

Microsoft and Elastic published technical details on Process Ghosting and related Windows executable image tampering techniques that let malware run after its backing file has been altered or deleted, bypassing antimalware scanning during a time-of-check/time-of-use gap in process creation. The technique abuses legacy process creation behavior, including use of the NtCreateProcessEx path, and is closely related to process doppelganging, process herpaderping, and process reimaging. Elastic described how an attacker can create a file, mark it delete-pending, write a payload, map it into an image section, close the handle so the file is removed, and then launch a process from the now fileless image section.
Elastic reported that a proof-of-concept showed Windows Defender failing to scan a payload because the file was already delete-pending or deleted when scanning occurred, and said it had reported the issue to Microsoft’s MSRC, which replied that it did not meet the servicing bar. Microsoft later described a detection approach in Microsoft Defender for Endpoint that identifies processes created without the GUID_ECP_CREATE_USER_PROCESS extra create parameter and checks whether the executable image section lost disk coherency and became page-file-backed via MmDoesFileHaveUserWritableReferences. According to Microsoft, combining those signals enables detection of known and previously unpublished variants and can generate alerts for ghosting, herpaderping, and doppelganging seen in the wild.


