28/10/2025
In this article we will describe a technique to easily create a "Two-Face" Rust binary on Linux: an executable file that runs a harmless program most of the time, but will run a different, hidden code if deployed on a specific target host. This approach, which allows binding a binary to its environment, can be useful for a targeted malware payload or, more commonly, in a license protection mechanism.
We will also detail how to make the "hidden" binary more difficult to inspect in memory.