⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a list of some of the most useful unix hacking commands.htm

📁 a collection of mega hacking tools
💻 HTM
📖 第 1 页 / 共 2 页
字号:
while : ; do        mkdir x        cd xdoneEither a panic will occur because all the i-nodes on the device are used up,or all the disk blocks will be consumed, thus preventing anyone from writingfiles on the device.In this version of the system,users are prevented fromcreating more than a set number of processes simultaneously,so unless usersare in collusion it is unlikely that any one can stop the system altogether.However, creation of 20 or so CPU or disk-bound jobs leaves few resourcesavailable for others.Also, if many large jobs are run simultaneously,swap spacemay run out, causing a panic.  It should be evident that excessive consumptionof diskspace, files, swap space and processes can easily occur accidentally inmalfunctioning programs as well as at command level.In fact UNIX is essentiallydefenseless against this kind of abuse,nor is there any easy fix.The best thatcan be said is that it is generally fairly easy to detect what has happenedwhen disaster strikes ,to identify the user responsible, and take appropriateaction.In practice,we have found that difficulties in this area are ratherrare,but we have not been faced with malicious users,and enjoy a fairlygenerous supply of resources which have served to cushion us against accidentaloverconsumption.The picture is considerably brighter in the area of protection of informationfrom unauthorized perusal and destruction.Here the degree of security seems(almost) adequate theoretically, and the problems lie more in the necessity forcare in the actual use of the system.Each UNIX file has associated with iteleven bits of protection information together with a user identificationnumber and a user-group identification number (UID and GID).Nine of the protection bits are used to specify independently permission toread, to write, and to execute the file to the user himself, to members of theuser's group, and to all other users.Each process generated by or for a userhas associated with it an effective UID and a real UID, and an effective andreal GID.When an attempt is made to access the file for reading, writing, orexecuting UID for the process is changed to the UID associated with the file;the change persists until the process terminates or until the UID changed againby another execution of a set-UID file.Similarly the effective group ID of aprocess is changed to the GID associated with a file when that file is executedand has the set-GID bit set.The real UID and GID of a process do not changewhen any file is executed,but only as the result of a privileged systemcall.The basic notion of the set-UID and set-GID bits is that one may write aprogram which is executableby others and which maintains files accessible toothers only by that program.The classical example is the game-playing program which maintains records ofthe scores of its players.The program itself has to read and write the scorefile,but no one but the game's sponsor can be allowed unrestricted access tothe file lest they manipulate the game to their own advantage.The solution is to turn on the set-UID bit of the game program.  When, and onlywhen,it is invoked by players of the game,it may update the score file butordinary programs executed by others cannot access the score.  There are anumber of special cases involved in determining access permissions.  Sinceexecuting a directory as a program is a meaningless operation,theexecute-permission bit, for directories, is taken instead to mean permission tosearch the directory for a given file during the scanning of a path name; thusif a directory has execute permission but no read permission for a given user,he may access files with known names in the directory,but may not read (list)the entire contents of the directory.Write permission on a directory is interpreted to mean that the user may createand delete files in that directory;it is impossible for any user to writedirectly into any directory..Another, and from the point of view of security,much more serious special case is that there is a ``super user'' who is able toread any file and write any non-directory.The super-user is also able to changethe protection mode and the owner UID and GID of any file and to invokeprivileged system calls.It must be recognized that the mere notion of asuper-user is a theoretical, and usually practical, blemish on any protectionscheme.The first necessity for a secure system is of course arranging that all filesand directories have the proper protection modes.Traditionally, UNIX softwarehas been exceedingly permissive in this regard;essentially all commands createfiles readable and writable by everyone.In the current version,this policy maybe easily adjusted to suit the needs ofthe installation or the individual user.Associated with each process and its descendants is a mask, which is in effectanded with the mode of every file and directory created by that process.  Inthis way, users can arrange that, by default,all their files are no moreaccessible than they wish.The standard mask, set by login,allows all permiss-ions to the user himself and to his group,but disallows writing by others.To maintain both data privacy and data integrity,it is necessary, and largelysufficient,to make one's files inaccessible to others.  The lack of sufficiencycould follow from the existence of set-UID programs created by the user and thepossibility of total breach of system security in one of the ways discussedbelow(or one of the ways not discussed below).For greater protection,an encryption scheme is available.Since the editor isable to create encrypted documents, and the crypt command can be used to pipesuch documents into the other text-processing programs,the length of timeduring which clear text versions need be available is strictly limited.Theencryption scheme used is not one of the strongest known, but it is judgedadequate, in the sense that cryptanalysisis likely to require considerably moreeffort than more direct methods of reading the encrypted files.For example, auser who stores data that he regards as truly secret should be aware that he isimplicitly trusting the system administrator not to install a version of thecrypt command that stores every typed password in a file.  Needless to say, thesystem administrators must be at least as careful as their most demanding userto place the correct protection mode on the files under their control.In particular,it is necessary that special files be protected from writing, andprobably reading, by ordinary users when they store sensitive files belongingto otherusers.It is easy to write programs that examine and change files byaccessing the device on which the files live.On the issue of password security,UNIX is probably better than most systems.Passwords are stored in an encrypted form which, in the absence of seriousattention from specialists in the field,appears reasonably secure, provided itslimitations are understood.In the current version, it is based on a slightl ydefective version of the Federal DES;it is purposely defective so thateasily-available hardware is useless for attempts at exhaustivekey-search.Since both the encryption algorithm and the encrypted passwords areavailable,exhaustive enumeration of potential passwords is still feasible up toa point.We have observed that users choose passwords that are easy toguess:they are short, or from a limited alphabet, or in a dictionary.Passwords should be at least six characters long and randomly chosen from analphabet which includes digits and special characters.Of course there also exist feasible non-cryptanalytic ways of finding outpasswords.For example:  write a program which types out ``login:''on thetypewriter and copies whatever is typed to a file of your own.  Then invoke thecommand and go away until the victim arrives..The set-UID (set-GID)notion mustbe used carefully if any security is to be maintained.  The first thing to keepin mind is that a writable set-UID file can have another program copied ontoit.For example, if the super-user command is writable,anyone can copy the shellonto it and get a password-free version of Shell Unix.A more subtle problem cancome from set-UID programs which are not sufficiently careful of what is fedinto them.To take an obsolete example,the previous version of the mail commandwas set-UID and owned by the super-user.This version sent mail to the recipient's own directory.The notion was that one should be able to send mail toanyone even if they want to protecttheir directories from writing.  The troublewas that mailwas rather dumb:anyone could mail someone else's priva te file tohimself.Much more seriousis the following scenario:  make a file with a linelike one in the password filewhich allows one to log in as the super-user.Thenmake a link named ``.mail'' to the password file in some writable directory onthe same device as the password file (say /tmp).  Finally mail the bogus loginline to /tmp/.mail;You can then login as the superuser,clean up theincriminating evidence,and have your will.The fact that users can mount their own disks and tapes as file systems can beanother way of gaining super-user status.Once a disk pack is mounted, thesystem believes what is on it.Thus one can take a blank disk pack,put on itanything desired,and mount it.There are obvious and unfortunate consequences.For example:a mounted disk with garbage on it will crash the system;one of thefiles on the mounted disk can easily be a password-free version of Shell Unix;other files can be unprotected entries for special files.  The only easy fixfor this problem is to forbid the use of mount to unpriv- ileged users.Apartial solution, not so restrictive,would be to have the mount command examinethe special file for bad data,set-UID programs owned by others ,and accessiblespecial files,and balk at unprivileged invokers.Scott Walters   London, CANADAwalterss@julian.uwo.ca  <CarbonBoy>PGP 31 03 1B E1 C7 6E 3A EC  97 32 01 BA 5B 05 5D FBfinger me for public key blockMIME-mail welcome'Beware the fury of a patient man.'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -