Skip to content

An implmentation of the "Reflections on Trusting Trust" attack on TinyCC

License

Notifications You must be signed in to change notification settings

ammrat13/tinycc-rott

Folders and files

NameName
Last commit message
Last commit date

Latest commit

409913f · Jan 14, 2024
Jan 13, 2024
Feb 25, 2017
Oct 29, 2023
Nov 8, 2023
Jan 6, 2024
Jan 13, 2024
Sep 6, 2023
Jan 12, 2024
May 24, 2003
Sep 6, 2023
Jan 6, 2016
Jan 12, 2024
Jan 13, 2024
Oct 31, 2023
Sep 6, 2023
Sep 6, 2023
Sep 6, 2023
May 9, 2022
Jul 24, 2022
Apr 25, 2023
Feb 13, 2021
Oct 22, 2021
Oct 29, 2023
Apr 25, 2023
Oct 22, 2021
Apr 25, 2023
May 8, 2017
Nov 27, 2023
Sep 6, 2023
May 5, 2022
Jul 24, 2022
Aug 16, 2022
Dec 13, 2022
Jul 31, 2023
Apr 25, 2023
Dec 13, 2022
May 8, 2017
Jul 29, 2015
Nov 8, 2023
Apr 25, 2023
Dec 16, 2023
Apr 8, 2023
Jan 7, 2024
Dec 12, 2023
Jul 29, 2015
Jul 29, 2015
Sep 6, 2023
Sep 6, 2023
Oct 29, 2023
Apr 25, 2023
Apr 25, 2023
Sep 6, 2023
Dec 8, 2023
Jan 8, 2024
Jul 29, 2015
Nov 8, 2023
Sep 6, 2023
Jan 12, 2024
Jan 14, 2024
Jan 14, 2024
Sep 6, 2023
Mar 10, 2023
Nov 27, 2023
Jul 29, 2015
Dec 13, 2022
Sep 6, 2023
Apr 25, 2023

Repository files navigation

"Reflections on Trusting Trust" in TinyCC

This repository implements the Reflections on Trusting Trust (RoTT) attack in TinyCC. It has two trojans that it can inject into other programs, namely:

  • It will cause the login.c file in the tests_rott directory to unconditionally allow a user identifying as "ken" to login.
  • It will cause the su toy in (my fork of) Toybox to unconditionally succeed when using the password "ken".

Furthermore, this fork of TinyCC can be used to compile a "clean" copy of TinyCC (commit 6120656), and it will propagate the two trojans to the newly built compiler.

The source for the trojans is in tccpp_rott-pre.inc, which is processed by tccpp_rott-gen.py to be included in tccpp.c. The trojans match based on a trigger string expected to be in the file, along with the name of the file itself. Note that filenames are matched based on their entire path given on the command line. So, for example, compiling login.c could potentially cause its trojan to activate, but compiling ./login.c won't.

About

An implmentation of the "Reflections on Trusting Trust" attack on TinyCC

Resources

License

Stars

Watchers

Forks