📄 paper2
字号:
some lazy and crazy enough to use easily-guessable passwords, four-letterwords, or whatever.Hashing techniques make it almost as quick to check a candidate against agroup of encrypted passwords as against a single one..ppA technique called ``salting'' protects against this kind of attack.Whenever a user's password is initialized or changed, a small random numbercalled the ``salt'' is generated (perhaps from the time of day).Not only is this combined with the password when it is encrypted, but asFigure\ 1 shows it is also stored in the password file for everyone to see.Every time someone claiming to be that user logs in, the salt is combined withthe password offered before being encrypted and comparedwith whatever is stored in the password file.For example, say my password was ``w#xs27'' (it isn't!).If the salt is ``U6'' (as in Figure\ 1), the system will apply its one-wayfunction to ``w#xs27U6'' to get the encrypted password..ppSince all can see the salt, it is no harder for anyone to guessan individual user's password.One can salt guesses just as the system does.But it \fIis\fR harder to search a group of passwords, since the salt will bedifferent for each, rendering it meaningless to compare a single encryptedpassword against all those in the group.Suppose you were checking to see if anyone had the password ``hello''.Without salting, you simply apply the one-way function to this word andcompare the result with everyone's encrypted password.But with salting it's not so easy, since to see if my password is ``hello''you must encrypt ``helloU6'', and the salt is different for everyone..rh "Forced-choice passwords."The trouble with letting users choose their own passwords is that they oftenmake silly, easily-guessed, choices.Many systems attempt to force people to choose more ``random'' passwords, andforce them to change their password regularly.All these attempts seem to be complete failures.The fundamental problem is that people have to be able to remember theirpasswords, because security is immediately compromised if they are writtendown..ppThere are many amusing anecdotes about how people thwart systems that attemptto dictate when they have to change their passwords.I had been using a new system for some weeks when it insisted that I change mypassword.Resenting it ordering me about, I gave my old password as the new one.But it was programmed to detect this ruse and promptly told me so.I complained to the user sitting beside me.``I know,'' she said sympathetically.``What I always do is change it to something else and then immediatelychange it back again!'' \cAnother system remembered your last several passwords, and insisted on aonce-a-month change.So people began to use the name of the current month as their password!.rh "Wiretaps."Obviously any kind of password protection can be thwarted by a physicalwiretap.All one has to do is watch as you log in and make a note of your password.The only defense is encryption at the terminal.Even then you have to be careful to ensure that someone can't interceptyour encrypted password and pose as you later on by sending this\fIencrypted\fR string to the computer \(em after all, this is what thecomputer sees when you log in legitimately!To counter this, the encryption can be made time-dependent so that the samepassword translates to different strings at different times..ppAssuming that you, like 99.9% of the rest of us, don't go to the trouble ofterminal encryption, when was the last time you checked the line between youroffice terminal and the computer for a physical wiretap?.rh "Search paths."We will see shortly that you place yourself completely at the mercy of otherusers whenever you execute their programs, and theycan do some really nasty things like spreading infection to your files.However, you don't necessarily have to execute someone else's program overtly,for many systems make it easy to use other people'sprograms without even realizing it.This is usually a great advantage, for you can install programs so that youor others can invoke them just like ordinary system programs, therebycreating personalized environments..ppFigure\ 4 shows part of the file hierarchy in our system.The whole hierarchy is immense \(em I alone have something like 1650 files,organized into 200 of my own directories under the ``ian'' node shown in theFigure, and there are hundreds of other users \(em and what is shown is just avery small fragment.Users can set up a ``search path'' which tells the systemwhere to look for programs they invoke.For example, my search path includes the 6 places that are circled.Whenever I ask for a program to be executed, the system seeks it in theseplaces.It also searches the ``current directory'' \(em the one where I happen to beat the time..ppTo make it more convenient for you to set up a good working environment, itis easy to put someone else's file directories on your search path.But then they can do arbitrary damage to you, sometimes completelyaccidentally.For example, I once installed a spreadsheet calculator called ``sc'' in oneof my directories.Unknown to me, another user suddenly found that the Simula compiler stoppedworking and entered a curious mode where it cleared his VDT screen and wrotea few incomprehensible characters on it.There was quite a hiatus.The person who maintained the Simula compiler was away,but people could see no reason for the compiler to have been altered.Of course, told like this it is obvious that the user had my directory on hissearch path and I had created a name conflict with \fIsc\fR, the Simulacompiler.But it was not obvious to the user, who rarely thought about the search pathmechanism.And I never use the Simula compiler and had created the conflict in allinnocence.Moreover, I didn't even know that other users had my directory on their searchpaths!This situation caused only frustration before the problem was diagnosed andfixed.But what if I were a bad guy who had created the new \fIsc\fR program toharbor a nasty bug (say one which deleted the hapless user's files)?.ppYou don't necessarily have to put someone on your search path to run therisk of executing their programs accidentally.As noted above, the system (usually) checks your current working directoryfor the program first.Whenever you change your current workplace to another's directory, youmight without realizing it begin to execute programs that had beenplanted there..ppSuppose a hacker plants a program with the same name as a commonutility program.How would you find out?The \s-2UNIX\s+2 \fIls\fR command lists all the files in a directory.Perhaps you could find imposters using \fIls\fR? \(em Sorry.The hacker might have planted another program, called \fIls\fR, whichsimulated the real \fIls\fR exactly except that it lied about its ownexistence and that of the planted command!The \fIwhich\fR command tells you which version of a program youare using \(em whether it comes from the current directory, another user'sdirectory, or a system directory.Surely this would tell you? \(em Sorry.The hacker might have written another \fIwhich\fR which lied about itself,about \fIls\fR, and about the plant..ppIf you put someone else on your search path, or change into their directory,you're implicitly trusting them.You are completely at a user's mercy when you execute one of their programs,whether accidentally or on purpose..rh "Programmable terminals."Things are even worse if you use a ``programmable'' terminal.Then, the computer can send a special sequence of characters to command theterminal to transmit a particular message whenever a particular key is struck.For example, on the terminal I am using to type this article, you couldprogram the \s-2RETURN\s+2 key to transmit the message ``hello'' whenever itis pressed.All you need to do to accomplish this is to send my terminal the charactersequence.LB\s-2ESCAPE\s+2 P ` + { H E L L O } \s-2ESCAPE\s+2.LE(\s-2ESCAPE\s+2 stands for the \s-2ASCII\s+2 escape character, decimal 27,which is invoked by a key labeled ``Esc''.) \cThis is a mysterious and ugly incantation, and I won't waste timeexplaining the syntax.But it has an extraordinary effect.Henceforth every time I hit the return key, my terminal will transmit thestring ``hello'' instead of the normal \s-2RETURN\s+2 code.And when it receives this string, the computer I am connected to will try toexecute a program called ``hello''!.ppThis is a terrible source of insecurity.Someone could program my terminal so that it executed one of \fItheir\fRprograms whenever I pressed \s-2RETURN\s+2.That program could reinstate the \s-2RETURN\s+2 code to make itappear afterwards as though nothing had happened.Before doing that, however, it could (for example) delete all my files..ppThe terminal can be reprogrammed just by sending it an ordinary characterstring.The string could be embedded in a file, so that the terminal would be buggedwhenever I viewed the file.It might be in a seemingly innocuous message;simply reading mail could get me in trouble!It could even be part of a file \fIname\fR, so that the bug would appearwhenever I listed a certain directory \(em not making it my current directory,as was discussed above, but just \fIinspecting\fR it.But I shouldn't say ``appear'', for that's exactly what it might not do.I may never know that anything untoward had occurred..ppHow can you be safe?The programming sequences for my terminal all start with \s-2ESCAPE\s+2,which is an \s-2ASCII\s+2 control character.Anyone using such a terminal should whenever possible work through aprogram that exposes control characters.By this I mean a program that monitors output from the computer and translatesthe escape code to something like the 5-character sequence ``<ESC>''.Then a raw \s-2ESCAPE\s+2 itself never gets sent to the terminal,so the reprogramming mechanism is never activated..ppNot only should you avoid executing programs written by people you don'ttrust, but in extreme cases you should take the utmost care in \fIany\fRinteraction with untrustworthy people \(em even reading their electronicmail..sh "Trojan horses: getting under the skin".ppThe famous legend tells of a huge, hollow wooden horse filled with Greeksoldiers which was left, ostensibly as a gift, at the gates of the city ofTroy.When it was brought inside, the soldiers came out at night andopened the gates to the Greek army, which destroyed the city.To this day, something used to subvert an organization from within by abusingmisplaced trust is called a Trojan horse..ppIn any computer system for which security is a concern, there must be thingsthat need protecting.These invariably constitute some kind of information (since the computer is,at heart, an information processor), and such information invariably outlastsa single login session and is therefore stored in the computer's file system.Consequently the file system is the bastion to be kept secure, and will bethe ultimate target of any invader.Some files contain secret information that not just anyone may read,others are vital to the operation of an organization and must at all costsbe preserved from surreptitious modification or deletion.A rather different thing that must be protected is the ``identity'' of eachuser.False identity could be exploited by impersonating someone else in order tosend mail.Ultimately, of course, this is the same as changing data in mailbox files.Conversely, since for each and every secret file \fIsomeone\fR musthave permission to read and alter it, preserving file system securityrequires that identities be kept intact..rh "What might a Trojan horse do?"The simplest kind of Trojan horse turns a common program like a text editorinto a security threat by implanting code in it which secretly readsor alters files it is not intended to.An editor normally has access to all the user'sfiles (otherwise they couldn't be altered).In other words, the program runs with the user's own privileges.A Trojan horse in it can do anything the user himself could do, includingreading, writing, or deleting files..ppIt is easy to communicate stolen information back to the person who buggedthe editor.Most blatantly, the access permission of a secret file could be changed sothat anyone can read it.Alternatively the file could be copied temporarily to disk \(em most systemsallocate scratch disk space for programs that need to create temporary workingfiles \(em and given open access.Another program could continually check for it and, whenit appeared, read and immediately delete it to destroy the trace.More subtle ways of communicating small amounts of information might be torearrange disk blocks physically so that their addresses formed a code, or tosignal with the run/idle status of the process to anyone who monitored thesystem's job queue.Clearly, any method of communication will be detectable by others \(em intheory.But so many things go on in a computer system that messages can easily beembedded in the humdrum noise of countless daily events..ppTrojan horses don't necessarily do bad things.Some are harmless but annoying, created to meet a challenge rather than tosteal secrets.One such bug, the ``cookie monster'', signals its presence by announcingto the unfortunate user ``I want a cookie''.Merely typing the word ``cookie'' will satiate the monster and cause it todisappear as though nothing had happened.But if the user ignores the request, although the monster appears to goaway it returns some minutes later with ``I'm hungry; I really want acookie''.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -