In: Computer Science
Research Question: In a recent lecture we focused on how the OS handles creation of load modules and loading them into memory for execution. We started by looking at where programs come from, and the translation process source code goes through to turn into a load module. In an era where security is a growing concern (rightly so), and hackersfind waysto exploit weaknessesin code or its implementation, it is timely to visit the role compilers might play in the intentional creation of ‘back doors’ that could be exploited in future. Read the article “Reflections on Trusting Trust” by Ken Thompson (one of the three creators of UNIX) and answer the following questions:
(a) What two ‘hacks’ did he introduce? Why did he need them both?
(b) Has the Ken Thompson Hack (KTH) been eradicated, or have there been more recent cases of it?
(c) What impact does the KTH have if it turns out to be widespread (i.e., not the specific program that he used, but applying the hack to other programs)?
(a) Two Hacks Introduced by Ken Thompson.
The first one :
He hacked /bin/login
to introduce a backdoor. He
did this by hacking the compiler to introduce the backdoor into a
binary whenever it detected that it was compiling the
login
source code.
The Second one :
He also hacked the compiler to introduce the backdoor-producing code into the compilerwhenever it detected it was compiling that.
(b) The Ken Thompson hack
Ken describes how he injected a virus into a compiler. Not only did his compiler know it was compiling the login function and inject a backdoor, but it also knew when it was compiling itself and injected the backdoor generator into the compiler it was creating. The source code for the compiler thereafter contains no evidence of either virus.
Has this been eradicated ?
I don't think so. There was recent attacks using the kent hack.The most recent was 2009.In August 2009 a virus utilizing the Ken Thompson hack was seen in the wild. It infected Delphi 4 through 7 and applications genereated with it.Nowadays, hardware is much more compatible and compilers therefore have a much smaller role in the day-to-day operation of a system. A compromised compiler is not the most scary scenario anymore - rootkits and a compromised BIOS are even harder to detect and get rid of.
(c) Impact of KTH when it is widespread?
The impact of the KTH will be higher till now.There is risk in every Compiler.If we want a risk free compiler means we have to build that compiler by ourself.That is not at all possible.
Ofcourse , if the hack is in other programs also the impact will be same.There will not be any lesser.Since the hack mainly focus on the Compailer.Now a days the compiler task is very less due to the maximum usage of the hardware.