Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 1.19 KB

File metadata and controls

22 lines (13 loc) · 1.19 KB

"Two-Face" Rust Linux binary

Two-Face Rust Linux binary

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.

See Creating a "Two-Face" Rust binary on Linux.

Usage

You need a Rust build environment for example from rustup.

A nightly toolchain is required (to support the ! "never" type).

The test-example script will build and run a complete example.

The following packages are provided in the repository:

  • evil_binary: an example of "hidden" binary, that will be run when host data matches what was set in example/host.json
  • harmless_binary: an example of "normal" binary that will be run on other hosts
  • example: the resulting "Two-Face" binary that will pack both previous binaries, and dispatch execution to either one depending on the host
  • twoface: the library that provides the build-time and run-time features