Lunduke
News • Science & Tech
The creator of UNIX built a Trojan Horse which let him log in to any UNIX machine.
And nobody knew about it for years.
May 05, 2024
post photo preview

Back in 1984, the Association for Computing Machinery presented Ken Thompson with a “Turing Award” for his many contributions to the world of computing.

And for good reason.

Ken worked on Multics, co-created UNIX, created multiple programming languages (Bon and B — which directly led to C), co-created the Plan 9 operating system, UTF-8, and on and on.  If anyone deserves an award for advancing computing... it's Ken Thompson.

But we’re not here today to talk about those extraordinary contributions to computing.

No, sir.

We’re here to talk… about his acceptance speech.

Because that speech revealed a truly fascinatin computer virus that Thompson had created years earlier… for the C compiler.  One which gave him a backdoor into UNIX itself.

The Speech

He titled his speech “Reflections on Trusting Trust”, and the basic premise is this:

“To what extent should one trust a statement that a program is free of Trojan horses? Perhaps it is more important to trust the people who wrote the software.”

To prove his point, Ken told the tale of how he had — years earlier — created what was, essentially, a computer virus that infected the C compiler (cc) and the UNIX login program.

Seriously.

This is real.

Ken could gain control of most UNIX systems

It worked, essentially, like this:

Ken modified cc (the C compiler on UNIX systems) so that — only when it was compiling UNIX’s “login” program — it would inject a small “backdoor” (into “login”) that would allow him to log in as any user on the system if he used a predefined “password”.

Which is, obviously, a pretty big security hole.

However…

That sort of "universall password" code would be likely to be found during even a rudimentary code review of the C compiler. Or, heck, even by any casual programmer who happened upon that section of the code.

What Ken did next was… devious.

Hiding his UNIX backdoor

He needed to make sure that, should anyone find his nefarious code in “cc”… that his backdoor would live on.

So he then added functionality to “cc” so that it would detect if it was compiling itself (because the C compiler was compiled… in the C compiler)… and insert code into the compiler that would add… itself.

Which means…

Even if the source code is removed from “cc” project… the code (for adding both the login backdoor and the “keep adding this to the C compiler” bits) would get “invisibly” injected into “cc” every time it got compiled by an already infected build of the compiler.

So… as long as there was an unbroken chain of using the C compiler from that point onward, the UNIX login backdoor was unlikely to be effectively removed.

Brutal.

According to Thompson:

“The actual bug I planted in the compiler would match code in the UNIX "login" command. The replacement code would miscompile the login command so that it would accept either the intended encrypted password or a particular known password. Thus if this code were installed in binary and the binary were used to compile the login command, I could log into that system as any user.”

The Moral of the story

As Ken Thompson put it…

“The moral is obvious. You can't trust code that you did not totally create yourself. (Especially code from companies that employ people like me.) No amount of source-level verification or scrutiny will protect you from using untrusted code. In demonstrating the possibility of this kind of attack, I picked on the C compiler. I could have picked on any program-handling program such as an assembler, a loader, or even hardware microcode. As the level of program gets lower, these bugs will be harder and harder to detect. A well installed microcode bug will be almost impossible to detect.”

Did this make it out into the wild?

I know what you're thinking.  "Is this code still out there?  How many systems were impacted by this?"

What we know: This bit of naughty code was released to at least one machine (used by a UNIX support group). This has been confirmed by Ken, himself.

However, it is believed that the code went no further than that machine.

But... do we know for sure?

Do we actually have a high level of confidence that the modified “cc” and “login” went no further than that support group UNIX box?

No. No, we do not.

In fact, according to Eric S. Raymond

“[I have] heard two separate reports that suggest that the crocked login did make it out of Bell Labs, notably to BBN, and that it enabled at least one late-night login across the network by someone using the login name “kt”.”

BBN.  That's Raytheon.  A critical DARPA researcher -- one which was instrumental in the early days of ARPANET.  A huge amount of software came out of BBN.  Heck, even the first Text Adventure game came from there.

If UNIX machines at Raytheon BBN were infected... the possibility of infected versions of those files making it to other sites is incredibly high.

Truly wild

Which leads to a (rather amusing, and mildly terrifying) bit of historical trivia:

Ken Thompson — one of the co-creators of UNIX — intentionally created a trojan horse that infected both the C compiler and the “login” program of UNIX systems.

What’s more… it went undetected for years.  We wouldn't even have known about it, if he hadn't told us he created it.

And we truly have no clue how widespread that trojan became.

community logo
Join the Lunduke Community
To read more articles like this, sign up and join my community today
22
What else you may like…
Videos
Podcasts
Posts
Articles
Linux Code of Conduct Board Blocks File System Changes

A code change for new bcachefs features is being blocked not for technical reasons... but a CoC dispute. Seriously.

Kent Overstreet's blog post:
https://www.patreon.com/posts/116412665

Sanctions Hit Linux Kernel, Russian Programmers Banned:
https://lunduke.locals.com/post/6263331/sanctions-hit-linux-kernel-russian-programmers-banned

70% of companies on the Linux Foundation Board are GPL violators:
https://lunduke.locals.com/post/5116049/70-of-companies-on-the-linux-foundation-board-are-gpl-violators

Python Bans Prominent Dev for Enjoying the Wrong Old SNL Sketch:
https://lunduke.locals.com/post/5985667/python-bans-prominent-dev-for-enjoying-the-wrong-old-snl-sketch

NixOS commits "purge" of "Nazi" contributors, forces abdication of founder
https://lunduke.locals.com/post/5821513/nixos-commits-purge-of-nazi-contributors-forces-abdication-of-founder

