This rule identifies 64-bit Portable Executable files, which are the standard format for modern Windows binaries and a common vehicle for deploying malicious payloads or legitimate software. Proactively hunting for these artifacts allows the SOC to establish a baseline of expected 64-bit executables and detect anomalous or unexpected PE64 files that may indicate staged implants, dropped tools, or newly deployed components within the environment.
rule IsPE64 : PECheck
{
condition:
// MZ signature at offset 0 and ...
uint16(0) == 0x5A4D and
// ... PE signature at offset stored in MZ header at 0x3C
uint16(uint32(0x3C)+0x18) == 0x020B
}
This YARA rule can be deployed in the following contexts:
MsMpEng.exe) or the Windows Update service (wuauclt.exe) may temporarily write or stage 64-bit PE executables (such as MpSigStub.exe or new driver binaries) to disk during signature or component updates.
MsMpEng.exe or svchost.exe (specifically the wuauserv or dcomlaunch groups) and the file path resides in C:\ProgramData\Microsoft\Windows Defender\ or C:\Windows\Temp\.MSBuild.exe or dotnet.exe) generates 64-bit PE executables (.exe files) in the bin\Debug or bin\Release directories.
C:\Users\<User>\source\, C:\Projects\, or C:\Builds\ where the parent process is MSBuild.exe, dotnet.exe, or devenv.exe.chrome.exe installer, slack.exe installer, or teams.exe installer) often extract 64-bit PE executables to temporary folders (%TEMP% or %LOCALAPPDATA%) before moving them to the final installation directory.
%TEMP% or %LOCALAPPDATA%\Temp where the parent process name matches known installer binaries (e.g., chrome.exe, slack.exe, teams.exe, msiexec.exe) and the