home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit 2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / Improving-Security / security3.txt < prev    next >
Encoding:
Text File  |  1999-11-04  |  23.8 KB  |  431 lines

  1. by Deborah Russell and Elizabeth D. Zwicky
  2. Graphic by Markus Hⁿbner
  3.  
  4. ---------------------------------------------------------------------------
  5. Until a few years ago Internet security wasn't even recognized as a need.
  6. The culture of the Internet encouraged the sharing of data and ideas; the
  7. common goals of Internet users made boundaries and restrictions
  8. unnecessary--or so it seemed to many at the time.
  9.  
  10. Originally, the people on the Internet were the people who built the
  11. Internet, but as time passed and the Internet became more useful and more
  12. reliable, they were joined by other people at their companies and
  13. universities--and then by other companies and universities. With fewer
  14. common goals and more people, the Internet became a much more dangerous
  15. place. Although various sorts of mischief were quite common, these
  16. incidents got little publicity, and most people who thought of computer
  17. security problems at all assumed that such problems involved teenagers
  18. breaking into banks with modems.
  19.  
  20. The Internet Worm changed all that. In November of 1988 the Internet linked
  21. about 60,000 computers, and a good many of them found themselves under
  22. attack. Even those not affected by the Worm still had to be checked and
  23. rechecked to be sure they were safe from infection. Estimates of the total
  24. price tag for the incident are in the hundreds of millions of dollars.
  25.  
  26. The Worm was the first Internet security incident to hit the nightly news.
  27. People who had been working in obscurity suddenly found TV camera crews in
  28. their machine rooms. The issue was no longer whether you needed to secure
  29. your computer systems--it was how you were going to secure them.
  30.  
  31. In the years since the Worm, there has been an explosion in Internet
  32. usage--and a corresponding explosion in new types of Internet attacks.
  33. Consider a few recent reports from the front:
  34.  
  35.    * Over the years, computational physicist and computer security
  36.      researcher Tsutomu Shimomura of the San Diego Supercomputer Center has
  37.      accumulated an invaluable archive of security tools and documentation
  38.      of system security holes. On Christmas Day 1994 an intruder copied the
  39.      files from his archive. Two days later Shimomura received a voice mail
  40.      message, bragging about the intrusion and threatening his life.
  41.      Shimomura reacted aggressively by setting up stealth monitoring posts
  42.      and tracking the intruder's further break-ins at telephone company
  43.      switching centers, companies like Apple and Motorola, the Well, and
  44.      Netcom (from which the intruder copied 20,000 credit card account
  45.      numbers). Shimomura concluded that the intruder was computer criminal
  46.      Kevin Mitnick, who had been sought for years by law enforcement. After
  47.      an intensive hunt conducted with the cooperation of the FBI and local
  48.      telephone companies, Mitnick was tracked down in Raleigh, North
  49.      Carolina.
  50.    * In the fall of 1994 two writers, Josh Quittner and Michelle Slatalla,
  51.      were the target of an "electronic mail bomb", apparently in
  52.      retaliation for an article on the cracker community they'd published
  53.      in Wired magazine. Someone broke into IBM, Sprint, and the writers'
  54.      network provider and modified programs so their email and telephone
  55.      service was disrupted. A flood of email messages so overwhelmed their
  56.      network service that other messages couldn't get through; eventually
  57.      their Internet connection was shut down entirely. Their phone service
  58.      also fell victim to the intruders, who reprogrammed things so that
  59.      callers were routed to an out-of-state number where they heard an
  60.      obscene recording.
  61.    * More and more sites are falling victim to password sniffers. The CERT
  62.      (Computer Emergency Response Team) reports that as many as 100,000
  63.      sites were targeted by password sniffers in 1994. (We'll explain what
  64.      sniffers do later in this article.)
  65.  
  66. Insidious attacks like these have made computer security one of the most
  67. pressing problems facing Internet users in this decade. O'Reilly &
  68. Associates' line of computer security books looks closely at the risks of
  69. using the Internet and the measures you can take to reduce these risks.
  70.  
  71. Internet Risks
  72.  
  73. What kinds of security risks do you take on the Internet? Here's a
  74. sampling:
  75.  
  76. Password Attacks
  77.  
  78. Some years ago, before the Worm raised our consciousness about security
  79. risks, it was almost laughably easy for intruders to break into almost any
  80. system. Many sites didn't use passwords at all, or offered guest or admin
  81. passwords that users could share. Users who did have their own passwords
  82. routinely chose passwords that could be easily guessed (the names of their
  83. children or pets, their birth dates, their license plates). Because nobody
  84. bothered to encrypt files, an intruder who broke into the system could then
  85. invade almost anybody's files, take a copy of the /etc/passwd file, and
  86. later run it through a password cracking program that quickly revealed the
  87. passwords of other users in the system. Once deciphered, these purloined
  88. passwords became bartering chips among underground groups that shared
  89. technical information about product vulnerabilities and site-specific
  90. security holes.
  91.  
  92. Most systems and users have tightened up their security in the wake of the
  93. Internet Worm. Guest and admin passwords have become rarer, but password
  94. security as a whole is still laughable in most places. Group accounts
  95. abound, and invariably at least 10 percent of the passwords users select
  96. are poor (the only way to make them better is to install a password program
  97. that forces good passwords). Readily available password dictionaries,
  98. cracking programs, and password sniffing combine to make passwords very
  99. vulnerable.
  100.  
  101. How can you avoid password attacks? Educate the users on your system so
  102. they pick better passwords. Consider using system-generated passwords or,
  103. better still, stronger types of authentication, such as one-time
  104. (nonreusable) passwords.
  105.  
  106. Password Sniffing Attacks
  107.  
  108. The recent wave of password sniffing attacks on the Internet makes the
  109. strength of your passwords almost irrelevant.
  110.  
  111. How does password sniffing work? In many network setups, it is possible for
  112. any machine on a given network to hear the traffic for every machine on
  113. that network. This is true for most Ethernet-based networks, and Ethernet
  114. is by far the most common local area networking technology in use today.
  115. This characteristic of Ethernet is especially dangerous because most of the
  116. protocols in use today are unencrypted. As a result, the data sent and
  117. received is there for anybody to snoop on. This data includes files
  118. accessed via network file systems, passwords sent to remote systems during
  119. Telnet, FTP, and rlogin sessions, electronic mail sent and received, and so
  120. on.
  121.  
  122. A password sniffer is a program that takes advantage of this characteristic
  123. to monitor all of the IP (Internet Protocol) traffic on its part of the
  124. network. By capturing the first 128 bytes of every FTP or Telnet session,
  125. for example, password sniffers can easily pick up your user name and
  126. password as you type them. Password sniffers may use programs provided for
  127. network debugging as building blocks, or may be written to use the services
  128. directly. Special-purpose password sniffing toolkits are widely available
  129. to attackers.
  130.  
  131. The danger of password sniffing attacks is in their rapid spread. Favorite
  132. targets for sniffers are network providers and public access systems where
  133. the volume of Telnet and FTP connections is huge. One sniffer on large
  134. public access systems can collect thousands of sniffed account names and
  135. passwords, and then compromise every system accessed. Even if your systems
  136. are as secure as possible and your user passwords are not guessable, you
  137. can be infected by a packet sniffer running at any site that your users can
  138. log in from, or at any site their packets will cross to get to you.
  139.  
  140. Password sniffing can happen anywhere. Many people make the mistake of
  141. assuming that because they're using a well-known, commercial service, there
  142. is no danger in remotely accessing their own machines across the network.
  143. In fact, the commercial services are prime targets, and most of them are
  144. periodically compromised. In any case, a connection may cross a large
  145. number of intermediate networks, which each represent unknown risks. How
  146. can you avoid being sniffed? In general, you can't and still provide remote
  147. network access. If your password ever passes across a network which might
  148. be insecure--electronically or physically--it is likely to be captured.
  149. What you can do is ensure that an intruder who gets your password can't use
  150. it. One-time (nonreusable) passwords are probably the most effective way.
  151. Using a freely available program like Bellcore's S/Key may not keep your
  152. passwords from being viewed, but because these passwords are used only
  153. once, it doesn't really matter if they are seen.
  154.  
  155. NFS and Other Data Service Attacks
  156.  
  157. A number of services exist to allow computers to share information with
  158. each other and to allow users to move easily from computer to computer.
  159. These services are an important part of the power of UNIX networks.
  160. Unfortunately, they are often exploited by attackers, who convince these
  161. services to share more information than intended or to share it with
  162. unintended recipients. Often this occurs because designers were concerned
  163. with local area network access and did not realize that services might also
  164. be available across wide area networks to other organizations.
  165.  
  166. The Network File System (NFS) and Network Information Service (NIS) are
  167. notoriously easy ways to attack a system. NFS allows systems to share files
  168. over a network by letting a client mount a disk on a remote server machine.
  169. NIS maintains a distributed database of password tables, group files, host
  170. tables, and other information that systems on a network can share. Many
  171. sites choose not to support NIS at all, and some avoid even NFS. However,
  172. these services are not a problem if they are run in a protected environment
  173. (for example, behind a fire wall).
  174.  
  175. If you haven't properly protected your site, an attacker may be able to
  176. simply NFS-mount your filesystems. The way NFS works, client machines are
  177. allowed to read and change files stored on the server without having to log
  178. into the server or enter a password.
  179.  
  180. Because NFS doesn't log transactions, you might not even know that someone
  181. has full access to your files.
  182.  
  183. NIS is most often used to distribute password information, and most
  184. implementations of NIS provide absolutely no control over which machines
  185. can request information. As long as an attacker can guess the name of your
  186. NIS domain and can send an NIS request to your NIS server, that attacker
  187. can get a full copy of your password information (including encrypted
  188. passwords), even if you are running shadow passwords and the passwords are
  189. not in the /etc/passwd file. The attacker is then free to crack your
  190. passwords at leisure.
  191.  
  192. NFS, NIS, and other services have additional security vulnerabilities, both
  193. obvious and not so obvious. For example, NFS has very weak client
  194. authentication, and an attacker may be able to convince the NFS server that
  195. a request is coming from a client that is permitted in the exports file
  196. (the file that lets you specify which file systems can be mounted via NFS,
  197. and which other machines can mount them). There are also situations in
  198. which an attacker can hijack an existing NFS mount. (See the discussion of
  199. hijacking attacks later in this article.)
  200.  
  201. Denial of Service Attacks
  202.  
  203. There are two classic types of denial of service attacks, both particularly
  204. devastating when used on a network. Earlier in this article, we described
  205. an "electronic mail bomb" that shut down service by flooding an email
  206. mailbox. That's one type of denial of service--the same type performed by
  207. the Internet Worm. What happens here is that an intruder so floods a system
  208. or network--with messages, processes, or network requests--that no work can
  209. be done. The system or network spends all its time responding to messages
  210. and requests, and canUt actually satisfy any of them.
  211.  
  212. In the other category of attack, equipment or services are completely shut
  213. down or disabled. With ICMP attacks, which are becoming more common on the
  214. Internet, an attacker sends an ICMP message to a host or router, telling it
  215. to stop sending packets to all or part of the network.
  216.  
  217. How can you prevent denial of service attacks? The best defense against an
  218. ICMP attack is to install a firewall that ignores or filters ICMP messages.
  219.  
  220. In general, though, denial of service attackers are tough to
  221. prevent--electronically, as well as in real life. If you accept things from
  222. the external world--electronic mail, telephone calls, or packages--it's
  223. possible to get flooded. The famous college prank of ordering a pizza or
  224. two from every pizzeria in town to be delivered to your least favorite
  225. person is a form of denial of service. (It's hard to do much while arguing
  226. with 42 pizza deliverers.) In the electronic world, denial of service is as
  227. likely to happen by accident as on purpose. (Have you ever had a persistent
  228. fax machine try to fax something to your voice line?) The most important
  229. thing is to set up services so that if one of them is flooded, the rest of
  230. your site keeps functioning while you fix the problem.
  231.  
  232. Fortunately, denial of service attacks are not terribly popular. They're
  233. easy enough to be unsporting; they tend to be simple to trace back--and
  234. therefore risky to the attacker; and they don--t provide the attacker with
  235. the information or the ability to use your computers that is the payoff for
  236. most other attacks. Intentional denial of service attacks are the work of
  237. people who are angry at your site in particular--and at most sites, there
  238. are very few such people.
  239.  
  240. IP Attacks
  241.  
  242. Attackers sometimes take advantage of a little-used option--the source
  243. routing option--in the IP header of packets being sent across the Internet.
  244. Even systems protected by firewalls have fallen victim to these types of
  245. attacks.
  246.  
  247. Certain kinds of firewalls work by keeping packets from being routed from
  248. an outside system into your internal network. In normal packet routing,
  249. packets are routed in the most efficient way from source to destination.
  250. However, if the source routing option is specified for a packet, it shows
  251. the particular route that the packet is to follow. Unfortunately, turning
  252. off the regular routing of packets from the Internet to an inside network
  253. doesn't turn off the routing of source-routed packets on BSD systems. At
  254. tackers have exploited this peculiarity and used it to penetrate systems
  255. that are expecting their firewalls to keep all such outside packets out.
  256.  
  257. Another attack, which surfaced for the first time in early 1995, involves
  258. attackers creating packets with false IP addresses. By exploiting
  259. applications that use authentication based on IP addresses (such as the
  260. so-called Berkeley RrS commands, which include rlogin, rsh, and rcp),
  261. intruders have been able to gain access. Most of the attacks take advantage
  262. of the ability of intruders to guess sequence numbers associated with
  263. network connections and the acknowledgments passed between machines. These
  264. attacks are technically tricky, because the intruder doesn't receive the
  265. responses to the packets it sends; when they succeed, however, the payoff
  266. for these attacks can be high. (The attack on Shimomura described earlier
  267. was this type.)
  268.  
  269. How can you prevent these attacks? Firewalls are the only sufficient
  270. defense. You want to look for packets on your external interface (that is,
  271. packets coming from outside your internal network) that claim to have
  272. internal source IP addresses and for packets that have source routes
  273. specified. You can do this by installing an appropriately configured packet
  274. filtering router. It's also best to avoid address-based authentication
  275. completely, if you can.
  276.  
  277. Hijacking Attacks
  278.  
  279. Another emerging Internet threat involves the hijacking of any open
  280. terminal or login session from users on the system. Once intruders have
  281. root access on a system, they use a tool that lets them dynamically modify
  282. the UNIX kernel. This allows them to take over terminal connections after
  283. any authentication procedures have been completed. Even the strongest
  284. authentication (e.g., one-time passwords) are irrelevant because the attack
  285. occurs after the user successfully logs in. (This is another way that your
  286. systems can be compromised from any system that your users can log in
  287. from.)
  288.  
  289. This sort of attack has always been possible, but is easier to do and
  290. harder to detect with the new tools. Various forms of hijacking--from the
  291. completely unsubtle method of waiting for someone to get up for a cup of
  292. coffee without locking their screen, to the devious exploitation of window
  293. systems--have long been the most popular attacks at universities and other
  294. places where people may legitimately have access and yet simultaneously be
  295. hackers. In the past, these attacks have mostly been aimed at users at the
  296. site where the attacks were taking place. The new attacks are aimed at
  297. getting from a compromised system to an otherwise uncompromisable system
  298. across the Internet.
  299.  
  300. How can you prevent this attack? Once intruders have root access, you
  301. can't. So keep them out to begin with.
  302.  
  303. Security Solutions
  304.  
  305. Getting discouraged about connecting to the Internet or doing any real work
  306. on it? Don't be. There are ways to protect your system against the threats
  307. we've described.
  308.  
  309. There isn't a magic Internet security bullet. The best security solution
  310. isn't a simple solution, but a collection of strategies and techniques.
  311. Your own site's security philosophy, the characteristics of your users, the
  312. type of data you're protecting, and your budget all help determine the
  313. right approach for you. Here are some suggestions.
  314.  
  315. Enforce Good Host Security
  316.  
  317. With host security, you enforce the security of every machine at your site
  318. separately, and you make every effort to learn about, and plug, any
  319. security holes that your particular operating system presents. Although
  320. host security isn't a complete solution to Internet risks--there are simply
  321. too many machines, vendors, and operating systems to be sure that you've
  322. successfully been able to secure them all--you need to make sure that every
  323. system on your local network is as secure as you can make it. Systems
  324. exposed directly to Internet traffic need especially strong host security.
  325.  
  326. In Practical UNIX Security, Simson Garfinkel and Gene Spafford offer
  327. hundreds of specific suggestions for host security and also discuss a wide
  328. range of network security problems and solutions. This book has become the
  329. classic security reference for UNIX users and system administrators.
  330.  
  331. Encryption of Files and Email
  332.  
  333. If you use good encryption, then even if an intruder gets access to your
  334. files and messages, he won't be able to make sense of them. There are many
  335. types of encryption programs. Make sure to use one that uses a strong
  336. cryptographic algorithm. Although it's been around a long time, the Data
  337. Encryption Standard (DES) is still a pretty sound private key encryption
  338. algorithm, particularly if you use a variant, like Triple-DES. IDEA, RC2,
  339. and RC4 are other good private key algorithms. The RSA algorithm is the
  340. premier public key algorithm. It's a part of Lotus Notes, Novell NetWare,
  341. and hundreds of other products. Diffie-Hellman and Merkle-Hellman are other
  342. good public key algorithms.
  343.  
  344. PGP is a program that implements the RSA algorithm and is freely available
  345. on the Net (for noncommercial use within the United States). In PGP: Pretty
  346. Good Privacy, Simson Garfinkel describes how to use PGP to encrypt files
  347. and email and how to "sign" your email with an unforgettable digital
  348. signature, proving to recipients that your messages were sent by you and
  349. weren't modified during transmission. The book also contains a fascinating,
  350. behind-the-scenes look at the development of Phil Zimmermann's
  351. controversial program and the issues surrounding privacy, the export of
  352. encryption programs, and cryptography patents.
  353.  
  354. Use Firewalls
  355.  
  356. A firewall restricts access from your internal network to the Internet--and
  357. vice versa. A firewall may also be used to separate two or more parts of
  358. your local network (for example, protecting finance from R&D).
  359.  
  360. The dictionary definition of "firewall" is: "A fireproof wall used as a
  361. barrier to prevent the spread of a fire." A fire may damage, or even
  362. destroy, one section of a building, but a firewall may keep that fire from
  363. spreading to other sections of the building; at the very least, it may slow
  364. down the spread until the fire can be brought under control.
  365.  
  366. On computer networks, firewalls serve an analogous purpose. A security
  367. problem somewhere on a network--for example, eavesdropping, a major
  368. break-in, or a worm program--may do a great deal of damage to one portion
  369. of the network. But if a fire wall is in place, it can isolate what's
  370. behind it from the security problem. Without firewalls network security
  371. problems can rage out of control, dragging more and more systems down. Once
  372. one system on a network has been compromised, it's often trivial to
  373. compromise the others. Shared system resources, homogeneous services, and
  374. trust policies may all contribute to the spread of a security problem from
  375. one system to another.
  376.  
  377. Think of a firewall as a checkpoint; all traffic is stopped and checked at
  378. this point--usually, at the perimeter of your internal network, where you
  379. connect to the Internet (see the figure above). Your own site's security
  380. policy determines what happens at the checkpoint. Some requests (e.g.,
  381. requests for email service) might pass right through. Others (e.g.,
  382. requests for potentially dangerous service like NFS or NIS) might be turned
  383. away. Still others (e.g., requests for FTP file transfers) might be routed
  384. to proxy services, which satisfy the requests without directly exposing
  385. internal systems.
  386.  
  387. If your site is connected to the Internet, you may want to check out our
  388. forthcoming book, Internet Security Firewalls, by D. Brent Chapman and
  389. Elizabeth D. Zwicky. It contains the details of various firewall approaches
  390. and architectures, how you can build packet filtering and proxying
  391. solutions at your site, and how to configure Internet services to work with
  392. a firewall.
  393.  
  394. Use Secure Procedures
  395.  
  396. Purely technical solutions go only so far. Just as there is a human element
  397. to committing computer crimes, there is a human element to preventing them.
  398. Be smart about prevention, and make sure your organization enforces good
  399. security procedures in everything they do. Physical security (e.g., using
  400. access cards for entry, protecting network cabling, etc.), personnel
  401. security (e.g., removing the accounts of people who leave your
  402. organization), and operational security (e.g., varying the schedules for
  403. changing passwords, checking log files, etc.) are less technical, but
  404. nevertheless important, parts of Internet security.
  405.  
  406. Two books provide valuable information on understanding and establishing
  407. security at your site.
  408.  
  409. Computer Security Basics, by Deborah Russell and G. T. Gangemi, is the
  410. first book to read if you want to learn what computer security is all
  411. about. It contains the basics of access control, encryption, trusted
  412. systems, and physical security, as well as a history of computer security
  413. developments, U.S. Government security programs (such as the "Orange
  414. Book"), and a complete glossary and resource summary.
  415.  
  416. Computer Crime: A Crimefighter s Handbook, by David Icove, Karl Seger, and
  417. William VonStorch, is aimed particularly at those who need to investigate
  418. computer crimes--law enforcement, managers, and others. It describes
  419. targets, criminals, methods, and security measures you can take to prevent
  420. them. It also details the way to detect, investigate, and prosecute
  421. computer crimes, and it includes the complete text of all computer crime
  422. laws, both federal and state.
  423.  
  424. ---------------------------------------------------------------------------
  425. Deborah Russell is the editor of the O'Reilly & Associates' computer
  426. security series and the coauthor of Computer Security Basics. Elizabeth D.
  427. Zwicky is a senior system administrator at Silicon Graphics and the
  428. president of SAGE (the System Administrator's Guild). She has been
  429. involuntarily involved in Internet security since before the Worm.
  430. ---------------------------------------------------------------------------
  431.