Guest User

Untitled

a guest
May 31st, 2013
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.09 KB | None | 0 0
  1. COPS and Robbers
  2. UN*X System Security
  3.  
  4.  
  5.  
  6. In the last few years, computer security has received a
  7. great deal more attention than it has in the past. Compu-
  8. terized break-ins and criminal activity, once merely the
  9. product of the imagination of science fiction writers, has
  10. became a fairly common occurence in both commercial and
  11. academic circles. In this paper, I will go over the prob-
  12. lems that face any multiuser computing system, then discuss
  13. how these problems apply to UNIX[1] specifically, and
  14. finally present in detail a suite of programs that were
  15. developed in an attempt to address some of the main problems
  16. that could be solved via software. UNIX, although con-
  17. sidered to be a fairly secure operating system ([Wood 88],
  18. [Duff 89], etc), has the advantage of having many published
  19. works ([Grampp and Morris 84], [Bishop 83], etc) on the
  20. problems that a computing site can have with security, and
  21. in addition, on how a UNIX system administrator might make
  22. his/her system more secure by monitoring various aspects of
  23. his/her UNIX site. This, combined with UNIX's popularity,
  24. make it an ideal target for a software security system to
  25. operate on.
  26.  
  27. In this report I am not going to discuss specific ways
  28. of breaking into a given UNIX machine (for a more detailed
  29. description on how to compromise UNIX security, see either
  30. [Baldwin88], [Bishop83], [Wood & Kochran 86], or [Grampp &
  31. Morris 84]) -- instead, I will concentrate on how to improve
  32. and strengthen the potentially good security of a generic
  33. UNIX system by means of a software toolkit that examines the
  34. weaker areas of UNIX that are either traditionally ignored
  35. (due to the time constraints or ignorance of the system
  36. administrators) or are simply reoccurring problems that need
  37. to be watched over. In addition, this report is not meant
  38. for UNIX neophytes -- although a great deal of proficiency
  39. is not needed to read this report and use the programs
  40. described herein, a familiarity with basic UNIX features --
  41. the file system and file permission modes for example -- and
  42. commands such as awk,grep,sed as well as a working
  43. knowledge of shell and C programming are necessary to
  44. _________________________
  45. 9 [1] Although originally designed and developed by Ken
  46. Thompson and Dennis Ritchie of AT&T, UNIX has grown far
  47. beyond its' original design and now numerous companies
  48. market their own "flavor" of UNIX. When I use the term
  49. UNIX in this paper, I don't mean merely AT&T's version,
  50. but instead I mean the majority of the most popular
  51. varieties, made by developers at Berkely, Sun, and a
  52. host of other manufacturers. I believe UNIX is still a
  53. trademark of Bell Laboratories.
  54. 9
  55.  
  56.  
  57. February 19, 1991
  58.  
  59.  
  60.  
  61.  
  62.  
  63. - 2 -
  64.  
  65.  
  66. understand the internal workings of the security system
  67. described in this paper.
  68.  
  69. Although there is no reasonable way that all security
  70. problems can be solved (at least not with a software solu-
  71. tion) on any arbitrary UNIX system, administrators and sys-
  72. tem programs can be assisted by a software security tool.
  73. The Computer Oracle Password and Security system (COPS) that
  74. will be described in this paper is just such a device. The
  75. COPS system is a collection of programs and shell scripts
  76. that attempt to address as many of these problems as possi-
  77. ble in an efficient, portable, and above all in a reliable
  78. and safe way. The main goal of COPS is one of prevention;
  79. it tries to anticipate and eliminate security problems by
  80. making sure people don't get a chance to compromise security
  81. in the first place. Alerting the administrators of a poten-
  82. tial intruder or that a virus has infected the system is
  83. beyond the scope of the present system, although with work
  84. with such capabilities could be added ([Bauer and Koblentz
  85. 88] and [Duff 89].)
  86.  
  87. To understand the reason COPS might check any specific
  88. problem, a look at computer security problems in general is
  89. in order. The problems listed below are not meant to be
  90. inclusive, but they are indicative of the myriad types of
  91. dilemmas a typical computer multiuser system might
  92. encounter:
  93.  
  94. 1) Administrators, system programmers, and computer
  95. operators. The very people that (should) worry the most
  96. about security are sometimes the ones that are the least
  97. concerned. Carelessness is one of the main culprits; a mis-
  98. take by a user might cause little or no problem, but when
  99. someone with no restrictions (or almost none) on their com-
  100. puter activity makes a mistake, a security hole can result.
  101. "I can trust my users" is a fine statement to make -- but
  102. can you trust your users' friends? How about the users of
  103. computers that are networked to yours? New software, sys-
  104. tems, or procedures can facilitate extra problems; a comput-
  105. ing staff is often ill or completely non-trained on new
  106. techniques and software. Too often "RTFM" is the only
  107. training that they will ever receive. Programs that are
  108. created for in-house use are often ill-documented and not
  109. debugged thoroughly, and when users other than the author
  110. start to use/abuse the program, problems can result. Espe-
  111. cially misunderstood, even by experienced UNIX system pro-
  112. grammers, is the SUID program or, worse yet, the SUID shell
  113. script ([Bishop 83].) When a user says that his/her password
  114. was forgotten (or any other account/security related prob-
  115. lem), what checks are made to verify that the person is
  116. really the owner of that account? Are users that are secu-
  117. rity problems kept track of, so that repeated abuses of the
  118. system will result in punitive action? Does your site even
  119. have a security policy? And of course, the last straw is
  120.  
  121.  
  122.  
  123. February 19, 1991
  124.  
  125.  
  126.  
  127.  
  128.  
  129. - 3 -
  130.  
  131.  
  132. that most system administrators simply have too much other
  133. work to do than to constantly check the system for potential
  134. security flaws -- let alone to double-check that any work
  135. done by other system programmers has been done correctly.
  136. These are the actions that often get left unsaid and undone.
  137.  
  138. A UNIX environment has no special defenses against this
  139. kind of "attack". Fortunately, a number of these potential
  140. problems (unless catastrophic in scope) are not only
  141. correctable, but are easy to detect with a software toolkit
  142. such as COPS. Even the most careful UNIX guru will periodi-
  143. cally make a mistake; COPS has been designed to aid in
  144. her/his never ending battle against the forces of darkness.
  145.  
  146. 2) Physical security. This is perhaps the most frus-
  147. trating of all possible problems because it effects all com-
  148. puter systems and is often the hardest to safeguard against.
  149. Even if the software is secure, even if the system adminis-
  150. trators are alert to potential problems, what happens if a
  151. user walks up to the root console and starts typing? Does
  152. the night janitorial staff let anyone into the machine room
  153. without proper identification? Who has access to the key
  154. that opens up the computing center? Are terminals that are
  155. logged on left unguarded or unlocked? Are passwords written
  156. on or near a users terminal or desk? No software in the
  157. world can help against human nature or carelessness.
  158. Reiterating to your staff and users that terminals should
  159. not be left alone or unguarded and that passwords (espe-
  160. cially root) should not be typed in front of unfriendly (and
  161. in this case, _everyone_ is your enemy) eyes would be a good
  162. start. A simple analogy: since you would never give the
  163. keys to the company car away, why on earth would you give
  164. away the keys to your computer, which is certainly worth a
  165. hell of a lot more time and money (although it may not get
  166. as good mileage on the interstate.) Common sense goes a
  167. long ways to help prevent this kind of risk.
  168.  
  169. 3) Authentication. What is authentication? All
  170. modern computing systems that have capabilities for multiple
  171. users have a means of identifying who is using the computer
  172. at any given time. A common means of identification is by
  173. using a password; and since the inception of this idea, poor
  174. passwords have been a perennial problem. People have a ten-
  175. dency to use their own name, or their social security
  176. number, or some other common word, name, or phrase for a
  177. password. The problem then arises when an unauthorized user
  178. wants to access clandestine information, he/she simply tries
  179. one of these simple passwords until a successful match is
  180. found.
  181.  
  182. Other problems with authentication? What computer
  183. hosts are "trusted" and allow users to log in from other
  184. machines without any further authentication? Are incorrect
  185. login attempts kept and/or monitored so as to allow
  186.  
  187.  
  188.  
  189. February 19, 1991
  190.  
  191.  
  192.  
  193.  
  194.  
  195. - 4 -
  196.  
  197.  
  198. administrators to keep track of any unusual activity? What
  199. about "Trojan horses" -- programs that can steal passwords
  200. and the privileges that a user owns -- is there a program or
  201. a administrative method that detects a potential 'horse?
  202.  
  203. Fortunately UNIX systems again have some fairly good
  204. tools to aid in this fight. Although finding simple pass-
  205. words is indeed a trivial task, forcing the users on a sys-
  206. tem to use passwords that are harder to guess is also
  207. trivial, by either modifying the mechanism that gets/gives
  208. the password to the user, and/or by having the system
  209. administrators run a simple password detector periodically,
  210. and notifying users if their password is deemed too obvious.
  211. The crypt command, although proven to be insecure for a
  212. knowledgeable and resourceful attacker ([Reed and Weinberger
  213. 84], [Baldwin 86]), does offer an added shield against most
  214. unauthorized users. Logs can be kept of incorrect login
  215. attempts, but as with most security measures, to be effec-
  216. tive someone (usually the site administrator) must take the
  217. time to examine the evidence.
  218.  
  219. 4) Bugs/Features. Massive software designs (such as
  220. an operating system) are usually the result of a team or of
  221. teams of developers working together. It only takes one
  222. programmer to make a mistake, and it will almost always hap-
  223. pen. "Back doors" that allow unauthorized entrances are
  224. sometimes purposefully coded in -- for debugging, mainte-
  225. nance, or other reasons. And there are always unexpected
  226. side effects when thousands of people using the system start
  227. doing strange (stupid?) things. The best kind of defense
  228. against this is to report the problems to the developer as
  229. they are discovered, and if possible, to also report a way
  230. to fix the problem. Unfortunately, in many cases the source
  231. code is needed to make a bug fix, and especially in non-
  232. academic areas, this is simply not available due to the
  233. prohibitive costs involved. Combining this with the reluc-
  234. tance of a (usually) commercial developer to admit any prob-
  235. lems with their product, and the end result is a security
  236. hole that will not be mended unless some kind of financial
  237. loss or gain is at stake -- for the developer of the pro-
  238. duct, not yours!
  239.  
  240. 5) Ignorance. Users who don't know or care can be a
  241. problem as well. Even if someone doesn't care about their
  242. own security, they can unwittingly compromise the entire
  243. system -- especially if they are a user with high
  244. privileges. Administrators and system operators are not
  245. immune to this either, but hopefully are better informed, or
  246. at least have access to a means of combating this dysfunc-
  247. tion. It may also be due to apathy, an unwillingness to
  248. learn a new system, a lack of time to explore all of the
  249. features of a large system, or simply not enough computer
  250. savvy to learn more about a very complex system, and no one
  251. willing to teach it to the user. This problem is much like
  252.  
  253.  
  254.  
  255. February 19, 1991
  256.  
  257.  
  258.  
  259.  
  260.  
  261. - 5 -
  262.  
  263.  
  264. illiteracy; it is a never-ending battle that will never go
  265. completely away. And while a software toolkit such as COPS
  266. can help combat this problem by calling attention to
  267. neglected or misunderstood critical areas, by far and away
  268. the best weapon against this is education. An educated user
  269. will simply not make as many mistakes; and while it may seem
  270. impractical to teach _all_ users about (even) the fundamen-
  271. tals of computer security, think of all the time and
  272. resources wasted tracking down the mistakes that keep recur-
  273. ring time and time again.
  274.  
  275. 6) Unauthorized permissions or privileges. Are users
  276. given _too much_ freedom? Do new computer accounts have any
  277. default security at all, or are the new users expected to
  278. know what to do to protect their programs, data, and other
  279. files. System files, programs, and data are sometimes
  280. shipped with minimal or no protection when gotten straight
  281. from the manufacturer; someone at the installation site must
  282. have enough knowledge to "tune" the system to be effective
  283. and safe. Password, memory, and log files especially should
  284. all be carefully monitored, but unfortunately an experienced
  285. user can often still find out any information they want with
  286. perseverance and a little luck. This is where a system such
  287. as COPS can really shine. After a new system is configured,
  288. some basic flaws can be uncovered with just a small amount
  289. of effort. New system problems that somehow slip through
  290. the cracks of the site installers can be caught and modified
  291. before any serious problems result. The key here is to
  292. prevent your system users from getting a denial of computer
  293. service that they need and deserve. Service could mean any-
  294. thing from CPU time, response time, file space, or any other
  295. commodity that a computer has to offer.
  296.  
  297. 7) Crackers/Hackers/Evil twin brothers. Not much is
  298. needed on this subject, save to say that they are often not
  299. the main problem. Professional evil-users are a rarity;
  300. often harmful acts are done by users who "just wanted to see
  301. what would happen" or had no idea of the ramifications of
  302. their acts. Someone who is truly experienced is very diffi-
  303. cult to stop, and is certainly outside the realm of any
  304. software security tool as discussed in this paper. For-
  305. tunately, most evil-doers are fairly inexperienced and
  306. ignorant, and when they make a mistake, a watchful adminis-
  307. trator can deal with a problem before it gets out of hand.
  308. Sometimes they can even reveal security problems that were
  309. previously undiscovered. COPS can help here mostly by
  310. reducing an attacker's options; the less holes to exploit,
  311. the better.
  312.  
  313. The COPS system attempts to help protect as many of the
  314. above items as possible for a generic UNIX system. In the
  315. proper UNIX spirit, instead of having a large program that
  316. attempts to solve every possible problem, it is composed of
  317. several small programs that each check one or more potential
  318.  
  319.  
  320.  
  321. February 19, 1991
  322.  
  323.  
  324.  
  325.  
  326.  
  327. - 6 -
  328.  
  329.  
  330. UNIX security holes. The COPS system uses a variety of
  331. these problems to see if there are any cracks in a given
  332. UNIX security wall. These methods correspond to some of the
  333. problems discussed above; specifically to administrators,
  334. system programmers, and computer operators; authentication;
  335. ignorance; unauthorized permissions or privileges; and
  336. finally crackers/hackers/evil twin brothers (numbers 1,3,5,
  337. and 6.) It is very difficult, almost a practical impossi-
  338. bility to give software assistance to problems in physical
  339. security, and finally bugs or features that are present in a
  340. given UNIX system are possible to detect, but are not
  341. covered in this system (yet). The design of most of the the
  342. programs were at least described if not outlined from the
  343. following sources:
  344.  
  345. Aho, Kernighan, and Weinberger 88
  346.  
  347. Baldwin 87
  348.  
  349. Fiedler and Hunter 86
  350.  
  351. Grampp and Morris 84
  352.  
  353. Wood and Kochran 86
  354.  
  355.  
  356. Of course with all of the problems listed below, look-
  357. ing at the actual source code of the program is very
  358. instructive -- each numbered section lists the corresponding
  359. program that is used to perform the check:
  360.  
  361. 1) COPS Checks "vital" system directories to see if
  362. they are world-writable. Directories listed as critical are
  363. in a configuration file and are initially:
  364.  
  365. / /etc /usr
  366.  
  367. /bin /Mail /usr/spool
  368.  
  369. /usr/adm /usr/etc /usr/lib
  370.  
  371. /usr/bin /usr/etc /usr/spool/mail
  372.  
  373. /usr/spool/uucp /usr/spool/at
  374.  
  375. The method COPS uses to detect problems -- read through
  376. a configuration file (dir.chklst) containing all of the
  377. potential danger spots, and then simply comparing each
  378. directory modes with a bit mask to see if it is world writ-
  379. able. The program that performs this task is dir.chk
  380.  
  381. 2) Check "vital" system files to see if they are
  382. world-writable. Files listed as critical are in a confi-
  383. guration file (file.chklst) and are initially:
  384.  
  385.  
  386.  
  387. February 19, 1991
  388.  
  389.  
  390.  
  391.  
  392.  
  393. - 7 -
  394.  
  395.  
  396. /.*
  397.  
  398. /etc/*
  399.  
  400. /bin/*
  401.  
  402. /usr/etc/yp*
  403.  
  404. /usr/lib/crontab /usr/lib/aliases /usr/lib/sendmail
  405.  
  406.  
  407. The wildcards are used like in UNIX, so these would include
  408. (some of the more important files):
  409.  
  410. /.login /.profile /.cshrc /.crontab /.rhost
  411.  
  412. /etc/passwd /etc/group /etc/inittab /etc/rc
  413.  
  414. /etc/rc.local /etc/rc.boot /etc/hosts.equiv /etc/profile
  415.  
  416. /etc/syslog.conf /etc/export
  417.  
  418. As well as the executable command files (among others):
  419.  
  420. sh,csh, and ls.
  421.  
  422.  
  423. Method -- again read through a configuration file list-
  424. ing all of the files to be checked, comparing each in turn
  425. with a write mask. The program that performs this task is
  426. file.chk
  427.  
  428. 3) Check "vital" system files to see if they are
  429. world-readable, plus check for a NFS file system with no
  430. restriction. These critical files are:
  431.  
  432. /dev/kmem /dev/mem
  433.  
  434. All file systems found in /etc/fstab
  435.  
  436. Plus a small number of user selectable files -- initially
  437. set to include /.netrc, /usr/adm/sulog, and /etc/btmp.
  438.  
  439. Method -- checking each in turn against a read mask for
  440. their read status. The file system names are read from
  441. /etc/fstab, the selectable files are kept in a variable.
  442. The program that performs this task is dev.chk
  443.  
  444. 4) Check all files in system for SUID status, notify-
  445. ing the COPS user of any changes in SUID status.
  446.  
  447. Method -- Use the "find" command on the root directory (this
  448. must be done by root to avoid missing any files unreadable
  449. but still dangerous.) The previous run will create a file
  450.  
  451.  
  452.  
  453. February 19, 1991
  454.  
  455.  
  456.  
  457.  
  458.  
  459. - 8 -
  460.  
  461.  
  462. that can be checked against the current run to keep track of
  463. changes in SUID status and any new SUID files. The program
  464. that performs this task is suid.chk and was written by Pren-
  465. tiss Riddle.
  466.  
  467. 5) Check the /etc/passwd file (and the yellow pages
  468. password database, if applicable) for null passwords,
  469. improper # of fields, non-unique user-id's, non-numeric
  470. group id's, blank lines, and non-alphanumeric user-id's.
  471.  
  472. Method -- Read through password file, flag any differences
  473. with normal password file, as documented in "man 5 passwd".
  474. Fortunately, the syntax of the password file is relatively
  475. simple and rigid. The program that performs this task is
  476. passwd.chk
  477.  
  478.  
  479. 6) Check the /etc/group file (and the yellow pages
  480. database, if applicable) for groups with passwords, improper
  481. # of fields, duplicate users in groups, blank lines, and
  482. non-unique group-id's.
  483.  
  484. Method -- Read through group file, flag any differences with
  485. normal group file as documented in "man 5 group". Again,
  486. the syntax of this file is fairly simple. The program that
  487. performs this task is group.chk
  488.  
  489. 7) Check passwords of users on system.
  490.  
  491. Method -- using the stock "crypt" command, compare the
  492. encrypted password found in the /etc/passwd file against the
  493. following (encrypted) guesses:
  494.  
  495. The login id (uid), information in the gecos field, and all
  496. single letter passwords.
  497.  
  498. The program that performs this task is pass.chk and was
  499. written by Craig Leres and was modified by Seth Alford,
  500. Roger Southwick, Steve Dum, and Rick Lindsley.
  501.  
  502. 8) Check the root path, umask, and if root is in
  503. /etc/ftpuser.
  504.  
  505. Method -- look inside the /.profile and /.cshrc files to
  506. ensure that all of the directories listed are not world
  507. writable, that "." isn't anywhere in the path, and that the
  508. umask is not set to create world writable files. The pro-
  509. gram that performs this task is root.chk
  510.  
  511. 9) Examine the commands in /etc/rc* to ensure that
  512. none of the files or paths used are world-writable.
  513.  
  514. Method -- grep through the files and examine any strings
  515. that start with "/" for writability. The program that
  516.  
  517.  
  518.  
  519. February 19, 1991
  520.  
  521.  
  522.  
  523.  
  524.  
  525. - 9 -
  526.  
  527.  
  528. performs this task is rc.chk
  529.  
  530. 10) Examine the commands in /usr/lib/crontab to ensure
  531. that none of the files or paths used are world-writable.
  532.  
  533. Method -- grep through the crontab file and examine any
  534. strings after field five (first five are not files, but how
  535. crontab is to be run) that start with "/" for writability.
  536. The program that performs this task is cron.chk 11) Check
  537. all of the user home directories to ensure they are not
  538. world writable.
  539.  
  540. Method -- get all of the home directories using the system
  541. call getpwent() and then for every home directory found,
  542. check the write permissions of of the home directory against
  543. a bit mask. The program that performs this task is home.chk
  544. and it was written by John Owens.
  545.  
  546. 12) Check important user files in user's home direc-
  547. tories to ensure they are not world writable. The files
  548. checked (all in the individual users' home directory, all
  549. with the prefix "."):
  550.  
  551. rhost profile login cshrc kshrc tcshr crhost
  552.  
  553. netrc forward dbxinit distfile exrc emacsrc
  554.  
  555. Method -- using the same system call as #10, determine user
  556. home directory. Then simply check all of the above files
  557. against a bit mask. The program that performs this task is
  558. user.chk
  559.  
  560. 13) Given a goal to compromise, such as user root, and
  561. a list of user and group id's that can be used in an attempt
  562. to achieve the goal, this security tool will search through
  563. the system until it verifies that the goal is compromisible
  564. or not. The program that performs this tricky task is part
  565. of the U-Kuang (rhymes with "twang") system. Robert Baldwin
  566. was kind enough to allow me to include this security checker
  567. (a fine security machine in it's own right) within this dis-
  568. tribution. For more information on this fascinating secu-
  569. rity checker, see kuang.man.ms and [Baldwin 87]. I have
  570. rewritten it in Bourne shell (it was in C-Shell) for further
  571. portability.
  572.  
  573. None of programs listed above certain cover all of the
  574. possible areas that can harm a system, but if run together
  575. they can aid an overworked administrator to locate some of
  576. the potential trouble spots. The COPS system is not meant
  577. to be a panacea against all UNIX security woes, but an
  578. administrator who examines the security toolbox programs and
  579. this research paper might reduce the danger of their UNIX
  580. system being compromised -- and that's all any security tool
  581. can ever hope to do. The COPS system could never replace a
  582.  
  583.  
  584.  
  585. February 19, 1991
  586.  
  587.  
  588.  
  589.  
  590.  
  591. - 10 -
  592.  
  593.  
  594. vigilant administration staffed with knowledgeable people,
  595. but hopefully, as administrators look into the package, more
  596. comprehensive programs will come into being, covering more
  597. of the problems that will continue as the latest versions of
  598. UNIX continue to grow.
  599.  
  600. Design Notes:
  601.  
  602. The programs that are described here were designed to
  603. address the problems discussed above, but still be usable on
  604. as many UNIX "flavors" as possible. Speed was sacrificed
  605. for simplicity/portability; hopefully the tools here will
  606. either be replaced or modified, as by no means are they the
  607. final word or solution to _any_ of these problems; indeed,
  608. it is my hope that after other programmers/administrators
  609. see this report, they will create newer, better, and more
  610. general tools that can be re-distributed periodically. None
  611. of the programs need to be run by root to be effective, with
  612. the exception of the SUID checker (to ensure that all files
  613. are checked.) Some of the tools were written by myself, the
  614. others were written by other programmers on the network and
  615. (with their permission) presented here. All of the programs
  616. in this report are in the public domain, with the exception
  617. of Robert Baldwin's U-Kuang system; they all exist solely to
  618. be used and modified to fit your needs. If they are re-
  619. distributed, please keep them in their original form unless
  620. it is clearly stated that they were modified. Any improve-
  621. ments (that might not be too hard :-), suggestions, or other
  622. security programs that you would like to see get further
  623. distribution can be sent to:
  624.  
  625.  
  626. (That's me)
  627.  
  628. or
  629.  
  630.  
  631. (Dr. Eugene Spafford)
  632.  
  633. Note that the COPS system is still in an infancy stage
  634. -- although it has been tested on a variety of computers at
  635. Purdue, it has not undergone any serious trials.
  636.  
  637. Enhancements I envision include:
  638.  
  639. i) Improved speed and portability without sacrificing func-
  640. tionality (pretty obvious, I guess....)
  641.  
  642. ii) A level of severity assigned to each warning; anything
  643. that could compromise root instantly (root having no pass-
  644. word, for example) might have a level 0 priority, while sim-
  645. ply having a user with a writable home directory might only
  646.  
  647.  
  648.  
  649. February 19, 1991
  650.  
  651.  
  652.  
  653.  
  654.  
  655. - 11 -
  656.  
  657.  
  658. be level 3. This way the system could be run at a certain
  659. threshold level, or simply have the set of warnings priori-
  660. tized for a less sophisticated administrator.
  661.  
  662. iii) Better handling of SUID programs. The current program
  663. needs more work to be done on it to be run effectively by
  664. most people; many will not be willing to put the time needed
  665. to go through the list of SUID files by hand to decide if
  666. they are needed or not. Perhaps also an alarm would sound
  667. if a shell script is SUID; doubly so if root owned.
  668.  
  669. iv) A CRC checker that would check a file system (possibly
  670. just the most important programs (such as this :-)) and
  671. report if any of the executable files were changed -- possi-
  672. bly signalling a viral infection.
  673.  
  674. v) The eradication of any design flaws or coding errors that
  675. are in the COPS system.
  676.  
  677. The main purpose of creating the COPS system was two-
  678. fold; the first was to foster an understanding of the secu-
  679. rity problems common to most UNIX systems, and the second
  680. was to try to create and apply software tools that, when
  681. run, will inform system administrators of potential problems
  682. present in their system. No attempt is made by the tools to
  683. correct any problems because a potential security problem at
  684. one site may be standard policy/practice at another. An
  685. emphasis on furthering education and knowledge about UNIX in
  686. general is the key to good security practices, not following
  687. blindly what an unintelligent tool might say.
  688.  
  689. Some of the advantages to using a system such as COPS
  690. are:
  691.  
  692. i) Nearly Continuous monitoring of traditional problem
  693. areas.
  694.  
  695. ii) A new system can be checked before being put into pro-
  696. duction.
  697.  
  698. iii) New or inexperienced administrators can not only stop
  699. some of their problems in security they may have, but can
  700. also raise their consciousness about the potential for secu-
  701. rity dilemmas.
  702.  
  703. And a couple of disadvantages:
  704.  
  705. i) An administrator could get a false sense of security from
  706. running these programs. Caveat emptor (ok, they are free,
  707. but still beware.)
  708.  
  709. ii) A specific path to the elimination of the problem is not
  710. presented. This could also be construed as an advantage,
  711. when considering the third point.
  712.  
  713.  
  714.  
  715. February 19, 1991
  716.  
  717.  
  718.  
  719.  
  720.  
  721. - 12 -
  722.  
  723.  
  724. iii) Badguys can get these tools. You know -- the guys with
  725. black hats. What happens when they get a copy of this pack-
  726. age? With any sensitive subject like security, knowledge is
  727. zealously guarded. People are afraid that absolute
  728. knowledge corrupts -- who knows, they may be right. But I
  729. staunchly stand by the tree of knowledge. Let the bad guys
  730. taste the fruit, and they may see the light, so to speak.
  731. In addition, the system does not say how to exploit the
  732. hole, just that it exists.
  733.  
  734. Results of Running COPS:
  735.  
  736. Not surprisingly, the results when COPS was run varied
  737. significantly depending on what system and site it was run
  738. on. Here at Purdue, it was run on a Sequent Symmetry run-
  739. ning DYNIX 3.0.12, on a pair of Suns (a 3/280 and 3/50) run-
  740. ning UNIX 4.2 release 3.4, a VAX 11/780 running 4.3 BSD
  741. UNIX, a VAX 8600 running Ultrix 2.2, and finally a NeXT
  742. machine running their 0.9 O/S version of UNIX. The results
  743. of the COPS system showed a reasonable amount of security
  744. concern on all of the machines; the faculty only machines
  745. showed the weakest security, followed by the machines used
  746. by the graduate students, and finally the undergraduate
  747. machines had the strongest security (our administrators
  748. _know_ that you can't trust those (us?) young folks.)
  749. Whether this was showing that Purdue has a good administra-
  750. tion, or that the UNIX vendors have a fairly good grasp on
  751. potential security problems, or if it was merely showcasing
  752. the shortcomings of this system wasn't clear to me from the
  753. results.
  754.  
  755. The security results probably will vary significantly
  756. from machine to machine -- this is not a fault of UNIX;
  757. merely having the same machine and software does not mean
  758. that two sites will not have completely different security
  759. concerns. In addition, different vendors and administrators
  760. have significantly varying opinions on how a machine should
  761. be set up. There is no fundamental reason why any system
  762. cannot pass all or nearly all of these tests, but what is
  763. standard policy at one sites may be an unthinkable risk at
  764. another, depending upon the nature of the work being done,
  765. the information stored on the computer, and the users of the
  766. system.
  767.  
  768. When I first started researching this report, I thought
  769. it would be a fairly easy task. Go to a few computing
  770. sites, read some theoretical papers, gather all the programs
  771. everyone had written, and write a brief summary paper. But
  772. what I found was an tremendous lack of communication and
  773. concerted effort towards the subject of security. AT&T had
  774. written a couple of programs ([Kaplilow and Cherepov 88], as
  775. had Hewlett Packard ([Spence 89]), but they were
  776. proprietary. I heard rumors that the government was either
  777. working on or had such a security system, but they certainly
  778.  
  779.  
  780.  
  781. February 19, 1991
  782.  
  783.  
  784.  
  785.  
  786.  
  787. - 13 -
  788.  
  789.  
  790. weren't going to give it to me. The one book devoted to
  791. UNIX security ([Kochran and Wood 86]) was good, but the pro-
  792. grams that they presented were not expansive enough for what
  793. I had in mind, plus the fact that they had written their
  794. programs mostly based on System V. And while most system
  795. administrators I talked to had written at least a shell
  796. script or two that performed a minor security task (SUID
  797. programs seemed the most popular), no one seemed to exchange
  798. ideas or any their problems with other sites -- possibly
  799. afraid that the admission of a weakness in their site might
  800. be an invitation to disaster. There is an excellent secu-
  801. rity discussion group on the network ([Various Authors 84-
  802. ]), from which I received some excellent ideas for this pro-
  803. ject, but it is very restrictive to whom it allows to parti-
  804. cipate. I hope that with the release of this security sys-
  805. tem it will not only help stamp out problems with UNIX secu-
  806. rity, but would encourage people to exchange ideas, pro-
  807. grams, problems and solutions to the computer community at
  808. large.
  809.  
  810. Dan Farmer September 29, 1989
  811.  
  812. Acknowledgements: I would like to thank Eugene Spafford
  813. for his invaluable help in the researching, planning, and
  814. development of this project. Without the writings and pro-
  815. grams created by Robert Morris, Matt Bishop, and other capa-
  816. ble UNIX programmers, this project could never have gotten
  817. off the ground. Thanks also go to Brian Kernighan, Dennis
  818. Ritchie, Donald Knuth, and Ken Thompson, for such inspira-
  819. tional computer work. And of course without Peg, none of
  820. this would have come into being. Thanks again to all of
  821. you.
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847. February 19, 1991
  848.  
  849.  
  850.  
  851.  
  852.  
  853. - 14 -
  854.  
  855.  
  856. BIBLIOGRAPHY
  857.  
  858.  
  859. _, UNIX Programmers Manual, 4.2 Berkeley Software Distribu-
  860. tion, Computer Science Division, Department of Electrical
  861. Engineering and Computer Science University of California,
  862. Berkeley, CA, August 1983.
  863.  
  864. _, DYNIX(R) V3.0.12 System Manuals, Sequent Computer Sys-
  865. tems, Inc., 1984.
  866.  
  867. Aho, Alfred V., Brian W. Kernighan, and Peter J. Weinberger,
  868. The AWK Programming Language, Addison-Wesley Publishing Com-
  869. pany, 1988.
  870.  
  871. Authors, Various, UNIX Security Mailing List/Security Dig-
  872. est, December 1984 -.
  873.  
  874. Baldwin, Robert W., Crypt Breakers Workbench, Usenet,
  875. October 1986.
  876.  
  877. Baldwin, Robert W., Rule Based Analysis of Computer Secu-
  878. rity, Massachusetts Institute of Technology, June 1987.
  879.  
  880. Bauer, David S. and Michael E. Koblentz, NIDX - A Real-Time
  881. Intrusion Detection Expert System, Proceedings of the Summer
  882. 1988 USENIX Conference, Summer, 1988.
  883.  
  884. Bishop, Matt, Security Problems with the UNIX Operating Sys-
  885. tem, Department of Computer Sciences, Purdue University,
  886. January 31, 1983.
  887.  
  888. Bishop, Matt, How to Write a Setuid Program, April 18, 1985.
  889.  
  890. Denning, Dorothy, Cryptography and Data Security, Addison-
  891. Wesley Publishing Company, Inc, 1983.
  892.  
  893. Duff, Tom, Viral Attacks On UNIX System Security, Proceed-
  894. ings of the Winter 1988 USENIX Conference, Winter, 1988.
  895.  
  896. Fiedler, David and Bruce Hunter, UNIX System Administration,
  897. Hayden Book Company, 1986.
  898.  
  899. Grampp, F. T. and R. H. Morris, "UNIX Operating System Secu-
  900. rity," AT&T Bell Laboratories Technical Journal, October
  901. 1984.
  902.  
  903. Kaplilow, Sharon A. and Mikhail Cherepov, "Quest -- A Secu-
  904. rity Auditing Tool," AT&T Bell Laboratories Technical Jour-
  905. nal, AT&T Bell Laboratories Technical Journal, May/June
  906. 1988.
  907.  
  908. Morris, Robert and Ken Thompson, "Password Security : A Case
  909. History," Communications of the ACM, November 1979.
  910.  
  911.  
  912.  
  913. February 19, 1991
  914.  
  915.  
  916.  
  917.  
  918.  
  919. - 15 -
  920.  
  921.  
  922. Reed, Brian, "Reflections on Some Recent Widespread Computer
  923. Break-ins," Communications of the ACM, vol. Vol 30, No. 2,
  924. February 1987.
  925.  
  926. Reed, J.A. and P.J. Weinberger, File Security and the UNIX
  927. System Crypt Command, Vol 63, No. 8, AT&T Bell Laboratories
  928. Technical Journal, October 1984.
  929.  
  930. Smith, Kirk, Tales of the Damned, UNIX Review, February
  931. 1988.
  932.  
  933. Spafford, Eugene H., The Internet Worm Program: An Analysis,
  934. Purdue Technical Report CSD-TR-823, Nov 28, 1988.
  935.  
  936. Spafford, Eugene H., 1989. Private Communications
  937.  
  938. Bruce Spence, spy: A UNIX File System Security Monitor,
  939. Workshop Proceedings of the Large Installation Systems
  940. Administration III, September, 1988.
  941.  
  942. Stoll, Clifford, Stalking the Wily Hacker, Volume 31, Number
  943. 5, Communications of the ACM, May 1988.
  944.  
  945. Thompson, Ken, Reflections on Trusting Trust, Volume 27,
  946. Number 8, Communications of the ACM, August 1984.
  947.  
  948. Wood, Patrick and Stephen Kochran, UNIX System Security,
  949. Hayden Books, 1986.
  950.  
  951. Wood, Patrick, A Loss of Innocence, UNIX Review, February
  952. 1988.
Advertisement
Add Comment
Please, Sign In to add comment