Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CC hack?

4 views
Skip to first unread message

kd

unread,
Dec 13, 1999, 3:00:00 AM12/13/99
to
I read somewher about something called the CC hack by Ken Thompson. What it
is really is a program that when run will output the exact source of the
program, nothing more, nothing less. I would love to look at such code and
have not found anything about it. Does any one here know how to do such a
thing or a web site w/ such code posted?

Gergo Barany

unread,
Dec 14, 1999, 3:00:00 AM12/14/99
to

Self-reproducing programs are commonly called quines. Do a web search,
it should turn up lots of them. There was also a quine thread here in
comp.lang.c just days ago, search deja.com (the thread's title was
something about self-printing programs, I think). This group's FAQ list
at http://www.eskimo.com/~scs/C-faq/top.html also includes a section
that discusses quines.
Ken Thompson's CC hack was something quite different, though; it was a C
compiler that noticed when it compiled certain programs (namely, itself
and the login program) and automatically inserted malicious code. That
way, any Unix system using his C compiler (and in the early days of
Unix, that was pretty much every one) had a modified login command which
allowed Thompson to enter without a user account.
I've read differing accounts about whether this was just a proposal he
made or if such a modified compiler really was implemented and
distributed; again, a web search might bring up some interesting info,
and slashdot.org recently ran two stories about the top ten hacks of all
time; one of them had a link to a site which discusses this in more
detail.

Gergo

--
Condense soup, not books!

GU d- s:+ a--- C++>$ UL+++ P>++ L+++ E>++ W+ N++ o? K- w--- !O !M !V
PS+ PE+ Y+ PGP+ t* 5+ X- R>+ tv++ b+>+++ DI+ D+ G>++ e* h! !r !y+

Toby Jaffey

unread,
Dec 14, 1999, 3:00:00 AM12/14/99
to

kd <kato...@hotmail.com> wrote:
> I read somewher about something called the CC hack by Ken Thompson. What it
> is really is a program that when run will output the exact source of the
> program, nothing more, nothing less. I would love to look at such code and
> have not found anything about it. Does any one here know how to do such a
> thing or a web site w/ such code posted?

http://www.tuxedo.org/~esr/jargon/html/entry/quine.html

--
(o_ | Toby Jaffey : www.nott.ac.uk/~psystrj/
//\ | Real Programmers don't eat quiche. They eat twinkies. And Szechwan
V_/_ | food.

0 new messages