Join our Newsletter — 33% off our NHI Course
Home› FAQ› Threats, Abuse & Incident Response› How can security teams detect replaced trusted executable?
Threats, Abuse & Incident Response

How can security teams detect replaced trusted executable?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 20, 2026 Domain: Threats, Abuse & Incident Response

Detect a replaced trusted executable by verifying file hashes, digital signatures, and version metadata against a known-good baseline. Alert when a signed or expected binary changes on disk, appears in an unusual path, or executes with altered behaviour. Monitor privileged directories closely, because attackers often swap a legitimate program for a trojanised copy.

How defenders spot a trusted binary that has been swapped

Detection starts with integrity, not just reputation. A trusted executable is suspicious when its hash no longer matches a known-good baseline, its signature no longer validates, or its version metadata changes unexpectedly. Teams should also treat execution from the wrong directory, a new parent process, or a sudden shift in command-line arguments as evidence that a legitimate program may have been replaced.

File integrity monitoring is most useful when it is paired with software inventory and signed-baseline comparisons. That lets analysts tell the difference between an approved update and a trojanised replacement. In practice, the question is not only whether the binary is signed, but whether the file on disk is the same binary the organisation intended to deploy.

Behaviour matters because attackers often preserve the original name and signature context while changing what the file does at runtime. Watch for a binary that still looks legitimate but begins creating unusual child processes, reaching out to unexpected hosts, or writing to locations it never normally touches. Those runtime signals are often what expose a swap when the filename alone would not.

Where replaced executables usually hide

Attackers favour paths and directories that already attract trust from users, admins, and endpoint tools. System directories, application install folders, startup locations, and other privileged paths deserve especially close monitoring because a replacement there can blend into normal activity and execute with elevated trust. A simple filename match is not enough when the surrounding location has changed.

Path anomalies are often the first clue that a legitimate program has been shadowed by a malicious copy. If an executable that normally runs from one location suddenly appears in another, or if a script launcher, service binary, or helper process starts resolving from an unexpected directory, the swap may already be operational. That is why path awareness is a core part of detection, not just an enrichment field.

Teams should also treat permission changes on the target directory as a warning sign. If an attacker can write into a folder that should be controlled, they can replace the binary without needing to alter the rest of the system. Monitoring who can modify the file, not just who can run it, is essential for catching this class of tampering early.

From alert to confirmation

Once a candidate replacement is found, analysts should confirm whether it is a benign update, an admin change, or an intrusion. Compare the file’s hash, signing chain, timestamp pattern, and version metadata against the approved baseline, then review nearby logs for the first time the altered binary appeared and which account introduced it. That sequence usually tells you whether the swap came from normal maintenance or from compromise.

It is also worth checking for sibling indicators on the host. Replaced executables are often part of a broader persistence or privilege-use pattern, so look for service changes, scheduled task edits, autorun modifications, and unexpected process launches around the same time. Persistence Techniques Guide is useful here because it helps connect a swapped binary to the broader mechanisms attackers use to keep it running.

If the binary handled authentication, remote administration, or privileged workflow steps, assume the swap may have exposed credentials, sessions, or operational trust. In that case, verification should include whether the program executed while altered, which accounts invoked it, and whether any downstream systems accepted its output as legitimate. That is the difference between a file-integrity issue and an active security event.

Risk and Threat Considerations

A replaced trusted executable is dangerous because it turns an approved control point into an attacker-controlled one. The file still looks familiar to users and tooling, which makes this a high-confidence way to hide malicious behaviour inside normal operations.

Failure mechanism: An attacker gains write access to a trusted path or update point, swaps the original binary for a trojanised copy, and relies on the existing trust of the filename, location, or signature context to avoid immediate suspicion.

Impact: The fake executable can inherit user or service trust, enable persistence, execute with elevated privileges, and become a launch point for lateral movement or credential theft if defenders do not verify integrity quickly.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
MITRE ATT&CKT1036 — MasqueradingReplaced trusted executables rely on disguising malicious files as legitimate ones.
T1543 — Create or Modify System ProcessMany trusted-binary swaps target services or other privileged execution points.
T1574 — Hijack Execution FlowBinary replacement is a common way to redirect trusted execution into malicious code.
Recommendation — Map swapped binaries to Masquerading detections and alert on path, hash, and behaviour drift. Monitor service-backed binaries for unexpected file replacement and configuration drift. Hunt for execution-flow hijacking where trusted programs launch altered code from new paths.
NIST CSF 2.0DE.CM-01 — The environment is monitored to detect cybersecurity eventsIntegrity drift in trusted executables is a detectable cybersecurity event.
PR.DS-10 — Integrity is verifiedHash and signature verification directly support executable integrity validation.
PR.AA-05 — Physical and logical access to assets is limitedWrite access to trusted paths enables malicious binary replacement.
Recommendation — Instrument file-integrity and process monitoring to detect unexpected executable replacement. Verify executable integrity against a known-good baseline before trusting the file. Restrict write access to privileged software directories and controlled update locations.
NIST SP 800-53 Rev 5SI-7 — Software, Firmware, and Information IntegrityIntegrity checks are the core control for detecting replaced executables.
CM-5 — Access Restrictions for ChangeBinary swaps depend on unauthorized or excessive change rights on software paths.
AU-6 — Audit Record Review, Analysis, and ReportingReviewing change and execution logs helps confirm when the replacement occurred.
Recommendation — Validate software integrity with hashes, signatures, and approved baselines. Restrict who can modify executable files and related protected directories. Correlate file-change and process logs to identify the first malicious execution.

Practitioner Guidance

What to verify: Confirm that your detection logic compares hash, signature, version, and path together, because any one signal alone can miss a well-prepared replacement. Also verify that your baselines reflect approved software updates, otherwise you will create alert noise that makes real swaps easier to miss.

What to measure: Track how quickly your team can identify the first host where the altered binary appeared, and whether you can prove whether it was introduced by a trusted change process or by an unauthorised actor. If you cannot answer that within the investigation window, your telemetry is too weak for this threat.

Practitioner takeaway: The most reliable detections combine integrity checks with context about where the file lives, how it runs, and who changed it; a trusted name without trusted provenance is not evidence of safety.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 20, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org