00:33:28
November 19, 2024
The Pokemon Go Spying Conspiracy Theory? Yeah. It's Verified.

Pokemon Go using your phone camera to build a CIA-backed 3D Map AI system.

It sounds like an insane movie plot. But it's real.

In 2016, this was "Lunduke's crazy conspiracy theory about Pokemon Go being used to spy on everyone, backed by the CIA". Now, in 2024, Niantic Labs (the makers of Pokemon Go), proudly brags about using Pokemon Go to spy on you... and using that covertly obtained information to build a massive, 3D artificial intelligence mapping system of private spaces.

"We receive about 1 million fresh scans each week, each containing hundreds of discrete images."

In other words: Lunduke was right.

The CIA, NSA, and Pokémon Go:
https://lunduke.locals.com/post/5756204/the-cia-nsa-and-pok-mon-go

Building a Large Geospatial Model to Achieve Spatial Intelligence:
https://nianticlabs.com/news/largegeospatialmodel

00:19:04
November 19, 2024
DOJ: Google Must Sell Off Chrome

And that's only one impact of Google being officially ruled a monopoly.

00:15:13
November 22, 2023
The futility of Ad-Blockers

Ads are filling the entirety of the Web -- websites, podcasts, YouTube videos, etc. -- at an increasing rate. Prices for those ad placements are plummeting. Consumers are desperate to use ad-blockers to make the web palatable. Google (and others) are desperate to break and block ad-blockers. All of which results in... more ads and lower pay for creators.

It's a fascinatingly annoying cycle. And there's only one viable way out of it.

Looking for the Podcast RSS feed or other links? Check here:
https://lunduke.locals.com/post/4619051/lunduke-journal-link-central-tm

Give the gift of The Lunduke Journal:
https://lunduke.locals.com/post/4898317/give-the-gift-of-the-lunduke-journal

The futility of Ad-Blockers
November 21, 2023
openSUSE says "No Lunduke allowed!"

Those in power with openSUSE make it clear they will not allow me anywhere near anything related to the openSUSE project. Ever. For any reason.

Well, that settles that, then! Guess I won't be contributing to openSUSE! 🤣

Looking for the Podcast RSS feed or other links?
https://lunduke.locals.com/post/4619051/lunduke-journal-link-central-tm

Give the gift of The Lunduke Journal:
https://lunduke.locals.com/post/4898317/give-the-gift-of-the-lunduke-journal

openSUSE says "No Lunduke allowed!"
September 13, 2023
"Andreas Kling creator of Serenity OS & Ladybird Web Browser" - Lunduke’s Big Tech Show - September 13th, 2023 - Ep 044

This episode is free for all to enjoy and share.

Be sure to subscribe here at Lunduke.Locals.com to get all shows & articles (including interviews with other amazing nerds).

"Andreas Kling creator of Serenity OS & Ladybird Web Browser" - Lunduke’s Big Tech Show - September 13th, 2023 - Ep 044

put that toxic L!nux in a VM on #Haiku !
I use AQEMU to manage the VMs, though I've had to launch from command-line and remove some missing network interface.

post photo preview

Tonight, I started down a new rabbit-hole: Boot sector games.

I know, I have so many rabbit-holes on my computer already you'd think the rabbit taking working on his slapshot. 🤣 Yes I still like tinkering with building programming/scripting languages. Yes I still want to reinstall Mint and start doing fun (and useful) things in VMs. Yes I still want to fire up a VM and learn mainframes. Yes I have a MUD in the works. I could go on and on and on and on... but I think that's what I love about computers. There's always something new to learn, always some fun new toy or cool new tool or whatever to tinker with. And tonight, boot sector games sounded fun. Why?

  • @Dirt2901 shared that video about how x86 CPUs start off in 16-bit mode and could still technically run DOS. That's kinda nuts. And kinda awesome.
  • I've been wanting to learn x86 Assembly anyway, so I figured, why not score two goals with one shot? 🤣
  • Building an OS, from scratch, is something I've always thought ...

Funny story of the day...
My dad calls me today because he has to send a fax and he can't figure out how.
Now, this is humorous on multiple levels. 1st, he taught me how to use our old fax machine 30 years ago. 2nd, I love the fact that he assumed I could send a fax in 2024.
Okay, well... i do have a phone line. I do have a Windows 98 PC with a working tested modem. So I told him to send it to me. So he did. I put the PDFs on a thumb drive, transferred them to the computer and it's sending them now.
What's odd is, it's making the call, starts negotiating, then hangs up and says no answer on last attempt.then it calls again and works fine. Really strange. But hey, it's working.
O,and he couldn't figure out how because all the online services wanted a subscription and his local FedEx said they don't offer that service anymore. Well, at least he raised me right.

November 20, 2024
Lunduke's Quest - November 20, 2024
Read full Article
November 12, 2024
post photo preview
Last week at The Lunduke Journal (Nov 3 - Nov 9, 2024)
Gimp 3.0! NOTEPAD.EXE AI! Mozilla Layoffs!

There was some interesting news this week in the world of computing.

But the only one I can think about is NOTEPAD.EXE getting Artificial Intelligence.

I mean.  What the fart?!

The Shows

The Articles

Read full Article
November 09, 2024
post photo preview
Funny Programming Pictures Part LXIII
Now with 14% more Unicode jokes!

My favorite picture this week is the one thaNO CARRIER

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read full Article
See More
Available on mobile and TV devices
google store google store app store app store
google store google store app tv store app tv store amazon store amazon store roku store roku store
Powered by Locals