Networks
In this chapter:
Vulnerabilities
-
Threats in networks: wiretapping, modification, addressing
-
Wireless networks: interception, association, WEP, WPA
-
Denial of service and distributed denial of service
Protections
-
Cryptography for networks: SSL, IPsec, virtual private networks
-
Firewalls
-
Intrusion detection and protection systems
-
Managing network security, security information, and event management
As we all know, much of computing today involves interacting remotely with people, computers, processes, and even wrongdoers. You could hide in your room and never pass anything to or receive anything from outside, but that would severely limit what you could do. Thus, some degree of external connectivity is almost inevitable for most computer users, and so the question becomes how to do that with reasonable security.
But as soon as you decide to connect to points outside your security perimeter, that connection leaves your zone of protection, and you are at risk that others will read, modify, and even obliterate your communication. In this chapter we consider security in remote networks. Users may not always recognize when a network connection occurs. For example, a network-enabled thermostat, speaker, or doorbell can seem just like its non-networked counterpart, but the connectivity introduces vulnerabilities. We consider such connected devices as part of the Internet of Things (IoT) in Chapter 8 . Often associated with the IoT is an amorphous supernetwork known simply as “the cloud,” a collection of networked storage and computing capabilities that can function as extensions of a user’s local computer. We also study the cloud in Chapter 8 . In Chapter 4 we consider the impact of a network on a local user, focusing extensively on the internet, the most obvious connection to most users. Users expect they control their local devices, although as Chapter 4 explains, these devices sometimes seem to be out of control.
In this chapter we focus on remote networks, where the user has little if any expectation of control, and thus the security risks are great. This chapter covers the two sides of network security: threats and countermeasures. Thus, we have divided the chapter into two parts to help you to find and digest topics and to highlight the distinction between these areas. Of course, the two halves reinforce each other, and both are necessary for a true understanding of security in networks.
We begin this chapter with a brief review of network terms and concepts. After that background we open the first part of the chapter: threats. As you see, the threats against networks derive from the three basic threat types we introduce in Chapter 1 : interception, modification, and interruption. As part of this chapter, we examine these threats in the context of wireless networking, a technology that has become popular through public WiFi at coffee shops, university campuses, airports, and corporate environments; many of these access points are free. But when you connect to a free access point, what security do you have? Next we discuss denial-of-service (DoS) attacks, in which legitimate users’ network use is severely constrained or even cut off; this kind of attack is unique to networks.
The second part of the chapter presents three important ways to counter threats to networking. We call on our workhorse, cryptography, showing how it can maintain confidentiality and integrity in networked communications. Then we introduce two pieces of technology that can help protect users against harm from networks: firewalls and intrusion detection and protection systems. We conclude the chapter with techniques and technologies for managing network security.
6.1 Network Concepts
A network is a little more complicated than a local computing installation. To trivialize, we can think of a local environment as a set of components—computers, printers, storage devices, and so forth—and wires. We use the singular noun “wire” to mean a cable that typically consists of two or more separate conductors of electrical signals. A wire is point to point, with essentially no leakage between end points (although wiretapping does allow anyone with access to the wire to intercept, modify, or even block the transmission). In a local environment, wires are frequently secured physically (for example, behind a wall or in a conduit), or perhaps they are laid in plain sight, so surreptitious wiretapping is not a major issue. Remote communication still involves a connection; we can think of it as though it travels on physical wires, but the wires are outside the control and protection of the user, so tampering with the transmission is a serious threat. The nature of that threat depends in part on the medium of these wires, which in a network can be metal wire, glass fibers, or electromagnetic signals such as radio communications. In a moment we look at different kinds of communications media.
In the local environment, users send data from one device to another by simply selecting the one wire to the desired destination. With a remote network, ordinarily the sender does not have one wire for each possible recipient because the number of wires would become unmanageable. Instead, as you probably know, the sender precedes data with what is essentially a mailing label, a tag showing to where (and often from where) to transmit data. At various points along the transmission path, a device will inspect the label to determine whether that device is the intended recipient. If it is not, the device will choose how to forward the data to get nearer to the destination. This processing of a label is called routing . Routing is implemented by computers, and, as you already know, computer programs are vulnerable to unintentional and malicious failures. In this section we also consider some of the threats to which routing is susceptible.
Background: Network Transmission Media
When data items leave a protected environment, people along the way can view or intercept the data; other terms used are eavesdrop , wiretap , or sniff . If you shout something at a friend some distance away, you are aware that people around you can hear what you say. The same is true with data, which can be intercepted both remotely, across a wide area network (WAN), and locally, in a local area network. A local area network ( LAN ) is one that is contained in one space—a home, office, or even a university campus. A LAN connects devices, including computers, network-enabled mobile devices like phones and tablets, and other components such as printers and storage devices. A LAN may also include what are called smart devices, such as thermostats, baby monitors, speakers, security devices, and doorbells.
Data communications travel either on an actual wire or wirelessly, both of which are vulnerable, with varying degrees of ease of attack. The nature of interception depends on the medium, which we describe next. As you read this explanation, think also of modification and blocking attacks, which we describe shortly.
Signal interception is a serious potential network vulnerability.
Cable
The simplest network connector is a wire called an Ethernet cable. At the local level, all signals in an Ethernet or other LAN are available on the cable for anyone or any connected device to intercept. Each LAN connector (typically a board in a computer or an access port on another device) has a unique address. Each board and its drivers are programmed to label all packets from its host with the board’s address (as a sender’s “return address”) and to take from the net only those packets addressed to its host.
Packet Sniffing
Removing only those packets addressed to a given host is mostly a matter of politeness; there is little to stop a program from examining each packet as it goes by. A device called a packet sniffer retrieves all packets on its LAN. Alternatively, one of the interface cards can be reprogrammed to have the supposedly unique address of another existing card on the LAN so that two different cards will both fetch packets destined for one address. (To avoid detection, the rogue card will have to put back on the net copies of the packets it has intercepted.) Fortunately (for now), wired LANs are usually used only in environments that are fairly friendly, so these kinds of attacks occur infrequently. However, as we describe shortly, a wireless local network often uses a communications technique known as WiFi that is easy to intercept, so the communication is seriously exposed.
Radiation
Clever attackers can take advantage of a wire’s properties and read packets without any physical manipulation. Ordinary wire (like many other electronic components) emits radiation. By a process called inductance an intruder can tap a wire and read radiated signals without making physical contact with the cable; essentially, the intruder puts an antenna close to the cable and picks up the electromagnetic radiation of the signals passing through the wire. (Read Sidebar 6-1 for some examples of interception of such radiation.) A cable’s inductance signals travel only short distances, and they can be blocked by other conductive materials, so an attacker can foil inductance by wrapping a cable in more wire and perhaps sending other, confounding signals through the wrapped wire. The equipment needed to pick up signals is inexpensive and easy to obtain, so inductance threats are a serious concern for cable-based networks. For the attack to work, the intruder must be fairly close to the cable; therefore, this form of attack is limited to situations with physical access or at least close proximity.
Sidebar 6-1 Electromagnetic Radiation
Electromagnetic leakage of electronic devices is a known phenomenon that has been studied for decades. Military experts worry about the ability of an adversary to intercept sensitive information from such sources as the electrical impulses generated as keys are pressed on a keyboard or the magnetic radiation from the circuitry that displays images on video screens. To intercept such data requires sophisticated electronics equipment capable of detecting small changes in low-level signals; consequently, the techniques are applicable primarily to very high-value situations, such as military ones.
Because the military is the primary affected target, much of the research in this area is not public. Two Ukrainian researchers, N.N. Gorobets and A.V. Trivaylo, published [ GOR09 ] results of some public studies in this area.
They consider flat panel computer displays. Conventional wisdom has been that old-style cathode ray tube (CRT) displays emit detectable signals but that the newer flat panel liquid crystal displays (LCDs) are “safe.” Instead, the researchers report, certain technical characteristics of the interface and display may make LCDs even easier to compromise than CRTs. The researchers present an example showing interception of test data from 10 meters (30 feet) away, two offices distant. They also report on experiments involving keyboards. Using different techniques, Gorobets and Trivaylo recovered keyboard signals from distances of 5 to 8 meters (roughly 15 to 25 feet).
More recent research [ NAS21 ] presented a technique nicknamed “Glowworm” by which eavesdroppers can recover sound by monitoring the power indicator LED of various devices (e.g., speakers, USB hub splitters, and microcontrollers). Using their technique, the researchers show that an eavesdropper could recover speech from a speaker's power indicator LED with good intelligibility from a distance of 15 meters and with fair intelligibility from 35 meters (roughly 45 and 100 feet). This attack requires line-of-sight access to the LED.
These distances involve close proximity, but the interception could occur from an adjacent building or across the street through a window. Such attacks highlight the unlimited possibilities for attackers: The flickering of an LED that is imperceptible to the human eye may still be measurable. Such seemingly insignificant events can lead to compromise of sensitive data. Worse, the interceptions leave no fingerprints to show that an attack has happened or who perpetrated it and when.
Cable Splicing
If the attacker is not close enough to take advantage of inductance, more hostile measures may be warranted. The easiest way to intercept a cable is by direct cut. If a cable is severed, all service on it stops. As part of the repair, an attacker can splice in a secondary cable that then receives a copy of all signals along the primary cable. Interceptors can be a little less obvious but still accomplish the same goal. For example, an attacker might carefully expose some of the outer conductor, connect to it, then carefully expose some of the inner conductor and connect to it. Both of these operations alter the resistance, called the impedance, of the cable. In the first case, the repair itself alters the impedance, and the impedance change can be explained (or concealed) as part of the repair. In the second case, a little social engineering can explain the change. (“Hello, this is Matt, a technician with Bignetworks. We are changing some equipment on our end, and so you might notice a change in impedance.”) Although these attacks require physical contact with the wire, the contact happens only once; after installing the wiretap, the attacker can disappear, retrieving data remotely.
Some LANs have a fixed set of devices that rarely change; with other LANs, people add and remove devices frequently enough that change is not an exceptional event. In an office, employees power up workstations that have been shut off for the night, visiting employees connect laptops to the network, workers join the network with smartphones, and technicians add and remove monitoring gear to maintain the network. Adding one more device may pass unnoticed. An attacker only needs to find an unused network connection point.
Another way to intercept from a wired LAN is to find the wiring closet or panel, the place where the wires of the network all come together and from which network administrators can reconfigure the LAN’s topology, for example, by routing one set of wires through a switch to make a separate subnet. With a device called a sniffer , someone can connect to and intercept all traffic on a network; the sniffer can capture and retain data or forward it to a different network.
Signals on a network are multiplexed, meaning that more than one signal is transmitted at a given time. For example, two analog (sound) signals can be combined, like two tones in a musical chord, and two digital signals can be combined by interleaving, like playing cards being shuffled.
Optical Fiber
Signals can be sent along a cable of glass filaments, each of which can transfer a pulse of light energy. Optical fiber offers two significant security advantages over other transmission media. First, the entire optical network must be tuned carefully each time a new connection is made. Therefore, no one can tap an optical system without detection. Clipping just one fiber in a bundle will destroy the balance in the network.
Second, optical fiber carries light energy, not electricity. Light does not create a magnetic field as electricity does. Therefore, an inductive tap is impossible on an optical fiber cable.
Just using fiber, however, does not guarantee security, any more than does just using encryption. The repeaters, splices, and taps along a cable are places at which data may be available more easily than in the fiber cable itself. The connections from computing equipment to the fiber may also be points for penetration. By itself, fiber is much more secure than cable, but it has vulnerabilities too.
Physical cables are thus susceptible to a range of interception threats. But pulling off such an intrusion requires physical access to one of the cables carrying the communication of interest, no small feat. In many cases pulling data from the air is easier, as we describe next.
Microwave
Microwave signals are not carried along a wire; they are broadcast through the air, making them more accessible to outsiders. More properly, such signals are called super high-frequency radio waves. For computer security, the most important form of microwave communication is WiFi, which is a shortened form of wireless fidelity. WiFi technology is primarily used for short distances, for example, within a single building, although cooperating equipment can transfer a WiFi signal for miles. We address the vulnerabilities of WiFi communication in Section 6.3 .
Microwave is a line-of-sight technology; the receiver needs to be on an unblocked line with the sender’s signal, although some radio signals can travel through walls and other obstacles. Typically, a transmitter’s signal is focused on its corresponding receiver because microwave reception requires a clear space between sender and receiver. The signal path is fairly wide, to be sure of hitting the receiver, as shown in Figure 6-1 . From a security standpoint, the wide swath is an invitation to mischief. Not only can someone intercept a microwave transmission by interfering with the line of sight between sender and receiver, someone can also pick up an entire transmission from an antenna located close to but slightly off the direct focus point.
FIGURE 6-1 Microwave Transmission Interception
The Sender, Interceptor, Receiver, and Interceptor are connected by Actual Signal Path (to account for errors in aim). The Sender, Interceptor, and Receiver are connected by Intended Signal Path.
A microwave signal is usually not shielded or isolated to prevent interception. Microwave is, therefore, an insecure medium because the signal is so exposed. However, because of the large volume of traffic carried by microwave links, an interceptor is unlikely to separate an individual transmission from all the others interleaved with it. A privately owned microwave link, carrying only communications for one organization, is not so well protected by volume.
Microwave signals require true visible alignment, so they are of limited use in hilly terrain. Plus, because the curvature of the earth interferes with transmission, microwave signals must be picked up and repeated to span long distances, which complicates long-distance communications, for example, over oceans. The surprising solution to these limitations is to use satellites.
Satellite Communication
Signals can be bounced off a satellite: from earth to the satellite and back to earth again. The sender and receiver are fixed points; the sender beams a signal over a wide area in which the satellite is located, and the satellite rebroadcasts that signal to a certain radius around the receiver. Satellites are in orbit at a level synchronized to the earth’s orbit, so they appear to be in a fixed point relative to the earth.
Transmission to the satellite can cover a wide area around the satellite because nothing else is nearby to pick up the signal. On return to earth, however, the wide dissemination radius, called the broadcast’s footprint, allows any antenna within range to obtain the signal without detection, as shown in Figure 6-2 . Different satellites have different characteristics, but some signals can be intercepted in an area several hundred miles wide and a thousand miles long. Therefore, the potential for interception by being in the signal’s path is even greater than with microwave signals.
FIGURE 6-2 Satellite Communication
The countermeasure for this spread relates to the method–opportunity–motive evaluation of Chapter 1 . First, the attacker has to know how the signal is communicated. With satellite communication, because the technology involves equipment owned and operated by different nations, the protocols are readily published. Next, the attacker has to want to intercept the signal; the signal has to have a high enough value to warrant obtaining it. In Sidebar 6-2 we discuss the economics of intercepting satellite communications.
Sidebar 6-2 Satellite Interception
Satellite technology is expensive. The satellites themselves cost millions of dollars to produce and launch, although once in orbit the devices have negligible costs to maintain. More significant, the communications systems used with satellites are expensive because they implement sophisticated satellite-to-ground and satellite-to-satellite connectivity. The uplink (ground to satellite) is from a single source, but when returning a signal to earth, the satellite bundles many communications in a single beam to cover as much physical territory as possible. Satellite communications are essential for remote areas of the globe, such as oceans or Antarctica, where there are few receivers. The satellite serves as an internet service provider (ISP) for these customers.
You might expect such expensive resources to be difficult—and costly—to compromise. At the 2020 Black Hat hackers’ conference (reported in Threatpost [ SEA20 ]), James Pavur, an academic researcher and doctoral candidate at Oxford University, described an interception device he assembled from US$300 of readily available parts, basically a regular rooftop dish antenna and a computer card used to receive satellite television signals on a computer.
Satellite positions are publicly known, and satellites use standard internet protocols for video, telephony, and data traffic. The communications signals are readily available to anyone who chooses to receive them. Pavur had to extract the signal from background noise, separate data communications from television signals, and cope with data corruption during transmission and reception, all problems solved with a little analysis.
Pavur was surprised by how many satellite ISPs did not encrypt their data. Certain traffic, such as website address lookups, have to be communicated in plaintext, but individuals’ interactions (such as between you and your bank) are often encrypted. But large corporate customers who own or lease private lines for internal communications may choose to avoid the speed degradation of encrypting traffic. When using protected cables on land, these organizations are reasonably secure, but not when the communication travels through space visible to anyone with appropriate interception gear.
For example, Pavur could intercept communications involving installations of wind turbines for electricity generation. Although the conversations between a turbine and its monitoring and management station did not contain juicy gossip, being able to read and perhaps modify these signals could allow an attacker to compromise an electrical infrastructure. Pavur also obtained internet traffic from cruise ships at sea, with many passengers’ email traffic.
The U.S. Federal Bureau of Investigation (FBI) released a private threat-intelligence notification in response to Pavur’s research.
Satellite communication is an important way to connect remote users, such as ships at sea, mountain climbers in remote regions, and offshore oil drilling platforms. Because the signal must travel from earth to satellite and back down to earth, the transmission speed is relatively slow.
Other Radio Wave Technologies
Other radio wave or electromagnetic technologies used for computer communication include
-
cellular transmission (used between mobile phones and a fixed base station, perhaps as much as 8 kilometers or 5 miles away)
-
Bluetooth (generally used for communicating across distances less than a meter, to printers or headphones, for example)
-
near field communication (used for even shorter distances, such as from a smartphone or an in-car payment transmitter to a payment terminal)
These technologies all use radio frequency signals and thus are exposed to interception as well as modification and interruption attacks, much like microwave communication.
In summary, network traffic is available to an interceptor at many points. Figure 6-3 illustrates how communications are exposed from their origin to their destination. We summarize strengths and weaknesses of different communications media in Table 6-1 .
FIGURE 6-3 Exposed Communications
A network connects the sender and the receiver, and a wiretap occurs between the sender and the network. Similarly, there is an imposter between the network and the receiver. The imposter is linked to the Rogue receiver. The network is linked to Wireless interception; wired interception; address modification.
Table 6-1 Communications Media Strengths and Weaknesses
| Medium | Strengths | Weaknesses |
|---|
| Wire |
-
Widely used
-
Inexpensive to buy, install, maintain
|
-
Susceptible to emanation
-
Susceptible to physical wiretapping
| | Optical fiber |
-
Immune to emanation
-
Difficult to wiretap
|
- Potentially exposed at connection points
| | Microwave |
- Strong signal, not seriously affected by weather
|
-
Exposed to interception along path of transmission
-
Requires line of sight location
-
Signal must be repeated approximately every 30 miles (50 kilometers)
| | Other radio wave technologies, including WiFi, Bluetooth, near field communication and cellular telephone communication |
-
Widely available
-
Built into many computers and devices
|
-
Signal degrades over distance; suitable for short range (distance varies by technology)
-
Signal interceptable in circular pattern around transmitter
| | Satellite |
-
Strong signal
-
Useful in remote locations
|
-
Delay due to distance signal travels up and down
-
Signal exposed over wide area at receiving end
|
From a security standpoint, you should assume that all communication links between network nodes can be broken. As Sidebar 6-3 indicates, even eyeballs can pass data unintentionally. For this reason, commercial network users employ encryption to protect the confidentiality of their communications, as we discuss later in this chapter. Local network communications can be encrypted, although for performance reasons it may instead be preferable to protect local connections with strong physical and administrative security.
All network communications are potentially exposed to interception; thus, sensitive signals must be protected.
Sidebar 6-3 Mirror, Mirror, on My Screen
Researcher Michael Backes has discovered that many surfaces can reflect images. We are, of course, aware of mirrors and shiny metal objects. But researcher Backes has experimented with eyeglasses (which he found work quite well), ceramic coffee cups, jewelry, and even individuals’ eyeballs.
A professor at Saarland University and the Helmholtz Center for Information Security, Backes got his idea as he passed a room in which his graduate students were intently typing on computers. Wondering what they were up to, he noticed the blue image of the screen reflected on a teapot on one student’s desk. The next day he appeared with a telescope and camera and began his study [ BAC09 ]. Using a powerful amateur-grade telescope, he trained his sight on reflecting objects from a distance of 10 meters (30 feet) and read the contents of a computer screen, even when the screen faced away from the telescope .
He has applied techniques from mathematics and astronomy to clarify the images, allowing him to read 36-point type (roughly three times as large as the type in this paragraph) from 10 meters away, but he thinks with more sophisticated equipment he could significantly improve on that result. Other photo enhancement software should also clarify the image, he thinks. He warns that if these attacks are feasible for an amateur like him, dedicated attackers can probably do better.
Maybe the expression “I can see what you are thinking” is truer than we think.
Intruding into or intercepting from a communications medium is just one way to strike a network. Integrity and availability threats apply as well. Addressing and routing are also fruitful points of vulnerability. In the next section we present basic network addressing concepts that have security implications.
Background: Protocol Layers
Computer network communications are performed through a virtual concept called the Open System Interconnection (OSI) model. This seven-layer model starts with an application program that prepares data to be transmitted through a network. The data move down through the layers, being transformed and repackaged; at the lower layers, control information is added in headers and trailers. Finally, the data are ready to travel on a physical medium, such as a cable or through the air on a microwave or satellite link.
The OSI model, most useful conceptually, describes similar processes of both the sender and receiver.
On the receiving end, the data enter the bottom of the model and progress up through the layers where control information is examined and removed, and the data are reformatted. Finally, the data arrive at an application at the top layer of the model for the receiver. This communication is shown in Figure 6-4 .
FIGURE 6-4 OSI Model
Two tables are placed on the left and right. Both tables show the same data as follows: 7 - Application; 6 - Presentation; 5 - Session; 4 - Transport; 3 - Network; 2 - Data Link; 1 - Physical. A down-arrow is placed on the left table from 7 to 1. An arrow from the first arrow moves right and then up, on the first table from 1 to 7.
Interception can occur at any level of this model: For example, the application can covertly leak data, as we mention in Chapter 3 , the physical media can be wiretapped, as we described in this chapter, or a session between two subnetworks can be compromised.
Background: Addressing and Routing
If data are to go from point A to B, there must be some path between these two points. One way, obviously, is a direct connection wire. And for frequent, high-volume transfers between two known points, a dedicated link is indeed used. A company with two offices on opposite sides of town might procure its own private connection. This private connection becomes a single point of failure, however, because if that line fails for any reason, the two offices lose connectivity, and a solid connection was the whole reason for the private line.
Obviously, direct connections work only for a small number of parties. It would be infeasible for every internet user to have a dedicated wire to every other user. For reasons of reliability and size, the internet and most other networks resemble a mesh, with data being boosted along paths from source to destination.
Protocols
A protocol is a language or set of conventions for how two computers will interact. (For simplicity, we describe this communication as being from one computer to another. The principle is the same if either end device is a mobile phone, tablet, or any other device that communicates on a network.) A simple protocol accomplishes email transfer. Essentially the sender’s computer contacts the recipient’s and communicates “I have email for your user Dmitri.” The receiving computer replies to accept the transfer, the sender sends it and then sends a completion notification to indicate the end of the transfer. Of course, this overview omits critical details.
When we use a network, the communications media are usually transparent to us. That is, most of us do not know whether our communication is carried over copper wire, optical fiber, satellite, microwave, or some combination. In fact, the communications medium may change from one transmission to the next. This ambiguity is actually a positive feature of a network: its independence . That is, the communication is separated from the actual medium of communication. Independence is possible because we have defined protocols that allow a user to view the network at a high, abstract level of communication (viewing it in terms of user and data); the details of how the communication is accomplished are hidden within software and hardware at both ends. The software and hardware enable us to implement a network according to a protocol stack, a layered architecture for communications; we introduce the OSI protocol model earlier in this chapter. Each layer in the stack is much like a language for communicating information relevant at that layer. The lowest level, the physical layer, is the only one that directly interacts with the actual communications medium, so all levels above never need to know how the signals actually traveled. We expand on protocols and their use later in this chapter.
Addressing
But how does the sender contact the receiver? Suppose your message is addressed to [email protected]. This notation means that “somewhere.net” is the name of a destination host (or, more accurately, a destination network). At the network layer, a hardware device called a router actually sends the message from your network to a router on the network somewhere.net. The network layer adds two headers to show your computer’s address as the source and somewhere.net’s address as the destination. Logically, your message is prepared to move from your machine to your router to your friend’s router to your friend’s computer. (In fact, along the path between the two routers there may be many other routers.) Together, the network layer structure with destination address, source address, and data is called a packet . The basic network layer protocol transformation is shown in Figure 6-5 .
FIGURE 6-5 Network Layer Transformation
Message acts as the Transport Layer. The Network Layer shows Destination Address, Address Source, and Message. An arrow from Message of the Transport Layer points at the Message of the Network Layer.
Packet: smallest individually addressable data unit transmitted
The message must travel from your computer to your router. Every computer connected to a network has a network interface card (NIC) with a unique physical address, called a MAC address (for medium access control). At the data-link level, two more headers are added, one for your computer’s NIC address (the source MAC) and one for your router’s NIC address (the destination MAC). A data-link layer structure with destination MAC, source MAC, and data is called a frame . Every NIC puts data onto the communications medium when it has data to transmit and seizes from the network those frames with its own address as a destination address.
MAC address: unique identifier of a network interface card that connects a computer and a network
On the receiving (destination) side, this process is performed in reverse: The NIC card receives frames destined for it. The recipient network layer checks that the packet is really addressed to it. Packets may not arrive in the order in which they were sent (because of network delays or differences in paths through the network), so the session layer may have to reorder packets. The presentation layer removes compression and sets the appearance appropriate for the destination computer. Finally, the application layer formats and delivers the data as a complete unit.
The layering and coordinating are a lot of work, and each protocol layer does its own part. But the work is worth the effort because the different layers are what enable Outlook running on a Windows computer on an Ethernet network in Washington D.C. to communicate with a user running mail on an Apple iPhone via a cellular connection in Prague. Moreover, the separation by layers helps the network staff troubleshoot when something goes awry.
Routing
We still have not answered the question of how data get from a source NIC to the destination. The internet has many routers, whose purpose is to redirect packets in an effort to get them closer to their destination. Routing protocols are intricate, but basically when a router receives a packet it uses a table to determine the quickest path to the destination and forwards the packet to the next step on that path. Routers communicate with neighboring routers to update the state of connectivity and traffic flow; with these updates the routers continuously update their tables of best next steps.
Routers direct traffic on a path that leads to a destination.
Ports
As we just described, data do not just magically slip into a computer or execute on their own; some active program on the receiving computer has to accept the data and store or process them. Some programs solicit data, like the box on a screen that prompts for a name and password, but other times those data arrive from the network and must be directed to a program that will handle them. An example of this latter case is incoming email: New mail can be sent at any time, so a service program running on a computer has to be ready to receive email and pass it along to a user’s email client such as Outlook or Thunderbird. Such services are sometimes called daemons ; for example, the daemons ready to receive incoming mail are named popd or imapd , the daemons that support the Post Office Protocol (POP) or Internet Message Access Protocol (IMAP) mail reception functions.
Many common services are bound to agreed-on ports , which are essentially just numbers to identify different services; the destination port number is given in the header of each packet or data unit. Ports 0 to 4095 are called well-known ports and are associated with specific services. For example, the POP and IMAP servers are typically bound to ports 110 and 143, respectively. A mail server is a program that receives and holds incoming email and waits for a client to request email that has been received and queued. The client contacts the server, sending the bound port a packet requesting establishment of a session; with the server’s response, the client and server negotiate to transfer mail from the server.
Port: number associated with an application program that serves or monitors for a network service
This overview or review of networking necessarily omits vital details. Our purpose is only to ensure you know some of the elementary terms and concepts of networks so we can examine security issues in networks.
Part I—War on Networks: Network Security Attacks
In this part we cover three types of security threats and vulnerabilities: First, we consider the network versions of confidentiality and integrity failures. In a network, loss of confidentiality is often called wiretapping (even when there is no physical wire involved), and loss of integrity goes under the broad title of data corruption. Although the methods of attack may be new, loss of confidentiality or integrity should be familiar from previous chapters in which we explore these failings in programs, browsers, and operating systems.
The second threat we address involves wireless networks. Here, too, the primary harm is to the confidentiality or integrity of a user’s data. In contrast to shared WANs, wireless networks are something over which the user has some control. In large, centrally managed, shared networks, users have little control over the kind of security services available. By contrast, a wireless network is smaller, no active management or monitoring may occur, and the parties sharing the network are quite local. Consequently, users have a more direct role in security.
For the third topic of this part we explore availability, or its loss, in a class of attacks known as denial of service. Because connectivity or access is a critical aspect of networked computing, anything that severely limits use of a network negates the whole purpose of networking. Thus, attackers who can deny service to users cause serious harm. Denial-of-service attacks are the first instance in this book for which availability, not confidentiality or integrity, is the dominant security feature.
As we present these three types of threats, we also hint at their controls and countermeasures. However, Part II of this chapter is the place where we present these controls and countermeasures in depth.
6.2 Threats to Network Communications
Now we look at security threats in networks. Recall our description of threats in Chapter 1 that identifies three potential types of harm:
-
interception , or unauthorized viewing
-
modification , or unauthorized change
-
interruption , or preventing authorized access
These three types of harm apply to networks, although the terminology is slightly different. Interception is sometimes called eavesdropping or wiretapping, modification is usually known by the more general term integrity failures, and interruption in a network is denial of service. Next we consider these network security issues. We also discuss port scanning: reconnaissance before an attack.
Interception: Eavesdropping and Wiretapping
Security analysts sometimes use the concept of a security perimeter, a virtual line that encircles a protected set of computing resources. You might think of a security perimeter as encompassing a physical location, such as a home, school, office, or store, as shown in Figure 6-6 . Of course, these lines do not really exist, and for much network use you need to extend your access outside your protected zone. But because you lose control of equipment (cables, network devices, servers) outside your zone, your ability to secure your data is limited.
FIGURE 6-6 Security Perimeters
Wiretapping is the name given to data interception (even if no physical wire is involved), often covert and unauthorized. As Sidebar 6-4 explains, even a backdoor intended only for court-authorized wiretaps can be misused. The name “wiretap” refers to the original mechanism, which was a device that was attached to a wire to split off a second pathway that data would follow in addition to the primary path. Now, of course, the media range from copper wire to fiber cables and radio signals and the way to tap depends on the medium.
Sidebar 6-4 Unintended Intended Interception
Telecommunications providers cooperate with governments in what is called lawful interception. Any time a court authorizes a wiretap on telephone or data communications, government agents work with service providers to install the tap. Modern telecommunications hardware and software include features to implement these wiretaps as technology has evolved. Even voice communications are now often transmitted digitally, using routers and routing protocols like those for data networking on the internet.
Most countries require telecommunications providers to cooperate with law enforcement personnel to allow access under proper court orders. Some countries, such as Russia, do not bother with the inconvenience of courts. By law, Russia forces its telephone operators to attach and maintain locked boxes at switching stations to allow access to web traffic and email messages, according to a report by journalist Zack Whittaker [ WHI19 ].
At the Black Hat security conference in February 2010, IBM security researcher Tom Cross presented a paper [ CRO10 ] in which he revealed technical and procedural issues with Cisco’s routers that affect lawful interception. Cisco routers have been vulnerable to a security flaw first announced in 2008; the flaw could allow unauthenticated access to a router. Even though a patch has been released, not all telecommunications networks’ routers have been updated. Furthermore, Cross said the Cisco equipment does not track failed login attempts or notify an administrator, leaving the devices vulnerable to automated password-guessing attacks, and no audit is generated of the use of the intercept function.
As it is, an ISP employee could potentially monitor installed lawful intercept wiretaps and alert the subjects that they are under surveillance, according to Cross [ GRE10 ]. Similarly, an employee could establish an unauthorized interception against any customer, and the ISP would have no audit trail by which to detect the intercept.
Cross pointed out that Cisco is the only major hardware vendor to release for public scrutiny its product designs for the lawful intercept function; he then said that because other companies have not publicized their designs, nobody can be sure whether their products are secure.
The vulnerability in this sidebar is phrased tentatively: “could potentially …” and “could establish …” That word choice indicates we do not know whether the Cisco equipment has been compromised in that manner.
Users generally have little control over the routing of a signal. With the telephone system, for example, a call from New York to Sydney might travel west by satellite, transfer to an undersea cable, and reach the ultimate destination on conventional wire. Along the way, the signal could pass through different countries, as well as international regions of the oceans and sky. The same is true of networked digital communications, which use some of the same resources telephony does. The signal may travel through hostile regions and areas full of competitors. Along the way may be people with method, opportunity, and motive to obtain your data. Thus, a WAN can be far riskier than a well-controlled local network. As Sidebar 6-5 relates, radio signals from automobiles have been tapped for years on behalf of law enforcement authorities. Those are just the known authorized interceptions; the signals are similarly available to anyone with method, opportunity and motive. As more everyday devices (such as doorbells, security cameras, speakers and electronic assistants) become connected to networks (as described in Chapter 8 ), the risks of unintended interception increase.
Sidebar 6-5 Intercepting Automobile Signals
Journalist Thomas Brewster [ BRE17 ] reported on a 15-year history of “cartapping,” the interception of signals between automobiles and their manufacturers. Satellite radio provider Sirius was asked in 2014 to turn over to New York police records of the location data of a vehicle allegedly used in illegal gambling. Sirius accommodated the request by using its radio connection to track the vehicle for a 10-day period. Similar to Apple’s Find My Phone, Sirius radio has a feature to flag a vehicle as stolen and trace its movement.
Similarly, the General Motors’ OnStar feature communicates with a home base to aid in vehicle recovery in the event of a breakdown or accident. In two separate cases, police asked General Motors to provide real-time location data on the cars of suspected criminals. In one case the police tracked a car from Texas to Louisiana and were able to pinpoint it in heavy traffic on a motorway; they stopped and arrested the driver, finding drugs and guns in the car.
OnStar even supports voice communication (to allow drivers to summon help in the event of a medical or mechanical emergency). But that feature allowed police to listen to a vehicle’s occupants and hear details of a crime to be committed.
The privacy aspects of these technologies are important. U.S. courts have allowed the interceptions under appropriate and limited court orders. Brewster’s article cites Susan Brenner, a professor of law at the University of Dayton, who observes that users activated services that they knew broadcast signals over an open network. Thus, they had limited expectations of privacy in those communications. But she notes that consumers often ignore the implications of such technologies.
Encryption is the strongest and most commonly used countermeasure against interception, although physical security (protecting the communications lines themselves), dedicated lines, and controlled routing (ensuring that a communication travels only along certain paths) have their roles as well. We examine encryption for communication later in this chapter.
What Makes a Network Vulnerable to Interception?
An isolated home user or a stand-alone office with a few employees is an unlikely target for many attacks. But add an external network to the mix, and the risk rises sharply. Consider these qualities of a network:
-
anonymity
-
multiple points of access
-
shared resources
-
complex system
-
no obvious perimeter
-
multiple paths for communication
Now we consider the security implications of these qualities.
Anonymity
An attacker can mount an attack from thousands of miles away and never come into direct contact with the system, its administrators, or users. The potential attacker is thus safe behind an electronic shield. The attack can be passed through many other hosts in an effort to disguise the attack’s origin. And authenticating computers to other computers is not the same as it is for humans.
Many Points of Attack
A simple computing system is a self-contained unit. Access controls on one machine preserve the confidentiality of data on that processor. However, when a file is stored in a network host remote from the user, the data or the file itself may pass through many hosts to get to the user. One host’s administrator may enforce rigorous security policies, but that administrator has no control over other hosts in the network. Thus, the user must depend on the access control mechanisms in each of these systems. An attack can come from any host to any host, so a large network offers many points of vulnerability.
Sharing
Because networks enable resource and workload sharing, networked systems open up potential access to more users than do single computers. Perhaps worse, access is afforded to more systems, so access controls for single systems may be inadequate in networks.
System Complexity
In Chapter 5 we explain that an operating system is a complicated piece of software. Reliable security is difficult, if not impossible, on a large operating system, especially one not designed specifically for security. A network involves two or more possibly dissimilar operating systems, one on each end unit and perhaps others at intermediate routing points between ends. Therefore, a network operating/control system is likely to be more complex than an operating system for a single computing system. Furthermore, the ordinary laptop computer today has greater computing power than did many office computers in the last two decades.
The attacker can use this power to advantage by causing the victim’s computer to perform part of the attack’s computation. And because an average computer is so powerful, most users do not know what their computers are really doing at any moment: What processes are active in the background while you are playing Invaders from Mars? This complexity diminishes confidence in the network’s security.
Most users have no idea of all the processes active in the background on their computers.
Unknown Perimeter
A network’s expandability also implies uncertainty about the network boundary. One host may be a node on two different networks, so resources on one network are accessible to the users of the other network as well. Although wide accessibility is an advantage, this unknown or uncontrolled group of possibly malicious users is a security disadvantage.
A similar problem occurs when new hosts can be added to the network. Every network node must be able to react to the possible presence of new, untrustable hosts. Figure 6-7 points out the problems in defining the boundaries of a network. Notice, for example, that a user on a host in network D may be unaware of the potential connections from users of networks A and B. And the router in the middle of networks A and B in fact belongs to A, B, C, and E. If these networks have different security rules, to what rules is that device subject?
FIGURE 6-7 Unclear Network Boundaries
Subnetwork A and Subnetwork B are connected to a network through a router that is also connected to Subnetwork C and Subnetwork E. Subnetwork D is also connected to the network through another router.
Unknown Paths
Figure 6-8 illustrates that several paths may lead from one host to another. Suppose a user on host A1 wants to send a message to a user on host B3. That message might be routed through hosts C or D before arriving at host B3. Host C may provide acceptable security, but D does not. Network users seldom have control over the routing of their messages. Inability to control routing is a factor in the interception of mobile phone signals, as described in Sidebar 6-6 .
FIGURE 6-8 Multiple Routing Paths
Network A shows Host A1, Network B shows Host B3, and Host A1 and Host B3 are connected through Host C and Host D.
Sidebar 6-6 Hello. Can You Hear Me Now? How About Now?
Mobile telephones are much more complicated than we sometimes imagine. With landline telephony you have essentially one cable connecting your phone with the local telephone switching office, so most of the telephone is just electronics to convert audio voice to an electronic signal and back again. Mobile telephones do that, plus they have to manage the connection to the mobile network. Unlike the case with landline communication, as a mobile phone moves (and sometimes even when not), the device is constantly looking for a different signal to which to connect.
At the 2010 Defcon 18 conference in Las Vegas, Nevada, security researcher Chris Paget demonstrated his own homemade cell system tower and convinced up to 30 unwitting attendees with mobile phones to connect to his system. The parts cost approximately US$1,500, and he used an ordinary laptop running an open source application that essentially turned the laptop into a base station. A mobile phone will try to associate with the strongest signal it can find; proximity helped Paget meet that goal. Users are unaware when a mobile phone establishes or changes its association with a provider.
The United States has laws against wiretapping telephone conversations, so Paget was careful to announce his intentions and activity to attendees. He also carefully eliminated all traces of the phone calls his system handled so as to preserve his customers’ privacy. (Most attackers would not be so scrupulously polite, however.) For purposes of the demonstration, he intercepted only outbound calls and played a warning message to the callers.
Perhaps most interesting, his system forced connected phones to use the older 2G protocol; Paget also said his system, in negotiating capabilities with the mobile phone, could force the phone not to use encryption (which, of course, facilitated interception).
Paget’s purpose for the demonstration was to show how easily an attacker could intercept communications in the mobile network. “The main problem is that GSM’s mobile telephony protocol is broken. You have 3G and all of these later protocols with problems for GSM that have been known for decades. It's about time we move on,” Paget said [ HIG10 ].
People did move on—but not in the way Paget meant. In December 2010, two researchers at the Chaos Computer Club Congress in Berlin, Germany, demonstrated their ability to intercept calls. Karsten Nohl and Sylvain Munaut used inexpensive Motorola mobile phones to intercept calls in progress. The Motorola phones contained firmware that was easy to replace, turning the phone into an interceptor that received all traffic within range. From that universe they could isolate any single phone’s communication. Using a huge prebuilt table of encryption keys, they determined the specific key used for that communication stream and ultimately intercepted plaintext of the entire conversation.
Devices to receive cell phone signals can be purchased (in 2022) commercially for a few hundred dollars. Sellers of this equipment often warn that intercepting telephone conversations is illegal in many countries, a fact unlikely to deter criminals interested in interception.
Thus, a network differs significantly from a stand-alone, local environment in ways that significantly increase the security risk.
Modification: Data Corruption
Eavesdropping is certainly a significant threat to network communications, and it is at the heart of major incidents of theft of trade secrets or espionage. But interception is a passive threat: Communication goes on normally, except that a hidden third party has listened in.
If you remember from Chapter 1 , modification is also a computer security concern, and it applies to networking, as well. The threat is that a communication will be changed during transmission. Sometimes the act involves modifying data en route; other times it entails crafting new content or repeating a previous communication. These three attacks are called modification, insertion, and replay, respectively. Such attacks can be malicious or not, induced or from natural causes.
People often receive incorrect or corrupted data: a minor misspelling of a name, an obvious typographic error, a mistaken entry on a list. If you watch real-time closed-captioning on television, sometimes you see normal text degenerate to gibberish and then return to normal after a short time, or you see bizarre mappings to words that sound similar to what the audio track really contains. Mistakes like this happen, and we either contact someone for a correction if the issues are serious or ignore them. Errors occur so frequently that we sometimes fail even to notice them.
In Figure 6-9 we remind you of some of the sources of data corruption; we have previously described most of these causes. Keep in mind that data corruption can be intentional or unintentional, from a malicious or nonmalicious source, and directed or accidental. Data corruption can occur during data entry, in storage, during use and computation, in transit, and on output and retrieval. In this section we are interested in corruption as part of networked interaction.
FIGURE 6-9 Data Corruption Sources
An illustration shows a man typing on a keyboard in front of a desktop. A double-head arrow connects this illustration to a cloud which is again connected by a double-head arrow to a cupboard-like illustration. The text pointing at the man's hand reads, Typing error. The text pointing at the desktop reads, Malicious code, Hardware failure, and Software flaw. The text pointing at the first double-head arrow read, Transmission problem, and Hacker activity. The text pointing at the cloud reads, Noise, accident. The text pointing at the cupboard-like illustration reads, Program error, and Human mistake.
Sometimes modification is blatant, making it readily apparent that a change has occurred (for example, complete deletion, which could be detected by a program, or replacement of text by binary data, which would be apparent to a human reader). Other times the alteration is subtle, such as the change of a single bit, which might allow processing to continue, although perhaps producing incorrect results.
Communications media are known to be vulnerable to data corruption. Simple factors such as weather and trees can interfere with clean transmission. For this reason, communications protocols include features to check for and correct, at least some, errors in transmission. The TCP/IP protocol suite (which we describe later in this chapter) is used for most internet data communication. TCP/IP (Transmission Control Protocol/Internet Protocol) has extensive features to ensure that the receiver gets a complete, correct, and well-ordered data stream, despite any errors during transmission.
In this section we describe some of the modification failures to which communications are vulnerable.
Network data corruption occurs naturally because of minor failures of transmission media. Corruption can also be induced for malicious purposes. Both must be controlled.
Sequencing
A sequencing attack or problem involves permuting the order of data. Most commonly found in network communications, a sequencing error occurs when a later fragment of a data stream arrives before a previous one: Packet 2 arrives before packet 1.
Sequencing errors are actually quite common in network traffic. Because data units are routed according to available routing information, when packet 1 is sent, the best route, which is the route chosen, goes via node C. Subsequently the router learns node C is no longer optimal, so when packet 2 is to be sent, the routing goes via node D. The second route is indeed superior, so much so that packet 2 arrives before packet 1. Congestion, network interference, faulty or failed equipment, and performance problems can easily cause these kinds of speed difficulties.
Network protocols such as the TCP suite ensure the proper ordering of traffic. However, application programs do not always detect or correct sequencing problems within the data stream. For example, if an application handles input from many concurrent clients at a shopping site, the application must ensure that individual orders are assembled correctly, regardless of the order in which the pieces of orders arrived.
Substitution
A substitution attack is the replacement of one piece of a data stream with another. Nonmalicious substitution can occur if a hardware or software malfunction causes two data streams to become tangled, such that a piece of one stream is exchanged with the other stream.
Substitution errors can occur with adjacent cables or multiplexed parallel communications in a network. Occasionally, interference, called crosstalk, allows data to flow into an adjacent path. Metallic cable is more subject to crosstalk from adjacent cables than is optical fiber. Crossover in a multiplexed communication occurs if the separation between subchannels is inadequate. Such hardware-induced substitution is uncommon.
A malicious attacker can perform a substitution attack by splicing a piece from one communication into another. Thus, Amy might obtain copies of two communications from Jess to her bank, one to transfer $100 to Amy and a second to transfer $100,000 to Bill, and Amy could swap either the two amounts or the two destinations. Substitution attacks of this sort are easiest to carry out with formatted communications. If Amy knows, for example, that bytes 24–31 represent the account number, she knows how to formulate a new message redirecting money to her account.
The obvious countermeasure against substitution attacks is encryption, covering the entire message (making it difficult for the attacker to see which section to substitute) or creating an integrity check (making modification more evident). In Chapter 12 we describe chaining, a process in which each segment of a message is encrypted so that the result depends on all preceding segments. Chaining prevents extracting one encrypted piece (such as the account number) and replacing it with another.
Insertion
An insertion attack, which is almost a form of substitution, is one in which new data values are inserted into a stream. An attacker does not even need to break an encryption scheme to insert authentic-seeming data as long as the attacker knows precisely where to slip in the already encrypted data.
Replay
In a replay attack, legitimate data are intercepted and reused, generally without modification. A replay attack differs from both a wiretapping attack (in which the content of the data is obtained but not reused) and a man-in-the-middle attack (in which the content is modified to deceive two ends into believing they are communicating directly).
In real life, a bank prevents someone from depositing the same check twice by marking the physical check, but with electronic deposits, for which the depositor takes a check’s picture with a smartphone, preventing reuse is more difficult. The classic example of a replay attack involves financial transactions in the following way. An unscrupulous merchant processes a credit card or funds transfer from a user and then, seeing that the transfer succeeded, resubmits another transaction from the same user.
With a replay attack, the interceptor need not know the content or format of a transmission; in fact, replay attacks can succeed on encrypted data without altering or breaking the encryption. Suppose a merchant has a credit card terminal with built-in encryption such that the user’s card number, perhaps a PIN, the transaction amount, and merchant’s identifier are bound into a single message, encrypted, and transmitted to the credit processing center. Even without breaking the encryption, a merchant who taps the communications line can repeat that same transaction message for a second transfer of the same amount. Of course, two identical transactions to one merchant would be noticeable and natural for the client to dispute, and the net gain from repeating a single credit purchase would be relatively small. Nevertheless, possible repetition of a transaction would be a vulnerability.
Replay attacks can also be used with authentication credentials. Transmitting an identity and password in the clear is an obvious weakness, but transmitting an identity in the clear but with an encrypted password is similarly weak, as shown in Figure 6-10 . If the attacker can interject the encrypted password into the communications line, the attacker can impersonate a valid user without knowing the password.
FIGURE 6-10 Encrypted Password Failure
An illustration shows a man typing the ID and the password (encryption). Interception: ID and Password (encrypted). In Replay: ID and password (encrypted).
A similar replay example involves cookies for authentication. Email programs that run within a browser (such as Gmail, Opera, and Hotmail) sometimes identify and authenticate with a cookie so a user need not repeatedly type an identifier and password to open email. If the attacker can intercept cookies being sent to (or extract cookies stored by) the victim’s browser, then returning that same cookie can let the attacker open an email session under the identity of the victim. The login and password exchange can be securely encrypted and so can the content of the cookie. For this attack to succeed, the remote email service need only accept a copy of its own cookie as a valid login credential.
Replay attacks are often countered with a sequencing number. The sender assigns each communication a sequence number, which can be unique to a single recipient (message 1 to James, message 2 to James, and so forth) or one numbering sequence for all messages (message 1, message 2, message 3, where 1 went to James, 2 to Klara, and 3 to Lars). Each recipient keeps the last message number received and checks each incoming message to ensure that its number is greater than the previous message received.
Physical Replay
Finally, for a physical example, think of security cameras monitoring a space, for example, the door to a bank vault. Guards in a remote control room watch video monitors to detect unauthorized access to the door. An attacker can feed an innocent image to the monitors. The guards are left looking at the innocent image, perhaps the vault door with nobody around, during which time the attacker has unmonitored access to the bank vault. This ruse was featured in the film Ocean’s 11 . Similar attacks can be used against biometric authentication (for example, the rubber fingerprint attack described in Chapter 2 ). A similar attack would involve training the camera on a picture of the room under surveillance, then replaying a picture while the thief moves undetected throughout the vault.
As these examples show, replay attacks can circumvent ordinary identification, authentication, and confidentiality defenses, and thereby allow the attacker to initiate and carry on an interchange under the guise of the victim. Sequence numbers help counter replay attacks.
Modification Attacks in General
All these attacks have involved some aspect of integrity. Remember the range of properties covered by the general concept of integrity; we repeat them from Chapter 1 for reference:
-
precisely defined
-
accurate
-
unmodified
-
modified only in acceptable ways
-
modified only by authorized people
-
modified only by authorized processes
-
consistent
-
internally consistent
-
meaningful and usable
Protecting these different properties requires different countermeasures, including tools, protocols, and cryptography. In previous chapters we present some of these approaches, and later in this chapter we build on those earlier methods.
Interruption: Loss of Service
The final class of network attacks we consider involves availability, the third leg of the C-I-A triad. We are all familiar with how frustrating it is to lose access to an important service, as when the electricity fails or our mobile phone battery is exhausted. Suddenly we notice all the ways we depended on that service.
Networks, and especially the internet, have solidly assured service. From the earliest designs for the internet, redundancy and fault tolerance were important characteristics, and the robustness remains. In part this strength is due to the mesh architecture of the internet. The so-called last mile, the final connection between a host and the larger network infrastructure, is a unique pathway, so any failure there isolates the host. But once into the network, routers present multiple pathways so if one is unavailable, another can be used.
Network design incorporates redundancy to counter hardware failures.
As with the other vulnerabilities we have just discussed, loss of service can be malicious or nonmalicious, intentional or accidental. Unlike confidentiality and integrity failures, however, denial of service is not binary: Yes, you do either have service or not, but a critical question is how much? Service capacity can be reduced. Is a service degradation of 0.1% or 1% or 10% catastrophic? The answer depends on the particular network in question, its traffic load, and the criticality of its data. Thus, we have to consider not only whether service is present but also whether the amount present is adequate.
Routing
As we have just described, internet routing protocols are complicated. Routers have to trust each other for status updates on accessibility of other parts of the internet. As described in Sidebar 6-7 , one piece of bad information can poison the data pool of many routers, thus disrupting flow for many paths. Although the internet routing protocols are self-healing, meaning they recover from bad data by recalibrating when they discover inaccuracies, it does take some time for the effects of errors to be flushed from the system.
Routing supports efficient resource use and quality of service. Misused, it can cause denial of service.
Sidebar 6-7 Cascading Failures
On 4 October 2021, Facebook lost connectivity with the internet, meaning none of its users could send or receive Facebook messages for a period of roughly six hours. At the time, outsiders speculated that an internet routing protocol was at fault. The BGP (Border Gateway Protocol, the protocol internet routers use to update each other on connectivity to nearby routers) provides the data all internet routers need to route packets to their destination. Incorrect data can make a domain unreachable, which is what happened in the Facebook case.
First, understand that the Facebook network is massive, involving millions of servers in many locations around the world. Although we speak of “the Facebook network,” actually Facebook uses the internet as its backbone. The Facebook network, then, is really a collection of many connections to the internet, with data flowing from one Facebook subnetwork to another.
A Facebook engineer was taking down a segment of the Facebook network to perform routine maintenance; Facebook has not detailed what was the maintenance issue, but network engineers do this kind of thing frequently. The Facebook network, as is typical, is designed to accommodate outages gracefully; other control routers detect the outage and deftly transfer the traffic to another network segment with users unaware, except for perhaps a millisecond delay for the rerouting and processing by another server. Again, as is typical for large client-supporting networks, Facebook routinely performs a stress test on its network by effectively pulling the plug on a segment to verify that traffic is successfully rerouted around the outage.
That is how it is supposed to work. In this case, however, the engineer mistyped a BGP command intended to gauge capacity of a segment to ensure that disabling the segment about to undergo maintenance would not overwhelm the rest of the network [ JAN21 ]. The erroneous BGP command had the effect of telling all adjacent routers that the entire Facebook network did not exist. Ordinarily, a Facebook network audit tool would have detected that error and stopped it before damage occurred, but a flaw in the auditing program itself failed to stop or even detect the error.
Again, ordinarily the outage would have registered on Facebook network monitoring stations as the traffic volume to Facebook suddenly dropped to zero, prompting a network engineer to immediately investigate. However, Facebook manages its network also through the internet, so engineers could not connect to any other Facebook devices to identify or investigate the problem. If you need to plug in a light to find an electrical fault but the electricity is out, you cannot find the fault, at least not that way. Thus, what might have been fixed in minutes took six hours because engineers had to check network links in person, not through the internet.
This case is interesting for several reasons:
-
Facebook is to be commended for having audit techniques to detect faulty network updates. Unfortunately, the audit tool had a flaw too.
-
Facebook correctly had electronic procedures to respond to system outages and says it tested those procedures. Unfortunately, the procedures could not handle loss of the entire Facebook network backbone, as opposed to a single subnetwork.
-
Running a large worldwide network with facilities in many locations, Facebook decided to use the internet for intracompany communication, a reasonable design. Similarly, network management tools used the internet, as well as the internal email system and the global authentication database. Unfortunately, that decision meant that in this instance of complete disconnection from the internet, messages between company employees—especially network troubleshooters—and probes by and results from network management tools were unusable.
-
Unofficial reports indicate that during the outage, physical security badge readers did not work because they, too, depended on the internet to reach a database of badge holders and permissions. Facebook has admitted that “it took extra time to activate the secure access protocols needed to get people onsite” [ JAN21 ].
To err is human. As this case highlights, failing to consider worst-case scenarios (such as total loss of access to the internet) allows those human errors to escalate. And technology is not always able to counter those human errors.
Although uncommon and highly sophisticated, attacks against the routing system are possible. We describe some relatively simple routing attacks later in this chapter.
Excessive Demand
Although Mae West is reported to have said “too much of a good thing can be wonderful,” that sentiment hardly applies to networks. Network capacity is enormous but finite, and capacity of any particular link or component is much smaller. Thus, with extreme demand, an attacker can overwhelm a critical part of a network, from a webpage server to a router or a communications line. For the 2012 London Olympic games, the ticketing servers crashed the moment tickets became available, due to too many people trying to purchase them at once. When COVID-19 vaccines became available in 2020, online scheduling programs failed due to a surge in demand. News sites sometimes experience overload when a major story breaks, such as the death of a well-known person. These cases show that excessive demand can be from a nonmalicious cause.
How the swamped component responds varies. Some components shut down completely, some provide degraded (slower) service to all requests, and others drop some activity in an attempt to preserve service for some users, perhaps enforcing a kind of priority ranking.
Malicious DoS attacks are usually effected through excessive demand. The goal is to overload the victim’s capacity or reduce the ability to serve other legitimate requesters.
Denial-of-service attacks usually try to flood a victim with excessive demand.
Component Failure
Being hardware devices, components fail; these failures tend to be sporadic, individual, unpredictable, and nonmalicious. As we have said, the internet is robust enough that it can work around failures of most components. And attackers usually cannot cause the failure of a component, so these problems are seldom the result of a malicious attack. (But see Sidebar 6-8 for a description of an induced hardware failure.) Security engineers do still need to remain mindful of the potential for system harm from equipment failures.
Sidebar 6-8 Stuxnet Induced Hardware Failure
In June 2010, nuclear enrichment facilities in Iran were hit by the complex and sophisticated computer virus Stuxnet. Stuxnet targeted industrial control systems by modifying code on programmable logic controllers (PLCs) to make them work in a manner the attacker intended and to hide those changes from the operator of the equipment. The systems Stuxnet went after were ones using Siemens Simatic controllers, apparently at the nuclear plant at Bushehr or Natanz. Stuxnet targets specific power supplies used to control the speed of a device, such as a motor. The malware modified commands sent to the drives from the Siemens SCADA software, causing the controllers to vary the speed of a device, making it change speed intermittently.
Stuxnet targeted particular drives running at high speeds. Such high speeds are used only for select applications, one of which is uranium enrichment. According to Symantec’s Eric Chien, “Stuxnet changes the output power frequency for short periods of time to 1410Hz and then to 2Hz and then to 1064Hz” [ FAL10 ]. The normal frequency of the motors is 1064 Hz; running at a speed of 1410 Hz could destroy the equipment. Such wild frequency oscillations cause the motors to speed up, then slow, and then speed up again. Enriching uranium requires centrifuges spinning at a precise speed for a long time; changing the speed would significantly reduce the quality of the enriched product.
Indeed, some outside experts think as many as 1,000 of approximately 8,000 centrifuges in the Iranian enrichment program failed in 2009 to 2010, during the peak of Stuxnet’s operation. Iran manufactured its own centrifuges, which were known to fail regularly, although probably not as many as 1,000 of 8,000. The virus may also have been intended to keep maintenance engineers and designers busy replacing failed hardware and figuring out how to keep the whole system running. Stuxnet could have contributed to this failure rate, perhaps the first example of a malicious attack causing hardware failure. Since Stuxnet in 2010, there have been other attacks that target industrial control systems, most notably Industroyer and Industroyer2 that caused failures of the power grid in Ukraine in 2016 and 2022.
The most important legacy of Stuxnet may be its staying power. Although in 2010 Microsoft patched the vulnerability that enabled Stuxnet, that patch was incomplete, and so Microsoft issued yet another patch in 2015. This same flaw was the most widely exploited worldwide in both 2015 and 2016, accounting for 24.7% of attacks in 2016 [ GOO17 ]. Network engineers are reticent to apply patches to computers controlling live processes out of fear the patch will interfere with the process control. Furthermore, process control computers can be used in factories or remote locations, making them hard for engineers to reach to install updates. Thus, it is not surprising that the Stuxnet vulnerability was heavily exploited years after it was announced and corrected.
Next we turn to a technique attackers use to determine how to mount an attack. Like a burglar casing out a neighborhood for vulnerabilities, a successful attacker intent on harming a particular victim often spends time investigating the victim’s vulnerabilities and defenses to plan an appropriate attack. This investigation is not an attack itself, but something that contributes to the attacker’s method and opportunity.
Port Scanning
Scanning is an inspection activity, and as such it causes no harm itself (if you don’t consider learning about your system as harm). However, scanning is often used as a first step in an attack, a probe, to determine what further attacks might succeed. Thus, we next introduce the topic of probing subnetworks for their architecture and exposure.
Vulnerabilities in different versions of software products are well known: Vendors post lists of flaws and protective or corrective actions (patches and work-arounds), and security professionals maintain and distribute similar lists, as well as tools to test for vulnerabilities. In 1999, the Mitre Corporation started a program to build a public database of known vulnerabilities, called common vulnerabilities and exposures , or CVE s. That program assigns a unique designation to each reported vulnerability so security analysts can coordinate work on common threats.
Hackers circulate copies of attack code and scripts. The problem for the attacker is to know which attacks to employ on which machines: An attack against a specific version of Adobe Reader will not work if the target machine does not run Reader or runs a version that does not contain the particular vulnerability. Sending an attack against a machine that is not vulnerable is, at least, time consuming but, worse, may even make the attacker stand out or become visible and identifiable. Attackers want to shoot their arrows only at likely targets.
An easy way to gather network information is to use a port scanner , a program that, for a particular internet (IP) address, reports which ports respond to queries and which of several known vulnerabilities seem to be present. Dan Farmer and Wietse Venema [ FAR90 , FAR95 ] are among the first to describe the technique in the COPS and SATAN tools. Since then, tools such as NESSUS and Nmap have expanded on the network-probing concept. Scanners are available for mobile devices, not just traditional computers.
A port scan maps the topology and hardware and software components of a network segment.
A port scan is much like a routine physical examination from a doctor, particularly the initial questions used to determine a medical history. The questions and answers by themselves may not seem significant, but they point to areas that suggest further investigation.
Port Scanning Tools
Port scanning tools are readily available, and not just to the underground community. The Nmap scanner, originally written by Fyodor and available at nmap.org , is a useful tool that anyone can download. Given an address, Nmap will report all open ports, the service each supports, and the owner (user ID) of the daemon providing the service. (The owner is significant because it implies what privileges would be conferred on someone who compromised that service. Administrators tend to name privileged accounts with names like admin or system .)
Another readily available scanner is netcat, written by Hobbit and now an integrated component within Linux. Commercial products are a little more costly but not prohibitive. Dozens of scanners are available.
Port Scanning Results
As described previously in this chapter, a port is simply a numeric designation for routing data to a particular program that is waiting for it. The waiting program, called a daemon or demon, is said to listen to a particular port; in fact, it registers with the network management software so it is invoked to receive data addressed to that port. For example, by convention, port 110 is the port number associated with Post Office Protocol for email, 80 is dedicated to HTTP (webpage) traffic, and 123 is assigned to the Network Time Protocol for clock synchronization. Over time the number of services has exceeded the range of available numbers, so there are collisions, reuses, informal uses, and reallocations.
Let us continue with our earlier discussion of a data request coming in on port 110. The client initiates a request to connect with a POP server by a defined protocol implemented in ASCII text commands. The server responds, typically identifying itself and sometimes its version number (so that client and server can synchronize on capabilities and expectations). We show a sample of that exchange in Figure 6-11 . Lines from the client are labeled CL and responses from the POP server are labeled SV. Anyone can initiate such an exchange by using Telnet, the terminal emulator program.
FIGURE 6-11 POP Server Session Creation
A scanner such as Nmap probes a range of ports, testing to see what services respond. An example output from Nmap is shown in Figure 6-12 . (The site name and address have been changed.) Notice that the entire scan took only 34 seconds.
FIGURE 6-12 Nmap Scanner Output
Port scanning tells an attacker three things: which standard ports or services are running and responding on the target system, what operating system is installed on the target system, and what applications and versions of applications are present. This information is readily available for the asking from a networked system; it can be obtained quietly, anonymously, without identification or authentication, drawing little or no attention to the scan.
It might seem that the operating system name or versions of system applications would not be significant, but knowing that a particular host runs a given version—that may contain a known or even undisclosed flaw—of a service, an attacker can devise an attack to exploit precisely that vulnerability. Thus, a port scan can be just a first step in a more serious attack.
Another thing an attacker can learn is connectivity. Figure 6-12 concerns a single host. In Figure 6-13 we expand the search to an entire subnetwork (again, with changed name and address). As you can see, the network consists of a router, three computers, and one unidentified device.
FIGURE 6-13 Nmap Scan of a Small Network
The information from Figure 6-13 gives another important clue: Because the latency time (the time between when a packet is sent to the device and the device responds) for all devices is similar, they are probably on the same network segment. Thus, you could sketch a connectivity diagram of the network (as shown in Figure 6-14 ).
FIGURE 6-14 Connectivity Diagram of Small Network
The diagram shows a network connected to a cupboard-like illustration that is connected to three desktops and their CPUs. The fourth connection shows a question mark. Each connection shows the following details below them: 192.168.1.1, 92.168.1.43, 192.168.1.44, 192.168.1.47, and 192.168.1.39, respectively.
Nmap has many options; an outsider can fingerprint owners and users, identify common services running on uncommon ports, map the connectivity (routes between) machines, or deduce the real kind of unknown device. Notice that with only a couple of commands the attacker in the two examples shown learns
-
how many hosts there are
-
what their IP addresses are
-
what their physical (MAC) addresses are
-
what brand each is
-
what operating system each runs, and what version
-
what ports respond to service requests
-
what service applications respond, and what program and version they are running
-
how long responses took (which reveals speed of various network connections and thus may indicate the design of the network)
For lazy attackers, Nmap even has an option by which it automatically generates a specified number of random IP addresses and then scans those addresses. This point is especially significant for computer security. If an attacker wants to exploit a vulnerability known in a particular version of some software, the attacker need not run the attack repeatedly against many systems that run a different version—or even different software entirely. Instead, the attacker first runs an Nmap scan either picking, say, 10,000 addresses at random or picking all addresses in a specified range, say, 192.168.*.*. When Nmap returns its results from all these scans, the attacker can use a simple text editor to select from the large output only those lines identifying the desired software version.
Harm from Port Scanning
You might ask what harm comes of someone’s knowing machines and services; after all, the reason the ports are open is to interchange data. A scanner is just picking up data the machines voluntarily divulge.
Think instead of two houses in a neighborhood a burglar is casing. She knows nothing about the first house. As to the second house, she knows two people live there; their bedroom is on the upper floor. The couple have a dog, which sleeps in the basement behind a closed door. They always leave a back window open slightly so the cat can get in and out. And one of the occupants recently sprained his ankle, so he moves slowly and with some pain. Most people would not consider these facts extremely personal or worth concealing. Clearly the second house is more attractive to the burglar, in part because she can plan an attack that capitalizes on the known vulnerabilities in that house. Even if the first house is woefully more vulnerable, the attacker is likely to go for the second house about which she has important intelligence. Thus, unnecessarily exposing characteristics of a computing system can be harmful.
Network and vulnerability scanners, of which Nmap is only one example, have two purposes, one good and one bad. The good use is by network administrators or system owners who will explore their networks with the tool. The tool will report which devices may be running out-of-date and vulnerable versions of software that should be upgraded or which ports are unnecessarily exposed and should be closed. Administrators of large networks may use a scanner to document and review all the devices connected to the network (because new devices may be added to the network at any time). But of course, as we have shown, the bad use of a network scanner is to allow an attacker to learn about a system. (The law is not settled as to whether scanning someone else’s computers without permission is illegal. ) Because of the importance of the good use, sound commercial software companies continue to improve the uses and usability of network scanners, which unfortunately also supports the bad use.
Port scans are difficult to classify. They certainly are a tool widely used by network attackers as a first step in a more serious effort. Are they a vulnerability? No; the vulnerability is in the amount and kind of information network administrators allow their components to export to any program that asks. Are they a threat? Not really, because the openings they report can be detected with or without port scans. Should they be prohibited in some way? It is probably too late for that action, especially because any competent programmer with a rudimentary knowledge of network protocols could easily write a basic one. Thus, at best we can say the port scanning technique exists, and network administrators should use port scanners themselves to determine how much outsiders can learn of their network. Port scanners do not cause denial of service or any other network failure, but they do facilitate and often precipitate it.
Network and vulnerability scanners can be used positively for management and administration and negatively for attack planning.
Network Vulnerability Summary
As the examples just presented show, numerous attacks against the infrastructure of WANs can lead to interception, modification, and denial of service. Because these attacks work against the large network, they are seldom used against one specific user, who can be difficult to isolate in a universe of millions of concurrent communications. (As we describe later in this chapter, DoS attacks can be, and often are, directed against one specific victim.)
In the next section we explore how similar tricks can be used in wireless, local networks, where a mere handful of users makes it feasible to focus an attack on just one. Notice that these networks can still connect to WANs such as the internet. So one user’s full activity is still open to interception and modification; the point of intrusion is just immediately adjacent to the user.
6.3 Wireless Network Security
In this section we briefly present the technology of wireless networking. We then describe two approaches for securing these networks. The first is widely acknowledged as a security failure. Do not skip reading about this first approach: Studying this failed attempt should yield insight into why integrating security is hard for an existing technology with nonsecurity constraints. Phrased differently, this tale is a prime example of why security engineers beg to be included in plans and designs from the beginning: Adding security after the design is fixed rarely succeeds. Still, from this story you can see what should have or could have been foreseen and addressed.
The second approach is better, but it, too, has some less serious security limitations. In this example you can see that even with a worked first example of security pitfalls to avoid, crafting a successful approach requires careful consideration of possible points of failure.
WiFi Background
Wireless traffic uses a section of the radio spectrum, so the signals are available to anyone with an effective antenna within range. Because wireless computing is so exposed, it requires measures to protect communications between a computer (called the client) and a wireless base station or access point. Remembering that all these communications are on well-known, predefined radio frequencies, you can expect an eavesdropping attacker to try to intercept and impersonate. Pieces to protect are finding the access point, authenticating the remote computer to the access point and vice versa, and protecting the communication stream.
Wireless communication will never be as secure as wired because the exposed signal is more vulnerable.
Wireless communication has other vulnerabilities, as related in Sidebar 6-9 .
Sidebar 6-9 Wireless Interceptions
The New Zealand Herald [ GRI02 ] reports that a major telecommunications company was forced to shut down its mobile email service because of a security flaw in its wireless network software. The flaw affected users on the company’s network who were sending email on their WAP-enabled (Wireless Applications Protocol) mobile phones.
The vulnerability occurred when the user finished an email session. In fact, the software did not end the WAP session for 60 more seconds. If a second network customer were to initiate an email session within those 60 seconds and be connected to the same port as the first customer, the second customer could then view the first customer’s messages.
The company blamed third-party software provided by a mobile portal. Nevertheless, the telecommunications company was highly embarrassed, especially because it “perceived security issues with wireless networks” to be “a major factor threatening to hold the [wireless] technology’s development back.” [ GRI02 ]
Anyone with a wireless network card can search for an available network. Security consultant Chris O’Ferrell has been able to connect to wireless networks in Washington D.C. from outside a Senate office building, the Supreme Court, and the Pentagon [ NOG02 ]; others join networks in airports, on planes, and at coffee shops. Both the Observer product from Network Instruments and IBM’s Wireless Security Analyzer can locate open wireless connections on a network so that a security administrator can know a network is accessible for wireless access.
And then some wireless LAN users refuse to shut off or protect their service. Retailer BestBuy was embarrassed by a customer who bought a wireless product; while in the parking lot, he installed it in his laptop computer. Much to his surprise, he found he could connect to the store’s administrative wireless network. BestBuy subsequently took all its wireless cash registers offline. But another retailer, the CVS pharmacy chain, announced it planned to continue use of wireless administrative networks in all 4,100 of its stores, arguing “We use wireless technology strictly for internal item management. If we were to ever move in the direction of transmitting [customer] information via in-store wireless LANs, we would encrypt the data” [ BRE02 ]. In too many cases, nobody remembers the initial intentions to protect data when someone changes an application years later.
Wireless Communication
To appreciate how security is applied to wireless communications and where it can fail, you need to know the general structure of wireless data communication. Wireless (and also wired) data communications are implemented through an orderly set of exchanges called a protocol, as introduced earlier in this chapter. We use protocols in everyday life to accomplish simple exchanges. For example, a familiar protocol involves making and receiving a telephone call. When you call a friend, you perform a version of these steps:
-
You press buttons to activate your phone.
-
You press buttons to select and transmit the friend’s number (a process that used to be called dialing the phone).
-
Your friend hears a ring tone and presses a button to accept your call.
-
Your friend says “hello” or some other greeting.
-
You respond with “hello” or some other acknowledgment.
-
You begin your conversation.
This process doesn’t work if you start to speak before your friend hears and answers the phone, or if your friend accepts your call but never says anything. These six steps must be followed in order and in this general form for the simple process of making a telephone call work. We all learn and use this protocol without thinking of the process, but the pattern helps us communicate easily and efficiently.
Similar protocols regulate the entire WiFi communication process. You can use your computer, made in one country with software written in another, to connect to wireless access points all around the world because these protocols are an internationally agreed-on standard, called the 802.11 suite of protocols. We now present important points of the 802.11 protocols that are significant for security.
The 802.11 Protocol Suite
The 802.11 protocols all describe how devices communicate in two radio signal bands allotted to WiFi. Each band is divided into channels or subranges within the band; these channels overlap, so to avoid interference with nearby devices, WiFi devices are designed to use only a few channels, often channels 1, 6, and 11. Wireless signals can travel up to about 300 meters (1,000 feet), although the quality of the signal diminishes with distance, and intervening objects such as walls and trees also interfere with communication. Devices called repeaters can extend the range of existing wireless transmitters.
As shown in Figure 6-15 , a wireless network consists of an access point or router that receives, forwards, and transmits data, and one or more devices, sometimes called stations , such as computers or printers, that communicate with the access point. The access point is the hub of the wireless subnetwork. Each device must have a network interface card, or NIC, that communicates radio signals with the access point. The NIC is identified by a unique 48- or 64-bit hardware address called a medium access control, or MAC, which we introduced earlier in the chapter. (MAC addresses are supposed to be fixed and unique, but as we describe later in this chapter, MAC addresses can be changed.) For a view of misuse of MAC addresses for authentication, see Sidebar 6-10 .
FIGURE 6-15 Local Station Communicating with Remote Network
The illustration shows the Local station, NIC MAC Addr 01af3c4c8a21 communicating with Access Point (Remote network) from 01af3c4c8a21.
A NIC identifies itself (and hence its connected computer) by a supposedly unique MAC address.
Sidebar 6-10 Using MAC Address for Authentication [Bad Idea]
In what we hope is a spoof, a posting (since deleted) allegedly from the IT services department of Harvard University indicated that Harvard would begin to use MAC addresses for authentication. The announcement stated that after registering with Harvard network services, students’ machines would be recognized by MAC address, so the students would no longer need to enter a Harvard ID and PIN to access the Harvard wireless network.
The posting was on an obscure Harvard web server, not the main IT services page, and seemingly no mention of it was made elsewhere on the Harvard website.
As we have just reported, a moderately skilled network programmer can change the MAC address, and a program called a sniffer reports the MAC address of devices participating in a wireless network. Thus, anyone who wanted to use the Harvard WiFi network could easily gain authenticated access by sniffing the MAC address from an ongoing session and setting a NIC card to present that address.
Perhaps this website was a joke from Harvard’s nearby rival M.I.T.?
WiFi Access Range
Distance is an important consideration with WiFi, but it is hard to state precisely. Wireless signals degrade because of interference from intervening objects, such as walls, machinery, and trees, as well as distance; a receiver will not establish, or may drop, a connection with a poor signal, one that is weak or has lost a lot of data. Outdoor signals, with fewer objects to interfere, are generally usable over longer distances than indoor signals.
On the other hand, antennas can be tuned to the frequency of wireless communication. Focusing directly on the source of a signal can also improve reception at great distance. In Table 6-2 we estimate some reasonable ranges for different WiFi protocols. Experimental results with 802.11n have demonstrated reception at distances of approximately 5000 ft/1600 m in ideal conditions.
Table 6-2 Typical 802.11 Protocol Access Range
| Protocol | Ordinary Signal Range |
|---|---|
| 802.11a (WiFi 2) | 100 ft / 35 m |
| 802.11b (WiFi 1) | 300 ft / 100 m |
| 802.11g (WiFi 3) | 300 ft / 100 m |
| 802.11n (WiFi 4) | 1000 ft / 300 m |
| 802.11ac (WiFi 5 or gigabit WiFi) | varies |
| 802.11ax (WiFi 6) | varies |
Most WiFi-enabled computers now communicate on the 802.11n protocol (and for compatibility on all earlier ones as well), so the range is easily from one house to the street, and even a few houses away in a conventional neighborhood. As described in Sidebar 6-11 , Google embarked on an adventurous project to map WiFi connectivity all over the world. The objective of this mapping is not obvious, but the European Union determined that Google was stepping over a line in collecting these data.
Sidebar 6-11 Google’s Street View Project
Google’s Street View project, launched in 2007, involved cars with cameras driving the streets of various cities to capture photographs of street scenes. These images were combined with GPS coordinates to fix each image to its physical location. The results of this image collection are now available in Google Maps.
According to the Electronic Privacy Information Center [ EPI10 ], while photographing scenes along these streets, Google’s cars also operated wireless network scanners and receivers, ran programs to select unencrypted network traffic encountered, and wrote that content to computer disks, along with the GPS coordinates at which the signal was received. Some of the data included email account passwords and email messages. Google also intercepted and saved network device identifiers (MAC addresses) and wireless network station identifiers (SSIDs) from wireless networks it detected from the streets. Wireless addresses combined with physical location could be used to deliver targeted advertising. An independent audit of the programs, commissioned by Google [ STR10 ], documents the syntactic analysis of collected data to be able to store individual fields.
The data collection operated from 2007 until May 2010, when Google announced it had mistakenly collected 600 MB of wireless content data. Although the audit establishes that the captured data items were parsed so as to separate encrypted and different kinds of unencrypted data, Google contends that writing and retaining the data was a mistake.
In 2013, Google agreed to a settlement of US$7 million in lawsuits brought by 37 U.S. states (in addition to a US$25,000 fine Google paid the U.S. government over a claim it had willfully stonewalled investigation into a claim of privacy violations in that activity). And in 2011 it paid a fine of EUR€100,000 (approximately US$150,000). In 2013, Germany fined Google EUR€145,000 (approximately US$200,000), and Google paid Italy EUR€1 million (approximately US$1.4 million) over privacy violations of this project. (Google’s gross income for 2013 was US$33 billion, so these fines amount to less than 0.1% of Google’s revenue for the year.) Additionally, Google’s actions spurred regulatory reviews in New Zealand, Australia, France, and the European Union.
One can argue that Google merely listened to public radio waves, which are exposed to anyone with an appropriate receiver. An extension of this argument is that these airwaves are no more protected than sound waves or visual images: As you talk in public you have no expectation that your conversation is private, and you know amateur photographers may catch your image when you happen to be in front of a landmark they are shooting. A counterargument is that because of various security measures you employ, you intend that your computer access be private. Legal aspects of this situation are likely to be debated for some time.
WiFi Frames
Each WiFi data unit is called a frame . Each frame contains three fields: MAC header , payload , and FCS ( frame check sequence ). The MAC header contains fixed-sized fields, including
-
frame type: control, management, or data
-
ToDS, FromDS: direction of this frame: to or from the access point (called the distribution system)
-
fragmentation and order control bits
-
WEP (wired equivalency privacy) bit: encryption, described shortly
-
up to four MAC addresses (physical device identifiers): sender and receiver’s addresses, plus two optional addresses for traffic filtering points
The payload or frame body is the actual data being transmitted, 0–2304 bytes whose structure depends on the application handling the data. The frame check sequence is an integrity check (actually a cyclic redundancy check, which we describe in Chapter 2 ) to ensure accurate transmission of the entire frame. The format of a WiFi frame is shown in Figure 6-16 .
FIGURE 6-16 Format of a WiFi Frame
The upper frame shows Header, Data, and Frame control. The lower frame shows Frame type, Sequencing, Direction, WEP, Destination MAC, and Source MAC. The frames are connected between the header and the Frame type. The Source MAC is linked to the Data.
Management Frames
A beacon signal advertises a network accepting connections.
Of the three frame types, management frames are the most important for this discussion because they control the establishment and handling of a series of data flows. The most significant management frame types are these:
-
Beacon . Each access point periodically sends a beacon frame to announce its presence and relay information, such as timestamp, identifier, and other parameters regarding the access point. Any NICs that are within range receive this beacon. When you connect to a WiFi service—for example, at a coffee shop—your computer receives the beacon signal from the shop to be able to initiate communications.
-
Authentication . A NIC initiates a request to interact with an access point by sending its identity in an authentication frame . The access point may request additional authentication data and finally either accepts or rejects the request. Either party sends a deauthentication frame to terminate an established interaction. Thus, for example, your computer responds to the coffee shop’s beacon signal by returning its identity (MAC address) in an authentication frame.
-
Association request and response . Following authentication, a NIC requests an access point to establish a session, meaning that the NIC and access point exchange information about their capabilities and agree on parameters of their interaction. An important part of establishing the association is agreeing on encryption. For example, an access point may be able to handle three different encryption algorithms (call them A, B, and C), and the requesting NIC can handle only two algorithms (call them B and D). In the association, these two would determine that they share algorithm B and thus agree to use that form of encryption to communicate. A deassociation request is a request to terminate a session.
A NIC requests a connection by sending an authentication frame.
SSID
One other important data value in WiFi communication is the designation of an access point so that a wireless device can distinguish among access points if it receives more than one signal. A Service Set Identifier , or SSID , is the identification of an access point; it is a string of up to 32 characters chosen by the access point’s administrator. The SSID is the identifier the access point broadcasts in its beacon, and the ongoing link ties an associated NIC’s communications to the given access point. For example, your computer’s wireless antenna might pick up three beacons: CoffeeShop, Apt203, and Quicksand.
An SSID is a character string to identify a wireless access point.
Obviously SSIDs need to be unique in a given area to distinguish one wireless network from another. For early wireless routers, the factory-installed default SSID, such as “wireless,” “tsunami,” or “Linksys” (a brand name), was not unique; now most factory defaults are a serial number unique to the device.
With this background on how wireless communication occurs, we can begin to explore some of the vulnerabilities.
Vulnerabilities in Wireless Networks
Wireless networks are subject to threats to confidentiality, integrity, and availability just like other computer applications and technologies. The attacker can either join the network of the target and participate in data exchanges or merely observe the traffic as a bystander.
Confidentiality
Certainly, if data signals are transmitted in the open, unintended recipients may be able to get the data. What parts of a communication might be sensitive? The data values themselves, certainly, but A’s communicating with access point B or the duration or volume of communication may also be. Similarly, the nature of the traffic might be, whether webpage access, peer-to-peer networking, email, or network management. Finally, the mode in which two units communicate—encrypted or not, and if encrypted, by what algorithm—could be. Thus, many aspects of a communication can be sensitive.
Integrity
As for integrity, we must consider both malicious and nonmalicious sources of problems. Numerous nonmalicious sources of harm include interference from other devices, loss or corruption of signal due to distance or intervening objects, reception problems caused by weather, and sporadic communication failures within the hardware and software that implement protocol communication.
The more interesting class of integrity violations involves direct, malicious attacks to change the content of a communication. For unencrypted communications, the attacker might try to forge data appearing to come from the host or client. Because the client and server can receive each other’s signals, the attacker cannot readily receive something from the client, modify it, and transmit the modified version before the client’s original signal gets to the server. However, the attacker can try to take over a communication stream by force. WiFi radio receivers that receive two signals prefer the stronger one. So if a rogue access point intercepts a signal from a client and sends back a strong signal, appearing to come from the server’s access point, the rogue may be able to commandeer the communications stream.
Availability
Availability involves three potential problems. First, the most obvious occurs when a component of a wireless communication stops working because hardware fails, power is lost, or some other catastrophe strikes. A second problem of availability is loss of some but not all access, typically manifested as slow or degraded service. Service can be slow because of interference, for example, if tree leaves in a wind interfere with frame transmission, so the receiving end recognizes loss of some data and must request and wait for retransmission. Service can also be slow if the demand for service exceeds the capacity of the receiving end, so either some service requests are dropped or the receiver handles all requests slowly.
Wireless communication also admits a third problem: the possibility of rogue network connection . Some WiFi access points are known as public hot spots and are intentionally available to anyone who wants to connect. But other private owners do not want to share their access with anybody in range. Although shared service may not be noticed, it is still inappropriate. A user wanting free internet access can often get it simply by finding a wireless LAN offering DHCP service. Free does not necessarily imply secure, as described in Sidebar 6-12 . In this case, although service is available, the security of that service may be limited. As the adage tells us, sometimes you get what you pay for.
Sidebar 6-12 A Network Dating Service?
Searching for open wireless networks within range is called war driving . To find open networks, you need only a computer equipped with a wireless network receiver. Similar to bird sighting events, four World Wide War Driving events were held (see wigle.net), two in 2002, and one each in 2003 and 2004. The goal was to identify as many different open wireless access points as possible in one week: For the first search, 9,374 were found; for the last, the number had grown to 228,537. The counts are not comparable because as word spread, more people became involved in searching for sites. For each of the four events, approximately two-thirds of the sites found did not support encrypted communication. Also approximately 30% of access points in each event used the default SSID (identifier by which the access point is accessed). Typically (in 2002–2004), the default SSID was something like “wireless.” A wireless base station with default SSID and no encryption is the equivalent of a box saying, “Here I am, please use my wireless network.”
While helping a friend set up his home network in the United States, a consultant had a wireless-enabled laptop. When he scanned to find his friend’s (secured) access point, he found five others near enough to get a good signal; three were running unsecured, and two of those three had SSIDs obvious enough to guess easily to which neighbors they belonged.
Just because a network is available does not mean it is safe. A rogue access point is another means to intercept sensitive information. All you have to do is broadcast an open access point in a coffee shop or near a major office building, allow people to connect, and then use a network sniffer to copy traffic surreptitiously. Most commercial sites employ encryption (such as the SSL algorithm, which we describe later in this chapter) when obtaining sensitive information, so a user’s financial or personal identification should not be exposed. But many other kinds of data, such as passwords or email messages, are open for the taking.
The appeal of war driving has waned for several reasons. First, the increase in free public WiFi hot spots in coffee shops, bookstores, hotels, libraries, and similar places means open WiFi connections are readily available; furthermore, most connection user interfaces helpfully list all access points within range. Second, the risks of connecting to an unsecured access point are high: Some unsecured WiFi connections are intentional magnets to lure unsuspecting clients to intercept sensitive data from the wireless connection. (We cannot overemphasize that open or free WiFi networks have absolutely unknown security.) Finally, because many people have internet-enabled cell phones, they use a phone for access instead of a computer with WiFi. However, the research group Wigle (wigle.net) maintains an ongoing database of wireless networks worldwide for researchers. Individuals scan for networks and submit them to Wigle.
With these three areas of possible security failing, we next look at specific wireless attacks and countermeasures.
Unauthorized WiFi Access
An unauthorized device can attempt to establish an association with an access point. Remember from the WiFi protocols that access basically involves three steps:
-
The access point broadcasts its availability by sending a beacon, an invitation for devices to connect with it.
-
A device’s NIC responds with a request to authenticate, which the access point accepts.
-
The device’s NIC requests establishment of an association, which the access point negotiates and accepts.
Threats can occur at each of these points. In step 1, anyone can pick up and reply to a broadcast beacon. In step 2, the authentication is not rigorous; in basic WiFi mode, the access point accepts any device, without authentication. In step 3, any access point can accept an association with any device. We can counter these attacks of unauthorized access at any of the three steps.
WiFi Protocol Weaknesses
The wireless access protocol has built-in weaknesses that can harm security. Obviously, wireless communication is more exposed than wired communication because of the lack of physical protection. For whatever reason, the initial designers of the international wireless communication protocols, the 802.11 suite, created situations that left wireless communications vulnerable, as we now describe.
Picking Up the Beacon
A client and an access point engage in the authentication and association handshake to locate each other. Essentially the client says, “I am looking to connect to access point S,” and the access point says, “I am access point S; I accept your request to connect.” The order of these two steps is important. In what is called open mode , an access point continually broadcasts its appeal in its beacon, indicating that it is open for the next step in establishing a connection. Essentially the access point says repeatedly, “I am access point S. Does anyone want to connect to me?” Closed or stealth mode , also known as SSID cloaking , reverses the order of the steps: The client must first send a signal seeking an access point with a particular SSID before the access point responds to that one query with an invitation to connect. These two modes of operation are shown in Figure 6-17 .
FIGURE 6-17 Connecting in Open and Closed Mode
(a) Open Mode: The access point SSID is linked to the Rogue Receiver, Intended Receiver, and Rogue Receiver. (b) Closed Mode: SSID is linked to Rogue Receiver and Access Point.
In open mode, an access point continually broadcasts its SSID; in closed mode, a client continually broadcasts a request to connect to a given SSID from a given MAC address.
Operating in closed mode would seem to be a successful way to prevent unauthorized access: If you do not know the SSID, you cannot request a connection. However, closed mode leaves the client exposed. In open mode, the client is quiet, monitoring beacons, until it finds one to which it wants to connect; thus, the client is not constantly visible. In closed mode, however, the client effectively becomes a beacon, sending a continuing series of messages saying, in essence, “I am MAC address mmm , looking for SSID sss . Are you sss ?” From those messages a rogue host can learn the expected values needed to impersonate an access point to which the client hopes to connect.
SSID in All Frames
Broadcasting the desired SSID in closed mode reveals the identity of a sought-after access point. Worse, in both closed and open modes, even after the initial handshake, all subsequent management and data frames contain this same SSID, so sniffing any one of these frames reveals the SSID. Thus, anyone who sniffs the SSID can save the SSID (which is seldom changed in practice) to use later. A snooper can reasonably guess that the client will attempt to connect to this same access point again. Thus, the rogue has the information needed to imitate either the client or the access point in the future.
A better protocol design would have been for the access point and the associating device to establish a shared data value to be used during this one association only. In that way, intercepting the initial authentication request would reveal the SSID, but intercepting any later frame would not.
Authentication in Wireless Networks
Access points can manage lists of MAC addresses of devices with which they will accept connections. Thus, authentication in step 2 could be accomplished by accepting only devices on the positive accept list.
Changeable MAC Addresses
The operating system doesn’t actually always obtain the hardware MAC address of a NIC card, but instead it consults internal data, so changing the MAC address requires changing only the network card address table. Instructions for doing that are easy to find on the internet.
Changing the NIC’s MAC address not only undermines MAC-based authentication on an access point, it can lead to a larger attack called MAC spoofing , in which one device impersonates another, thereby assuming another device’s communication session.
An operating system can send any address as if it were the MAC address of a NIC.
Stealing the Association
Unfortunately, if a rogue process has intercepted an SSID and spoofed a MAC address, the two best points of access control have been lost. Looked at from the other perspective, however, you might assume that a device that has successfully passed the SSID and authentication tests will now associate with the identified access point. Wrong again!
Even though frames all contain the SSID of the intended recipient access point, nothing prevents any access point from accepting and replying to any frame. In fact, some access point hardware and firmware is known to be flawed and will accept any association it can receive [ AND04 ]. These are known as promiscuous access points . For an example of vulnerable associations, see Sidebar 6-13 . Think of them next time you consider connecting to free WiFi service hot spots in a bar or an airport.
Sidebar 6-13 Keeping the Sheep from the Foxes
Firefox is a popular browser, in part because users have written and contributed add-ons, an astonishing 2 billion at last count, to do a wide range of things from managing appointments and displaying the weather forecast to downloading video and translating text from one language to another.
One such add-on, Firesheep, lets a user join into another user’s established WiFi connection with the click of a mouse (an activity known as session hijacking). (The add-on has now been deleted, but the underlying vulnerability still exists for anyone willing and able to exploit it.) To use Firesheep, all you needed to do was join an open public network, such as the free WiFi network at your local coffee spot. While you were connected, Firesheep silently scanned all the rest of the traffic on the network, selecting messages that showed an established association with some service, such as web-based email or a social networking site. As we describe in Chapter 4 , many of these sites manage their active associations by using cookies that are sent from the site to the user’s browser and back to the site again. The problem is that often those cookies are communicated unencrypted, completely in the clear, meaning that anyone who intercepts and transmits the cookie joins the session of the original user.
Firesheep made the process user friendly. As it was scanning the network, it picked out popular social sites, for example, Facebook or Twitter, picked up user names and even pictures, and displayed those on the screen. Click on a photo and you were logged in as that user. The countermeasure, encryption, is not always applied by these sites (although most financial institutions do encrypt the entire session, so your banking transactions are probably not exposed by Firesheep). Says the extension’s author, Eric Butler [ BUT10 ]:
Websites have a responsibility to protect the people who depend on their services. [Sites] have been ignoring that responsibility for too long, and it’s time for everyone to demand a more secure web. My hope is that Firesheep will help the users win.
Indeed, three weeks after Butler released Firesheep in October 2010 with a demonstration in San Diego at the ToorCon security conference, Microsoft announced that it was adding full session encryption (SSL, which we explain later in this chapter) to its Hotmail web-based email program. After years of prodding, the popular web-based email and social networking sites now use full session encryption. Still, new, unprotected sites are brought online every day.
Preferred Associations
Common WiFi situations involve residents connecting to their home networks, students connecting to school networks, business workers connecting to corporate networks, and patrons connecting to coffee shop or bookstore networks. A typical user might connect frequently to a handful of networks, with the occasional one-time connection to a hotel or an airport network when on travel, or a museum during a day’s visit. To simplify connecting, the wireless interface software builds a list of favorite connection points (home, school, office) to which it will try to connect automatically. There is usually no confusion because these networks will have distinct names (actually SSIDs), so your computer will connect automatically to the WestHallDorm network.
Consider, however, free WiFi access. Coffee shops, bookstores, airports, and municipalities offer this service, and some network administrators want to make it easy for patrons by naming the service FreeWiFi or something similar. If you instruct your software (or in some cases, if you don’t instruct your software not to), it will save FreeWiFi as an access point to which it will connect automatically any time it sees that SSID name in the future. Unfortunately, the name of an SSID is not bound to any physical characteristic: Your computer does not distinguish between FreeWiFi as an access point at your coffee shop or a rogue point in a strange city intended to lure unsuspecting visitors in that region. Your computer will continue to search for an access point with SSID FreeWiFi and connect to any such a point anywhere it finds one. Although the main weakness here is the software that maintains the list of preferred access points for automatic connection, the protocol is also at fault for not ensuring a unique connection point identification.
This list of vulnerabilities in wireless networks is long, which should tell you that wireless communication is difficult to secure. Alas, WiFi security has been problematic almost from its inception, as you will see as we move from vulnerabilities to countermeasures. In this chapter we consider two instances of the same kind of countermeasure: protocols. The first protocol suite was introduced along with the other protocols defining wireless communication; the second protocol suite was a replacement for what was almost from the beginning found to be marginally effective at best. Thus, we denote these as one failed countermeasure and one improved but not perfect countermeasure. We describe the failure first.
Failed Countermeasure: WEP (Wired Equivalent Privacy)
At the same time the IEEE (Institute of Electrical and Electronics Engineers) standards committee was designing the protocols to enable wireless digital communication, they realized they also needed some mechanism to protect the security of those communications, and so they included a countermeasure in the initial protocol design. Wired equivalent privacy , or WEP , was intended as a way for wireless communication to provide privacy equivalent to conventional wired communications. Physical wires are easy to protect because they can be secured physically, and they are harder to intercept or tap without detection. To make wireless communication marketable, the protocol designers thought they needed to offer confidentiality comparable to that of wired communication. The result was WEP, which was part of the original 802.11 standard when it was published in 1997.
Weaknesses in WEP were identified as early as 2001, and the weaknesses are so severe that a WEP connection can be cracked with available software in a few minutes [ BOR01 ].
The original 802.11 wireless standard was an attempt to standardize the emerging field of wireless communications, and so it contains significant detail on transmission, frequencies, device-to-device interaction, and operation.
WEP Security Weaknesses
The WEP protocol was meant to provide users immunity to eavesdropping and impersonation attacks, which, at the time, were not a serious threat. (That reasoning is similar to saying protection against vehicle accidents was not a significant concern when the automobile was invented because few other people had cars. As automobile usage has increased, manufacturers have added a host of security features, such as air bags, seat belts, and reinforced doors. WiFi protocols have been slower to adapt.)
WEP security involved some relatively simple techniques to respond to what were expected to be unsophisticated, infrequent attacks. WEP uses an encryption key shared between the client and the access point. To authenticate a user, the access point sends a random number to the client, which the client encrypts using the shared key and returns to the access point. From that moment on, the client and access point are authenticated and can communicate using their shared encryption key. Several problems exist with this seemingly simple approach, which we now describe.
Weak Encryption Key
First, the WEP standard allows either a 64- or 128-bit encryption key, but each key begins with a 24-bit initialization vector (IV), which has the effect of reducing the actual key length to 40 or 104 bits. (The reason for these key lengths was that the U.S. government mandated that cryptographic software for export be limited to algorithms that used a key no more than 40 bits long. The mandate has since been lifted.)
The user enters the key in any convenient form, usually in hexadecimal or as an alphanumeric string that is converted to a number. Entering 64 or 128 bits in hex requires choosing and then typing 16 or 32 symbols correctly for the client and access point. Not surprisingly, hex strings like C0DEC0DE … (that is a zero between C and D) are common. Passphrases are vulnerable to dictionary attacks, which we describe in Chapter 2 .
Thus, users tended to use keys that were not really random. The situation is like asking very young children to pick a number between 1 and 100 and then trying to guess it. If you determine the children know only the numbers 1 through 10, your chance of guessing correctly improves from 1 in 100 to 1 in 10, even though the target space is still ostensibly 1 to 100. Nonrandom distribution skews the chances of guessing correctly.
Static Key
The WEP encryption key is shared between sender and receiver. This means that the same value has to be entered at both the access point and the remote device. Although users are occasionally willing to choose and enter a key both places, they do not want to do so frequently. Thus, the same encryption key tends to be used for a long time.
A dedicated attacker who can monitor a large amount of wireless network traffic will collect many data points from which to deduce a key. If the key changes frequently, data points from an old key provide no help in deducing a new key, but keys that are not changed frequently admit the possibility of deducing from the large number of data points. Thus, a key that is seldom changed increases the chance an attacker can deduce it.
Weak Encryption Process
Even if the key is strong, it really has an effective length of only 40 or 104 bits because of the way it is used in the algorithm. A brute-force attack against a 40-bit key succeeds quickly. Even for the 104-bit version, flaws in the RC4 algorithm and its use (see Borisov [ BOR01 ], Fluhrer [FLU01], and Arbaugh [ ARB02 ]) defeat WEP security. Tools such as WEPCrack and AirCrack-ng allow an attacker to crack a WEP encryption, usually in a few minutes. At a 2005 conference, the FBI demonstrated the ease with which a WEP-secured wireless session can be broken.
Weak Encryption Algorithm
The fourth problem with WEP is the way it performs encryption. WEP does not use RC4 as an encryption algorithm directly; instead, RC4 generates a long sequence of random numbers, called the key sequence, derived from the 24-bit initialization vector (IV) and the 40-bit key. WEP combines the key sequence with the data using an exclusive-OR function. Unfortunately, if the attacker can guess the decrypted value of any single encrypted frame, feeding that value into the exclusive-OR function reveals that segment of the key sequence. The same key sequence is reused for all messages, so the segment will repeat at the same point. The IV is communicated as plaintext, so an attacker can intercept it for an exhaustive key search attack. Other known problems involve the use of an exclusive OR.
Initialization Vector Collisions
A final encryption problem with WEP concerns the initialization vector, which becomes the first 24 bits of the encryption key. These 24 bits cycle in a predictable pattern until all 24-bit patterns have been used (approximately 16 million iterations), at which point the initialization vector reverts to the first value and the cycle begins again. At least that is the theory. In practice, certain initialization vector values get caught in the loop and never change, while others do not cycle through all 16 million 24-bit patterns. And the first few changes are not totally random but have some degree of predictability.
An interested attacker can test for all 16 million possible initialization vectors in a few minutes, and weaknesses such as unchanging (so-called weak) initialization vectors reduce the number of tests even further, thus speeding up the search.
Faulty Integrity Check
As if encryption problems were not enough, WEP was not designed for strong integrity. As you already know, wireless communications are subject to data loss and interference. Thus, the protocol designers included a check value to demonstrate whether a frame arrived intact or some bits had been lost or accidentally changed in transmission. The receiver recomputes the check value and if it does not match, signals a transmission error and asks for another copy to be sent.
The integrity check uses a well-known algorithm. If a malicious attacker wants to change part of a communication, the attacker simply changes the data, computes a new integrity check value, and replaces the original check with the new one. Thus, when the frame arrives, the new check value will match the modified data, and the receiver will not be aware the data value has been modified maliciously.
No Authentication
A final flaw in the WEP protocol is that it has no authentication. Any device that can name the correct SSID and present the correct MAC address is assumed to be legitimate. As we saw, even if the SSID is not broadcast, it is available in other frames, as is the MAC address, so an attacker can easily present the SSID and reconfigure the NIC to indicate the necessary MAC address. Thus, the attacker is not seriously deterred from faking a valid network node.
WEP uses short, infrequently changed encryption keys, it requires no authentication, and its integrity is easily compromised.
Bottom Line: WEP Security Is Unacceptable
All these flaws of WEP are limitations of the basic WEP protocol. Within a few years of introduction of the WEP standard, researchers Fluhrer [FLU01] and Arbaugh [ ARB02 ] produced actual demonstration programs showing the ability to deduce an RC4 key in minutes. As Sidebar 6-14 describes, these weaknesses are not just theoretical; attackers have exploited these vulnerabilities and compromised wireless systems, causing loss of large amounts of sensitive data. The WEP protocol design does not use cryptography effectively, fails to perform authentication, lacks effective control over intentional modification, and cannot assure availability to authorized users. With these flaws in the protocol itself, no improved implementation or secure mode of use can compensate.
Sidebar 6-14 TJ Maxx Data Theft
In 2005, a crew of 11 hackers stole over 45 million credit and debit card numbers from the clothing stores TJ Maxx and Marshalls and their business partners; the criminals did so without ever setting foot inside the store.
The thieves set up an antenna outside one TJ Maxx store and intercepted wireless communications among handheld scanner devices, cash registers, and computers on the store’s wireless network. With an antenna shaped like a telescope, someone with a simple laptop computer can intercept a WiFi signal miles away from the access point. These thieves worked from the parking lot.
The network was secured with the easily compromised WEP protocol, even though serious security vulnerabilities in WEP had been demonstrated and documented years earlier.
Data obtained from wireless interception included not just transaction details but also more important account login IDs and passwords that let the crew install sniffers in the network and hack into the central database of the parent company that owns TJ Maxx and Marshalls.
Albert Gonzales of Miami was convicted in March 2010 of being the ringleader of the group that included two other U.S. citizens, three Russians, two Chinese, and one each from Estonia and Belarus. Gonzales was sentenced to 20 years in prison.
TJ Maxx was not the only vulnerable retailer, however. In 2009, Motorola’s Air Defense unit surveyed retailers in major cities throughout the world, including Atlanta, Boston, New York City, Paris, Seoul, and Sydney. According to their press release of 28 January 2009, they found that 44% of retailers’ wireless networks and devices could be compromised. Wireless networks in stores did not employ encryption 32% of the time, and 25% of the networks used the weak WEP security technology, approximately ten years after the weaknesses of WEP had been widely publicized.
As this example shows, computer security is a global and borderless problem. Attackers can come from anywhere, and they will attack any vulnerable target they find. The targets are indeed widespread, and the abundance of vulnerable networks draws capable attackers from many backgrounds, routinely challenges the authority of national legal jurisdictions, and relies on the ability of countries to design and implement international legal frameworks.
Unfortunately, some retailers start using wireless technology only to communicate low-sensitivity information, such as inventory data. However, when they expand their networking applications and begin to communicate more sensitive data, they forget about or overlook the exposure of using weak security. For this reason, security must be reviewed any time there is a change to a system’s use, architecture, or implementation.
Stronger Protocol Suite: WPA (WiFi Protected Access)
The WEP protocol suite was published in 1997 and ratified in 1999, which means that products implementing WEP began to appear around 1999. In 1995 sci.crypt postings, Wagner [ WAG95 ] and Roos [ ROO95 ] independently discovered problems in the key structure of RC4, but because RC4 was not widely used before its incorporation in the WEP standard, these problems had not been widely studied.
The first indications of serious WEP weaknesses were published in 2001, only two years after the WEP protocol’s formal acceptance. Such a brief period could be the result of numerous causes. Certainly the constraint on cryptographic strength in place in 1997 limited the security options of protocol developers. Furthermore, underestimating the seriousness of the threat against a new and hence unused technology likely led the protocol designers to take an easy approach. When WEP’s shortcomings were published in 2001, it became clear that WEP was not an adequate protocol for WiFi. (Alas, as described in Sidebar 6-15 , even experts fail to practice strong security.)
Sidebar 6-15 Do As I Say, Not As I Do
You would expect a conference of computer security professionals to follow best security practices. No, that is only what they counsel, not what they do.
At the 2010 RSA Security Conference, which attracts many computer security practitioners and industry leaders, Motorola’s Air Defense division scanned the wireless waves to see who was connected to what. They observed over 2,000 connections. They found [ WIL10 ] that 116 clients had connected point-to-point to such risky SSIDs as “Free Public WiFi” and “Free Internet Access.” A point-to-point connection (called ad hoc) is to another computer, not necessarily to an access point and server.
Worse, 62% of the networks located were running the WEP protocol or the stronger but still flawed TKIP (Temporal Key Integrity Protocol), nearly ten years after WEP’s lack of security had been demonstrated convincingly, and almost five years after a vulnerability (described later in this chapter) in TKIP was publicized.
Motorola did not track down the devices employing weak security, so no one knows how many were users' machines as opposed to demonstration machines in the exhibition hall. Still, one wonders what these statistics say about the general public’s use of best security practices.
And lest you conclude that surely this problem has gone away, the firm Wigle (for Wireless Geographic Logging Engine) collects statistics on WiFi sites. In 2022, 21 years after publication of the security weaknesses of WEP, Wigle obtained reports on approximately 1 billion WiFi networks. For 17.6% of the sites it was not possible to determine whether the site used encryption and, if so, with which protocol. Of the remainder, roughly 2.7% were unencrypted, and 4.2% used the seriously flawed WEP encryption protocol. WPA2, discussed next, protected 71.4% of the sites. But at least 6.9 million sites were severely unprotected.
For these reasons, in 2001 the IEEE began design of a new authentication and encryption scheme for wireless, as we explain in the next section.
You might well wonder why we have devoted so much attention to a flawed security approach, especially because flaws became well known just two years after the approach was ratified. Humans make mistakes, and we do not dissect WEP just to confirm that point. The designers of WEP failed to look critically at their design. After developing an initial concept, they should have challenged their approach, seeking ways it could fail, asking question such as how secure is a 40-bit key or how could integrity fail. We want you to learn to look for weaknesses and think like an attacker. The failure points of WEP could have been foreseen. The time to apply security analysis is early in the design process, not after the product is on the market. Thus, we present WEP not as a litany of failures but as a case in which rigorous challenge could have produced a more robust design.
The alternative to WEP is WiFi Protected Access or WPA , designed in 2003. The IEEE standard 802.11i, known as WPA2, was approved in 2004 and is an extension of WPA. Although the name WPA2 is correct, the standard is informally known as WPA. 1 How does WPA improve on WEP?
- Strictly speaking, there is a difference between these: WPA was the original replacement for WEP; WPA2 goes beyond WPA by requiring support for the strong AES encryption algorithm. Furthermore, to use the trademarked “WiFi Certified” designation, a device must be certified by the WiFi Alliance. In practice, all WiFi devices sold now meet the WPA2 standard. In this book we follow common usage and use WPA to refer to both the WPA and WPA2 protocols.
Strengths of WPA over WEP
WPA set out to overcome the then-known shortcomings in WEP, and thus many features of WPA directly address WEP weaknesses. Following are some of the ways in which WPA is superior to WEP.
Non-Static Encryption Key
First, WEP uses an encryption key that is unchanged until the user enters a new key at the client and the access point. Cryptologists deplore static encryption keys because a fixed key gives the attacker a large amount of ciphertext to try to analyze and plenty of time in which to analyze it. WPA has a key change approach, called Temporal Key Integrity Program ( TKIP ), by which the encryption key is changed automatically on each packet.
WPA also uses a hierarchy of keys to establish a new key for each session. These keys permit the access point (called the authenticator) and the connecting device (called the supplicant) to create and exchange keys for confidentiality and integrity that are unique to the association session.
Authentication
Second, WEP uses the encryption key as an authenticator, albeit insecurely. WPA employs the Extensible Authentication Protocol (EAP) by which authentication can be done by password, token, certificate, or other mechanism. For small network (home) users, this probably still means a shared secret, which is not ideal. Users are prone to select weak keys, such as short numbers or passphrases subject to a dictionary attack.
Strong Encryption
The encryption algorithm for WEP had been RC4, which has cryptographic flaws both in key length and design, explained by Arbaugh [ ARB02 ]. In WEP the initialization vector for RC4 is only 24 bits, a size so small that collisions commonly occur; furthermore, WEP does not check against initialization vector reuse.
WPA2 adds AES (described in Chapter 2 ) as a possible encryption algorithm (although RC4 is also still supported to maintain compatibility). AES is a much stronger encryption algorithm, in part because it uses a longer encryption key (which increases the time for an exhaustive search from days to millennia).
Integrity Protection
WEP includes a 32-bit integrity check separate from the data portion. But because the WEP encryption is subject to cryptanalytic attack [FLU01], the integrity check was also subject, so an attacker could modify content and the corresponding check without having to know the associated encryption key [ BOR01 ]. WPA includes a 64-bit integrity check that is encrypted.
Session Initiation
The setup protocol for WPA and WPA2 is much more robust than that for WEP. Setup for WPA involves three protocol steps: authentication, a four-way handshake (to ensure that the client can generate cryptographic keys and to generate and install keys for both encryption and integrity on both ends), and an optional group key handshake (for multicast communication). Lehembre [ LEH05 ] affords a good overview of the WPA protocols.
WPA and WPA2 address the security deficiencies known in WEP. Arazi et al. [ ARA05 ] make a strong case for public key cryptography in wireless sensor networks, and a similar argument can be made for other wireless applications (although the heavier computation demands of public key encryption is a limiting factor on wireless devices with limited processor capabilities.) WEP use is declining in favor of WPA.
WPA fixes many shortcomings of WEP by using stronger encryption; longer, changing keys; and secure integrity checks.
Attacks on WPA
Shortly after the appearance of the WPA protocol suite, researchers found and described flaws.
Man-in-the-Middle
Mishra and Arbaugh [ MIS02 ] identified two potential flaws in the design of WPA protocols. The first of these, called a man-in-the-middle attack (we show other examples of in-the-middle attacks in Chapter 4 ), is exploited when a clever attacker can intrude in a legitimate conversation, intercepting and perhaps changing both sides, in order to surreptitiously obtain or modify protected data. The attack of Mishra and Arbaugh uses a malicious man-in-the-middle to hijack a session, that is, for an outsider to replace a legitimate user and carry on that session in the authority of the user.
The attack succeeds by means of a MAC address spoofing attack. During the association sequence between a device and an access point, the device presents credentials to authenticate, and the access point sends a message confirming the authentication. At that point, the malicious man-in-the-middle changes its MAC address to that of the access point and sends the device a request to disassociate. Disassociation is a means for either party to terminate an association and can happen because of completion of activity, overloading, or some other reason. The requesting device ceases the association and begins again the process of associating; meanwhile, the malicious outsider has changed the MAC address to that of the disassociated device and continues the association with the access point as if it were the original user.
The problem permitting this attack is that frames lack integrity protection; therefore, the disassociate message from a rogue host is not identified as being inauthentic.
Incomplete Authentication
The second attack against WPA pinpoints a related weakness in the authentication sequence.
At one point, the supplicant (client) is required to authenticate to the access point, but the supplicant has no basis for assurance that the access point is legitimate, that is, that a malicious party is not sending signals pretending to be an access point. Thus, the supplicant can be forced to reveal authentication data to an unauthorized third party.
Recall our discussion in Chapter 3 of the importance of mutual suspicion in programs: Each routine needs to suspect that all other routines with which it interacts might be faulty or hostile. The posited attack shows an example of failing to exercise mutual suspicion.
Exhaustive Key Search
A known limitation of cryptography is that the entire space of possible cryptographic keys can be searched to find the correct one. The countermeasure to this attack is to use a key so long that the number of possible keys required to be searched is prohibitive. The 56-bit DES key has been shown vulnerable to an adversary with significant computing power, and a panel of cryptographers in 1996 [ BLA96 ] advised using algorithms with keys of 100 bits or more for high security. This advice depends on the key being truly random; as with using aaaaaa as a password, using any predictable pattern number weakens the key. Because key selection is so critical, the key management of WPA has come under scrutiny. WPA uses a 256-bit base key, which seems long enough to be secure.
To establish a shared key between the access point and the device, the administrator has to enter a very large number correctly twice, once for the access point and once for the device. To simplify the entry of a large number, many WPA implementations allow a passphrase, a string of characters, which are then converted to a number. Moskowitz [ MOS03 ] observes that people tend not to choose character strings (especially long ones) completely at random, and thus guessing attacks with popular strings succeed faster than full exhaustive searches. Moskowitz notes, however, that the algorithm by which WPA converts a passphrase into an encryption key is (computer) time consuming, which reduces the ability of an attacker to test a large number of potential passphrases as keys.
A similar attack depends on people’s having chosen short passphrases because an exhaustive attack will progress in an orderly manner through all one-character potential passphrases, then two characters, and so forth.
Finally, in 2008 researchers Martin Beck and Erik Tews [ BEC08 ] presented an attack against a feature of WEP that was carried over into WPA (but not WPA2). The attack undermines the integrity of encrypted content. We have already described the insecurity of the RC4 algorithm used by WEP, applying either a 40- or 104-bit key, and the Tews–Beck attack finds another weakness there. The researchers also attack WPA with their technique, which they call chopchop because they chop out and replace one byte of a block and see the change in the block’s integrity. By repeatedly chopping and substituting, they infer the integrity key. The attack undermines the original WPA because it uses an integrity mechanism called TKIP (Temporal Key Integrity Protocol) designed to be compatible with WEP. The sophisticated attack is most effective against short data blocks of which the attacker knows some of the underlying plaintext data; the result of the attack enables the attacker to substitute some packets with other data without being detected. Ohigashi and Morii [ OHI09 ] improved upon the chopchop technique by making it faster.
This attack is significant because it demonstrates a previously unknown vulnerability. However, it results only in successfully replacing certain packets in a WPA stream. It does not undermine WPA or TKIP in general, and, more important, it is not effective against WPA2 using the AES algorithm.
Conclusion: WPA Is Adequately Secure
The vulnerabilities identified occur in restricted cases and do not affect most users or WPA itself. Care in choosing an encryption key can ensure that it is long and random enough to be immune from guessing attacks.
In 2018 the Wi-Fi Alliance upgraded WPA2 (commonly called WPA) to WPA3 . The basic structure of WPA remains the same; the new protocol precludes dictionary attacks against passwords, uses longer encryption keys and stronger encryption algorithms, and supports an easy-to-use association technique that avoids passwords (and the tendency of users to choose guessable ones). WPA3 began to be implemented in products soon after it was developed.
More serious than any weaknesses in the WPA algorithm suite is the amount of data people communicate without protection. Protection of user data is an application issue, not a networking one, and thus it is something for users and programs to solve.
So far in this book, we have focused almost exclusively on confidentiality and integrity attacks, both in conventional computing and in networks. Our toolkit of countermeasures relies heavily on the trio of authentication, access control, and encryption, as well as special-purpose tools such as defensive programming, separation, and least privilege. Now we turn to a security vulnerability especially potent in networks: denial of service, or loss of availability. To counter such threats, we find we need a radically different set of countermeasures.
6.4 Denial of Service
Denial of service is devastating to a commercial firm that depends on computing for customer interaction, as well as back-end functions like inventory management and scheduling. Governments continue to move service to the web, so failed access means citizens cannot perform ordinary government interactions. Recent advances in electronic medical records have brought advantages, but as reliance on that mode of data management grows, treating patients will become dangerous without data access. The Internet of Things (described in Chapter 8 ) is rapidly increasing dependence on web access for such things as home heating control, fire protection, and intruder detection. Computerized control of devices from traffic lights to aircraft means that a service failure can lead to serious complications in the physical world as well. For these, reasons, we explore causes and countermeasures for denial of service.
Example: Massive Estonian Web Failure
We begin this section with an example of a large service attack. And although perpetrators of this attack are still unknown, it is fairly clear that this attack was politically motivated.
Officials in the Republic of Estonia decided in 2007 to move a monument called the “Bronze Soldier,” which commemorated Russian involvement in World War II. Taking the move as an affront to Russia, people blockaded the Estonian embassy in Moscow, and protests erupted in Estonia, which has a large ethnic Russian minority population.
Almost immediately after the demonstrations began, Estonian websites were bombarded with traffic, at rates of 100–200 megabits per second. Although more recently attacks have exceeded 10,000 times that volume, in 2007, 100 megabit per second traffic was unheard of.
Among the sites under attack were those of
-
the president
-
parliament
-
many government departments
-
political parties
-
major news organizations
-
major banks
-
telecommunications firms
Attacks began on 27 April after the statue was moved, and they continued for several days and then diminished. On 8–9 May, a period when Russia celebrates its victory over the Nazis in World War II, the attacks surged again, and they rose again in the middle of May before eventually subsiding.
Estonia is one of the most heavily computerized countries in the world and has pioneered e-government; the slowdown on major government and commercial sites for almost a month had a serious impact on their citizens’ ability to do business and interact with their government.
The Estonian computer emergency response team determined that the attacks were coming largely from outside Estonia. Experts acted quickly to close down sites under attack and apply other controls to limit inbound traffic. Emergency response teams from the European Union and the United States joined to help manage the attack [ VAM07 ].
Pinpointing the source of the attack was not possible. The source of such attacks is often unclear because internet routing protocols do not retain the trail of all links in a chain of communication, only the most recent router. (A proper communication also indicates the original source address, which, being easy to spoof, is certainly not useful in tracing a denial-of-service attack.) Although the Estonian Foreign Minister accused the Kremlin of involvement, the Defense Minister acknowledged there was no definitive evidence of that. One Russian was convicted in Estonia of a minor role in the attack. Responsibility for planning, coordinating, and mounting the attack has not been and probably never will be established [ EVR09 ].
The source of a denial-of-service attack is typically difficult or impossible to determine with certainty.
Isolated action? No. In January 2013, the New York Times website was bombarded by a massive flooding attack, as were the sites of the Washington Post and the Wall Street Journal . Allegedly, these websites were attacked by hackers with ties to China. In August 2013, a group identified as the Syrian Electronic Army allegedly shut off access to the New York Times website for 20 hours. In June 2014, the same group allegedly redirected readers of Reuters from a story describing a Syrian attack to a message reporting the site had been hacked. In February 2022, Ukraine was hit by an attack that brought down the websites of the country’s defense ministry, army, and two largest banks, just weeks before Russia invaded the country. Denial of service for political purposes is a potent tool. Financial institutions have also been targeted with attacks from unknown sources.
A denial-of-service , or DoS , attack is an attempt to defeat availability, the third of the three basic properties to be preserved in computer security. Denial of service means just what its name implies: A user is denied access to authorized services or data. Confidentiality and integrity are concerned with preventing unauthorized access; availability is concerned with preserving authorized access.
Confidentiality and integrity tend to be binary: Data or objects either are or are not kept private and unmodified; availability can be more nuanced, in that there may be service but in insufficient quantity or at unacceptable responsiveness. You know that a webpage takes a few moments to load, but as time passes, you become more frustrated or suspicious that it will never display; then, suddenly it appears, and you wonder why it took so long. Thus, denial of service ranges from complete loss of access to noticeable and unacceptable slowing to minor inconvenience.
How Service Is Denied
In this section we describe what denies service. Many causes are nonmalicious and often sporadic and spontaneous, so little can be done about them. We focus on the malicious causes because those are the ones security teams can address. Fortunately, several classes of countermeasures are effective against malicious DoS attacks. First, we consider some of the causes.
Denial of service can occur from excessive volume, a failed application, a severed link, or hardware or software failure.
Think for a moment about how you might deny access in a computer network.
-
One potential weakness is the capacity of the system. If demand is higher than the system can handle, some data will not move properly through the network. These attacks are also known as volume-based or volumetric attacks.
-
Similar to overwhelming basic network capacity, an attack can exhaust the application, for example email, that services a particular network use, in what is called an application-based attack.
-
Another way to deny service is to cut or disable the communications link between two points. Many users will be unable to receive service, especially if that link is a single point through which much traffic must pass.
-
A final cause of denied access is a hardware or software failure. Although similar to a failure of a communications link, in this case the problem relates to machinery or programs, for which protection can involve concepts like fault tolerance.
First we examine the issue of insufficient capacity.
Flooding
Imagine a teacher in a classroom full of six-year-olds. Each child demands the teacher’s attention. At first, the teacher hears one child and gives the child attention. Then a second child calls, and the teacher focuses on that child while trying to remember what the first child needed. Seeing that calling out works, children three, four, and five cry out for the teacher, but this frustrates other children who also demand attention. Of course, each child who calls out does so more loudly than the previous ones, and soon the classroom is a cacophony of children’s shouts, making it impossible for the teacher to do anything except tell them all to be quiet, wait their turn, and be patient (none of which comes naturally to six-year-olds). The teacher becomes so overloaded with demands that the only solution is to dismiss all current demands and start afresh.
An attacker can try for the same overloading effect by presenting commands more quickly than a server can handle them; servers often queue unmet commands during moments of overload for service when the peak subsides, but if the commands continue to come too quickly, the server eventually runs out of space to store the demand. Such an attack is called an overload or flood .
The target of a flooding attack can be an application, such as a database management system; an operating system or one of its components, for example, file or print server; or a network appliance like a router. Alternatively, the flooding attack can be directed against a resource, such as a memory allocation table or a webpage. On the day Michael Jackson died, Google received so many queries about him that the Google engineers thought they were under attack and took evasive measures that, ironically, limited access to the Google news service. A DoS flooding attack can be termed volumetric, meaning it simply seeks to saturate or exhaust the capacity of a critical telecommunications link.
A flooding attack occurs from demand in excess of capacity, from malicious or natural causes.
Blocked Access
As another physical analogy, consider a traffic accident that stops traffic in both directions of a busy, two-lane road. As motorists begin to line up behind the accident, at some point one driver concludes a wise approach is to slip into the oncoming traffic lane to get around all the stopped cars and, naturally, other drivers immediately follow. They get as far as the accident and have to stop. What then happens is that two lanes of traffic build up at the point of the accident on both sides of the accident, meaning that police and other emergency vehicles cannot get past the two solid lines of cars in both directions to get to the accident. Even when the disabled cars are pushed off the road to clear the accident, all lanes are still filled with cars that cannot move because there is no room either in front or behind.
In computer security, the attacker may simply prevent a service from functioning. The attacker could exploit a software vulnerability in an application and cause the application to crash. Or the attacker could interfere with the network routing mechanisms, preventing access requests from getting to the server. Yet another approach would be for the attacker to manipulate access control data, deleting access permissions for the resource, or to disable the access control mechanism so that nobody could be approved for access. Sidebar 6-16 describes an attacker who encrypted disk files of the entire Irish national health service, thereby blocking access to patient records and denying access to most medical services.
Sidebar 6-16 Ireland Health Service Attacked for Ransom
In April 2021, the Health Service Executive (HSE) of Ireland, which operates the country’s entire national health system, was subject to a ransomware attack. Analysts believe the attack was implemented by a ransomware service called Conti (described in Chapter 4 ), which operates as a kind of ransom attack-for-hire action.
Because of the attack, the HSE shut down all its national and local IT systems [ HHS21 ]. The HSE instructed employees to shut down all computers and not turn on any already shut down. Attackers demanded a ransom payment, but the HSE did not pay. The attack affected elective and noncritical care. Healthcare workers reverted from electronic to paper records, although accessing these records was more time consuming.
The Conti ransomware service is difficult to analyze or protect against because it leaves few traces after it operates. The software first determines which data files to attack, typically going for administrative data such as personnel and financial records. After identifying files to target, the attack begins to work in memory, fetching a disk file, encrypting it, and then rewriting the encrypted version over the plaintext original on disk. Because Conti works in memory, it does not leave traces of its code when a targeted computer is shut down, complicating the ability of responders to analyze its operation or perhaps infer its encryption keys.
Within a week of the HSE infection, the attacker posted a decryption key for the locked files and recovery began. After one month, the security team had restored approximately half of the affected files and cleaned half of the servers. It took the HSE four months to recover fully from the attack [ PWC21 ]. HSE has made no estimate of the financial cost or the impact on patient care due to the attack.
Access Failure
Either maliciously or not, hardware and software fail from time to time; of course, it always seems that such nonmalicious failures occur at the worst times. Software stops working due to a flaw, or a hardware device wears out or inexplicably stops. The failure can be sporadic, meaning that it goes away or corrects itself spontaneously, or the failure can be permanent, as from a faulty component.
These, then, are the three root threats to availability:
-
insufficient capacity; overload
-
blocked access
-
unresponsive component
The attacker will try to actualize any of these threat types by exploiting vulnerabilities against them. In the next section we examine some of these potential vulnerabilities. In Sidebar 6-17 we describe an incident that resulted from a combination of factors—none malicious—including age of components, antiquated network design, and faulty communications protocols. The case is from 2002, but the underlying problem is still important: As computer systems expand, administrators often fail to maintain a coherent overall network design, leading to unexpected security problems.
Sidebar 6-17 Beth-Israel-Deaconess Hospital Systems Down
In 2002, Boston’s Beth Israel-Deaconess Medical Center was recognized by Information Week as 16th of the 500 top innovative IT groups in the United States. In the same year, the hospital suffered a DoS incident that sent the entire hospital back to using the paper forms it had abandoned years earlier [ BER03 ].
On Wednesday, 13 November 2002, the first symptom noticed was that ordinarily instantaneous email was taking ten seconds to transmit. The network engineers observed that one core network switch was saturated by a sudden surge in traffic from an unknown source. To cope with this volume from an unknown cause, the engineers began disintegrating the network, closing connections to simplify traffic flow in the network and also to help identify the source of the problem. Later the engineers would learn that closing portions of the network actually exacerbated the problem.
It turned out the network was thrashing because of something called a spanning tree protocol loop. The hospital’s network architecture included many switches, each of which used a spanning tree algorithm , essentially a map of the shortest route to each known destination in the network. Each switch was responsible for testing its connections and communicating with neighboring switches to build its own spanning tree. But to avoid endless loops (node A determines that the way to node C is to go first to node B, but node B thinks the better path is to go through node A, so the communication loops endlessly between nodes A and B), the algorithm capped the path length computation at seven. At Beth Israel, one very large data transfer got caught in a longer loop that slowed traffic considerably. But when the engineers started cutting circuits, those actions caused all the switches to try to recalculate their spanning tree paths, which in turn slowed traffic and caused the engineers to sever even more links, leading in turn to even more switch recalculations.
A significant part of the problem was that the network design was appropriate for 1996, when it was initially installed, but the network architecture had not been upgraded to account either for major expansion, as Beth Israel brought in several regional hospitals to join its IT network, or for advances in technology, as routers replaced switches in large network segments with complex connectivity. The 1996 network was functioning adequately in 2002 at times of low stress, but a major burst of network traffic flooded the network, denying prompt access to all users.
Lab test requests, patient record charts, prescription orders, digital x-ray results, billing records, all data that would normally have been handled easily electronically suddenly ceased working. On Thursday, 14 November 2002, the administrators decided to give up on the entire electronic system to allow network engineers full access to the network. The hospital reverted to using paper forms, obviously slower and more cumbersome. But even then, the network was so congested it was difficult to map the connectivity of its 25,000 nodes. The hospital called in its network equipment supplier, Cisco, to help redesign and reimplement its network. Over the weekend, hospital and Cisco engineers tested components and segments and replaced switches with routers that were not subject to the spanning tree problem. By Monday the new network was performing reliably, and users returned to using the IT network instead of paper.
This incident occurred in 2002, but the vulnerability remains relevant. Organizations are often reluctant to redesign and reimplement complex networks that have grown over time; cost and inconvenience are two strong motivators for maintaining the status quo. But as staff members move on, people forget a network’s architecture and design rationale, so maintenance often consists of leaving things alone as much as possible. As this example shows, that strategy has a finite life span and often catastrophic consequences.
As Sidebar 6-17 shows, denial of service can arise from malicious or benign causes. At the start of an incident, administrators can fail to distinguish between an intentional attack and a random hardware or software failure. The middle of an ongoing crisis is not the best time to debate possible sources of the problem. Furthermore, as in this situation, several causes, no one of which is enough by itself to cause a problem, can interact in a way that becomes serious. Yet teasing out the individual causes can be challenging to an administrator, especially when faced with the immediate problem of trying to get a failed system operating again.
If a network works, administrators are tempted to expand it incrementally instead of redesigning it to address increased usage.
From the three basic causes of failed service—lack of capacity or overload, blocked access, and unresponsive components—we move now to identify the vulnerabilities that could lead to these failures.
Flooding (Capacity) Attacks in Detail
The most common malicious DoS attack type is flooding. It might seem as if overwhelming a victim would require prodigious resources. However, exploiting weaknesses in network protocols and utilities can produce denial of service; in fact, a few lines of code from one computer can bring down a seemingly more powerful network entity. In this section we examine how flooding attacks are assembled.
Insufficient Resources
In our example of the teacher and the six-year-olds, the teacher simply could not handle demands from all the students: one at a time, perhaps, but not all at once. One teacher with 2 or 3 students could probably have coped, or 10 teachers with 30 students, but not one against 30. Similarly with computing systems, the attacker can try to consume a critical amount of a scarce resource.
Flooding a victim is basically an unsophisticated attack, although the means of performing the flooding can become sophisticated. Another way to deny service is to block access to a resource, which we consider next.
Insufficient Capacity
If the attacker’s bandwidth is greater than that of the victim, the attacker can overwhelm the victim with the asymmetry, just like one teacher and 30 students. A victim is always potentially vulnerable to an attacker with more resources. Examples of insufficient resources may be slots in a table of network connections, room in a buffer, or cycles of a processor.
Flooding occurs because the incoming bandwidth is insufficient or resources—hardware devices, computing power, software, or table capacity—are inadequate.
Denial of service is especially noticeable in network attacks, in which the attacker can consume too much of the available network bandwidth. We consider network capacity exhaustion next.
Network Flooding Caused by Malicious Code
The most primitive DoS attack is flooding a connection. If an attacker sends you as much data as your communications system can handle, you are prevented from receiving any other data. Even if an occasional packet reaches you from someone else, communication to you will be seriously degraded. Ironically, this problem is exacerbated by the robustness of the TCP protocols: If, because of congestion, packets 1 and 2 are delayed but packet 3 manages to slip through first, the protocol handler will notice that 1 and 2 are missing. The receiver accepts and holds packet 3, but the sender may retransmit packets 1 and 2, which adds to the congestion.
More sophisticated attacks use or misuse elements of internet protocols. In addition to TCP and UDP (User Datagram Protocol), there is a third class of protocols, called the ICMP (Internet Control Message Protocol) suite. Normally used for system diagnostics, these protocols do not have associated user applications. ICMP functions include
-
ping , which requests a destination to return a reply, intended to show that the destination system is reachable and functioning
-
echo , which requests a destination to return the data sent to it, intended to show that the connection link is reliable (ping is actually a version of echo)
-
destination unreachable , which indicates that a destination address cannot be accessed
-
source quench , which means that the destination is becoming saturated and the source should suspend sending packets for a while
These protocols have important uses for network management. But they can also be used to attack a system. The protocols are handled within the network stack, so the attacks may be difficult to detect or block on the receiving host. But peculiarities or oversights in the protocols or their implementations can open the way for an attacker to exploit a weakness to overwhelm the code supporting the protocol function. We examine how these protocols can be used to attack a victim. And we stress that packets are unauthenticated: An attacker can use ping or echo packets to saturate a network just as readily as an administrator uses them to manage network performance.
Ping of Death
A ping of death is a simple attack, using the ping command that is ordinarily used to test response time from a host. Since ping requires the recipient to respond to the packet, all the attacker needs to do is send a flood of pings to the intended victim. The attack is limited by the smallest bandwidth on the attack route, as shown in Figure 6-18 . If the attacker is on a 10-megabyte (MB) connection and the path to the victim is 100 MB or more, mathematically the attacker alone cannot flood the victim. But the attack succeeds if the numbers are reversed: An attacker on a 100-MB connection can certainly flood a 10-MB victim. The ping packets will saturate the victim’s bandwidth.
FIGURE 6-18 Ping Attack. (a) Attacker Has Greater Bandwidth (b) Victim Has Greater Bandwidth
(a) Attacker has greater bandwidth: The Attacker sends continuously pings, then there is a reply from the victim, pings from the attacker, and a reply from the victim. (b) Victim has greater bandwidth: The attacker pings, there is a reply from the victim, a ping from the attacker, a reply from the attacker, a reply from the victim, a ping from the attacker, a reply from the victim and a ping from the attacker.
Smurf
The smurf attack is a variation of a ping attack. It uses the same vehicle, a ping packet, with two extra twists. First, the attacker chooses a network of unwitting victims that become accomplices. The attacker spoofs the source address in the ping packet so that it appears to come from the victim, which means a recipient will respond to the victim. Then the attacker sends this request to the network in broadcast mode by setting the last byte of the address to all 1s; broadcast mode packets are distributed to all hosts on the subnetwork. The attack is depicted in Figure 6-19 , showing the single broadcast attack being reflected back on the victim. In this way, the attacker uses the entire subnetwork to multiply the attack’s effect.
FIGURE 6-19 Smurf Attack
The attacker sends broadcast ECHO request to network, with victim's return address. All network hosts reply to victim. The victim is saturated with ECHO replies from entire network.
Echo–Chargen
The echo–chargen attack works between two hosts. Chargen is an ICMP service that generates a stream of packets to test the network’s capacity. Echo is another ICMP service used for testing; a host receiving an echo returns everything it receives to the sender.
The attacker picks two victims, A and B, and then sets up a chargen process on host A that generates its packets as echo packets with a destination of host B. Thus, A floods B with echo packets. But because these packets request the recipient to echo them back to the sender, host B replies by returning them to host A. As shown in Figure 6-20 , this series puts the network infrastructures of A and B into an endless loop, as A generates a string of echoes that B dutifully returns to A, just as in a game of tennis. Alternatively, the attacker can make B both the source and destination address of the first packet, so B hangs in a loop, constantly creating and replying to its own messages.
FIGURE 6-20 Echo–Chargen Attack
Victim A: Chargen packet with echo bit on. Victim B: Echoing what you just sent me. Victim A: Chargen another packet with echo bit on. Victim B: Echoing that again. Victim A: Chargen another packet with echo bit on.
SYN Flood
Another popular DoS attack is the SYN flood . This attack uses the TCP protocol suite, making the session-oriented nature of these protocols work against the victim.
For a protocol such as Telnet or SMTP, the protocol peers establish a virtual connection, called a session, to synchronize the back-and-forth, command–response nature of the interaction. A session is established with a three-way TCP handshake. Each TCP packet has flag bits, one of which is denoted SYN (synchronize) and one denoted ACK (acknowledge). First, to initiate a TCP connection, the originator sends a packet with the SYN bit on. Second, if the recipient is ready to establish a connection, it replies with a packet with both the SYN and ACK bits on. Finally, the first party completes the exchange to demonstrate a clear and complete communication channel by sending a packet with the ACK bit on, as shown in Figure 6-21 .
FIGURE 6-21 Three-Way TCP Handshake
Occasionally packets get lost or damaged in transmission. The destination (which we call the recipient) maintains a queue called the SYN_RECV connections, tracking those items for which a SYN–ACK has been sent but no corresponding ACK has yet been received. Normally, these connections are completed in a short time. If the SYN–ACK (2) or the ACK (3) packet is lost, eventually the destination host will time out the incomplete connection and discard it from its waiting queue.
The attacker can deny service to the target by sending many SYN requests, to which the target properly responds with SYN–ACK; however, the attacker never replies with ACKs to complete the connections, thereby filling the victim’s SYN_RECV queue. Typically, the SYN_RECV queue is quite small, holding 10 or 20 entries. Because of potential routing delays in the internet, typical holding times for the SYN_RECV queue can be minutes. So the attacker need only send a new SYN request every few seconds, and the queue will fill.
Attackers using this approach usually do one more thing: They spoof a nonexistent return address in the initial SYN packet. Why? For two reasons. First, the attacker does not want to disclose the real source address in case someone should inspect the packets in the SYN_RECV queue to try to identify the attacker. Second, the attacker wants to make the malicious SYN packets indistinguishable from legitimate SYN packets to establish real connections. Choosing a different (spoofed) source address for each one makes them unique, as ordinary traffic would be. A SYN–ACK packet to a nonexistent address results in an ICMP Destination Unreachable response, but this is not the ACK for which the TCP connection is waiting. (TCP and ICMP are different protocol suites, so an ICMP reply does not necessarily get back to the sender’s TCP handler.)
These attacks misuse legitimate features of network protocols to overwhelm the victim, but the features cannot be disabled because they have necessary purposes within the protocol suite. Overwhelming network capacity is not the only way to deny service, however. In the next section we examine attacks that exhaust other available resources.
Network Flooding by Resource Exhaustion
A computer supports multiple applications by dividing time among applications; operating systems research has helped people design effective algorithms for deciding how much (what proportion of) processing time to allocate to which applications. Switching from one application to another, called context switching , requires time and memory because the current state of the application is saved, and the previous state of the next application is reloaded. Register values must be written to memory; outstanding asynchronous activities must be completed, dropped, or recorded; and memory must be preserved or freed. If there are few active processes and few context switches, the overhead for each switch is negligible, but as the number of active processes increases, the proportion of time spent in context switching also grows, which means the proportion of time for actual computing decreases. With too many processes, a system can enter a state called thrashing , in which its performance fails because of nearly continuous context switching.
Time is not the only resource that can be exhausted. Buffers for incoming email can be overwhelmed by a sudden flood of incoming messages. Logging and log files can be swamped by a large number of errors or fault conditions that must be handled. Buffers for reassembling fragmented communications can also be exhausted.
Even identification and authentication can become vulnerable in an exhaustion attack. To protect against automated guessing attacks, some authentication services temporarily or permanently disable account access after some number, such as three or five, of failed login attempts. Thus, a malicious user can block access by repeatedly failing to log in as the victim.
IP Fragmentation: Teardrop
The teardrop attack misuses a feature ironically intended to improve network communication. A network IP datagram is a variable-length object. To support different applications and conditions, the datagram protocol permits a single data unit to be fragmented, that is, broken into pieces and transmitted separately. Each fragment indicates its length and relative position within the data unit. The receiving end reassembles the fragments into a single data unit.
As shown in Figure 6-22 , in the teardrop attack, the attacker sends a series of datagrams that cannot fit together properly. One datagram might say it is position 10 for length 50 bytes, another position 20 for 60 bytes, and another position 40 for 30 bytes. These three pieces overlap, so they cannot be reassembled properly. In an extreme case, the operating system locks up with these partial data units it cannot reassemble, thus leading to denial of service.
FIGURE 6-22 Teardrop Attack
The left side of the illustration shows the following details: Fragment start = 10 len = 50 (A box with left stripe). Fragment start = 10 len = 50 (A box with right stripe). Fragment start = 40 len = 30 (A shaded box). The right side of the illustration shows the following details: Reassembly Buffer shows a box divided into six segments, ranging from 0 to 100: 0 to 10 - blank box, 10 to 20 - left stripe, 20 to 40 - left and right stripe, 40 to 60 - shaded left and right stripes, 60 to 70 - shaded right stripes, 70 to 80 - right stripes, and 80 to 100 - blank box.
Another cause of denial of service is based in network routing: If routing tables no longer point at a site, that site is effectively unreachable. We look at routing attacks next.
Denial of Service by Addressing Failures
As we describe earlier, another way the attacker can deny service is by preventing access, physically or logically. In this section we consider ways to prevent data from getting to the victim. You can see that anyone who can sever, interrupt, or overload a system’s capacity can deny service. The physical threats are rather obvious and are described later in this chapter. We consider instead several electronic attacks that can cause a denial of service. In this section we look at ways service can be denied intentionally or accidentally.
Misrouting is an attack that achieves two goals. Suppose your neighbor’s home address is 217 Main Street, but you take down the numbers on her house and put 217 above your own house instead. Then all of your neighbor’s mail would be delivered to your house and your neighbor would get none. You would be ideally positioned to inspect (and perhaps open) everything your neighbor should have received, and you would block all deliveries to your neighbor. This addressing change would facilitate interception and denial of service. A similar situation occurs with network addresses, as we now describe.
DNS Spoofing
At the heart of internet addressing is a protocol called DNS or Domain Name System protocol. DNS is the database of translations of internet names to addresses, and the DNS protocol resolves the name to an address. For efficiency, a DNS server builds a cache of recently used domain names; with an attack called DNS poisoning, attackers try to insert inaccurate entries into that cache so that future requests are redirected to an address the attacker has chosen.
A standard DNS query and response is shown in Figure 6-23 , in which the user requests a translation of the URL microsoft.com , and the name server responds with the address 207.46.197.32.
FIGURE 6-23 Resolving a Domain Name to an Address
User: Please convert w w w dot Microsoft dot com. The DNS server: 207.46.197.32.
DNS service is implemented on a remote server, so a man-in-the-middle attack involves the attacker’s intercepting and replying to a query before the real DNS server can respond. Such a situation, called DNS spoofing , is shown in Figure 6-24 . In that example, the attacker quickly responds with address 7.0.1.1 (presumably an address over which the attacker has control). With that change the attacker can enter into the middle of the user’s communication with microsoft.com , forwarding whatever the attacker wants to the real Microsoft website. The user’s browser disregards the correct response from the DNS server that arrives after the browser has already accepted the false address from the attacker.
FIGURE 6-24 Address Resolution Involving DNS Spoofing
User: Please convert w w w dot Microsoft dot com. Attacker: 7.0.1.1. Attacker: 207.46.197.32 User: Received too late; Ignored. The DNS server plays no role.
Any server can respond to a DNS lookup request; the first responder wins. Being first lets an attacker redirect traffic.
Rerouting Routing
One example of a man-in-the-middle attack involves one node’s redirecting a network so that all traffic flows through the attacking node, leading to a potential for interception. Network routers are a loose confederation of mutually trusting components that arrange for delivery of all data through a network, including the internet. The man-in-the-middle explanation for routers is a bit complicated, so we present a simplified version that highlights the middle role; For a more complete description of this phenomenon, consult Hepner et al. [ HEP09 ].
Each router sends a message to other routers, listing addresses to which it has a path; the other routers then add their paths and forward the extended list to the other routers as well. In this way, all routers learn of the connections of all other routers. In Figure 6-25 , four routers control four subnets: A controls the 10.0.0.0 subnet; B, the 20.0.0.0, and so forth. A is adjacent to B, B is adjacent to C, and T is another router not adjacent to any of the other three. A advertises to its neighbors that it is a distance of 1 from any machine in the 10.0.0.0 subnet.
FIGURE 6-25 Router Advertises Its Subnet
A (10.0.0.0), B (20.0.0.0), and C (30.0.0.0) are linked to T (90.0.0.0) through three dots. An arrow points at B and reads, 10.0.0.0 dist 1.
Because B has just learned that router A is only distance 1 from the 10.0.0.0 subnet, B advertises to its neighbors A and C that it is distance 1 from its own subnet and distance 2 from the 10.0.0.0 subnet, as shown in Figure 6-26 . Of course, A doesn’t care that it could get to 10.0.0.0 addresses by going through B; that would be a senseless loop, but it does record that B is the closest path to 20.0.0.0 addresses.
FIGURE 6-26 Router Advertises Its Own Subnet and Its Neighbor’s
A (10.0.0.0), B (20.0.0.0), and C (30.0.0.0) are linked to T (90.0.0.0) through three dots. An arrow points at A and reads, 10.0.0.0 dist 2. An arrow points at C and reads, 20.0.0.0 dist 1.
Figure 6-27 shows how C takes what it has just learned from B and broadcasts it to other routers adjacent to it. In this way, the routers announce their capabilities throughout the entire network. Over time, the routers share information that details the complete network topology. Each router maintains a table of destinations and next steps, so if C had something for the 10.0.0.0 subnetwork, its table would indicate it should forward that data stream to B.
FIGURE 6-27 Router Propagates Routing Information
A (10.0.0.0), B (20.0.0.0), and C (30.0.0.0) are linked to T (90.0.0.0) through three dots. Two arrows point at B and the three dots and the text reads, 10.0.0.0 dist 3, 20.0.0.0 dist 2, and 30.0.0.0 dist 1.
In Figure 6-28 , we complicated the scene a bit by adding more routers; for simplicity we do not show their subnetworks. These routers will all advertise their connectivity, from which they can determine the shortest path between any pair of points. Notice that A is rather isolated from T; its shortest path is B-N-P-Q-T.
FIGURE 6-28 More Complex Router Connectivity Diagram
A (10.0.0.0), is linked to B (20.0.0.0), and B is linked to C (30.0.0.0). B is linked to N and C is linked to M. M, N, P, Q, T (90.0.0.0), and D are linked. D is linked to Q.
Routers operate on implicit trust; what a router reports is believed to be true. Routers do, however, sometimes malfunction or their administrators enter inaccurate data, so routing tables can become corrupted from nonmalicious (and malicious) causes. In our example, if router A advertised it was distance 1 from the 90.0.0.0 subnetwork, most traffic to that subnetwork would be routed to A because that distance would beat any path except T itself. If A received that traffic, it could easily intercept and modify any traffic to that network, so a rogue router in a network could instigate a man-in-the-middle attack in this way.
Routers implicitly trust each other.
Router Takes Over a Network
At the 2008 Defcon conference, most attendees were unaware that two researchers had rerouted the conference’s wireless network through their equipment. The researchers, Pilosov and Kapela [ PIL08 ], described and demonstrated their attack. Although the attack is more detailed than we want to present here, it extends the approach just described. Other papers (such as [ HEP09 ], [ KUH07 ], and [ BEL89 ]) have discussed similar vulnerabilities.
Routers communicate available paths by the BGP (Border Gateway Protocol), which is complex, so attacks against it are sophisticated but certainly feasible. Details such as timing and sequence numbers must be captured and used correctly in order for a BGP update to be recognized and accepted by the rest of the network. Furthermore, attacks on the protocol depend on a device’s being at the “edge” of a subnetwork, that is, directly connected to two different subnetworks. Although an attacker can represent being on the edge of a local subnetwork, for example, a wireless network in a hotel or laboratory, it is harder to represent being on the edge of a larger subnetwork, for example, impersonating an ISP in direct connection to the internet. A successful attacker, however, can redirect, read, copy, modify, or delete all traffic of the network under attack.
Source Routing and Address Spoofing
Internet traffic usually travels by the best available route; that is, each router determines the best path (called the next hop ) to which to direct a data unit. However, a sender, using a process called source routing , can specify some or all of the intermediate points by which a data unit is transferred. With strict source routing , the complete path from source to destination is specified; with loose source routing , certain (some or all) required intermediate points are specified.
One use of source routing is to test or troubleshoot routers by forcing traffic to follow a specific path that an engineer can then trace. A more vicious use of source routing is to force data to flow through a malicious router or network link. Obviously, adding source routing to a data stream allows the man-in-the-middle to force traffic to flow through his router. Because of its potential for misuse, loose source routing is blocked by many internet routers.
Traffic Redirection
As we saw earlier, at the network layer, a router is a device that forwards traffic on its way through intermediate networks between a source host’s network and a destination’s network. So if an attacker can corrupt the routing, traffic can disappear.
Routers use complex algorithms to decide how to direct traffic. No matter the algorithm, they essentially seek the best path (where “best” is measured in some combination of distance, time, cost, quality, and the like). Routers are aware only of the routers with which they share a direct network connection, and they use gateway protocols to share information about their capabilities. Each router advises its neighbors about how well it can reach other network addresses. This characteristic allows an attacker to disrupt the network.
To see how, keep in mind that in spite of its sophistication, a router is simply a computer with two or more network interfaces. Suppose a router advertises to its neighbors that it has the best path to every other address in the whole network. Soon all routers will direct all traffic to that one router. The one router may become flooded, or it may simply drop much of its traffic. In either case, a lot of traffic never makes it to the intended destination.
As we mention earlier, routers trust each other to provide accurate data. Occasionally, due to nonmalicious corruption a router will send faulty data, but these sporadic failures have localized effect and heal themselves over time thanks to network reliability. However, an intentionally misleading router (or a device maliciously impersonating a router) can persist because of implicit trust. As you know, a standard countermeasure to exclude impostors is identification and authentication. But for efficiency, router communication protocols were designed without authentication. Only now are authenticating steps being added to router protocols.
DNS Attacks
Our final DoS attack is actually a class of attacks based on the concept of domain name server. A domain name server queries other name servers to resolve domain names it does not know. For efficiency, it caches the answers it receives so that it can convert that name more rapidly in the future. An address mapped by a DNS server can be retained for weeks or months.
Name Server Application Software Flaws
In the most common implementations of Unix, name servers run software called Berkeley Internet Name Domain, or BIND, or named (a shorthand for “name daemon”). BIND has had numerous flaws, including a now familiar buffer overflow. By overtaking a name server or causing it to cache spurious entries, an attacker can redirect the routing of any traffic, with an obvious implication for denial of service.
Top-Level Domain Attacks
Another way to deny service through address resolution failures involves incapacitating the internet’s DNS system itself. In October 2002, a massive flood of traffic inundated the internet’s top-level domain DNS servers, the servers that form the foundation of the internet addressing structure. At that time there were 13 top-level domain server addresses spread around the world; each top-level server address represents a small network of cooperating servers that translate the top level, or last part of a network address: the .com, .edu, .fr, .uk, .org, or .biz part of a URL. In the 2002 attack, roughly half the flood of traffic came from just 200 addresses. Although some people think the problem was a set of misconfigured firewalls, nobody knows for sure what caused the attack, and even whether it was an attack or an anomalous incident.
Again in 2007, a similar thing happened. On 6 February 2007, the DNS root name servers were hit with two massive DoS attacks for a total of six hours. This time it was clearly an attack, at least part of which originated from the Asia-Pacific region [ ICA07 ]. In this situation also, the impact of the attack was significantly reduced because, between 2002 and 2007, the internet began using a new design for the root name servers. Called anycast, this technology allows the lookup function to be spread over many computers, even hundreds. By the mid-2010s all top-level servers implemented anycast, making the internet less subject to the attacks just mentioned. Anycast is now used for subdomains (for example, microsoft.com ), meaning that numerous redundant servers can resolve addresses within the subdomain. Thus, attacks on a single DNS server, or even a small number of servers, have little impact.
An attack in March 2005 used a flaw in a Symantec firewall to allow a change in the DNS records used on Windows machines. The objective of this attack was not denial of service, however. In this attack the poisoned DNS cache redirected users to advertising sites that received money from clients each time a user visited the site. Nevertheless, the attack also prevented users from accessing the legitimate sites.
These attacks attempt to deny service by limiting the system’s ability to resolve addresses. Because address resolution is distributed in the internet, these attacks tend to be more effective at causing localized denial of service and less effective against large segments.
Denial-of-service attacks are often second-level attacks. First, the attacker lodges attack code in a target system and then, after the code is in place, the attacker triggers that code to implement a DoS attack. Next we consider how the attacker can infiltrate the target system from which to initiate a DoS attack.
Session Hijack
In a session hijack attack, the attacker allows an interchange to begin between two parties but then diverts the communication, much as would a man-in-the-middle. Think, for example, of logging in to a financial site, completing the authentication, and then losing the session to an attacker. Financial sites are typically well protected with encryption, but other sites may be vulnerable, for example, ones that communicate medical records or support interaction between students and teachers.
In a session hijack, the attacker literally steals an established TCP connection by rewriting source and destination addresses.
Session hijacking is facilitated by elements of the TCP/IP protocol design. First, consider the IP header, as shown in Figure 6-29 . The important part is bytes 12–19, which contain the source and destination IP addresses. The purpose for the destination is obvious; the source is necessary so that the receiver can generate a response message to the sender. At any point along the journey from source to destination, an attacker can change that source address, thereby redirecting the response to the attacker, not the original sender.
FIGURE 6-29 IP Header
0 to 2, and 0 bytes - Flags, 2 to 3 and 0 bytes - Length; 0 to 2, and 4 bytes - Identification; 2 to 3, and 4 bytes - Flags, and Fragment Offset; 0 to 2, and 8 bytes - Time to Live, and Protocol, 2 to 3, and 8 - Header Checksum; 0 to 3, and 12 bytes - Source IP Address; 0 to 3, and 16 bytes - Destination IP Address; 0 to 3, and 20 bytes - IP Options, 3 and above - Padding; 0 to 3, and 24 plus - Data...
Now consider the TCP protocol header, as shown in Figure 6-30 . The entire TCP packet is contained within an IP datagram of Figure 6-29 ; thus all of Figure 6-30 is contained within the Data field (bytes 24 and beyond) of Figure 6-29 .
FIGURE 6-30 TCP Header
0 to 2, and 0 bytes - Sender Port, 2 to 3, and 0 bytes - Receiver Port; 0 to 3, and 4 bytes - Sequence Number; 0 to 3, and 8 bytes - Acknowledgment Number; 0 to 2, and 12 bytes - Data Offset, Reserved, Flags, 2 to 3, and 12 bytes - Window; 0 to 2, and 16 bytes - Checksum, 2 to 3, and 16 bytes - Urgency; 0 to 3, and 20 plus - Options (length varies) ...; 0 to 3, and varies - Packet Data ....
If packets arrive out of order, the protocol handlers use the TCP sequence and acknowledgment numbers, bytes 4–11 in Figure 6-30 to reconstruct a data item. The TCP protocol suite was designed with unstable networks in mind, so it contains features for recognizing and correcting errors, not just damage to the message data but also corruption of the control data shown in these headers.
A sender creates and sends packet 1, then 2, then 3, and so forth, and the recipient returns packets with acknowledgment numbers as packets are received, as shown in Figure 6-31 . We simplify the explanation slightly by showing only the sequencing from the client’s perspective. The client sends its current buffer pointer, and the server acknowledges that same pointer. (For the full protocol, each acknowledges the other’s last pointer and sends its current pointer accounting for the latest receipt of data.) If the client sends a packet with an erroneous pair of sequence and acknowledgement numbers, this disrupts synchronization, and the receiver discards packets until receiving one that matches the previous acknowledgment number. If they do not resynchronize, they terminate and reestablish the session. The protocol is thus self-healing because once the two ends resynchronize, they can determine the last successful exchange and retransmit from that point forward.
FIGURE 6-31 Normal TCP Exchange
Sender: Data (len 5) Seq = 10 points to Receiver: Ack = 15 which points to Sender: Data (len 20) Seq = 15 which points to Receiver: Ack = 35 which points to Sender.
The attacker can take advantage of this correction by inserting a packet that maintains synchronization with the receiver but destroys synchronization with the real sender. The attacker and the recipient are now resynchronized and continue the exchange begun by the original sender. In this way, as shown in Figure 6-32 , the attacker has surreptitiously slid into the session, taking the place of the original sender. This inserted packet is a replay carefully constructed by a man-in-the-middle. This attack was discovered by Robert Morris, Sr. [ MOR85 ] and expanded by Steven Bellovin [ BEL89 ].
FIGURE 6-32 TCP Hijack
Sender: Data (len 5) Seq = 10 points to Receiver: Ack = 15 through Attacker which points to Sender.: Data (len 20) Seq = 15 through Attacker which points to Receiver: Ack = 35 through Attacker which points to Sender. Data (len 100) Seq = 35 through Attacker points to Ack = 135 through Hijack; Ack = 135 points to Sender: Data (len 30) Seq = 35 which points to receiver: X. Ack = 135 points to Data (len 25) Seq = 135 which shows a right arrow toward receiver.
Meanwhile, as shown in Figure 6-33 , the attacker sends an RST (reset) command to the original sender, convincing the sender that the receiver has closed the original connection. The sender can attempt to open a new connection with the recipient, unaware that the attacker is continuing the previous session. Depending on the application that was running, the attacker can accept the sender as a new user (possibly requiring the user to reauthenticate) or reject the user for duplicating a connection already in progress.
FIGURE 6-33 Resetting the Original Sender
Sender: Data (len 5) Seq = 10 through Attacker points to Receiver: Ack = 15 which through Attacker points to Sender: Data (len 20) Seq = 15 which through Attacker points to Receiver: Ack = 35 which points to Sender. Data (len 30) Seq = 35 points to receiver: X. Data (len 100) Seq = 35 points to Ack = 135 through Hijack. Ack = 135 points to Data (len 25) Seq = 135 which points toward Receiver. The bottom of Data (len 25) Seq = 135 shows Reset that points toward Sender.
Thus, with a session hijack attack, an attacker can slide into an ongoing communication stream without being obvious to either of the two original parties; the communication continues with the attacker substituting for the original sender, while that sender is stopped. Because momentary loss of connection occurs for many benign reasons, users tend not to suspect an attack in this situation; the session is often reestablished by the network protocol handlers without the user’s knowledge.
The attacker simply blends into the communications stream, taking over the interaction from the original sender. The attack succeeds because the attacker can see and manipulate the TCP and IP headers, but of course these need to be visible throughout the network because they are what allows traffic to be delivered. We show in the next section, however, a way to protect against hijacking, both by concealing connecting data within the application and by hiding the header data.
DNS Cache Poisoning
The DNS cache poisoning attack is a way to subvert the addressing to cause a DNS server to redirect clients to a specified address. A conceptually simple DNS poisoning attack is to forge a message to a DNS registrar, requesting that the server for a particular domain name be changed from one address to another. These requests occur normally when a website is moved from one hosting provider to another or when an organization changes its address structure. However, a malicious attacker can use a DNS change request to redirect traffic intended for a particular domain name. Because of strong authentication requirements, registrars seldom succumb to such a forgery.
A more likely attack is to use the DNS protocol messages by which all internet name servers coordinate their address translations. Researcher Dan Kaminsky [ KAM08 ] expanded on some previously known methods to poison the DNS cache. The DNS protocol is complex, but you do not need to understand the details to appreciate this attack.
A client requiring the address corresponding to a domain name sends a query to its local DNS name server. If that server does not have the answer, it forwards the query to a root name server; the query is forwarded to more-specific name servers until one replies authoritatively with the address. That address is propagated through the chain of servers involved in resolving the query and eventually back to the client. The servers along the way cache the response so that they can respond directly to future queries for the same address.
Kaminsky noticed a flaw in this progression: namely, that these queries remain open until answered and that a response matching the ID number for the query will be cached. If an attacker can guess the sequence of query ID numbers, the attacker can forge a response that satisfies an open query’s ID; that forged reply can provide any address as a response. Until the response is removed from the cache, all traffic for the requested address will be directed to the address given in the forged reply. Thus, by predicting sequence numbers correctly and generating network traffic to a specific name server, the attacker can redirect traffic silently to a selected address.
In cache poisoning an incorrect name-to-address DNS conversion is placed in and remains in a translation cache.
This example shows the vulnerability of predictable sequence numbers. A countermeasure for this type of attack is an unpredictable series of sequence numbers, preferably drawn from a large range of possibilities.
For years, the internet governing bodies have been working to implement a protection against such replay and hijack attacks. This objective is addressed with DNSSEC , the DNS security extension (RFC 4033 [ ARE05 ]) that uses signed certificates of the sort defined in Chapter 2 . In June 2010, the first root DNS server was assigned a private key for signing DNS records; other root servers were soon assigned keys. Every DNS record at the root level is signed and published, along with the root administrator's public key, in the DNS itself.
Exploiting Known Vulnerabilities
Assailants have no shortage of tools with which to begin an attack. Hacker tools often begin with a known vulnerability, sometimes a well-known one for which a patch has long been available; people have a habit of failing to apply patches to older systems or ones in remote locations. Failure to patch systems is becoming a serious problem because of the time between publicity concerning a vulnerability and its first exploitation. Symantec [ SYM10 ] reported that in 2009, the window between disclosure and exploitation was less than one day on average for the 28 vulnerabilities Microsoft patched in Internet Explorer; exploits emerged on average two days after the vulnerability was made known. The window between the day a patch is available and the day the vulnerability is first exploited is very short indeed. As explained in Chapter 3 , a zero-day exploit is one for which an exploitation occurs before the vulnerability is publicly known and hence before a patch is available. In 2009, Symantec identified 12 zero-day exploits. By 2021, 83 zero-day exploits were discovered, according to security technology provider Eclypses [ ECL21 ].
Some attack tools, such as RUDeadYet and EvilGrade, check for many vulnerabilities. Trojan horses, viruses, and other kinds of malware can form a base for a DoS attack. One popular but especially effective attack toolkit is Zeus, which costs less than US$700 but also circulates for free in the hacker underground. Security firm Symantec has documented over 90,000 variants of Zeus [ SYM10 ]. In tools such as these, denial of service is sometimes a by-product; the tool exploits a vulnerability that ultimately causes a system crash, thus denying service, or at least disrupting it. As we describe later in this chapter, exploiting a vulnerability is often a first step in an attacker’s commandeering control of a computer that is then conscripted into the attacker’s army.
Physical Disconnection
Finally, we consider the last of our causes of denial of service: physical failures. A network consists of appliances, connectors, and transmission media, any of which can fail. A broken cable, faulty circuit board, or malfunctioning switch or router can cause a denial of service just as harmful as a hacker attack. And just like an attacker who strikes without warning and often without obvious cause, hardware failures are unanticipated.
Transmission Failure
Communications fail for many reasons. For instance, a line is cut. Or network noise makes a packet unrecognizable or undeliverable. A machine along the transmission path fails for hardware or software reasons. A device is removed from service for repair or testing. A device is saturated and rejects incoming data until it can clear its overload. Many of these problems are temporary or automatically fixed (circumvented) in major networks, including the internet.
However, some failures cannot be easily repaired. A break in the single communications line to your computer (for example, from the network to your network interface card or the service provider to your subnet’s router) can be fixed only by establishment of an alternative link or repair of the damaged one. The network administrator will say “service to the rest of the network was unaffected,” but that is of little consolation to you.
Component Failure
Components, for example, routers, circuit boards, firewalls, monitoring devices, storage devices, and switches, fail for unidentified reasons. Age, factory flaws, power surges, heat, and tampering can affect hardware. A network is often a fragile chain of components, all of which are necessary to keep the network in operation. In the worst case, the failure of any component causes the entire network to fail. In Sidebar 6-18 we describe how the failure of one or two circuit boards affected the State of Virginia.
Sidebar 6-18 State of Virginia Halted Because of IT Failure
On 25 August 2010, computer services for 26 of the 89 agencies of the State of Virginia failed, affecting 13% of the state’s file servers. State agencies could not access data needed to serve customers. Perhaps most noticeably affected was the state’s Department of Motor Vehicles, which could not issue driver licenses or identification cards. The State Department of Taxation and State Board of Elections were also severely affected, being without access to databases for almost a week; other state agencies were affected for up to three days. During the outage, the Department of Taxation could not access taxpayers’ accounts, the state could not issue unemployment checks, and welfare benefits were paid only because of heroic effort by employees working nonstop over a weekend.
The cause of the loss of service was ultimately found to be a failed hardware component, specifically an EMC storage area network (SAN) device. Ironically, that hardware is intended to improve reliability of data storage by supporting redundancy and common backup and allowing data to be aggregated from a variety of different kinds of storage devices. Within the SAN two circuit boards failed, leading to the widespread loss of access; one board was found to be defective, and when it was replaced, the storage network failed so catastrophically that the entire system had to be shut down for over two days. The manufacturer said such a massive failure was unprecedented and the technology had a reliability rate of 99.999% [ NIX10 ].
When the hardware was working again, state officials and technicians from Northrop Grumman, the state’s contractor running the entire system, found that major databases had been corrupted, making the only course of action to rebuild the databases from backup copies on tape. Most recently entered data—representing 3% of the databases—was irretrievably lost [ SOM10 ].
Not every denial-of-service problem is the result of a malicious attack, but the consequences of denial of service can be equally severe from malicious or nonmalicious causes.
Hardware failures are almost always natural occurrences, unless the direct result of sabotage or malicious damage. Although induced hardware breakdowns are uncommon, they are not impossible. For example, the Stuxnet worm previously described in Sidebar 6-8 could exercise mechanical equipment to the point of failure.
We have considered what might be called individual DoS attacks, actions that disable a single host or deny service to a single address or network segment. Such a situation is regrettable for the affected host or addresses. Although that kind of harm can incapacitate an ordinary user, large installations such as companies or major government facilities are unfazed because they have great capacity and resiliency. However, the more serious reason to study these attacks is that they can be used as repeatable components in a much larger attack that can and does severely affect major users. In the next section we study these distributed DoS attacks.
Denial-of-service attacks pit one adversary against one target; a well-resourced target can usually outlast a less equipped attacker.
6.5 Distributed Denial of Service
The DoS attacks we just described are powerful by themselves, and Sidebar 6-19 shows us that many are launched. But an assailant can construct a two-stage attack that multiplies the effect many times. This multiplicative effect gives power to distributed denial of service.
Distributed denial-of-service attacks change the balance between adversary and victim by marshalling many forces on the attack side.
Sidebar 6-19 Denial of Service: Change Over Time
How much DoS activity is there? As with most computer security incidents, reliable, representative statistics are hard to obtain because there is no central data collection, sampling approaches vary so there is little way to compare values, and no one knows the population the results describe. Some results on denial of service from the early 2000s to the early 2020s do show an indisputable change, however.
Researchers at the University of California, San Diego (UCSD) studied the amount of DoS activity on the internet [ UCS01 ]. Because many DoS attacks use a fictitious return address, the researchers asserted that traffic to nonexistent addresses indicated the amount of DoS attacking. They monitored a large, unused address space on the internet for a period of three weeks in 2001. Their discoveries:
-
More than 12,000 attacks were aimed at more than 5,000 targets during the three-week period.
-
SYN floods apparently accounted for more than half of the attacks.
-
Half the attacks lasted less than 10 minutes, and 90% of attacks lasted less than an hour.
Steve Gibson of Gibson Research Corporation experienced several DoS attacks in mid-2001. He collected data for his own forensic purposes [ GIB01 ]. As reported in the Register 30 May 2001, the first attack lasted 17 hours, at which point he managed to reconfigure the router connecting him to the internet so as to block the attack. During those 17 hours he found his site was attacked by 474 Windows-based PCs. A later attack lasted 6.5 hours before it stopped by itself. These attacks were later found to have been launched by a 13-year-old from Kenosha, Wisconsin.
Two decades later things had changed considerably. In 2017 (not reported until 2020), Google cloud services suffered an attack of 2.54 terabytes per second (Tbps). (A terabyte is over a trillion bytes, 2 40 or 1024 4 .) In November 2021, the Microsoft security team reported its Azure denial-of-service protection platform successfully mitigated an attack of 3.47 Tbps. In 2021, network and security management firm F5 reported that most DoS attacks were against the infrastructure, that is, the capacity of targets’ network connectivity. More worrisome, however, F5 reported that most DoS attacks it examined consisted of two or more attack vectors, exploiting several weaknesses at once. Multi-vector attacks also require the victim to respond in several ways at once.
IT Security News reported that, in 2021, 94% of DoS attacks lasted less than 4 hours, but one attack lasted a record-setting 329 hours or 13.7 days.
Denial-of-service attacks are also starting to target specific network activity. A classic DoS attack attempts to consume the entire bandwidth of a link, but recent attacks target firewalls, DNS servers, the infrastructure for VoIP services, load balancers, and the like. Because these services entail computation, they are slower and are overwhelmed by a smaller volume of traffic than a simple bandwidth exhaustion attack.
To mount a distributed denial-of-service (or DDoS ) attack, an attacker does two things, as illustrated in Figure 6-34 . In the first stage, the attacker wants to conscript an army of compromised machines to attack a victim. Using any convenient attack (such as exploiting a buffer overflow or tricking the user to open and install unknown code from an email attachment), the mastermind plants a Trojan horse on a remote machine. That Trojan horse does not necessarily cause any obvious harm to the infected machine; in fact, the machine needs to remain healthy (and infected) so it can participate in the attack against the real victim. The foreign code file may be named for a popular editor or utility, bound to a standard operating system service, or entered into the list of processes (daemons) activated at startup. No matter how it is situated within the system, it will probably not attract any attention.
FIGURE 6-34 Distributed Denial-of-Service Attack
n illustration shows a person using a desktop and there is a Trojan horse connected to the desktop. 1. Attacker plants Trojan horse in zombie. The desktop is linked to seven desktops with Trojan horses. The central desktop is linked to another desktop with Trojan horses and arrows pointing from it in all directions. This desktop leads to the victim's desktop. The sixth and the seventh desktops are linked to the victim's desktop; 2. Zombies attack victims simultaneously on command.
The attacker repeats this process with many target computers. Each of these compromised systems then becomes what is known as a zombie or bot (hackerese for robot). The target systems’ users carry out their normal work, unaware of the resident zombie. Many current vulnerability attacks download code to the compromised machine to turn it into a zombie.
At some point the attacker chooses a victim and sends a signal to the zombies to launch the attack. Then, instead of the victim’s trying to defend against a DoS attack from one malicious host, the victim must try to counter attacks from many zombies all acting at once. Not all the zombies need to use the same attack; for instance, some could use smurf attacks, and others could use SYN floods to address different potential weaknesses.
Scripted Denial-of-Service Attacks
In addition to their tremendous multiplying effect, DDoS attacks are a serious problem because they are easily launched from scripts. Given a collection of DoS attacks and a propagation method, one can easily write a procedure to plant a Trojan horse that can launch any or all of the DoS attacks. DDoS attack tools first appeared in mid-1999. Some of the original DDoS tools include Tribal Flood Network (TFN), Trin00, and TFN2K (Tribal Flood Network, year 2000 edition). As new vulnerabilities that allow Trojan horses to be planted are discovered and as new DoS attacks are found, new combination tools appear. For more details on this topic, see [ HAN00 ].
According to the U.S. Computer Emergency Response Team [ HOU01 ], scanning to find a vulnerable host (potential zombie) is included in combination tools; a single tool identifies its zombie, installs the Trojan horse, and activates the zombie to wait for an attack signal. Symantec [ SYM10 ] confirms that exploit packs include code to turn a compromised system into a zombie. Target (zombie) selection seems to be random, meaning that attackers do not seem to care which zombies they infect. This revelation is actually bad news because it means that no organization or accessible host is safe from attack. Perhaps because they are so numerous and because their users are assumed to be less knowledgeable about computer management and protection, Windows-based machines are becoming more popular targets for attack than other systems. Most frightening is the finding we have already presented that the time is shrinking between discovery of a vulnerability and its widespread exploitation.
Compromised zombies to augment an attack are located by scanning random computers for unpatched vulnerabilities.
Sidebar 6-20 describes an example of an attacker with greater firepower. The battle was not one-on-one but many-against-one: The attacker called on an army of agents to attack at once from all directions. The attacks encountered in the sidebar occurred just as the attack community was advancing to a new mode of attack. The investigator understood ordinary DoS attacks; what he didn’t understand at first was a DDoS attack, in which the impact is multiplied by the force of many attackers.
Sidebar 6-20 Attacked by an Army
Barrett Lyon was a college dropout hacker turned computer consultant who had phenomenal focus and technical savvy. For helping one client expand and stabilize a web application network, he got referrals that led to more referrals.
The online betting firm Betcris had been plagued with occasional attacks that overwhelmed its website for up to a day. During these periods no bettors could place bets, and Betcris lost as much as US$5 million of business in a day. During Spring 2003, the head of Betcris got an email message from an anonymous hacker warning that Betcris would be subjected to a DoS attack unless it paid the attacker US$500. After paying, the manager of Betcris asked colleagues for referrals and contacted Lyon for advice. Lyon recommended buying some hardware devices designed for repelling such attacks; the manager of Betcris installed them and felt safe for the future.
In late November Betcris got another demand: An email message announced “Your site is under attack” and demanded US$40,000 to leave Betcris alone for a year. Thinking the solution Lyon had recommended was adequate, the manager of Betcris ignored the demand.
A massive DoS attack overwhelmed the special-purpose machines in ten minutes, causing the Betcris site to crash; the attack also overwhelmed Betcris’s ISP, which dropped Betcris as a client to save its other customers. As the attack progressed, the demands progressed to US$60,000 and ultimately US$1 million. During this time Lyon realized this was no ordinary DoS attack launched from a few machines, but one involving hundreds, perhaps thousands, more.
Lyon knew the attacks had to have some similarity. He looked for close IP addresses so he could block an entire range, but found few. Some attacks went after routers while others seemed like normal customers. Lyon quickly wrote code to block things he could and bought equipment to become an ISP himself to serve Betcris. Meanwhile, the attacker went after business neighbors of Betcris in the online gambling community, as well as Betcris’s former ISPs. After several days of back-and-forth combat, Lyon won: The Betcris website was back up, stable, and performance was normal.
All told, the battle cost about US$1 million to mitigate, just what the attacker had wanted as extortion. In the combat, Lyon learned a lot about a new form of attack just emerging in 2003, the DDoS attack [ MEN10 ].
Bots
When force is required, call in the army. In this situation, the army to which we refer is a network of compromised machines ready, willing, and able to assist with the attack. Unlike real soldiers, however, neither the machines nor their owners are aware they are part of an attack.
Zombies are machines running pieces of malicious code under remote control. These code objects are Trojan horses that are distributed to large numbers of victims’ machines. Because they may not interfere with or harm a user’s computer (other than consuming computing and network resources), they are often undetected.
Botnets
Botnets , networks of bots, are used for massive DoS attacks, implemented from many sites working in parallel against a victim. They are also used for spam and other bulk email attacks, in which an extremely large volume of email from any one point might be blocked by the sending service provider. An example of a botnet operation is described in Sidebar 6-21 .
Sidebar 6-21 Botnet Operation and Takedown
The Koobface bot network generated over US $2 million from June 2009 to June 2010 by selling fake antivirus code (as described in Chapter 4 .) Koobface (which is an anagram of the name Facebook) consists of compromised systems, many of which were infected through Facebook connections. Once a machine became infected, it would send its user’s Facebook friends messages advising them of (fake) antivirus code to buy and install, thereby expanding the botnet through the social network. It would also become a host of pay-per-click and pay-per-install pages.
Security researcher Nart Villeneuve [ VIL10 ] studied the Koobface command and control structure. It used the pull model of operation, in which individual bots periodically contact the command server to look for more work. The command server would convert some of the bots into proxies that other bots would contact, so few bots—only the proxies—had the address of the real server. The command server also had the IP addresses of most antivirus manufacturers and commercial security research firms, and it would block any connection from those addresses to thwart researchers’ attempts to interact with the server.
Villeneuve describes the difficulties of investigating Koobface with the intention of criminal prosecution. Botnets tend to be multinational entities with pieces in many countries, thus complicating prosecution because of different laws, standards of evidence, investigative practices, and judicial structures. The key elements of botnets use crime-friendly hosting services that protect their clients from abuse complaints and takedown requests. Thus, both law enforcement officials and network security administrators have difficulty taking action against major botnets.
In this instance, Villeneuve and his colleagues at the Toronto-based security firm SecDev worked with British ISP Coreix and others to take down three of Koobface’s main command and control servers in November 2010. Villeneuve infiltrated one of those servers by monitoring its messaging to four phone numbers in Moscow.
Even if this action does not completely disable Koobface, it certainly slows the operation. Furthermore, the analysis revealed other servers that experts can monitor to see where else Koobface’s handlers try to establish bases.
Botnet Command and Control Update
Just like a conventional army, a network of bots requires a command hierarchy; the bots require officers to tell them when to attack, against whom, and with what weapon. The bot headquarters is called a command and control center . The basic structure of such an army is shown in Figure 6-35 . The mastermind wants to be isolated from the actual configuration to reduce the likelihood of detection. Also, in case part of the army is isolated and taken down, the attacker wants redundancy to be able to regroup, so the attacker builds in redundancy. The attacker controls one or more master controllers that establish command and control centers.
FIGURE 6-35 Botnet Command and Control Structure
The illustration shows two attackers. The first attacker is linked to three Masters. The second attacker is linked to the third Master. The first Master is linked to the first and second C and C. The second master is also linked to the first and second C and C. The third Master is linked to the third C and C. The first C and C is linked to the first and the second Bots. The second C and C is linked to the first, second, and third Bots. The third C and C is linked to the fourth, fifth, and sixth. The bottom of the Bots read, Victim.
A botnet command and control center instructs specific machines to target a particular victim at a given time and duration.
Command and control centers control the individual bots, telling them when to start and stop an attack against which victim. Communication from the command and control center to the bots can be either pushed , with the center sending instructions to the bots, or pulled , with each bot responsible for periodically calling home to a controller to determine whether there is work to do. To avoid detection, masters change command and control centers often, for which the push model is more effective since the individual bots do not have to be informed of the address of the new command and control computer.
Bots coordinate with each other and with their master through ordinary network channels, such as Internet Relay Chat (IRC) channels, peer-to-peer networking (which has been used for sharing music over the internet), or other network protocols (including HTTP). Structured as a loosely coordinated web, a botnet is not subject to failure of any one bot or group of bots, and with multiple channels for communication and coordination, they are highly resilient. All this command and control activity has to be performed stealthily so as not to arouse network administrators’ attention or be disabled, as described in Sidebar 6-22 .
Sidebar 6-22 Command and Control Stealth
Conficker, introduced in Chapter 3 , is an especially crafty piece of malware that has infected millions of machines since its first appearance late in 2008. It relies on a typical bot network with command and control servers, but its use of stealth techniques and encryption to protect its network is sophisticated.
The command and control site uses 512-bit key RSA encryption and an MD4 hash to sign code being downloaded to the compromised machine. The machine verifies the signature; if the signature does not match, the machine discards the download. Each Conficker host uses the current date as a seed to generate a list of random domain names, called rendezvous points, which it then polls to try to find commands. In this way the command and control servers move every day, and analysts cannot predict to what addresses the servers will move, which means the analysts cannot block access to those addresses in advance.
That is, until Phillip Porras and his team analyzed Conficker [ POR09 ]: They broke Conficker’s code and determined the list of addresses in advance. Blocking those addresses effectively halted Conficker’s progress. Except that on 15 March 2009, one site name was mistakenly not blocked, and Conficker bots were again able to contact the command server for an update. That update, unfortunately, gave Conficker a new life.
The updated Conficker randomly selected 500 domain names, but appended to the name was one of 116 suffixes or top-level domains, like .com, .edu, .org, as well as country codes such as .us, .fr, .cz, .br, .ru. These country code domain suffixes are under control of individual countries, so getting permission to close down one of those domains is administratively more difficult than a .com address. It seems, however, as if those domain names were a red herring to delude and perhaps occupy analysts.
Shortly after the 15 March 2009 code update, Conficker entirely changed its model for code updates: Instead of each bot fetching its updates from a central command and control server, the bots communicated updates among themselves by a peer-to-peer networking strategy. Finding which of millions of communicating Conficker bots have the latest code release is a hopeless task for researchers.
The version that appeared in late December 2008 used a new hash function, MD6, that had just been published on Ron Rivest’s M.I.T. website in October 2008, as a candidate for the U.S. National Institute of Standards and Technology new secure-hash standard. Thus, in roughly two months’ time, Conficker’s authors noticed this new algorithm’s publication and incorporated it into the evolving development of Conficker. Even when analysts can reverse-engineer the code to determine how it operates, they cannot craft a so-called inoculation package, modified code that would cause systems infected by Conficker to remove the infection, because they cannot make the code have the correct cryptographic checksum.
Since 2008, three more major versions have appeared. The authors of Conficker have been resilient and resourceful, countering various attempts to exterminate it. Its primary objective seems to have been staying power, remaining active so it can propagate and spread its payload. Its latest version (E) carries the Waladec spam bot and an antivirus scareware agent.
Estimates of the number of machines Conficker infected range from 9 to 15 million. In 2009, Microsoft released a patch for the vulnerability Conficker exploits and covered Conficker removal in its regular Malicious Software Removal Tool security update. Thus, users who regularly applied updates should have removed traces of the infection. Although the number of infected machines was down to 1.7 million in 2010, it remained at 500,000 as late as 2017. As with biological viruses, eradication is almost impossible if a significant group of vulnerable systems is unprotected. But as more machines become protected, herd immunity acts to limit the spread.
Rent-A-Bot
People who infect machines to turn them into bots are called botmasters . A botmaster may own (in the sense of control) hundreds or thousands of bots. Because the infected machines belong to unsuspecting users who do use them for real computing, these bots are not always available. Sometimes the real owners turn off their machines, disconnect them from the internet, or use them so intensively that little capacity is left to serve as a bot. Much of the time, however, these machines are quiet, readily available for malicious work.
A botmaster often has two uses for the botnet: First, the botnet should be available for attacks when the botmaster wants to go after a victim. As noted in a previous sidebar in this chapter, attacks can go on for hours. However, DoS activity tends to be targeted, not random, so one botmaster is unlikely to have an unlimited number of victims against which to direct the bots. Thus, to bring in a little income, botmasters also sometimes rent out their botnets to others. Researcher Dancho Danchev [ DAN13 ] reported that in 2013, a botnet of 1,000 hosts could be rented for US$25–$120, or US$200–$500 for 10,000 hosts for 24 hours.
Botnet operators make money by renting compromised hosts for distributed denial of service or other activity. The rent is mostly profit.
Opt-In Botnets
Have a favorite cause? Want to protest against [name your outrage] but fear your lone voice will not be heard? Join with a group of like-minded individuals to launch a DDoS attack against the outrage.
Yes, there are now postings for affinity groups to join together in protest. You download and install an attack script and show up at 11:00 am (GMT) Tuesday to protest by pointing your attacking computer at x .com. Join in when you want, drop out when you (or your computer) are tired. Join the movement! The only thing lacking is the pizza party after the demonstration. Sorry, you will have to buy your own.
Malicious Autonomous Mobile Agents
Bots belong to a class of code known more generally as malicious autonomous mobile agents . Working largely on their own, these programs can infect computers anywhere they can access, causing denial of service as well as other kinds of harm. Of course, code does not develop, appear, or mutate on its own; there has to be a developer involved initially to set up the process and, usually, to establish a scheme for updates. Such an agent is sometimes called an inoculation agent .
As bots or agents execute and acquire updates, not every agent will be updated at once. One agent may be on a system that is powered off, another on a system that currently has no external network connectivity, and still another may be running in a constrained resource domain. Thus, as agents run in and out of contact with their update servers, some will be up to date and others will be running older code versions. The problem of coordinating an army of disparate agents is an active research topic, based on the Byzantine generals problem [ LAM82 ].
Autonomous Mobile Protective Agents
Suppose a security engineer decodes the logic of an agent; the engineer might then enlist the agent to fight for the good guys by modifying it to look normal to its siblings but in fact to spread a counterinfection. So, for example, a modified agent might look for other hostile agents and pass them an “update” that in fact disables them.
This concept is not as far-fetched as it sounds. In the same way that attackers have developed networks for harm, security researchers have postulated how good agents could help heal after a malicious code infection.
A German teenager, Sven Jaschen, wrote and released a worm called NetSky in February 2004. He claimed his intention was to remove infections of the widespread MyDoom and Bagle worms from infected computers by closing the vulnerabilities those worms exploit. NetSky spread by email. However, Jaschen soon became engaged in a battle with the creators of Bagle and MyDoom, who produced better versions of their code, which led to new versions of NetSky, and so on, for a total of 30 separate strains of NetSky. According to one security expert, Mikko Hypponen of f-Secure, NetSky was more effective at reducing the flow of spam than anything that had happened in the U.S. Congress or courts. Unfortunately, it also consumed large amounts of system resources and bombarded numerous commercial clients with email. Later versions of the worm launched DoS attacks against places Jaschen disliked. Two years after the virus’s release, it was still the most prevalent virus infection worldwide, according to security firm Sophos [ SOP04 ].
Two months after releasing NetSky, on his 18th birthday, Jaschen wrote and released a highly destructive internet-based virus named Sasser that forced computers to reboot constantly. He was arrested by German authorities, convicted, and sentenced to a 31-month suspended sentence and 3 years’ probation.
Coping with Distributed Denial-of-Service Attacks
DDoS attacks are not hard to prevent, at least in theory. Most bots are conscripted using well-known vulnerabilities, for which patches have been distributed for some time. Thus, if the entire world would just install patches in a timely manner, the DDoS threat would diminish. Some computer users, however, do not have legal copies of their operating systems and other software, so they cannot subscribe for and obtain patches through the manufacturers’ chains. Computer software is one of a small number of commodities, including illegal firearms and illicit drugs, in which the black market also affects legitimate consumers. DDoS attacks involve some talented programmers and analysts in a lucrative game of crafting intricate shields around creaky old mundane flaws. Until we eradicate the flaws, nothing around them will improve. That is the point where theory meets practice.
Bots are co-opted by an agent who exploits a vulnerability, typically one already known. Vulnerable machines can be discovered by scanning.
Administrators can address ordinary DoS attacks by means of techniques such as tuning (adjusting the number of active servers), load balancing (evening the computing load across available servers), shunning (reducing service given to traffic from certain address ranges), and blacklisting (rejecting connections from certain addresses). These same techniques are used against DDoS attacks, applied on a larger scale and at the network perimeter. So far most DDoS attacks seem to have been to make a statement or focus attention, so after they go on for a while, the attacker concludes the point has been made and halts. Some attacks, such as the one described earlier in Sidebar 6-20 , aim to extort money from the victims; as with other kinds of extortion attacks, paying the bribe may not stop the attack.
This discussion of denial of service concludes our examination of the threats to which networked computing is vulnerable. Denial of service is a distinctive problem and requires its own countermeasures. Other network attacks involving interception and modification employ more well-known controls.
This attack is also the final piece in our analysis of security threats and vulnerabilities to computer networks. This part has touched all three elements of the C-I-A triad, with eavesdropping and masquerading (attacks on confidentiality), data corruption and replay (integrity), and denial of service (availability). The section on WiFi networking showed vulnerabilities that can lead to failures of each of the three. That section also demonstrated that even carefully developed standards can exhibit serious security flaws.
You may have concluded at this point that the number, breadth, and severity of network security threats and vulnerabilities make a hopeless situation: Coping with all the problems is impossible. Keep in mind that Part I of this chapter raises threats, whereas the upcoming Part II shows the defender’s arsenal of countermeasures. Do not despair; reinforcements are available.
However, your concern is well placed. As in many other aspects of security, offense and defense play a cat-and-mouse game: The offensive side creates a new attack (which might be a variation on an old attack), to which the defense responds. Defense often plays a catch-up game, meaning that many defensive actions respond to offensive moves. Fortunately, researchers and developers continue to seek new ways to thwart attackers.
We now investigate safeguards for computer networks.
Part II—Strategic Defenses: Security Countermeasures
In the rest of this chapter we consider three categories of controls: First, as you can well imagine, the familiar control of encryption is a strong tool for preserving both confidentiality and integrity in networks. We describe architecturally how encryption can be used and then introduce two specific applications of cryptography to networking: encrypted communication between a browser and its websites, called SSL encryption, and encrypted links within a network, called a virtual private network or VPN. Then we introduce a network-protection tool called a firewall, which is really just an instantiation of the familiar reference monitor. We end the chapter with another device, called an intrusion detection or protection system, that monitors network traffic to identify and counter specific malicious network threats.
6.6 Cryptography in Network Security
Recall from Chapter 2 that there are two broad classes of encryption: symmetric (secret key) and asymmetric (public key) systems. The first of those is the cryptographic workhorse, used for bulk encryption of large quantities of data. That description perfectly fits network traffic, and that is exactly how it is used. The second class of cryptographic algorithms excels at establishing a trustworthy relationship between two parties who may not previously have had one, which also applies naturally in a networking situation. In this section we describe how those two approaches can provide security strength in a network.
Network Encryption
Encryption is probably the most important and versatile tool for a network security expert. We have seen in earlier chapters that encryption is powerful for providing privacy, authenticity, integrity, and separation. Because networks involve even greater risks, they often secure data with encryption, perhaps in combination with other controls.
Before we begin to study the use of encryption to counter network security threats, let us consider four points.
-
Encryption protects only what is encrypted (which should be obvious but isn’t always). Recognize that data are exposed between a user’s fingertips and the encryption process before they are transmitted, and they are exposed again once they have been decrypted on the remote end. The best encryption cannot protect against a malicious Trojan horse that intercepts data before the point of encryption.
-
Designing encryption algorithms is best left to professionals. Cryptography is filled with subtlety, and a seemingly minor change can have a severe impact on security.
-
Encryption is no more secure than its key management. If an attacker can guess or deduce a weak encryption key, the game is over.
-
Encryption is not a panacea or silver bullet. A flawed system design with encryption is still a flawed system design. People who do not understand encryption sometimes mistake it for fairy dust to sprinkle on a system for magical protection. This book would not be needed if such fairy dust existed.
In network applications, encryption can be applied either between two hosts (called link encryption) or between two applications (called end-to-end encryption). We consider both below. With either form of encryption, key distribution is always a problem. Encryption keys must be delivered to the sender and receiver in a secure manner. In a later section of this chapter, we also investigate techniques for safe key distribution in networks. Finally, we study a cryptographic facility for a network computing environment.
Modes of Network Encryption
Encryption can be employed in a network through two general modes: link and end-to-end. They perform different functions and have different strengths and weaknesses. And they can even be used together, even if doing so leads to redundancy.
Link Encryption
In link encryption , data are encrypted just before the system places them on the physical communications link. In this case, encryption occurs at layer 1 or 2 in the OSI model. (Remember that the OSI model is merely conceptual. A similar situation occurs with actual protocols of the TCP/IP suites, which have a similar but shorter layered structure.) Similarly, decryption occurs just as the communication arrives at and enters the receiving computer. A model of link encryption is shown in Figure 6-36 . As you can see, the data travel in plaintext through the top layers of the model until they are encrypted just prior to transmission, at level 1. Addressing occurs at level 3. Thus, in the intermediate node, the encryption must be removed to determine where next to forward the data, and so the content is exposed.
FIGURE 6-36 Model of Link Encryption
Sender: There are seven Ms in a column, numbered 7 through 1 from the top; the M numbered 1 is shaded. A down arrow passes beside the column and the corresponding 1 on the arrow is shaded. The sender leads to the Intermediate node through a shaded, arrow. The first column shows three Ms, numbered 3 through 1 from the top. An up arrow passes beside the first column and the corresponding 1 on the arrow is shaded. The second column shows three Ms, numbered 3 through 1 from the top. A down arrow passes beside the second column and the corresponding 1 on the arrow is shaded. The Ms that are numbered 1 are shaded in both columns. The intermediate node leads to Receiver through a shaded, arrow. There are seven Ms in a column, numbered 7 through 1 from the top; the M numbered 1 is shaded. An up arrow passes beside the column and the corresponding 1 on the arrow is shaded. Shaded Ms are Encrypted, and non-shaded Ms are plaintext.
Link encryption covers a communication from one node to the next on the path to the destination.
Encryption protects the message in transit between two computers, but the message is in plaintext inside the hosts. (A message in plaintext is said to be “in the clear.”) Notice that because the encryption is added at the bottom protocol layer, the message is exposed in all other layers of the sender and receiver. If we have good physical security and we trust the software that implements the upper-layer functions, we may not be too concerned about this potential vulnerability. But that message is open to access in two layers of all intermediate hosts through which the message may pass. The message is in the clear in the intermediate hosts, and one of these hosts may not be especially trustworthy. We will deal with that vulnerability shortly.
Link encryption is invisible to the user. The encryption becomes a transmission service performed by a low-level network protocol layer, just like message routing or transmission error detection. Figure 6-37 shows a typical link-encrypted message, with the shaded fields encrypted. Because some of the data link header and trailer is applied before the block is encrypted, part of each of those blocks is shaded. As the message M is handled at each layer, header and control information is added on the sending side and removed on the receiving side. Hardware encryption devices operate quickly and reliably; in this case, link encryption is invisible to the operating system as well as to the operator.
FIGURE 6-37 Link Encryption
A row of seven boxes are labeled, H1, H2, H3, M, T3, T2, and T1. H2, H3, M, T3, and T2 are shaded, and M is the longest box. The shaded M is Encrypted.
Link encryption is especially appropriate when the transmission line is the point of greatest vulnerability. Think of a communication that travels from one city to another, exposed between the two. If all hosts on a network are reasonably secure but the communications medium is shared with other users or is not secure, link encryption is an easy control to use.
End-to-End Encryption
As its name implies, end-to-end encryption provides security from one end of a transmission to the other. The encryption can be applied between a user and a host by a hardware device. Alternatively, the encryption can be done by software running on the host computer. In either case, the encryption is performed at the highest levels, usually by an application at OSI level 7, but sometimes 5 or 6. A model of end-to-end encryption is shown in Figure 6-38 .
FIGURE 6-38 Application-Level (End-to-End) Encryption
Sender: There are seven Ms in a column, numbered 7 through 1 from the top; all Ms are shaded. A shaded down arrow passes beside the column. Sender leads to the Intermediate node through a shaded arrow. The first column shows three Ms, numbered 3 through 1 from the top; all Ms are shaded. A shaded, up arrow passes beside the first column. The second column shows three Ms, numbered 3 through 1 from the top; all Ms are shaded. A shaded, down arrow passes beside the second column. The intermediate node leads to Receiver through a shaded arrow. There are seven Ms in a column, numbered 7 through 1 from the top; all Ms are shaded. A shaded, up arrow passes beside the column. Shaded Ms are Encrypted, and non-shaded Ms are plaintext.
Because the encryption precedes all the routing and transmission processing of the layer, the message is transmitted in encrypted form throughout the network. Of course, only the data portion of the message is protected, but often the headers are not as sensitive as the data. End-to-end encryption addresses potential flaws in lower layers in the transfer model. If a lower layer should fail to preserve security and reveal data it has received, the data’s confidentiality is not endangered. Think, for example, of a super-secret project being run within a company. Although communication within the company is normally protected against outsiders, this project should be protected even from unauthorized access within the company. Thus, end-to-end encryption is used to ensure that only a select group of recipients know about the project. Figure 6-39 shows a typical message with end-to-end encryption, again with the encrypted field shaded.
FIGURE 6-39 End-to-End Encryption
A row of seven boxes are labeled, H1, H2, H3, M, T3, T2; M is shaded, and M is the longest box. The shaded M is Encrypted.
End-to-end encryption covers a communication from origin to destination.
When end-to-end encryption is used, messages sent through several hosts are protected. The data content of the message is still encrypted, as shown in Figure 6-40 , and the message is encrypted (protected against disclosure) while in transit. Therefore, even though a message must pass through potentially insecure nodes (such as C through F) on the path between A and B, the message is protected against disclosure while in transit.
FIGURE 6-40 Message Protected in Transit
A message is protected and transited from A to C, C to D, D to E, E to F, and F to B.
Comparison of Encryption Methods
Simply encrypting a message is not absolute assurance that it will not be revealed during or after transmission. In many instances, however, the strength of encryption is adequate protection, considering the likelihood of the interceptor’s breaking the encryption and the timeliness of the message. As with many aspects of security, we must balance the strength of protection with the likelihood of attack.
With link mode encryption, all transmissions are protected along a particular link. Typically, a given host has only one link into a network, meaning that all network traffic initiated on that host will be encrypted for that host. But this encryption scheme implies that every other host receiving these communications must also be able to decrypt the messages. Furthermore, all hosts must share keys. A message may pass through one or more intermediate hosts on the way to its final destination. If the message is encrypted along some links of a network but not others, then part of the advantage of encryption is lost. Therefore, link encryption is usually performed on all links of a network if it is performed at all.
By contrast, end-to-end encryption is applied to “logical links,” which are virtual channels between two processes, at a level well above the physical path. Since the intermediate hosts along a transmission path do not need to encrypt or decrypt the message traffic, they have no need for cryptographic facilities. Thus, encryption is used only for those messages and applications for which it is needed. Furthermore, the encryption can be done with software, so we can apply it selectively, one application at a time or even to one message within a given application.
The selective advantage of end-to-end encryption is also a disadvantage regarding encryption keys. Under end-to-end encryption, a virtual cryptographic channel exists between each pair of users. To provide proper security, each pair of users should share a unique cryptographic key. The number of keys required is thus equal to the number of pairs of users, which is n * n - 1 / 2 for n users. This number increases rapidly as the number of users increases.
As shown in Table 6-3 , link encryption is faster, is easier for the user, and uses fewer keys. End-to-end encryption is more flexible, can be used selectively, is done at the user level, and can be integrated with the application. Neither form is right for all situations.
Table 6-3 Comparison of Link and End-to-End Encryption
| Link Encryption | End-to-End Encryption |
|---|
| Security within hosts | | Data partially exposed in sending host | Data protected in sending host | | Data partially exposed in intermediate nodes | Data protected through intermediate nodes | | Role of user | | Applied by sending host | Applied by user application | | Invisible to user | User application encrypts | | Host administrators select encryption | User selects algorithm | | Key managed centrally by host administrator | Each user (or user’s application) manages key individually | | Can be done in software or hardware | Usually software implementation; occasionally performed by user add-on hardware | | All or no data encrypted | User can selectively encrypt individual data items | | Implementation considerations | | Requires one key per pair of hosts | Requires one key per pair of users | | Provides node authentication | Provides user authentication |
In some cases, both forms of encryption can be applied. A user who does not trust the quality of the link encryption provided by a system can apply end-to-end encryption as well. A system administrator who is concerned about the security of an end-to-end encryption scheme applied by an application program can also install a link-encryption device. If both encryptions are relatively fast, this duplication of security has little negative effect.
Link-level encryption is especially well suited to implementing a private network by using public resources. A virtual private network, described in the next section, is a technique that provides privacy in a public network.
Browser Encryption
Browsers are a primary endpoint between users and internet resources, so they can encrypt data for protection during transmission. The browser and the server negotiate a common encryption key. Even if an attacker does hijack a session at the TCP or IP service level, the attacker, not having the proper key, cannot join the application data exchange.
In this section we present two protocols, SSH and SSL, both of which are decades old. We stress that these are protocols, not encryption algorithms; that is, they specify how encryption can be invoked, not what encryption to apply. Both protocols allow use of several different encryption algorithms, and both admit the adoption of other algorithms along the way. Thus, even though old encryption schemes (for example, DES) may fade from use, any application based on the protocols can be upgraded to use a newer and more robust algorithm.
SSH Encryption
Secure Shell ( SSH ) provides an authenticated and encrypted path to the shell or operating system command interpreter. SSH replaces utilities such as Telnet, rlogin, and rsh for remote access. SSH protects against spoofing attacks and modification of data in communication. SSH is commonly used for delivering code updates and managing or maintaining a system remotely. The SSH protocol involves negotiation between local and remote sites for encryption algorithm (for example, DES or AES) and authentication (including public key and Kerberos).
SSH defines how encryption implements a protected path—from user to operating system or between two hosts.
SSH was originally developed in 1995 by Finnish computer scientist Tatu Ylönen for Unix but is now generally available for all systems. Internet standards RFCs 4250–4254 define the protocol.
In 2008, a team of British researchers [ ALB09 ] devised an attack by which they could recover 32 bits of data from an SSH session in certain circumstances. Although exposure of 32 bits of data is significant, the British Centre for the Protection of the National Infrastructure rated the likelihood of successful attack as low because of the conditions necessary for a successful attack. Nevertheless, you should note that the protocol does have a known vulnerability.
SSL and TLS Encryption
Secure Sockets Layer ( SSL ) is an encryption protocol to protect data being transmitted across the internet. It can use a variety of commercial encryption algorithms and a certificate structure for authentication and key exchange. The primary use of SSL is to protect data confidentiality.
The SSL protocol was originally designed by Netscape in the mid-1990s to protect communication between a web browser and server. It went through three versions: SSL 1.0 (private), SSL 2.0 (1995), and SSL 3.0 (1996). In 1999, the Internet Engineering Task Force (IETF) upgraded SSL 3.0 and named the upgrade TLS , for transport layer security . TLS 1.0, which is sometimes also known as SSL 3.1, is documented in RFC 2246; three newer versions are named TLS 1.1 (RFC 4346 in 2006), TLS 1.2 (RFC 5246 in 2008), and TLS 1.3 (RFC 8446 in 2018). Each upgrade fixes identified security weaknesses (which have become more obscure over time), removes some insecure options, and improves performance. The acronym SSL is often used to refer to both the SSL and TLS protocol suites.
In the OSI network model, applications run at the highest level, called level 7, and SSL is implemented at level 4, above network addressing (level 3) and physical media (level 1). SSL operates between applications (such as browsers) and the TCP/IP protocols to provide server authentication, optional client authentication, and an encrypted communication channel between client and server. SSL can be used to provide encryption for functions such as email and file transfer, in addition to browser access.
SSL encryption covers communication between a browser and a remote web host.
Cipher Suite
Client and server negotiate encryption algorithms, called the cipher suite , for authentication, session encryption, and hashing. To allow for expansion and deprecation of algorithms over time, the first to open an interaction, often the client, states its preferred algorithms, and the second party responds with the highest one on that list it can handle.
The Internet Assigned Numbers Authority (IANA) globally coordinates the DNS Root, IP addressing, and other internet protocol resources, including cipher suites; we show the choices in Table 6-4 . This table shows the cipher suites currently accepted under TLS 1.3; most implementations also allow cipher choice from previous versions of TLS, such as triple DES and RSA key exchange. When client and server begin an SSL session, the server sends a set of records listing the cipher suite identifiers it can use; the client responds with its preferred selection from that set. As you can see in the table, SSL supports use of the popular cryptographic algorithm AES; IANA also sanctions use of a newer algorithm called ChaCha20, combined with another algorithm called Poly1305 (both discussed in Chapter 12 ). CCM and GCM are different ways to link blocks of ciphertext.
Table 6-4 TLS 1.3 Cipher Suites
| Cipher Suite Identifier | Algorithms Used |
|---|---|
| TLS_AES_256_GCM_SHA384 | AES with a 256-bit key encryption, 384-bit SHA hash function |
| TLS_CHACHA20_POLY1305_SHA256 | Chacha20–Poly1305 stream cipher, 256-bit SHA hash function |
| TLS_AES_128_GCM_SHA256 | AES with a 128-bit key encryption, 256-bit SHA hash function |
| TLS_AES_128_CCM_8_SHA256 | AES with a 128-bit key encryption, 256-bit SHA hash function |
| TLS_AES_128_CCM_SHA256 | AES with a 128--bit key, SHA-1 hash function |
The SSL protocol is simple but effective, and it is the most widely used secure communication protocol on the internet. (Note, however, there is a flaw in the MD5 algorithm by which researchers were able to forge a seemingly valid certificate for use with SSL. There is also a plaintext injection attack against TLS 1.2, described as CVE-2009-3555. The flaw involves a fix on the server side, so many web application services will need to be corrected.)
SSL Session
Because SSL is commonly used with webpages, it is often referred to as HTTPS (HTTP Secure), and you will see the https: prefix in the address bar of a browser, as well as a closed padlock in the corner whenever SSL is in operation. To use SSL, the client requests an SSL session. The server responds with its public key certificate so that the client can determine the authenticity of the server. The client computes and returns a symmetric session key encrypted under the server’s public key. The server retrieves the session key, and then they switch to encrypted communication, using the shared session key.
After an SSL session has been established, the details of the session can be viewed. For example, Figure 6-41 shows an SSL connection established to https://login.yahoo.com .
FIGURE 6-41 SSL Session Established
The screenshot shows the following details: The title bar reads, Page Info - h t t p s : / / login dot yahoo dot com / config / login? Dot done = h t t p : / / finance dot yahoo.co... The icons shows General, Media, Permissions, and Security. Web Site Identity Web site: login.yahoo.com Owner: This web site does not supply ownership information. Verified by: DigiCert Inc A button reads, View Certificate. The next section reads, Privacy and History. Have I visited this web site before today? No Is this web site storing information (cookies) on my computer? Yes. A button beside reads, View Cookies. Have I saved any passwords for this web site? No. A button beside reads, View Saved Passwords. The last section reads, Technical Details. Connection Encrypted: High-grade Encryption (Camellia-256 256 bit) The page you are viewing encrypted before being transmitted over the Internet. Encryption makes it very difficult for unauthorized people to view information traveling between computers. It is therefore very unlikely that anyone read this page as it traveled across the network.
The details of that session, shown in Figure 6-42 , reveal that an encrypted session was established based on a certificate Yahoo supplied. That certificate was signed by DigiCert, a certification authority.
FIGURE 6-42 SSL Certificate Employed
The screenshot shows the following details: The title bar reads, Certificate Viewer: login dot yahoo dot com. The tabs below show General and Details; General is selected. This certificate has been verified for the following uses: SSL Server Certificate Issued To Common Name (CN) login. yahoo.com Organization (O) Yahoo! Inc. Organizational Unit (OU) <Not Part Of Certificate> Serial Number 0F: 58: 49: 41: 52:C 3: 35:4B:6D:EB:E7: 20:9E: 72:6E:67 Issued By Common Name (CN) DigiCert High Assurance CA-3 Organization (O) DigiCert Inc Organizational Unit (OU) w w w dot digi cert dot com Validity Issued On 20-Dec-10 Expires On 3-Jan-13 Fingerprints SHA 1 Fingerprint 89:0C:0C:65:87:30:4C:43: 75:20:B4:81:AA:7B:CC:F2:EE: 15: 19:54 MDS Fingerprint 75:4A:A4:87: 70: 53: 70: 5D: 4D: 1D: 15:54: 18:3C:FE:EC.
In Figure 6-43 you can see the entire chain of certificates and signers, starting with the GTE CyberTrust root certificate and following down to the Yahoo certificate. This figure also shows the details of the encryption algorithm (RSA) with which the certificate was signed.
FIGURE 6-43 Chain of Certificates
The screenshot shows the following details: The title bar reads, Certificate Viewer: login dot yahoo dot com. The tabs below show General and Details; Details is selected. The first section reads, Certificate Hierarchy -GTE CyberTrust Global Root -DigiCert High Assurance EV Root CA -DigiCert High Assurance CA-3 login dot yahoo dot com The second section reads, Certificate Fields Not Before Not After Subject -Subject Public Key Info Subject's Public Key Algorithm Subject's Public Key Certificate Signature Algorithm Certificate Signature Value The third section reads, Field Value PKCS Hash 1 RSA Encryption Export Close.
The chain of certificates and signers is important because of the potential for unscrupulous CAs . If you examine the set of CA certificates loaded in a browser, you will likely find familiar and unfamiliar names of organizations from all over the world. Any of these CAs can sign a certificate for another lower-level certificate authority, and so forth, down to an individual organization engaging in an SSL session. If an attacker wanted to establish a fake banking site, for example, getting an unscrupulous CA to issue a certificate for SSL would add to the site’s apparent credibility without necessarily providing security.
Finally, in Figure 6-44 you can see that the DigiCert root certificate was issued by GTE CyberTrust Solutions. Other fields include period of validity, algorithms used, date of issuance, and contact details. Thus, an interested user could compare the full chain of certificates and signatures starting from a trusted root.
FIGURE 6-44 Root Certificate
The screenshot shows the following details: The title bar reads, Certificate Viewer: login dot yahoo dot com. The tabs below show General and Details; Details is selected. The first section reads, Certificate Hierarchy -GTE CyberTrust Global Root -DigiCert High Assurance EV Root CA -DigiCert High Assurance CA-3 login dot yahoo dot com The second section reads, Certificate Fields - DogiCert H.gh Assurance EV Root CA Certificate Version Serial Number Certificate Signature Algorithm Issuer -Not Before -Not After Field Value CN = GTE CyberTrust Global Root OU = GTE CyberTrust Solutions, Inc. O = GTE Corporation C = GS Export Close.
Although the preloaded certificate authorities are reputable, if one were to sign a certificate for a less honorable firm, the SSL operation would still succeed. SSL requires a certificate chain from a CA in the browser’s list, but all such CAs are equally credible to the browser. That is why you should review your set of loaded certificates to ensure you would trust anything signed by any of them. Fortunately for users, during security updates browser vendors add new CAs and, more important, remove ones that are less reliable.
The SSL protocol is simple but effective, and it is the most widely used secure communication protocol on the internet. However, remember that SSL protects only from the client’s browser to the server’s decryption point (which is often only to the server’s firewall or, slightly stronger, to the computer that hosts the web application). Data are exposed from the user’s keyboard to the browser and throughout the recipient’s environment. Remember the vulnerabilities of a keystroke logger and man-in-the-browser that we describe in Chapter 4 . Blue Gem Security has developed a product called LocalSSL that encrypts data from the time it has been typed until the operating system delivers it to the client’s browser, thus thwarting any keylogging Trojan horse that has become implanted in the user’s computer to reveal everything the user types.
SSL encryption protects only from the browser to the destination decryption point. Vulnerabilities before encryption or after decryption are unaffected.
Onion Routing
As we described both link and end-to-end encryption, the data portion of the communication was secured for confidentiality. However, the addressing data were exposed. Thus, someone monitoring traffic between points A and B would know the volume of traffic communicated.
Paul Syverson and colleagues [ SYV97 ] introduced the concept of onion routing . That model uses a collection of forwarding hosts, each of which knows only from where a communication was received and to where to send it next. Thus, to send untraceable data from A to B, A picks some number of forwarding hosts, call them X, Y, and Z. A begins by encrypting the communication under B’s public key. A then appends a header from Z to B and encrypts the result under Z’s public key. A then puts a header on that from Y to Z and encrypts that under Y’s public key. A then puts a header on that communication from X to Y and encrypts that under X’s public key. Finally, A puts on a header to send the package to X.
Upon receiving the package, X decrypts it and finds instructions to forward the inner package to Y. Y then decrypts it and finds instructions to forward the inner package to Z. Z then decrypts it and finds instructions to forward the inner package to B. The package is deconstructed like peeling the layers from an onion, which is why this technique is called onion routing.
No intermediate host can know who the ultimate recipient is. Even Z cannot tell that B is the final destination because what Z delivers to B is encrypted under B’s public key. Thus, X, Y, and Z know only that they are intermediaries, but they do not know which other intermediaries there are, how many of them there are, or where they are in the chain. Any intermediate recipients—those other than the original sender and ultimate recipient—know neither where the package originated nor where it will end. This scheme provides confidentiality of content, source, destination, and routing.
Packages for onion routing can be any network transmissions. The most popular uses, however, are covert email (in which the recipient cannot determine who was the original sender), and private web browsing (in which neither the destination host nor an eavesdropper monitoring the sender’s outgoing communication can determine the destination host or traffic content).
The Tor project ( torproject.org ) distributes free software and enlists an open network that uses onion routing to defend against traffic analysis. Tor (which stands for The Onion Router) protects by transferring communications around a distributed network of over 5,000 relays run by volunteers all around the world: It prevents outsiders watching internet connections from learning what sites a user visits, and it prevents sites from learning the user’s physical location. Tor users include Iranian activists who eluded their government’s censors to transmit images and news during protests following the presidential election of 2009, and Chinese citizens who regularly use it to bypass the country’s stringent limitations on internet content and access. Journalists in conflict areas use Tor to transmit stories to publishers in safer locations. Military and law enforcement personnel use Tor to protect communication in undercover activities. Tor also facilitates the so-called dark side of the internet used to implement illegal traffic in child pornography, drugs, and stolen credit card and identity details.
Tor—onion routing—prevents an eavesdropper from learning source, destination, or content of data in transit in a network.
Tor is not foolproof. Intermediate nodes can collect, retain, and analyze traffic that passes through them. Tor describes its process as creating a twisty, hard-to-follow path where footprints are erased from time to time. Twisty and hard to follow are not impossible to follow. With Tor, the first (X) and last (Z) nodes see a communication’s actual source and destination, respectively. Thus, if either of those points is malicious, Tor provides no anonymity. Each internal node (X, Y, or Z) knows its predecessor and successor, although as we just described, no internal node knows how many predecessor or successor nodes there are. Collecting enough Tor traffic could let an analyst infer a communication from the known first point and the known last point, thus eliminating the secrecy of all the intermediate steps. Although these attacks are difficult, an attacker with adequate method (and motive) could overcome the protection of Tor. In short, although not foolproof, Tor protects the privacy of many communications and, specifically, many communicators.
IP Security Protocol Suite (IPsec)
Address space for the internet is running out. As domain names and equipment proliferate, the original, decades-old, 32-bit address structure of the internet is filling up. A new structure, called IPv6 (version 6 of the IP suite), solves the addressing problem. This restructuring also offered an excellent opportunity for the IETF to address serious security requirements.
As a part of the IPv6 suite, the IP Security protocol suite, or IPsec , was adopted by the IETF. Designed to address fundamental shortcomings such as being subject to spoofing, eavesdropping, and session hijacking, the IPsec protocol defines a standard means for handling encrypted data. IPsec is implemented at the IP layer (3), so it protects data produced in all layers above it, in particular, TCP and UDP control information, as well as the application data. Therefore, IPsec requires no change to the existing large number of TCP and UDP protocols or applications.
IPsec implements encryption and authentication in the internet protocols.
IPsec is somewhat similar to SSL in that it supports authentication and confidentiality in a way that does not necessitate significant change either above it (in applications) or below it (in the transfer protocols). Like SSL, it was designed to be independent of specific cryptographic algorithms and to allow the two communicating parties to agree on a mutually supported set of protocols.
IPsec Security Association
The basis of IPsec is what is called a security association , which is essentially the set of security parameters for a secured communication channel. It is roughly comparable to an SSL session. A security association includes
-
encryption algorithm and mode (for example, AES)
-
encryption key
-
encryption parameters, such as the initialization vector
-
authentication protocol and key
-
life span of the association, to permit long-running sessions to select a new cryptographic key as often as needed
-
address of the opposite end of the association
-
sensitivity level of protected data (usable for classified data)
A host, such as a network server or a firewall, might have several security associations in effect for concurrent communications with different remote clients. A security association is selected by a security parameter index (SPI), a data element that indicates which security association is used with this communication.
Headers and Data
The fundamental data structures of IPsec are the authentication header ( AH ) and the encapsulated security payload ( ESP ). The ESP replaces (includes) the conventional TCP header and data portion of a packet, as shown in Figure 6-45 . The physical header and trailer depend on the data link and physical layer communications medium, such as Ethernet.
FIGURE 6-45 IPsec Encapsulated Security Payload
The first box is divided into five small boxes and reads, Physical Header, IP Header, TCP Header, Data, and Physical Trailer. The second box is divided into four boxes and reads, Physical Header, IP Header, ESP (includes control, TCP header, and data), and Physical Trailer. A dashed line between IP Header and TCP Header links between IP Header and ESP (includes control, TCP header, and data). A dashed line between Data and Physical Trailer links between ESP (includes control, TCP header, and data) and Physical Trailer.
The ESP contains both an authenticated portion and an encrypted portion, as shown in Figure 6-46 . The sequence number is incremented by 1 for each packet transmitted to the same address using the same security association, to preclude packet replay attacks. The payload data are the actual data of the packet. Because some encryption or other security mechanisms require blocks of certain sizes, the padding factor and padding length fields contain padding and the amount of padding to bring the payload data to an appropriate length. The next header indicates the type of payload data. The authentication field is used for authentication of the entire object.
FIGURE 6-46 Protection of the ESP in IPsec
The box is divided into four small boxes, and reads, Crypto Num, Seq Num, Payload Data, and Auth Data. A box above Payload Data reads ESP. A box covering Crypto Num, Seq Num, and Payload Data reads, AH encrypted. A text above this box reads, authenticated.
IPsec encapsulated security payload contains descriptors to tell a recipient how to interpret encrypted content.
Key Management
As with most cryptographic applications, the critical element is key management. IPsec addresses this need with the Internet Security Association Key Management Protocol , or ISAKMP . Like SSL, ISAKMP requires that a fresh key be generated for each security association. The ISAKMP protocol is simple, flexible, and scalable. In IPsec, ISAKMP is implemented through the ISAKMP key exchange , or IKE , which provides a way to manage and agree on protocols, algorithms, and keys. For key exchange between unrelated parties, IKE uses the Diffie–Hellman scheme (described in Chapter 12 ) to generate a mutually shared secret that will then be used as an encryption key. With their shared secret, the two parties exchange identities and certificates to authenticate those identities. Finally, they derive a shared cryptographic key and enter a security association.
The key exchange is very efficient: The exchange can be accomplished in two messages, with an optional two more messages for authentication. Because this is a public key method, only two keys are needed for each pair of communicating parties. IKE has submodes for authentication (initiation) and for establishing new keys in an existing security association.
Modes of Operation
IPsec can enforce either or both of confidentiality and authenticity. Confidentiality is achieved with symmetric encryption, and authenticity is obtained with an asymmetric algorithm for signing with a private key. Additionally, a hash function guards against modification.
For some situations, not only are the data of a transmission sensitive, but so is the identity (address) of its final recipient. Of course, packets require addresses to be routed through the network. However, the exposed address can be that of a front-end device, such as a firewall, that then forwards the transmission to an unexposed internal network address.
IPsec defines two modes of operation, as depicted in Figure 6-47 . In transport mode (normal operation), the IP address header is unencrypted. In tunnel mode , the recipient’s address is concealed by encryption, and IPsec substitutes the address of a remote device, such as a firewall or router, that will receive the transmission and remove the IPsec encryption.
FIGURE 6-47 IPsec Modes of Operation
(a) Original Packet: A box is divided into three small boxes and they read, IP Header, TCP Header, and Data. (b) Transport Mode: A box is divided into five small boxes and they read, IP Header, ESP Header, TCP Header, Data, and ESP Trailer. TCP Header, Data, and ESP Trailer are shaded. ESP Header, TCP Header, Data, and ESP Trailer are surrounded by a line that reads, encrypted (shaded), and the text outside it reads, authenticated. (c) Tunnel Mode: A box is divided into six small boxes and they read, New IP Header, ESP Header, IP Header, TCP Header, Data, and ESP Trailer. IP Header, TCP Header, Data, and ESP Trailer are shaded. ESP Header, IP Header, TCP Header, Data, and ESP Trailer are encrypted (shaded). ESP Header, IP Header, TCP Header, Data, and ESP Trailer are authenticated.
IPsec can establish cryptographic sessions with many purposes, including VPNs, applications, and lower-level network management (such as routing). The protocols of IPsec have been published and extensively scrutinized. Work on the protocols began in 1992. They were first published in 1995, and they were finalized in 1998 (RFCs 2401–2409) [ KEN98 ]. A second version of IKE was standardized in 2005 [ KAU05 ], and extensions were documented in 2008 [ BLA08 ], although the basic IKE structure from 1995 remains. IKE and IPsec include an encrypted nonce specifically to thwart hijacking.
Although some people claim the IPsec protocol suite is overly complex, it is a mature and widely accepted standard for secure internet communication. Active research and standards refinement ensure that it will evolve with internet threats and capabilities.
Virtual Private Networks
Link encryption can give a network’s users the sense that they are on a private network, even when it is part of a public network. Furthermore, applied at the link level, the encrypting and decrypting are invisible to users. For this reason, the approach is called a virtual private network (or VPN ).
A virtual private network simulates the security of a dedicated, protected communication line on a shared network.
Typically, physical security and administrative security are strong enough to protect transmission inside the perimeter of a site (office, building, plant, or campus, for example). Thus, the greatest exposure for a user occurs when communications leave the protected environment. Link encryption between two secured endpoints can achieve this result. For VPNs we consider three cases.
Separate Subfacilities
Consider a company that has two physically separated offices, and the employees want to work as a single unit, exchanging sensitive data as if they were in one protected office. Each office maintains its own network. The two offices could implement a private network by acquiring, managing, and maintaining their own network equipment to provide a private link between the two sites. This solution is often costly, and the company assumes full responsibility for maintaining the connection. Often such companies are not in the networking business, but maintaining that one link requires them to become or hire network administrators. However, the company may not like the risk of communicating sensitive company information across a public, shared network.
The alternative is a VPN between the offices. With link encryption, all communications between the sites are encrypted. Most of the cost of this solution is in acquiring and setting up the network. Some employee communications will involve sensitive plans and confidential data; other communications will be mundane office chatter about sports teams or lunch plans. There is almost no harm in encrypting the chatter as well as the important traffic because the added time to encrypt and decrypt all traffic is usually insignificant relative to the network transmission time.
Firewalls (described in the next section) can implement a VPN. When a user first establishes communication with the firewall, the user can request a VPN session with the firewall. The user’s client and the firewall negotiate a session encryption key, and the firewall and the client subsequently use that key to encrypt all traffic between the two. In this way, the larger network is restricted only to those given special access by the VPN. In other words, it feels to the user as if the larger network is private, even though it is not. With the VPN, we say that the communication passes through an encrypted tunnel. Establishment of a VPN is shown in Figure 6-48 .
FIGURE 6-48 Establishment of a VPN
Office A's desktops A1, A2, A3, and A4 are connected to other sites through firewall A. Similarly, Office B's desktops B1, B2, B3, and B4 are connected to other sites through firewall B.
Telecommuting
Now consider the second case, which involves Mia, an employee working from home or any other unsecured remote location. To be productive from home she needs to use central files and resources she could access easily from the office. But obviously, the company does not want these resources exposed to the general public. From her house Mia uses a technology such as broadband to connect to an internet provider that routes some of her traffic to her office and the rest to other websites. Thus, she appears to her office like any other web user. She can also use a VPN for secure office communications.
VPNs are created when the firewall interacts with an authentication service inside the perimeter. The firewall may pass user authentication data to the authentication server, and upon confirmation of the authenticated identity, the firewall provides the user with appropriate security privileges. For example, Mia may be allowed to access resources not available to general users. The firewall implements this access control on the basis of the VPN. A VPN with privileged access is shown in Figure 6-49 . In that figure, the firewall passes Mia’s (privileged) identity to the internal server.
FIGURE 6-49 VPN with Privileged Access
Office desktops A1, A2, A3, and A4 are connected to other sites through firewall A. Similarly, a teleworker is connected to other sites directly.
Concealed Identity
A third use of a VPN involves masking a web client’s identity and traffic. There are many reasons why you might want to conceal aspects of your identity. Some oppressive countries prevent their citizens from accessing content counter to the government’s viewpoint. One government may want to prevent people from learning negative parts of the country’s history or want to complicate the ability to organize actions against the government. The rise of social media has given citizens a tool with which to share information and organize. In these cases, protecting who and where you are can let you find suppressed information and act with less fear your government will track you.
Some companies or schools want to block access to certain kinds of websites. As a simple example, on the day of a huge sporting event, office workers may want to open a screen window to be able to glance at the match while reviewing a less-exciting proposal. To improve productivity (and perhaps reduce morale), the company might stop its staff from accessing broadcasts of the game. Some content, especially film or video, is blocked to residents of certain regions because of intellectual property agreements. Your friends in other countries have seen the latest season of a popular series, but it is not available in your country.
Finally, there are privacy implications: Your ISP can record which sites you have visited. Perhaps you use insecure links, for example, in hotels or coffee shops or over an exposed cellular connection. A VPN can help counter all these limitations.
Consider a user Edvin who lives in a region that blocks access to any site not displayed in the Finnish language. Edvin’s ISP has an agreement with the government to drop any non-Finnish pages Edvin might try to fetch with his browser. Wanting to view a Spanish film, Edvin uses a VPN to establish an encrypted tunnel to a server in Mexico; Edvin’s browser and the Mexican server create and exchange a session encryption key. Edvin’s ISP can see the initial server request directed to the Mexican server. But from that point on, all traffic between Edvin and the server is encrypted, so Edvin’s ISP cannot monitor the content of Edvin’s browsing. In particular, it cannot know whether Edvin is seeing things not in Finnish. A government and ISP can block access because of subject, language, source, or other factor, but only if they can inspect the actual content.
In a different situation, Lucia is staying in a hotel on a business trip. She connects to the WiFi from her room to exchange messages with her colleagues back in the office. In previous sections we studied the WEP and WPA protocols for protecting communication between a user and a WiFi access point. Lucia does not know whether her communication to the hotel’s access point uses either of these, and, even if so, she cannot know how well the hotel manages security. To be on the safe side, Lucia joins the hotel’s network but then immediately starts a VPN client on her laptop. Her client connects to a remote VPN server, and then her client and the server negotiate an encrypted session. From that point on, even if someone has compromised the hotel’s devices or wiretapped Lucia’s connection with the hotel’s WiFi, only the address of this remote VPN server would be visible in Lucia’s communication stream; all of Lucia’s data would be encrypted. We say that Lucia is communicating through a VPN tunnel to the remote VPN server.
A VPN conceals the content, including the source and destination, of all traffic it handles. Edvin’s web searching all appears to originate from the VPN server; results returning to Edvin are hidden by the tunnel. Lucia’s activity in the hotel is invisible to anyone else; nobody will see that she connects to the corporate network (and thus not even know what company she works for). Thus, VPNs conceal some of the most exposed aspects of our internet use.
We have now covered several cryptographic protections for communications—SSH, SSL or TLS, onion routing, IPSec, and VPNs. These approaches address different vulnerabilities, so you should not think of them as competing technologies, nor should you try to compare them to find the best one to implement. In fact, for a particular set of vulnerabilities, all may be appropriate. Cryptography is indeed time consuming. Fortunately, however, with the speed of modern computers and communications, the hindrance from invoking encryption is scarcely perceptible for most uses.
Encryption is a great control. It is a tested, mature technology. But it is not the only tool in the network security engineer’s toolbox. Next we consider another widely used tool to secure networks. This tool is a device, actually a special-purpose computer, that screens network traffic, keeping “bad” network traffic away from the “good” users and data.
6.7 Firewalls
A firewall is, as its name implies, a device whose purpose is to block bad things (such as a fire) from spreading to things we want to protect. But before we actually consider firewalls, we explore how and where they can be effective.
A firewall in a physical structure separates two parts of the building so that a fire on one side does not spread to the other side. Think of a connected row of houses, at 131 to 135 River Street. The occupants of 133 River Street have smoke detectors that, if the worst happens, will alert them to a fire and allow them to escape the burning house safely; they will call firefighters, who will arrive soon to extinguish the fire.
Fires grow as they raise the temperature of the surroundings and ignite more consumable materials. Therefore, between the time when the smoke detector sounds until the firefighters arrive, the fire has perhaps expanded to 132 and 134 River Street. A fire now threatens those occupants and their homes, and the firefighters have to battle a larger blaze, as well as protect houses 131 and 135. If firewalls block or significantly deter the fire’s spread, the firefighters have only to deal with 133, as well as deterring spread to 132 and 134. The range of damage is less, and the danger is more contained.
The effectiveness of firewalls depends on architecture. Fire travels easily through openings, so the firewall must be solid and unbroken. An air shaft or ventilation duct that runs between these units becomes is a path for fire spread, as would a connecting hallway or shared entryway.
Just as homes must be designed to reduce the risk of fire damage, so too must networks be designed to reduce the risk of security damage. Before we consider firewalls themselves, we want to describe how the layout of a network affects the effectiveness of a firewall.
System Architecture
If you are trying to limit the information a port scan reveals about a network and its hosts and services, the natural approach is to segment the network, with many hosts on segments that are not immediately visible to the outside.
As an example, think about a typical hospital telephone system. Some functions, such as human resources or patient services, need to accept calls directly from outsiders, and those telephone numbers could be published in a directory. But the hospital does not necessarily want outsider callers to reach the operating room, the diagnostics laboratory, or even the housekeeping or maintenance department. The hospital would publish a general operator’s number; if a caller has a convincing reason to speak directly to someone in the operating room, the operator can forward the call or, more likely, redirect it. The hospital executives have administrative assistants who screen their calls, allowing some calls through immediately, taking messages for others, and redirecting still others. The architecture implicit in this description of a hospital’s telephone service is of a small number of externally accessible phone numbers (relative to the larger number of internal phones), and a few other choke points that screen and redirect all other calls.
A similar situation occurs with networks. Compare the network of Figure 6-50 (a) to that of Figure 6-50 (b). In Figure 6-50 (a), all five computers A–E are visible to the outside network, whereas in Figure 6-50 (b) only router A is visible. (We depict devices A–E as individual computers only to simplify the representation; in practice, B–E would probably be networks of multiple devices each.) The network of devices B–E in part (b) is known as a protected subnet , and device A is called a dual-homed gateway .
FIGURE 6-50 (a) Visible Devices (b) Less Visible Devices
(a) Visible Devices: Computers A, B, C, D, and E are connected to a router that is connected to the outside network. (b) Less Visible Devices: Computers B. C, D, and E are connected to a router which is connected to the second router. Computer A is connected to the second Router. The second router is connected to the outside network.
We can even expand the notion of protected subnets to two or more subnets, as shown in Figure 6-51 . The three subnets could be for separate departments or user groups, or they could be allocated geographically. As we previously described, separation is a powerful security concept: Each subnetwork is vulnerable, but a security failure in one does not necessarily permit compromise of another.
FIGURE 6-51 Multiple Protected Subnets
Computers B, C, D, and E are connected to the first router. Computers F, G, and H are connected to the first router. The first router is connected to the second router. Computer A is connected to the second router. The second router is connected to the outside network.
Protected subnetworks can separate any subgroup requiring controlled access to data or communication.
Restricting the architecture of a network, also known as its topology or design, limits or controls data movement, but it does not fully address the central security goal of controlled access. To accomplish that goal we depend on a device called a firewall, which we describe next.
What Is a Firewall?
Network firewalls function similarly to physical firewalls: They protect against the spread of something harmful from one subnet to another. The primary use of a firewall is to protect an internal subnetwork from the many threats we have already described in the wild internet. Firewalls can also be used to separate segments of an internal network, for example, to preserve high confidentiality of a sensitive research network within a larger organization.
Firewalls are one of the most important security devices for networks. Firewalls were officially invented in the early 1990s, but the concept really reflects the reference monitor (introduced in Chapter 2 ) from two decades earlier. The first reference to a firewall by that name may be by Marcus Ranum [ RAN92 ]; other early references to firewalls are the Trusted Information Systems firewall toolkit [ RAN94 ] and the 1994 book by Bill Cheswick and Steve Bellovin [updated as CHE02].
A firewall is a device that runs code to filter all traffic between a protected or “inside” network and a less trustworthy or “outside” network. Usually, a firewall runs on a dedicated device; because it is a single point through which traffic is channeled, performance is important, which means that only firewall functions should run on the firewall machine.
In practice, a firewall is a computer with memory, storage devices, interface cards for network access, and other devices. It runs an operating system and executes application programs. Often the hardware, operating system, and applications are sold as a package, so the firewall application (a program) is sometimes also called a firewall. As we describe later in this section, firewall functionality is also migrating to the internet, meaning that the hardware and software of some firewalls is somewhere else on the network, not necessarily on the subnetworks they protect.
A firewall is a computer traffic cop that permits or blocks data flow between two parts of a network architecture. It is the only link between parts.
A firewall platform typically does not have compilers, linkers, loaders, general text editors, debuggers, programming libraries, or other tools an attacker might use to extend an attack from the firewall computer. And people with accounts on a firewall don’t (or at least shouldn’t) use it to surf the web or handle email. Because a firewall runs executable code, an attacker could compromise that code and execute from the firewall’s device, so we want to deny such tools to attackers.
For a long time, proprietary software on network devices was scarcely a target for attackers, but even these devices now catch hackers’ attention. Fortunately, the major firewall vendors aggressively monitor attack patterns to keep firewall code solid and therefore effective. Vendors call this practice threat intelligence , a centralized approach to tracking threats and generating functionality updates.
The purpose of a firewall is to keep “bad” things outside a protected environment. To accomplish that, firewalls implement a security policy that is specifically designed to address what bad things might happen. For example, the policy might be to prevent any access from outside (while still allowing traffic to pass from the inside to the outside). Alternatively, the policy might permit accesses only from certain places (addresses), from certain users, at certain times, in certain amounts, across certain protocol connections, or for certain activities. Part of the challenge of protecting a network with a firewall is configuring a security policy to meet the needs of the installation.
Firewalls enforce predetermined rules governing what traffic can flow. Administrators update rules to address changing threats or needs.
People in the firewall community (users, developers, and security experts) disagree about how a firewall should work. In particular, the community is divided about a firewall’s default behavior. We can describe the two schools of thought as “that which is not expressly forbidden is permitted” ( default permit ) and “that which is not expressly permitted is forbidden” ( default deny ). Think of your mother saying, “While I am out, you may not hit your brother” (so you infer that tripping him is allowed), or “While I am out, you may eat a cookie” (which does not give you permission to eat a candy bar). Users, always interested in new features, prefer the permissive form. Security experts, relying on several decades of experience, strongly counsel the more cautious second form. An administrator implementing or configuring a firewall must choose one of the two philosophies, although the administrator can often broaden the policy by setting the firewall’s parameters.
As we just noted, the notion of a firewall dates to the early 1990s, with commercial products becoming readily available before 2000. At first, products were of distinct types, depending on what activity they blocked. Over time, however, manufacturers discovered that a firewall to block only one class of threats faced a limited market. Originally, characteristics distinguished one kind of firewall from another, but over time all vendors incorporated characteristics from their competitors. Today, firewalls are complex devices that cover a myriad of threats. To simplify our explanations, we first present the different kinds of filtering that firewalls do. But you should remember that these different modes of operation have ultimately merged into comprehensive threat management devices. Similarly, in the sections after we describe firewalls, we present devices that detect and prevent intrusions and manage security devices. These functions have also been merged into modern firewalls.
Design of Firewalls
As we have described them, firewalls rigorously and effectively control the flow of data to and from a network. Two qualities lead to that effectiveness: a well-understood traffic flow policy and a trustworthy design and implementation.
Policy
A firewall implements a security policy , that is, a set of rules that determine what traffic can or cannot pass through the firewall. As with many problems in computer security, we would ideally like a simple policy, such as “good” traffic can pass but “bad” traffic is blocked. Unfortunately, defining “good” and “bad” is neither simple nor algorithmic. Firewalls come with example policies, but each network administrator needs to determine what traffic to allow into a particular network.
An example of a simple firewall configuration is shown in Table 6-5 . In this table, “inside” hosts, those being protected, have network addresses of the form 192.168.1.*. (The * character represents any value in that field.) The table is processed from the top down, and the first matching rule determines the firewall’s action. This policy says any inbound traffic to port 25 (mail transfer) or port 69 (so-called trivial file transfer) is allowed to any host on the 192.168.1 subnetwork. By rule 3, any inside host is allowed outbound traffic anywhere on port 80 (webpage fetches). Furthermore, by rule 4, outside traffic to the internal host at destination address 192.168.1.18 (presumably a web server) is allowed. All other traffic–that is, traffic that has not matched any of the first four rules–to the 192.168.1 network is denied. (Note that internal traffic, from one host to another in the 192.168.1.* subnetwork, is usually routed without passing through the firewall, so such communication is unlimited.)
Table 6-5 Example Firewall Configuration
| Rule | Type | Source Address | Destination Address | Destination Port | Action |
|---|---|---|---|---|---|
| 1 | TCP | * | 192.168.1.* | 25 | Permit |
| 2 | UDP | * | 192.168.1.* | 69 | Permit |
| 3 | TCP | 192.168.1.* | * | 80 | Permit |
| 4 | TCP | * | 192.168.1.18 | 80 | Permit |
| 5 | TCP | * | 192.168.1.* | * | Deny |
| 6 | UDP | * | 192.168.1.* | * | Deny |
Trust
A firewall is an example of the reference monitor, a fundamental computer security concept. Remember from Chapters 2 and 5 that a reference monitor has three characteristics:
-
always invoked
-
tamperproof
-
small and simple enough for rigorous analysis
Architecturally, a firewall is positioned at a choke point, the single connection between the protected internal network and the potentially hostile outside network, thus meeting the “always invoked” condition.
To be highly immune to modification, a firewall is typically isolated. Usually a firewall is implemented on a separate computer, with direct connections only to the outside and inside networks. This isolation is expected to meet the “tamperproof” requirement.
Furthermore, the firewall platform runs a stripped-down operating system supporting minimal services that could compromise the operating system or the firewall application. For example, the firewall probably generates a log of traffic denied, but it may not have installed tools by which to view and edit that log. Some early firewalls printed the audit log on an attached printer; once printed, the log could not be changed. In this way, even if an attacker should compromise the firewall’s system, there are no tools with which to disguise or delete the log entries that might show the incident.
Finally, firewall designers strongly recommend keeping the functionality of the firewall simple. Over time, unfortunately, users have placed increased demands on firewall functionality (such as traffic auditing, a graphical user interface, a language for expressing and implementing complex policy rules, and capabilities for analyzing highly structured traffic), so most current firewalls cannot be considered either small or simple. Nevertheless, firewall manufacturers have withstood most marketing attempts to add irrelevant functionality whose net effect is only to reduce the basis for confidence that a firewall operates as expected.
A firewall is a reference monitor, positioned to monitor all traffic, not accessible to outside attacks, and implementing only access control.
Types of Firewalls
Firewalls have a wide range of capabilities but, in general, implement a small number of distinct security services. Each type of service addresses a particular nature of threat; no one type is necessarily right or better and the others wrong. In this section we first motivate the need for different types of firewall services and then examine each type to see what it is, how it works, and what its strengths and weaknesses are. Different firewall services implement different types of policies; for example, one function called URL inspection judges traffic based only on web page header (address) data. Other firewall types look into the content being communicated to make access decisions. Simplicity in a security policy is not a bad thing; the important question to ask when choosing a type of firewall is what threats an installation needs to counter.
Network Technology Background
Before we describe actual firewalls, we need to reiterate and expand upon a bit of network technology that we introduce at the start of this chapter. Figure 6-52 depicts what is known as the ISO Open Systems Interconnect (OSI) model of networking.
FIGURE 6-52 OSI Reference Model
The sender is listed from top to bottom, numbered 7 through 1 in the following order: 7 ? Application; 6 ? Presentation; 5 ? Session; 4 ? Transport; 3 ? Network; 2 ? Data Link; 1 ? Physical. A down arrow passes beside the Sender list. The receiver is listed from top to bottom, numbered 7 through 1 in the following order: 7 ? Application; 6 ? Presentation; 5 ? Session; 4 ? Transport; 3 ? Network; 2 ? Data Link; 1 ? Physical. An up arrow passes beside the Receiver list. Between the sender and receiver, there are seven rows of boxes. The seventh row of boxes read, H1, H2, H3, M, T3, T2, and T1. The sixth row of boxes read, H2, H3, M, T3, and T2. The fifth row of boxes read, H3, M, and T3. The top four rows show a box each and each reads, M. All seven rows are shaded.
In this model, data are generated at the top layer (7—Application) by some application program. Then the data pass through the other six layers; at each layer the data are reformatted, packaged, and addressed. For example, the transport layer performs error checking and correction to ensure a reliable data flow, the network layer handles addressing to determine how to route data, and the data link layer divides data into manageable blocks for efficient transfer. The last layer, the physical layer, deals with the electrical, radio wave, or other technology by which signals are transmitted across some medium. At the destination, the data enter at the bottom of a similar stack and travel up through the layers, where addressing details are removed and items are again unpacked and reformatted. Finally, an application on the destination side receives and acts on the data. Each layer plays a well-defined role in the communication. This architecture is more conceptual than actual, but it facilitates discussion of network functions.
Different firewall functions correspond to different threats. Consider the port scan example with which we began this section. Suppose you identified an attacker who probed your system several times. Even if you decided your defenses were solid, you might want to block all outside traffic—not just port scans—from that attacker’s address, in a way similar to blocking telephone calls from a number that has made nuisance calls to you. By blocking all access by an attacker, you would prevent any subsequent attack from the same address. But that takes care of only one attacker at a time, and it assumes the attacker works from a fixed address (or phone number).
Now consider how a port scan operates. The scanner sends a probe first to port 1, then to ports 2, 3, 4, and so forth. These ports represent services, some of which you need to keep alive so that external clients can access them. But no normal external client needs to try to connect to all your ports. So you might detect and block probes from any single source that seems to be trying to investigate your network. Even if the order of the probes is not 1-2-3-4 (the scanner might scramble the order of the probes to make their detection slightly more difficult), receiving several connection attempts to unusual ports from the same source might be something to stop after you had seen enough probes to recognize the attack. For that, your firewall would need to record and correlate individual connection probes.
A different network attack might target a specific application. For example, a flaw might be known about version x.y of the brand z web server, involving a data stream containing a specific string of characters. Your firewall could look for exactly that character string directed to the web server’s port. These different kinds of attacks and different ways to detect them lead to several kinds of firewalls. Types of firewall functions include
-
URL or packet filtering
-
circuit-level or traffic and path security
-
stateful inspection
-
deep packet inspection
-
application-level protection, also known as proxying
-
guard
-
sandboxing
-
personal firewalls
We describe these types in the following sections.
URL or Packet Filtering
A URL filter or packet filtering gateway or screening router is the simplest and, in some situations, the most effective firewall function. A packet filtering gateway controls access on the basis of packet address (source or destination) or specific transport protocol type (such as HTTP web traffic or SMTP mail transfer), that is, by examining the control (outermost header) information of each single packet. A firewall can screen traffic before it gets to the protected network. So, if the port scan originated from address 100.200.3.4, you might configure the packet filtering gateway firewall to discard all packets from that address. Figure 6-53 shows a packet filter that blocks access from (or to) addresses in one network; the filter allows HTTP traffic but blocks traffic using the Telnet protocol. Packet filters operate at OSI level 3.
FIGURE 6-53 Packet Filter
Computers A, B, C, D, and E are connected to a Firewall through HTTP packets. One side of the Firewall leads to a bin through Telnet packets. The other side leads to a router which leads to an outside network.
Packet filters—screening routers—limit traffic based on packet header data: addresses and ports on packets.
Packet filters do not “see inside” a packet; they accept or reject packets solely on the basis of IP addresses and ports. Thus, any details in the packet’s data field (for example, allowing certain http commands while blocking other services) is beyond the capability of a packet filter.
Packet filters can perform the important service of ensuring the validity of inside addresses. An inside host typically trusts other inside hosts precisely because they are not outsiders: Outside is uncontrolled and fraught with harmful creatures. But the only way an inside host can recognize another inside host is by the address shown in the source field of a message. Source addresses in packets can be forged, so an inside application might think it was communicating with another host on the inside instead of an outside forger. A packet filter sits between the inside network and the outside net, so it can determine whether a packet from the outside is forging an inside address, as shown in Figure 6-54 .
FIGURE 6-54 Packet Filter Screening Outside Hosts
Computers A, B, C, D, and E having 192.168.x.y network are connected to a Firewall through src: other addresses. One side of the Firewall leads to a bin through src: 192.168.x.y. The other side leads to a router which leads to an outside network.
When we say the filtering firewall “sits between” two networks, we really mean it connects to both the inside and outside networks, by two separate interface cards. The packet filter can easily distinguish inside from outside traffic based on which interface a packet arrived on.
A screening packet filter might be configured to block all packets from the outside that claimed their source address was an inside address. In this example, the packet filter blocks all packets claiming to come from any address of the form 192.168.*.* (but, of course, it permits any packets with destination 192.168.*.*). A packet filter accepts or rejects solely according to the header information—address, size, protocol type—of each packet by itself. Such processing is simple, efficient, and fast, so a packet filtering firewall often serves as a sturdy doorkeeper to quickly eliminate obviously unwanted traffic.
The primary disadvantage of packet filtering routers is a combination of simplicity and complexity. The router’s inspection is simplistic; to perform sophisticated filtering, the rules set needs to be very detailed. A detailed rules set will be complex and therefore prone to error.
You may have seen a case similar to packet filtering with email traffic. Some organizations mark email from an outside source with a flag such as [External] in the subject field. The flag reminds an internal user when a message is from someone outside. An email handler application can easily distinguish external from internal mail and add a flag as appropriate.
Circuit-Level Gateway
A circuit-level gateway essentially allows one network to be an extension of another. It operates at OSI level 5, the session level, and it functions as a virtual gateway between two networks. A circuit is a logical connection that is maintained for a period of time and then is torn down or disconnected. The firewall verifies the circuit when it is first created. After the circuit has been verified, subsequent data transferred over the circuit are not checked. Circuit-level gateways can limit which connections can be made through the gateway.
As described previously in this chapter, SSL encryption is a workhorse in security. It can implement end-to-end security for a single virtual connection that runs for the duration of a connection, which may endure just for the exchange of a few items of data or may last years.
One use for a circuit-level gateway is to implement a VPN, described earlier in this chapter. Suppose a company has two offices, each with its own network, at addresses 100.1.1.* and 200.1.1.*. Furthermore, the company wants to ensure that communication between these two address spaces is private, so the network administrator installs a pair of encryption devices. The circuit-level gateway separates all traffic to and from the 100 and 200 networks, as shown in Figure 6-55 . (This figure shows only the 100 network; a parallel structure exists for the 200 network.) The circuit gateway on the 100 network routes all traffic to the 200 network through an encryption device. When traffic returns, the firewall on the 100 subnetwork routes all traffic from the 200 network through a similar decryption unit and back to the 100 gateway. In this way, traffic flow between the 100 and 200 networks is automatically screened (so no other traffic can masquerade as part of this pair of protected networks) and encrypted for confidentiality. Users are unaware of the cryptography, and management is assured of the confidentiality protection.
FIGURE 6-55 Circuit-Level Gateway
Computers A, B, C, D, and E having 100.1.1.x network are connected to a Circuit Gateway which connects to the router which leads to an outside network. If Dest 200.1.1.* is no, it leads to the router. If Dest 200.1.1.* is yes, it leads to encryption which leads to the router.
A circuit-level gateway connects two separate subnetworks as if they were one physically secured unit.
Encryption is inherently a slow process; modern encryption algorithms involve many logical and arithmetic functions to secure blocks of data. Today’s algorithms involve repeated cycles of scrambling, table lookup, and key manipulation. These many iterations of simple operations are ideal for implementing in hardware because they are of a fixed form that uses only a few actions. A special-purpose chip called an SSL accelerator optimizes the efficiency of SSL encryption. A circuit-level gateway can route all traffic of a protected connection through an SSL accelerator.
Stateful Inspection
Filtering firewalls work on packets one at a time, accepting or rejecting each packet and moving on to the next. They have no concept of “state” or “context” from one packet to the next. Stateful inspection or dynamic packet filtering maintains state information from one packet to another in the input stream.
Stateful inspection infers an attack according to information from multiple packets.
Recall the description of running a port scan against ports 1, 2, 3, 4, and so forth; blocking that activity is one use of a stateful inspection firewall. By itself, a probe against host 10.1.3.1 port 1 is meaningless. It is most likely a legitimate attempt to connect to the service of port 1 or a single mistake, but it could also signal the start of a port scan attack. The firewall records that address 100.200.3.4 sent a connection packet to port 1 at time 01:37.26. (A port number can be written after an address, for example, 10.1.3.1:1.) When the probe against port 2 of the same destination host arrives, the firewall may record the second connection from 100.200.3.4 at 01:37.29. After two more connection attempts at 01:37.34 and 01:37.36, the next connection at 01:37.39 meets the firewall’s rule for number of probes to different ports on a single host in a short time, so this fifth request activates a firewall rule to block all further connections from 100.200.3.4, as shown in Figure 6-56 . The firewall progresses through several states (the count of connection requests from address 100.200.3.4) from different packets until the count exceeds the threshold for acceptable behavior. The name stateful inspection refers to accumulating threat evidence across multiple packets.
FIGURE 6-56 Stateful Inspection Blocking Multiple Probes
Computers A, B, C, and D, having 10.1.3.* Network and E (host 10.1.3.1) are connected to Firewall through the attempts 10.1.3.1:4 leading to 10.1.3.1:3 leading to 10.1.3.1:2 leading to 10.1.3.1:1. One side of the firewall leads to a bin through the Further traffic from 100.200.3.4. The otherside of the firewall leads to the router which leads to an outside network.
One classic approach used by attackers is to break an attack into multiple packets by forcing some packets to have very short lengths so that a firewall cannot detect the characteristic of an attack split across two or more packets. Stateful inspection tracks the sequence of packets and conditions from one packet to another to thwart such an attack.
Deep Packet Inspection
So far the screening process described has involved examining only one part of a communication stream: the address headers. Although that type of analysis can detect and block many kinds of attacks, more clues are available. For example, although port 80 is the typical protocol address for webpages, a malicious attacker could try to sneak damaging code into a system through a different port. Thus, a security product could detect an attack from the source address, destination port number, and even the packet payload (the actual data being transmitted). Such comprehensive analysis is called deep packet inspection , in which the firewall’s accept or reject decision depends on analysis of more than one type of data from a packet.
As an example, consider a company that is developing a new product based on petroleum and helium gas, code-named “light oil.” In any outbound data flows, such as file transfers, email, webpages, or other data stream, the firewall will replace the words “petroleum,” “helium,” or “light oil” with “magic.” This firewall function inspects packets based on destination (outside the company perimeter), content (specific words), and protocol (email, web access, file transfer). So far, we have presented a firewall primarily as an inbound filter: letting in only appropriate traffic (that which conforms to the firewall’s security policy). This example shows that a firewall can similarly screen outbound traffic.
The earlier example of an [External] flag for inbound email is another example of inspection inside a packet. Email headers fit a standard form, although they are not at fixed positions within a packet. A firewall could intercept all incoming email traffic (because of the destination port number), inspect within the packets, and find the From: or Subject: header field, to which it would apply the [External] flag. A firewall is a place to apply such a warning, although it can also be done within the email application.
Deep packet inspection is a function found in several types of firewalls, including application proxies that we describe next.
Application Proxy
A different approach to filtering based on application data involves acting as the application itself. Packet filters look only at the headers of packets, not at the data inside the packets. Therefore, a packet filter would pass anything to port 993 only if its screening rules allow inbound connections to that port. But applications are complex and sometimes contain errors. Worse, applications (such as the email delivery agent) often act on behalf of all users, so they require privileges of all users (for example, to store incoming mail messages so that inside users can read them). A flawed application, running with all-users privileges, can cause much damage.
An application proxy gateway , also called a bastion host , is a firewall that simulates the (proper) effects of an application at level 7 so that the application receives only requests to act properly. A proxy gateway is a two-headed device: From the inside, the gateway appears to be the outside (destination) connection, while to outsiders, the proxy host responds just as the insider would. In fact, it behaves like a man-in-the-middle as described in Chapter 4 .
An application proxy simulates the behavior of a protected application on the inside network, allowing in only safe data.
An application proxy runs pseudoapplications. For instance, when electronic mail is transferred to a location, a sending process at one site and a receiving process at the destination communicate by a protocol that establishes the legitimacy of a mail transfer and then actually passes the mail message. The protocol between sender and destination is carefully defined. A proxy gateway essentially intrudes in the middle of this protocol exchange, seeming like a destination in communication with the sender that is outside the firewall, and seeming like the sender in communication with the real recipient on the inside. The proxy in the middle has the opportunity to screen the mail transfer, ensuring that only acceptable email protocol commands and content are sent in either direction.
As an example of application proxying, consider the FTP (File Transfer Protocol). Specific protocol commands fetch ( get ) files from a remote location, store ( put ) files onto a remote host, list files ( ls ) in a directory on a remote host, and position the process ( cd ) at a particular point in a file storage directory tree on a remote host. FTP commands are actually a subset of commands a user could execute from a workstation to manipulate files. Some administrators might want to permit get commands but block puts, to reveal only certain files or prohibit access to files outside of a particular directory (so that an outsider could retrieve only files from a prescribed subdirectory—essentially being unaware of any other parts of the directory structure). The proxy would simulate both sides of this protocol exchange. For example, in one instance the proxy might accept get commands but reject put commands. In another situation a proxy could filter the local response to a request to list files so as to reveal only a subset of files the inside administrator was willing to expose to outsiders. In this latter case, the proxy might accept a cd .. (change directory to the predecessor of the current subdirectory) command but, having determined that the external user is already positioned at the top of the permitted directory subtree, the proxy would simply drop or fail to pass the cd command to the file transfer server.
To understand the real purpose of a proxy gateway, let us consider several examples:
-
A company wants to set up an online price list so that outsiders can see the products and prices offered. It wants to be sure that (a) no outsider can change the prices or product list and (b) outsiders can access only the price list, not any of the more sensitive files stored inside.
-
A school wants to allow its students to retrieve any information from resources on the internet. To help provide efficient service, the school wants to know what sites have been visited and what files from those sites have been fetched; the school will cache particularly popular files locally.
-
A government agency wants to respond to statistical queries through a database management system. However, the agency wants to screen results so that no names or identifications are returned in results—only counts in categories.
Each of these requirements can be met with a proxy. In the first case, the proxy would monitor the FTP data to ensure that only the price list file was accessed and that the file could only be read, not modified. The school’s requirement could be met by a logging procedure joined with the web browser. The agency’s need could be satisfied by a special-purpose proxy that interacted with the database management system, performing queries but filtering the output. (Notice how similar these activities are to the man-in-the-middle attacks described in Chapter 4 and earlier in this chapter.) These functions are shown in Figure 6-57 .
FIGURE 6-57 Proxy Firewall Functions
Computers A, B, C, and D are connected to Firewall through Filtered Commands. One side of the firewall connects to the Logging Server, and the second side connects to the File cache. The third side connects to the router which connects to the outside network.
The proxies on the firewall can be tailored to specific requirements, such as logging details about accesses. They can even present a common user interface to what may be dissimilar internal functions. Suppose the internal network has a mixture of operating system types, none of which support strong authentication through a challenge–response token. The proxy can demand strong authentication (name, password, and challenge–response), validate the challenge–response itself, and then pass on only simple name and password authentication details in the form required by a specific internal host’s operating system. (This proxy action is similar to the single sign-on process described in Chapter 2 .)
The distinction between a proxy and a screening router is that the proxy interprets the protocol stream as an application would, to control actions through the firewall on the basis of things visible within the protocol, not just on external packet header data.
Guard
A guard is a sophisticated firewall. Like a proxy firewall, it receives protocol data units, interprets them, and emits the same or different protocol data units that achieve either the same result or a modified result. The guard determines what services to perform on the user’s behalf in accordance with its available information, such as whatever it can reliably ascertain the (outside) user’s identity, previous interactions, and so forth. The degree of control a guard can provide is limited only by what is computable. But guards and proxy firewalls are similar enough that the distinction between them is sometimes fuzzy. That is, we can add functionality to a proxy firewall until it starts to look a lot like a guard.
Guard activities can be quite detailed, as illustrated in the following examples:
-
A university wants to allow its students to use email up to a limit of k messages not to exceed n bytes in the last d days. Although this result could be achieved by modifying email handlers, it is more easily done by monitoring the common point through which all email flows, the mail transfer protocol.
-
A school wants its students to be able to access the internet but, because of the capacity of its connection, it will allow only so many bytes per second (that is, allowing text mode and simple graphics but disallowing complex graphics, video, music, or the like).
-
A news publication wants to supply content to attract customers but make customers pay for regular use, a strategy called a paywall. Customers can see the full content of a few articles. After that point, however, a customer requesting an article receives only the first few lines of content, followed by a message inviting the reader to pay to see the remainder.
-
A company wants to allow its employees to fetch files by FTP. However, to prevent introduction of viruses, it will first pass all incoming files through a virus scanner. Even though many of these files will be nonexecutable text or graphics, the company administrator thinks that the expense of scanning them (which file shall pass) will be negligible.
A guard can implement any programmable set of conditions, even if the program conditions become highly sophisticated.
Each of these scenarios can be implemented as a modified proxy. Because the proxy decision is based on some determinable quality of the communication data, we call the proxy a guard. Think of a human guard who controls a door. The guard may have rules, such as to admit only persons having an appropriate identity badge. But the guard also has certain discretion, for example, to admit a baby carried by a woman with a badge. Both automated and human guards are appropriate for dealing with intricate rules. Because the security policy implemented by the guard is somewhat more complex than the action of a proxy, the guard’s code is also more complex and therefore more exposed to error. Simpler firewalls have fewer possible ways to fail or be subverted. An example of a guard process is the so-called Great Firewall of China, described in Sidebar 6-23 .
Sidebar 6-23 Great Firewall of China
Rulers in the People’s Republic of China want to control data to which their residents have access. Content companies like Google have been told that if they want to do business in China, they need to employ special versions of their web applications that filter out “offensive words.” When Skype wanted to enter the Chinese market, it was similarly told it had to scrub text messages; the result: Skype text now eliminates words such as “Falun Gong” and “Dalai Lama.” China also encourages its own alternatives to products such as Facebook, Twitter, YouTube, and Wikipedia.
Bloomberg Business News reported that in 2006, China employed 30,000 people to monitor content on websites and report on ones that violate standards [ ELG06 ]. By 2017, that estimate rose to 2 million people. All internet traffic passes through a bank of government-controlled firewalls. Any email or text messages that contain banned words are dropped at the firewall.
The Great Firewall blocks access to popular sites including Google, Instagram, Twitter, Wikipedia, and Facebook, as well as most news sites. Also, the technology blocks specific IP addresses, reduces service quality (speed) on some links, and interferes with DNS resolution of addresses outside China.
Chinese residents found that VPNs would let them create an encrypted tunnel to a server outside China to fetch news that would not be filtered by the Great Firewall. In 2018, China ordered its three main telecommunications providers (and ISPs) to not allow VPNs. Chinese users reported that after establishing a VPN connection, they found the connection was dropped.
In 2020, researchers reported that SSL connections between China and a non-Chinese point were being blocked [BLO20]. Apparently the Chinese ISPs were injecting reset commands into SSL traffic streams, causing the connection to fail. After blocking a connection, the Chinese ISPs jammed the connection for two to three minutes, preventing either end from (re)establishing an SSL connection.
Although not technically a firewall, the Great Firewall of China, formally known by the more appealing name Golden Shield Project, certainly performs firewall functions. However, as the cited examples show, filtering content is more difficult than simply screening addresses.
Sandbox
A final firewall capability is to protect against potential malicious code by use of a sandbox . A firewall can detect inbound code. Instead of allowing the code to execute on an internal host, where malicious code could affect sensitive resources or modify or obtain protected data, the code runs in a web-based sandbox, by which its access to resources or data is severely constrained. If the code’s actions seem benign, a security administrator can decide to permit the code into the protected zone. An example of a sandbox is shown in Figure 6-58 .
FIGURE 6-58 Sandbox
Computers B, C, D, and E are connected to a router. The router is connected to a firewall. One side of the firewall is connected to the sandbox tat the computer A. The other side is connected to the outside network.
We have purposely arranged these firewall types from simple to complex. Simple screening is highly mechanistic and algorithmic, implying that code to implement it is regular and straightforward. Complex content determinations edge closer to machine intelligence, a more heuristic and variable activity. More complex analysis takes more time, which may affect a firewall’s performance and usefulness. No single firewall approach is necessarily right or better; each has its appropriate context of use.
Personal Firewalls
Firewalls typically protect a (sub)network of multiple hosts. University students and employees in offices are behind a real firewall. Increasingly, home users, individual workers, and small businesses use cable modems or other broadband connections with unlimited, always-on access. These people need a firewall, but a separate firewall computer to protect a single workstation can seem too complex and expensive. These people need a firewall’s capabilities but cheaper and simpler to use.
A personal firewall is an application program that runs on the device it protects. A personal firewall can complement the work of a conventional firewall by screening the kind of data a single host will accept, or it can substitute for a regular firewall, as with a cable or other broadband connection.
A personal firewall runs on a single host to monitor and control traffic to that host. It can require support from the operating system.
Just as a network firewall screens incoming and outgoing traffic for that network, a personal firewall screens traffic on a single workstation. A workstation could be vulnerable to malicious code or malicious active agents (ActiveX controls or Java applets), leakage of personal data stored on the workstation, and vulnerability scans to identify potential weaknesses.
Each personal firewall is configured to enforce some policy. For example, the user may decide that certain sites, such as computers on the company network, are highly trustworthy, but most other sites are not. Vendors sometimes supply and maintain lists of unsafe sites to which their products block access by default. The firewall manager defines a policy permitting download of code, unrestricted data sharing, and management access from the corporate segment but not from other sites. A parent might activate a personal firewall to block sites that are not appropriate for the ages of the children users. Personal firewalls can also generate logs of accesses, which can be useful to examine in case something harmful does slip through the firewall.
Combining a malware scanner with a personal firewall is both effective and efficient. Typically, users forget to run scanners regularly, but they do remember to run them occasionally, such as sometime during the week or month. However, sporadic scanning means that the scanner detects a problem only after the fact—perhaps long after a virus has been downloaded and installed from an email attachment. With the combination of a virus scanner and a personal firewall, the firewall directs all incoming email to the virus scanner, which examines every attachment the moment it reaches the target host and before it is opened.
A personal firewall runs on the very computer it is trying to protect. Thus, a clever attacker is likely to attempt an undetected attack that would disable or reconfigure the firewall for the future. As described in Sidebar 6-24 , users can defeat the security policy of their own firewall. You learned in Chapter 4 that code that hooks into an operating system can be a rootkit itself, a potential threat, while on the other hand, such code can be vulnerable to a crafty attack through the operating system by a rootkit. Still, especially for cable modem, DSL, and other always-on connections, the static workstation is a visible and vulnerable target for an ever-present attack community. A personal firewall can provide reasonable protection to clients that are not behind a network firewall.
Sidebar 6-24 Poking a Hole in the Firewall
Firewalls have clear security benefits, but sometimes they prevent well-intentioned users from accessing needed data and functions. For instance, firewalls usually prevent a user on one system from using the FTP to upload or download files on another system. For this reason, someone inside the firewall sometimes “pokes a hole” through the firewall so that a trusted outsider can get in temporarily. Such a hole is actually an exception entered into the firewall policy rules. These holes allow files to be shared, applications to be accessed, and more. Technically called an SSH backdoor, the firewall hole can be set up in various ways. Once the outsider’s work is done, the insider closes up the hole and protection is restored.
Some operating systems allow rules that intentionally breach firewalls. For example, Windows formally allows a user to create the hole by setting “exceptions” on the administrative screen for the Windows firewall, shown in Figure 6-58 . (Although this image is from an outdated version of Windows, we use it because it highlights the exception rules.) The exceptions can either open a port or, preferably, enable a specified program or service to have access within the firewall.
FIGURE 6-59 Firewall Exceptions
The title bar read, Windows Firewall. The tabs below read, General, Exceptions, and Advanced. Exceptions is selected. The text below reads, Windows Firewall is blocking incoming network connection, except for the programs and services selected below. Adding exceptions allows some programs to work better but might increase your security risk. Programs and Services: The table below shows column headers, Name, and Group policy. A list of names and group policies are listed, and some of them are checked. The first name is selected. The bottom shows the following buttons: Add Program, Add Port, Edit, and Delete. A text with a check box reads, Display a notification when Window Firewall blocks a program. A link below reads, what are the risks of allowing exceptions? The bottom right shows Ok and cancel buttons.
What are the downsides of such firewall breaches? They weaken the firewall, perhaps to the point of disabling it. Such breaches risk inadvertently allowing others (other than the traffic for which the exception is being created) to squeeze through the hole at the same time.
So is it permissible to poke a hole in a firewall? Only if it is absolutely necessary, is temporary, and is done with the permission of the system administrator and access through this hole is closely monitored. Such situations may arise in emergencies, when protected information or services are needed to address unusual problems. The challenge is to ensure that the emergency does not become standard practice and that the exception is removed after its use.
Comparison of Firewall Types
We can summarize the differences among the several types of firewalls we have profiled. The comparisons are shown in Table 6-6 . Firewall types are arranged generally from least sophisticated on the left to more so on the right, with the exception of personal firewalls, which are more like an enterprise packet filter. Do not, however, interpret least sophisticated as meaning weakest or least desirable; in fact, packet filtering firewalls are the workhorses of enterprise networks, quickly and efficiently blocking much undesirable traffic. As you study this table, bear in mind that firewalls, like many other commercial products, are caught in marketing wars. Products that started as simple packet filters soon began to appear with functions more normally found in stateful inspection and application-level firewalls. Thus, few products now fit the crisply distinct definitions of types just presented, and the cells of this table describe fundamental properties that may be enhanced in practice.
Table 6-6 Comparison of Firewall Types
| Packet/URL Filter | Circuit Gateway | Stateful Inspection | Application Proxy | Guard | Personal Firewall |
|---|---|---|---|---|---|
| Simplest decision-making rules, packet by packet | Joins two subnetworks | Correlates data across packets | Simulates effect of an application program | Implements any conditions that can be programmed | Similar to packet filter, but getting more complex |
| Sees only addresses and service protocol type | Sees addresses and data | Can see addresses and data | Sees and analyzes full data portion of pack | Sees and analyzes full content of data | Can see full data portion |
| Auditing limited because of speed limitations | Auditing likely | Auditing possible | Auditing likely | Auditing likely | Auditing likely |
| Screens based on connection rules | Screens based on address | Screens based on information across multiple packets—in either headers or data | Screens based on behavior of application | Screens based on interpretation of content | Typically, screens based on content of each packet individually, based on address or content |
| Complex addressing rules can make configuration tricky | Relatively simple addressing rules; make configuration straightforward | Usually preconfigured to detect certain attack signatures | Simple proxies can substitute for complex decision rules, but proxies must be aware of application’s behavior | Complex guard functionality; can be difficult to define and program accurately | Usually starts in mode to deny all inbound traffic; adds addresses and functions to trust as they arise |
Examples of Firewall Configurations
Let us look at several examples to understand how to use firewalls. We present situations designed to show how a firewall complements a sensible security policy and architecture.
The simplest use of a firewall is shown in Figure 6-60 . This environment has a screening router positioned between the internal LAN and the outside network connection. In many cases, this installation is adequate when we need to screen only the address of a router.
FIGURE 6-60 Screening Router
Computers A, B, C, D, and E are connected to the Screening router as firewall. One side of the screening router leads to a bin and the other side leads to an outside network.
However, to use a proxy machine, this screening router’s placement is not ideal. Similarly, configuring a router for a complex set of approved or rejected addresses is difficult. If the firewall router is successfully attacked, all traffic on the LAN to which the firewall is connected is visible. To reduce this exposure, a firewall may be installed on its own LAN, as shown in Figure 6-61 . The firewall’s LAN feeds traffic to a router for a separate protected LAN of users’ machines. In this configuration, the only traffic visible to the outside is on the firewall’s LAN, whose data either came from the outside or are destined to go outside.
FIGURE 6-61 Firewall on Separate LAN
Computers A, B, C, D, and E are connected to a router. The router is connected to the firewall. One side of the firewall leads to a bin and the other side leads to a router that leads to an outside network.
Proxying leads to a slightly different configuration. The proxy host–firewall communicates with both internal systems and the outside because it looks like an internal host to the outside.
Examples of proxied applications include email, webpage service, and file transfer. A common situation provides a more detailed example—a proxy application for webpage servers: A company has an internal web structure, with pages describing products, customers, and perhaps internal contact information. The company maintains a protected database of products, including stock on hand, but the company does not want to release exactly how many units of a product are on hand. Thus, each time the system is ready to display a product’s page, the firewall queries the database and, according to the result obtained, replaces the exact quantity by a line saying “available now,” “a few left,” or “out of stock.” The firewall serves as a user’s proxy to access the database on behalf of the outside user but limits the information returned from the query. (Adding this functionality to a firewall is an unnecessary exposure. The engine producing webpage responses to user queries could add the same description with less security impact.)
A typical architecture for this situation is shown in Figure 6-62 . The webpage server, also known as a bastion host, is on its own LAN, isolated from the main internal LAN by a second firewall.
FIGURE 6-62 Application Proxy
Five computers are connected to a Database server that is connected to the first firewall. The firewall is connected to the first router. The router is connected to the Application proxy zone. The Application proxy zone shows the Webpage server linked to the second firewall and linearly linked to a bin. The other side of the firewall is linked to the second router which is linked to the outside network.
The same architecture can be extended, as shown in Figure 6-63 . In this figure, the externally accessible services, such as webpages, email, and other public accesses, are on servers in the demilitarized zone or DMZ , named after the military buffer space, sometimes called the “no man’s land,” between the territories held by two competing armies.
FIGURE 6-63 Demilitarized Zone
Five computers with Internal LAN (private network) are linked to the Database server which is linked to the first Firewall. The firewall is linked to the first router, which links to the Demilitarized Zone (DMZ). The first router is linked to a second firewall. A linear arrangement shows a database server, a Comms server, an Email server, a Webpage server, and a second firewall. One side of the firewall is linked to a bin and the other side is linked to a second router which links to the outside network.
In all these examples, the network architecture is critical. A firewall can protect only what it can control, so if a subnetwork has external connections not screened by the firewall, the firewall cannot control traffic on that unscreened connection. An example is a device with its own direct internet connection (perhaps a rogue wireless connection). As we saw earlier in this chapter, visibility to one device, perhaps via the wireless connection mentioned here, can give an attacker visibility and access to other devices. For this reason, the only path to every protected network device must pass through the network’s firewall.
Outside users can access data in a firewall’s demilitarized zone but cannot get to sensitive resources on the more protected inside network.
Although these examples are simplifications, they show the kinds of configurations firewalls protect.
Actual Firewall Design
As we said at the beginning of this section on firewalls, the first firewalls were of distinct types: They filtered on packet header information, packet content, correlations between packets, or complex content analysis. Firewall vendors honed their engines to be extremely efficient filters (in part because each firewall had to evaluate all of its subnetwork’s traffic, which could be heavy in volume and speed). To impose the smallest possible drag on the servers’ performance, early firewall vendors prided themselves on minimality of function, which led to blazing throughput.
Consider automobiles. One vendor promotes a sleek, speedy vehicle, while another extols cargo capacity or fuel efficiency or smoothness of ride. If a consumer cares only about speed, it is easy to compare a handful of high-performance cars. But few purchasers care about just one issue. A purchasing couple might have one partner who focuses on speed while another is more concerned about fuel economy. Automobile manufacturers’ marketing teams realize that a successful car must appeal to as broad a user base as possible. Nobody goes so far as to build a sports car that is also good for hauling heavy loads and large families. But successful products appeal to a broad user base.
A similar situation has occurred with firewalls. Early firewall designs adhered to one of the types described in this section. However, over time, the sharp lines between firewall types have blurred. Packet filtering, stateful inspection, and application-level threat detection used to be found in distinct firewall types; now one product uses “novel ways” to secure a subnetwork. Vendors describe this breadth as full (protocol) stack visibility.
This merging of features is good in that one device can counter a variety of threats. Complex functionality does put additional pressure on vendors to develop products that are good at all these things.
Next, we review the kinds of attacks against which firewalls can and cannot protect.
What Firewalls Can—and Cannot—Block
As we have seen, firewalls are not complete solutions to all computer security problems. A firewall protects only the perimeter of its environment against attacks from outsiders who want to execute code or access data on the machines in the protected environment. Keep in mind these points about firewalls:
-
Firewalls can protect an environment only if the firewalls control the entire perimeter. That is, firewalls are effective only if no unmediated connections breach the perimeter. If even one inside host connects to an outside address without going through the firewall, by a wireless connection for example, the entire inside net is vulnerable through the unprotected host. This point relates to the network topology discussion with which we began our study of firewalls.
-
Firewalls do not protect data outside the perimeter; data that have properly passed (outbound) through the firewall are just as exposed as if there were no firewall.
-
Firewalls are the most visible part of an installation to the outside, so they are the most attractive target for attack. For this reason, several layers of protection, called defense in depth, are better than relying on the strength of just a single firewall.
-
Firewalls must be correctly configured, that configuration must be updated as the internal and external environments change, and firewall activity reports must be reviewed periodically for evidence of attempted or successful intrusion.
-
Firewalls are targets for penetrators. Although a firewall is designed to withstand attack, it is not impenetrable. Designers intentionally keep a firewall small and simple so that even if a penetrator breaks it, the firewall does not host further tools, such as compilers, linkers, loaders, and the like, to continue an attack.
-
Firewalls exercise only minor control over the content admitted to the inside, meaning that inaccurate data or malicious code must be controlled by other means inside the perimeter.
Firewalls are important tools in protecting an environment connected to a network. However, the environment must be viewed as a whole, all possible exposures must be considered, and the firewall must fit into a larger, comprehensive security strategy. Firewalls alone cannot secure an environment.
Network Address Translation (NAT)
Firewalls protect internal hosts against unacceptable inbound or outbound data flows. However, as shown earlier in this chapter, sometimes an outsider can gain valuable information just by learning the architecture, connectivity, or even size of an internal network. When internal hosts present their IP addresses to an outsider (necessary if the outsider is expected to reply), the outsider can infer some of the network structure from the pattern of addresses. Furthermore, once released, these addresses will forever be known and exploitable by outsiders. Conveniently, a firewall can also prevent this information from escaping.
Every packet between two hosts contains the source host’s address and port and the destination host’s address and port. Port 80 is the number conventionally used for HTTP (webpage) access. As shown in Figure 6-64 , internal host 192.168.1.35 port 80 is sending a packet to external host 65.216.161.24 port 80. Using a process called network address translation (NAT) , the source firewall converts source address and port 192.168.1.35:80 in the packet to the firewall’s own address, 173.203.129.90. The firewall also makes an entry in a translation table showing the destination address, the (internal) source port, and the original (internal) source address to be able to redirect any replies to the original source address. As you might expect, the firewall converts the address back on any return packets.
FIGURE 6-64 Network Address Translation
Private domain 192.168.1. - User at 192.168.1.35 connects to the packet (Generates packet src = 192.168.1.35:80) which connects to Public domain 173.203.129.90 which links to an outside network that again connects to a packet (src = 173.203.129.90:4236) which connects to a packet (Destination 65.216.161.24).
Network address translation conceals real internal addresses; outsiders who do not know real addresses cannot access them directly.
The only complication to this scheme occurs if two internal hosts both contact the same destination address over the same port, which might be expected if two internal hosts independently wanted to access the webpage at nytimes.com , for example. In this case, the firewall would rewrite the source port number of one requesting host to a random different number so that the firewall could properly retranslate the return. Internal host 192.168.1.35 might become 173.203.129.90 port 4236, and 192.168.1.57 might become 173.203.129.90 port 4966. The firewall, of course, keeps track of which port number matches with which internal address.
The outside world sees only one public address, 173.203.129.90, for the whole secured private network, so outsiders cannot infer the structure of the internal network. In fact, outsiders do not know whether one communication at one time is from the same internal host as a later communication, thus shielding individual internal users somewhat. Finally, knowing the supposed address of an insider will not help an outsider later: If an outsider crafts traffic to the same address at a later time, the firewall will reject the traffic because the sender’s address is no longer in the translation table. Although primarily used because of another problem (limited public address numbers), network address translation performs a significant security role. This translation is a wonderful side benefit of using firewalls.
6.8 Intrusion Detection and Prevention Systems
After the perimeter controls, firewalls, and authentication and access controls block certain actions, some users are admitted to use a computing system. Most of these controls are preventive: They block known bad things from happening. Many studies (for example, see [ DUR99 ]) have shown that most computer security incidents are caused by insiders or people impersonating them, people who would not be blocked by a firewall or other perimeter control. And insiders require access with significant privileges to do their daily work. The vast majority of harm from insiders is not malicious; it is honest people making honest mistakes. Then, too, there are the potential malicious outsiders who have somehow passed the screens of firewalls and access controls. Prevention, although necessary, is not a complete computer security control; detection during an incident copes with harm that cannot be prevented in advance. Larry Halme and Ken Bauer [ HAL95 ] wrote a careful taxonomy of the range of controls to deal with intrusions.
Intrusion detection systems complement other preventive controls as the next line of defense. An intrusion detection system ( IDS ) is a device, typically a separate computer, that monitors activity to identify malicious or suspicious events. Richard Kemmerer and Giovanni Vigna [ KEM02 ] recount the history of IDSs. An IDS is a sensor, like a smoke detector, that raises an alarm if specific conditions occur.
As with smoke alarms, detecting danger necessitates action. Whether the response is calling the fire department, activating a sprinkler system, sounding an evacuation alarm, or alerting the control team (or all of these) depends on what advance plans have been made to handle the incident. IDSs likewise have a response function. In many cases, the response is to alert a human team that will then decide what further action is warranted. Sometimes, however, the IDS goes into protection mode to isolate a suspected intruder and constrain access. IDSs can do this by electronically reconfiguring a network so as to disconnect the infected segment from the uninfected portion. A response system is called an intrusion protection system ( IPS ). We describe both IDS and IPS technology in this section. Often in the field the term “intrusion detection system” includes those devices performing intrusion protection as well.
Just like firewall filtering functions, intrusion detection technology has evolved and become mainstream. For marketing reasons, each intrusion detection product has had to present features comparable to (ideally better than) its competitors, so the race for leader of the intrusion detection pack has become one in which everyone tries to do everything. Intrusion detection devices have become so useful that most firewalls now include some intrusion detection and prevention capabilities. What we describe as stand-alone products are frequently seen as capabilities within a firewall device.
We apologize in advance for using terminology loosely in this section on intrusion detection. As you certainly know, a computer does not “know” anything and it certainly does not find, notice, or recognize, at least not in the sense that we humans do. We can say that a program produced a result from analysis or correlation of data, but sentences like that can be complicated and mechanical. We know that you as a reader and technologist understand the difference between wonderful, inspired programming and human discernment. Even with the great advances of artificial intelligence, computers do not “learn” or “detect” in the way we people do; they remain devices executing programs.
A model of an IDS is shown in Figure 6-65 . The components in the figure are the four basic elements of an intrusion detection system, based on the Common Intrusion Detection Framework of [ STA96 ]. An IDS receives raw inputs from sensors. It saves those inputs, analyzes them, and takes some controlling action.
FIGURE 6-65 Model of an Intrusion Detection System
Raw event source connects to Events (E) which connects to (S) Storage through Raw or low-level event data and (A) Analysis. (A) Analysis connects to (S) Storage, (C) Countermeasures through High-level interpreted events, and to (A) Analysis. (E) Events links to (C) Countermeasures which leads further through Reactions to events.
IDSs perform a variety of functions:
-
monitoring users and system activity
-
auditing system configuration for vulnerabilities and misconfigurations
-
assessing the integrity of critical system and data files
-
recognizing known attack patterns in system activity
-
identifying abnormal activity through statistical analysis
-
managing audit trails and highlighting user violation of policy or normal activity
-
correcting system configuration errors
-
installing and operating traps to record information about intruders
No one IDS performs all of these functions. Let us look more closely at the kinds of IDSs and their use in providing security.
Types of IDSs
The two general types of IDSs are signature based and heuristic. Signature-based IDSs perform simple pattern-matching and report situations that match a pattern (signature) corresponding to a known attack type. Heuristic IDSs, also known as anomaly based ones, build a model of acceptable behavior and flag exceptions to that model; for the future, the administrator can mark a flagged behavior as acceptable so that the heuristic IDS will now treat that previously unclassified behavior as acceptable. Thus, heuristic IDSs are said to learn what constitute anomalies or improper behavior. This learning occurs as an artificial intelligence component of the tool, the inference engine , identifies pieces of attacks and rates the degree to which these pieces are associated with malicious behavior.
Signature-based IDSs look for patterns; heuristic ones learn characteristics of unacceptable behavior over time.
Early IDSs (for example, [ DEN87 , LUN90 , FOX90 , LIE89 ]) worked after the fact by reviewing logs of system activity to spot potential misuses that had occurred. The administrator could review the results of the IDS to find and fix weaknesses in the system. Now, however, IDSs operate in real time (or near real time), watching activity and raising alarms in time for the administrator to take protective action.
Signature-Based Intrusion Detection
A simple signature for a known attack type might describe a series of TCP SYN packets sent to many different ports in succession and at times close to one another, as would be the case for a port scan. An IDS would probably find nothing unusual in the first SYN, say, to port 80, and then another (from the same source address) to port 25. But as more and more ports receive SYN packets, especially ports that normally receive little traffic, this pattern reflects a possible port scan. Similarly, some implementations of the protocol stack fail if they receive an ICMP packet with a data length of 65535 bytes, so such a packet would be a pattern for which to watch.
The problem with signature-based detection is the signatures themselves. An attacker will try to modify a basic attack in such a way that it will not match the known signature of that attack. For example, the attacker may convert lowercase letters to uppercase or convert a symbol such as “blank space” to its character code equivalent %20. The IDS must necessarily work from a canonical form of the data stream to recognize that %20 matches a pattern with a blank space. The attacker may insert spurious packets that the IDS will see, or shuffle the order of reconnaissance probes, to intentionally cause a pattern mismatch. Each of these variations could be detected by an IDS, but more signatures require additional work for the IDS, thereby reducing performance.
Of course, a signature-based IDS cannot detect a new attack for which no signature has yet been installed in the database. Every attack type starts as a new pattern at some time, and the IDS is helpless to warn of its existence. Attackers also try to change their signature.
Signature-based IDSs often incorporate statistical analysis. This approach uses tools both to obtain sample measurements of key indicators (such as amount of external activity, number of active processes, number of transactions) and to determine whether the collected measurements fit the predetermined attack signatures.
Signature-based IDSs are limited to known patterns.
Ideally, signatures should match every instance of an attack and match subtle variations of the attack but not match traffic that is not part of an attack. However, this grand goal is unreachable.
Signature-based intrusion detection works well on certain types of DoS attacks. For example, ping and echo-chargen attacks are relatively easy to spot from their distinctive packet types. On the other hand, some attacks are hard for an IDS to identify. Because a teardrop attack depends on many packets that do not fit together properly, an IDS can notice that attack only after collecting information about all or a significant number of the packet fragments. And because packet fragmentation is a characteristic of most traffic, the IDS would need to maintain data on virtually all traffic, a challenging (but not impossible) task. Similarly, a SYN flood is recognized only by a profusion of unmatched SYN–ACK responses; but because SYN–ACK is part of the three-way TCP handshake, it is a part of every communication session established, which makes it difficult for the IDS to classify the behavior as an attack.
Heuristic Intrusion Detection
Because signatures are limited to specific, known attack patterns, another form of intrusion detection becomes useful. Instead of looking for matches, heuristic intrusion detection looks for behavior that is out of the ordinary. The original work in this area (for example, [ TEN90 ]) focused on the individual, trying to find characteristics of that person that might be helpful in understanding normal and abnormal behavior. For example, one user might always start the day by reading email, sending a few text messages, reviewing yesterday’s to-do list, and occasionally backing up files. These actions would be normal. This user does not seem to use many administrator utilities. If that person opened the day by trying to access sensitive system management utilities, this new behavior might be a clue that someone else was acting under the user’s identity.
If we think of a compromised system in use, it started clean, with no intrusion, and it ended dirty, fully compromised. There may be no point in an administrator’s tracing the use in which the system changed from clean to dirty; more likely, little dirty events occurred, occasionally at first and then increasing as the system became more deeply compromised. Any one of those events might be acceptable by itself, but their accumulation and their order and pace could have been signals that something unacceptable was happening. The inference engine of an intrusion detection system continuously analyzes the system, raising an alert when the system’s dirtiness exceeds a threshold or when a combination of factors signals likely malicious behavior.
Let’s consider an example. A network computer belonging to Ana starts to inspect other network computers, looking at which ones have storage areas (files) available to other network users. When Ana probes Boris’s computer, the IDS may classify that act as unusual, but Boris’s computer denies her access and the IDS simply notes the denied access request. Then when Ana probes Chen’s machine, the second attempt becomes more unusual. It turns out that Chen’s machine has a file structure open to the network, and Ana obtains a directory listing of all accessible files on Chen’s machine, which the IDS flags as suspicious. When Ana then tries to copy all of Chen’s files, the IDS recognizes a likely attack and triggers an alarm to an administrator. Any of the actions Ana (or someone using her access credentials) took is not significant by itself, but each piece of the accumulation leads to greater suspicion and finally an alarm.
Inference engines work in two ways. Some, called state-based intrusion detection systems, see the system going through changes of overall state or configuration, from clean to dirty in the way we described. State-based IDSs then try to detect when the system has veered into unsafe modes, became sort of dirty, so to speak. So, in our example the states would be probing (clean), probing again (not completely clean), listing contents (borderline), copying contents (certainly dirty).
Alternatively, intrusion detection can work from a model of known bad activity whereby the IDS raises an alarm when current activity matches the model to a certain degree. These are called model-based intrusion detection systems. This approach has been extended to networks in [ MUK94 ]. Later work (for example, [ FOR96 , LIN99 ]) sought to build a dynamic model of behavior to accommodate variation and evolution in a person’s actions over time. The technique compares real activity with a known representation of normality. For example, except for a few utilities (log in, change password, create user), any other attempt to access a password file is suspect. This form of intrusion detection is known as misuse intrusion detection . In this work, the real activity is compared against a known suspicious pattern. Returning to our example, Ana’s searching for open files and then copying a large number is a misuse.
To a heuristic IDS, all activity is classified in one of three categories: good/benign, suspicious, or unknown. Over time, specific kinds of actions can move the system’s overall state from one of these categories to another, corresponding to the IDS’s inference of whether certain actions are acceptable.
As with pattern-matching, heuristic intrusion detection is limited by the amount of information the system has seen (to classify actions into the right category) and how well the current actions fit into one of these categories. The advantage of heuristic intrusion detection is that systems learn over time. Again with our simple model of clean to dirty, initially the system classified only two states, clean and dirty. But as the system found more dirty situations, it learned precursors to dirty: when x happens, the system subsequently becomes dirty most of the time. Thus, x becomes an indicator the system learns to monitor. The system then focuses on precursors to x , to learn what else to watch for. IDS designers counter the small data problem by pooling observations from systems in many networks over time.
Heuristic intrusion detection infers attacks by tracking suspicious activity.
Stateful Protocol Analysis
As we noted, intrusion detection by means of pattern-matching is difficult if the pattern to be matched is long or variable. A SYN flood attack has a simple pattern (SYN, SYN–ACK, no corresponding ACK), but these are three separate steps spread over time; detecting the attack requires recognizing step one, later finding step two, and then waiting a reasonable amount of time before concluding that step three is true. Think of an IDS as a state machine, with a state for each of these steps, as shown in Figure 6-66 . The IDS needs to record which state it is in. Now multiply the number of states to account for hundreds of thousands of concurrent connections by many users. The logic of the IDS is complicated: Many handshakes may be in progress at any time, and the IDS must maintain the state of each of them. Computers are well suited to the task of maintaining and analyzing many threads of data.
FIGURE 6-66 IDS State Machine
State 1: Initial leads to State 2: SYN received through SYN recognized. State 2: SYN received leads to State 3: SYN-ACK sent which leads to State 4: Waiting for ACK. State 4: Waiting for ACK leads to Onetime or many? through ACK wait limit expired, and to State 1: Initial through ACK received: normal. Onetime or many? If once, it leads to State 1: Initial through Infrequent: Probably an error, not an attack. If many, it leads to Indicate attack.
Other protocols have similar stateful representations. As the IDS monitors traffic, it will build more possible patterns, matching traffic to the expected nature of the interchange. The different protocols with their different states and transition conditions are multiplied by the number of instances (for example, the number of concurrent TCP connections being established at any time), making the IDS bookkeeping complex indeed.
Front End versus Internal IDSs
An IDS can be placed either at the front end of a monitored subnetwork or on the inside. A front-end device intercepts traffic as it enters the network and thus can inspect all packets; it can take as much time as needed to analyze them, and if it finds something that it classifies as harmful, it can block the packet before the packet enters the network. All this processing reduces data flow speed by a small but generally imperceptible amount. A front-end IDS may be visible on the outside, and thus it may be a target of attack itself. Skillful attackers know that disabling the defenses of an IDS renders the network easier to attack. Front-end intrusion detection technology is frequently integrated into a firewall.
On the other hand, a front-end IDS does not see inside the network, so it cannot identify any attack originating or even fermenting inside. An internal device monitors activity within the network. If an outside attacker is sending unremarkable packets to a compromised internal machine, instructing that machine to initiate a DoS attack against other hosts on that network, a front-end IDS will not notice that attack. Thus, if one internal computer begins sending threatening packets to another computer on the inside, for example, an echo–chargen stream, the internal IDS would be able to detect that. An internal IDS is also more well protected from outside attack because it is not visible outside the network. Furthermore, an internal IDS can learn typical behavior of internal machines and users so that if, for example, user A suddenly started trying to access protected resources after never having done so previously, the IDS could record and analyze that anomaly.
Host Based and Network Based
Host-based intrusion detection (called HIDS ) runs on and protects a single host against attack. It collects and analyzes data for that one host. The operating system supplies some of that data to the IDS, passing along approved and denied requests to access sensitive resources, logs of applications run, times and dates of actions, and other security-relevant data. The device either analyzes data itself or forwards the data to a separate machine for analysis and perhaps correlation with HIDSs on other hosts. The goal of a host-based system is to protect just one machine and its data. If an intruder disables that IDS, however, it can no longer protect its host. Being a process on the target computer also exposes the HIDS to the vulnerability of being detected.
A network-based IDS or NIDS is generally a separate network appliance or a function built into a firewall that monitors traffic on an entire network. It receives data from firewalls (if separate), operating systems of the connected computers, other sensors such as traffic volume monitors and load balancers, and administrative actors on the network. The goal of a NIDS is to protect the entire network or some set of specific sensitive resources, such as a collection of servers holding critical data. The detection software can also monitor the content of packets communicated across the network, to detect, for example, unusual activity by one host (that might have been compromised) against another. A network IDS is better able to protect itself against detection or compromise than a host-based one because the network IDS can observe but never communicate on the network it is monitoring. That way an attacker will not know the attack has been recognized.
A HIDS monitors host traffic; a NIDS analyzes activity across a whole network to detect attacks on any network host.
Protocol-Level Inspection Technology
We have described attacks that require different kinds of inspection, for example:
-
Ping and echo commands require the IDS to inspect the individual packets to determine packet type.
-
Malformed packets require the IDS to detect an error in the general structure of the packet.
-
Fragmentation requires the IDS to recognize over time that the separate pieces of the data unit cannot be reassembled correctly.
-
Buffer overflow attacks require the IDS to monitor applications.
An IDS is said to operate at a particular network level or layer. For example, an IDS that detects malformed packets will not likely also be able to monitor application data because that would require the IDS to do all the work of reassembling packets to extract the application-level data. Thus, different IDSs, or different components of an IDS package, monitor a network at different levels.
That model of separation makes a clear story and a logical design, but it does not match reality. Today’s IDSs do a little bit of everything, monitoring activity at several levels. As with firewalls, competition has forced all designers to expand their offerings.
That trend has affected IDSs in two ways. First, the clear distinction between signature- and anomaly-based IDSs is less precise as products now use some of both approaches. Second, the filtering function of a firewall and the inspection function of an IDS involved some overlap and redundancy. Now, firewalls include some IDS functionality, and there are fewer stand-alone IDSs. Both these changes are positive. The result is more effectiveness with less overhead.
Some security engineers consider other devices to be IDSs as well. For instance, to detect unacceptable code modification, programs can compare the active version of software code with a saved version of a digest of that code. The Tripwire program [ KIM98 ] (described in Chapter 4 ) is a typical static data comparison program. It can detect changes to executable programs and other data files that should never or seldom change.
Goals for Intrusion Detection Systems
The two styles of intrusion detection—pattern-matching and heuristic—represent different approaches, each of which has advantages and disadvantages. Actual IDS products often blend the two approaches.
Ideally, an IDS should be fast, simple, and accurate as well as rigorous and complete. It should detect all attacks with negligible performance penalty. An IDS could use some—or all—of the following design approaches:
-
Filter on packet headers.
-
Filter on packet content.
-
Maintain connection state.
-
Use complex, multipacket signatures.
-
Use minimal number of signatures with maximum effect.
-
Filter in real time, online.
-
Hide its presence.
-
Use optimal sliding-time window size to match signatures.
Stealth Mode
An IDS is a network device (or, in the case of a host-based IDS, a program running on a network device). Any network device is potentially vulnerable to network attacks. How useful would an IDS be if it itself were deluged with a DoS attack? If an attacker succeeded in logging in to a system within the protected network, wouldn’t trying to disable the IDS be the next step?
To counter those problems, most IDSs run in stealth mode , whereby an IDS has two network interfaces: one for the network (or network segment) it is monitoring and the other to generate alerts and perhaps perform other administrative needs. The IDS uses the monitored interface as input only; it never sends packets out through that interface. Often, the interface is configured so that the device has no published address through the monitored interface; that is, no router can route anything directly to that address because the router does not know such a device exists. It is the perfect passive wiretap. If the IDS needs to generate an alert, it uses only the alarm interface on a completely separate control network. Such an architecture is shown in Figure 6-67 .
FIGURE 6-67 IDS Control Network
The IDS control network is connected to IDS through the firewall which is optional. The IDS is connected to the outside network through another firewall. Where the network is monitored.
Stealth mode IDS prevents the attacker from knowing an alarm has been raised.
Accurate Situation Assessment
Intrusion detection systems are not perfect, and mistakes are their biggest problem. Although an IDS might detect an intruder correctly most of the time, it may stumble in two different ways: by raising an alarm for something that is not really an attack (called a false positive, or type I error in the statistical community) or not raising an alarm for a real attack (a false negative, or type II error). Too many false positives means the administrator will be less confident of the IDS’s warnings, perhaps leading to a real alarm’s being ignored. But false negatives mean that real attacks are passing the IDS without action. We say that the degree of false positives and false negatives represents the sensitivity of the system. Most IDS implementations allow the administrator to tune the system’s sensitivity to strike an acceptable balance between false positives and negatives.
IDS Strengths and Limitations
Intrusion detection systems are evolving products. Research began in the mid-1980s, and commercial products had appeared by the mid-1990s. However, this area continues to change as new research influences the design of products.
On the upside, IDSs detect an ever-growing number of serious problems. And as we learn more about problems, we can add their signatures to the IDS model. Thus, over time, IDSs continue to improve. At the same time, they are becoming cheaper and easier to administer.
On the downside, avoiding an IDS is a high priority for successful attackers. At best, a compromised device is useless, and one might even be harmful. Fortunately, stealth mode IDSs are difficult even to find on an internal network, let alone to compromise.
IDSs look for known weaknesses, whether through patterns of known attacks or models of normal behavior. Similar IDSs may have identical vulnerabilities, and their selection criteria may miss similar attacks. Knowing how to evade a particular model of IDS is an important piece of intelligence passed within the attacker community. Of course, once manufacturers become aware of a shortcoming in their products, they try to fix it. Fortunately, commercial IDSs are pretty good at identifying attacks.
Another IDS limitation is its sensitivity, which is difficult to measure and adjust. IDSs will never be perfect, so finding the proper balance is critical.
A final limitation is not of IDSs per se, but is one of use. An IDS does not run itself; someone has to monitor its track record and respond to its alarms. An administrator is foolish to buy and install an IDS and then ignore it.
In general, IDSs are excellent additions to a network’s security. Firewalls block traffic to particular ports or addresses; they also constrain certain protocols to limit their impact. But by definition, firewalls have to allow some traffic to enter a protected area. Watching what that traffic actually does inside the protected area is an IDS’s job, which it does quite well.
Intrusion Prevention Systems
Intrusion detection systems work primarily to detect an attack after it has begun, and naturally, system or network owners want to prevent the attack before it happens. Think of house burglars. You install locks to prevent an intrusion, but those really do not stop a truly dedicated burglar who will smash and enter through a window or cut a hole in the roof if the motivation is strong enough. As the adage says, where there’s a will, there’s a way. A second difficulty is that you never know when the attacker will strike, whether the attacker will be alone or in a gang of thousands of people, whether the attacker will be a person or an army of trained ants, or whether the brass band marching past your house is part of an attack. You may install a house alarm that senses motion, pressure, body heat, scent, or some other characteristic of an attacker so that regardless of how the attacker entered, you or the police are informed of the intrusion. But even an alarm presupposes the attacker will be a person, when in fact it might be a robot, drone, or space invader. Furthermore, such alarms are subject to false positives because a household pet or a balloon moving in the breeze can set off the alarm.
Similarly, computer systems are subject to many possible attacks, and preventing all of them is virtually impossible. Outguessing the attacker, actually all attackers, is also virtually impossible. Adding to these difficulties is distinguishing an attack from benign but unusual behavior. Detecting the attack gets easier as the attack unfolds, when it becomes clearer that the motive is malicious and that harm is either imminent or actually underway. Thus, as evidence mounts, detection becomes more certain; being able to detect bad things before they cause too much harm is the premise on which intrusion detection systems are based.
By contrast, an intrusion prevention system , or IPS , tries to block or stop harm. In fact, it is an IDS with a built-in response capability. The response is not just raising an alarm; the automatic responses include cutting off a user’s access, rejecting all traffic from address a.b.c.d, or blocking all users’ access to a particular file or program. Everything already said of IDSs is also true of IPSs. In the next section we consider some of the actions IPSs can take after having detected a probable attack.
IPSs extend IDS technology with built-in protective response.
Intrusion Response
Intrusion detection is probabilistic. Even in the face of a clear pattern, such as an enormous number of ping packets, perhaps thousands of people just happened to want to test whether a server was alive at the same time, although that possibility is decidedly unlikely. In taking action, especially if a tool causes the action automatically, a network administrator has to weigh the consequences of action against the possibility that there is no attack.
Responding to Alarms
Whatever the type, an IDS raises an alarm when it finds a match. The alarm can range from something modest, such as writing a note in an audit log, to something significant, such as paging the system security administrator. Particular implementations allow the administrator to determine what action the system should take on what events.
What are possible responses? The range is unlimited and can be anything the administrator can imagine (and program). In general, responses fall into four major categories (any or all of which can be used in a single response):
-
Monitor , collect data, perhaps increase amount of data collected.
-
Protect , act to reduce exposure.
-
Signal an alert to other protection components.
-
Call a human .
Monitoring is appropriate for an attack of modest (initial) impact. Perhaps the real goal is to watch the intruder to see what resources are being accessed or what attempted attacks are tried. Alternatively, the system might have classified activity as an attack but with a relatively low confidence level in that classification. The prudent course of action might be to watch closely but take no further action at this time. Another monitoring possibility is to record all traffic from a given source for future analysis—that is, gather more data than usual. This approach should be invisible to the attacker.
Protecting can mean increasing access controls and even making a resource unavailable (for example, shutting off a network connection or making a file unavailable). The system can even sever the network connection the attacker is using. In contrast to monitoring, protecting may be very visible to the attacker. Visible action may be exactly the right course if it causes the attacker to cease and go elsewhere.
Protecting can be very close to signaling. As an analogy, suppose you see someone acting suspiciously, for example, testing the doors on cars parked on the street to see whether they are locked. You would protect against such behavior by watching to make sure the intruder does not get into your car. You would signal by calling neighbors to warn them of this suspicious behavior. A better signal would be calling the police to let them investigate on behalf of all neighbors. In a network context, think of protecting as securing certain specific devices in one virtual ring, and of signaling as raising the alert status of other devices in a wider virtual ring.
Finally, calling a human allows individual discrimination. The IDS can take an initial, perhaps overly strong, defensive action immediately while also generating an alert to a human, who may take seconds, minutes, or longer to respond but then applies a more precise but nuanced counteraction.
Alarm
The simplest and safest action for an IDS is simply to generate an alarm to an administrator who will then determine the next steps. Humans are most appropriate to judge the severity of a situation and choose among countermeasures. Furthermore, humans can remember past situations and sometimes recognize connections or similarities that an IDS may not detect. (These qualities are why you would want to call the police in the previous example.)
Unfortunately, generating an alarm requires that a human be constantly available to respond to that alarm and that the response be timely and appropriate. If multiple sensors generate alarms at the same time, a human can become overloaded and miss new alarms or be so involved with one that the second alarm is not handled quickly enough. Worse, the second alarm can so distract or confuse the human that action on the first alarm is jeopardized. In Sidebar 6-25 we discuss how too many alarms contributed to a serious breach. False alarms compound and condition a human responder to not act.
Sidebar 6-25 Target Corp. Overwhelmed by Too Many Alarms
In late 2013, Russian hackers infiltrated the network of Target, a major retailer in the United States. The attackers planted code to collect shoppers’ credit and debit card numbers, including the verification number that would make those numbers quite valuable on the black market. In all, 40 million numbers were stolen in a few weeks leading up to Christmas, typically a retailer’s busiest shopping period of the year.
Target had invested in intrusion detection technology, which was working and spotted suspicious activity. The software notified Target’s security monitoring center, which analyzed the situation and raised an alert to the firm’s security operations center on 30 November and again on 2 December. The staff of the security operations center did nothing.
“Like any large company, each week at Target there are a vast number of technical events that take place and are logged. Through our investigation, we learned that after these criminals entered our network, a small amount of their activity was logged and surfaced to our team,” said Target spokeswoman Molly Snyder via email. “That activity was evaluated and acted upon.” [ SCH14 ]
The threats received were classified as “malware.binary,” meaning an unidentified piece of malicious code of unknown type, source, or capability. Some experts say they expect the Target security team received hundreds of such threat alerts every day.
This story points out the difficulty of using IDS technology: Unless someone acts on the alarms produced, raising the warning has no value. But sometimes the number of alarms is so large the response team is swamped. With too many alarms, responders can become complacent, ignoring serious situations because previous investigations of alerts turned up empty.
Adaptive Behavior
Because of these limitations of humans, an IDS can sometimes be configured to take action to block the attack or reduce its impact. Here are some of kinds of actions an IDS can take:
-
Continue to monitor the network.
-
Block the attack by redirecting attack traffic to a monitoring host, discarding the traffic, or terminating the session.
-
Reconfigure the network by bringing other hosts online (to increase capacity) or adjusting load balancers.
-
Adjust performance to slow the attack, for example, by dropping some of the incoming traffic.
-
Deny access to particular network hosts or services.
-
Shut down part of the network.
-
Shut down the entire network.
Counterattack
A final action that can be taken on a detection of an attack is to mount an offense, to strike back. An example of such an attack is described in Sidebar 6-26 .
Sidebar 6-26 Counter-Counter-Countermeasures?
Wikileaks maintains a website of leaked sensitive data from anonymous sources. On 22 November 2010 it announced it was going to leak a massive number of internal U.S. diplomatic messages beginning on 28 November. On 28 November, it announced its website was under a serious DoS attack, even before the first release of diplomatic messages, but WikiLeaks continued to release the messages.
Unknown people, presumably angered by WikiLeaks’ breaching security in releasing these cables, apparently launched a DoS attack against it. The severity of the attack was great enough that on 2 December WikiLeaks’ hosting provider, Amazon Web Services, a division of online retailer Amazon.com , canceled its contract with WikiLeaks, forcing the site to find a new provider. Next, unknown people launched a DoS attack against the DNS provider serving WikiLeaks, EveryDNS. WikiLeaks switched to a Swiss hosting provider, using a network architecture supported by 14 different DNS providers and over 350 mirror sites [ BRA10 ]. Thus, the anti-WikiLeaks forces and their DoS attack caused WikiLeaks to move content and to arrange hosting contracts abruptly.
Meanwhile, the anti-anti-WikiLeaks forces took action. A leaderless group, named Anonymous, on 8 December 2010 launched a series of DoS attacks of its own, called Operation Payback. The targets were MasterCard, which had been accepting donations to transfer to WikiLeaks but had stopped that practice; Amazon, the web hosting company that canceled service for WikiLeaks; PayPal, which had also stopped accepting payments for WikiLeaks; and other smaller targets. Anonymous involved a group of about 1,500 activist hackers who were organizing in online forums and chats. The attack disabled MasterCard’s online services for about six hours.
John Perry Barlow, co-founder of the Electronic Frontier Foundation (EFF) and Fellow at Harvard University's Berkman Center for Internet and Society, tweeted: “The first serious infowar is now engaged. The field of battle is WikiLeaks. You are the troops.”
Offensive action must be taken with great caution for several reasons:
-
The apparent attacker may not be the real attacker. Determining the true source and sender of internet traffic is not foolproof. Taking action against the wrong party only makes things worse.
-
A counterattack can lead to a real-time battle in which both the defenses and offenses must be implemented with little time to assess the situation.
-
Retaliation in anger is not necessarily carefully considered and measured.
-
Legality can shift. Limited, necessary action to protect one’s resources is a well-established legal principle. Taking offensive action opens one to legal jeopardy, comparable to that of the attacker.
-
Provoking the attacker can lead to escalation. The attacker can take the counterattack as a challenge.
False positives are the Achille’s heel of an IPS. If the IPS incorrectly classifies an activity as malicious and blocks it or reduces a network’s capabilities, it has a negative effect on the very network the IPS is intended to protect. For this reason, network administrators prefer using technology to detect problems and raise alarms while leaving the decision to react to humans.
6.9 Network Management
The security components of firewalls, IDSs and IPSs are designed to operate largely on their own, monitoring their respective threat landscapes and issuing alerts if something appears amiss. If security were static, administrators could activate and forget about these devices.
However, as we point out repeatedly in this book, security is constantly evolving. Administrators have to ensure security devices have the latest threat definitions and the latest software releases for the devices themselves. But large networks change as new devices are brought online and other ones are replaced or removed. Think, for example, of the complexity of managing the network of a typical university: Students and faculty arrive, sometimes with new devices; other people and pieces of technology leave. One research group at the university might establish a joint venture with a commercial lab, requiring sharing of limited data. A visiting scholar might want to connect seamlessly with her home institution. Statistical reports must be filed with various offices and agencies. Many other situations require network administrators to act. Add to these demands the need to analyze security data generated: logs of blocked accesses, alerts of possible intrusion behavior, and summaries of access trends.
Then, too, there are the mechanical aspects of network management. To manage capacity, some networks use devices called load balancers that transfer traffic between servers to smooth demand and response. Equipment can fail, first requiring an administrator to notice the failure and identify the failed equipment, and second, potentially requiring reconfiguration or replacement. And from time to time the administrator has to review the entire network design to think through and implement possible revisions.
For all these reasons, network administrators need tools to help them manage their resources.
Management to Ensure Service
Networks are not set-and-forget kinds of systems; because network activity is dynamic, administrators need to monitor network performance and adjust characteristics as necessary to ensure adequate performance for users.
In this section we list some of the kinds of management that networks require. Recognize, however, that most of this information is useful for network administrators whose main responsibility is keeping the network running smoothly, not defending against DoS attacks. These measures counter ordinary cases of suboptimal performance but not concerted attacks. In this section we merely mention these topics; for details you should consult a comprehensive network administration reference.
Capacity Planning
One benign cause of denial of service is insufficient capacity: too much data or demand for too little capability. Not usually viewed as a security issue, capacity planning involves monitoring network traffic load and performance to determine when to upgrade which aspects.
A network or component running at or near capacity has little margin for error, meaning that a slight but normal surge in traffic can put the network over the top and cause significant degradation in service.
Websites are especially vulnerable to unexpected capacity problems. A news site may run fine during normal times until a significant event occurs, such as the death of a famous person or an earthquake, plane crash, or terrorist attack, after which many people want the latest details on the event. Launching a new product with advertising can also cause an overload; events such as opening sales of tickets for a popular concert or sporting event have swamped websites. Network administrators need to be aware of these situations that can cause unexpected demand.
Load Balancing
Popular websites such as those of iTunes, Netflix, and the New York Times are not run on one computer alone; no single computer has the capacity to support all the traffic these sites receive at once. Instead, these places rely on many computers to handle the volume. In 2016, Netflix managed its own content network, and it had over 4,000 servers around the world. Then, it decided to move content distribution to the cloud, so it no longer has servers dedicated to providing content to users.
Network load balancing directs incoming traffic to resources with available capacity.
The public is unaware of these multiple servers, for example, when using the URL www.nytimes.com , which may become server1.nytimes.com or www3.nytimes.com . In fact, on successive visits to the website, different servers might handle a user’s activity. A load balancer is an appliance that redirects traffic to different servers while working to ensure that all servers have roughly equivalent workloads.
Network Tuning
Similarly, network engineers can adjust traffic on individual network segments. If two clients on one segment are responsible for a large proportion of the traffic, it may be better to place them on separate segments to even the traffic load. Engineers can install new links, restructure network segments, or upgrade connectivity to ensure good network performance. Network tuning depends on solid data obtained by monitoring network traffic over time.
In a real attack, network administrators can adjust bandwidth allocation to segments, and they can monitor incoming traffic, selectively dropping packets that seem to be malicious. (Note: Overzealously dropping packets risks little harm; TCP protocols detect missing packets and seek retransmission, and UDP protocols do not guarantee delivery. Losing a small percentage of legitimate traffic while fending off a DoS attack is an acceptable tradeoff.)
Rate limiting is a countermeasure that reduces the impact of an attack. With rate limiting, the volume of traffic allowed to a particular address is reduced. Routers can send a quench signal back to another router that is forwarding traffic; such a signal informs the sending router that the receiving router is overloaded and cannot keep up, therefore asking the sender to hold up on transmitting data. A quench can work its way back through a network to a source of attack, as long as the attack comes from a single point. Of course, a true attacker is unlikely to honor such a quench request.
Network Addressing
A problem inherent in internet (IPv4) addressing is that any packet can claim to come from any address: A system at address A can send a packet that shows address B as its source. That statement requires a bit of elaboration because address spoofing is not simply a matter of filling in a blank on a webpage. Most users interact with the internet through higher-level applications, such as browsers and mail handlers, that craft communications streams and pass them to protocol handlers, such as bind and socks . The protocol handlers perform the network interaction, supplying accurate data in the communication stream. Thus, someone can spoof an address only by overriding these protocol handlers, which requires privilege in an operating system. Hacker tools can do that interaction, and researchers Beverly and Bauer [ BEV05 ] report on an experiment in which they spoofed transmissions from a quarter of internet addresses.
ISPs could do more to ensure the validity of addresses in packets. With difficulty, providers can distinguish between traffic from their own customers—whose address blocks the provider should know and be able to verify—and traffic from outsiders. Having reliable source addresses would limit certain DoS attacks, but the internet IPv4 protocol design does not include mechanisms to support address authenticity. The enhancements in the newer IPv6 addressing support more reliable source addresses, although use of these enhancements is not mandatory. The transition from IPv4 to IPv6 is underway; as of 2022 adoption of IPv6 stands at just under 40%, according to Google’s measurement of sites and traffic it handles. We are not yet close to the complete replacement of IPv4 by IPv6.
Shunning
With reliable source addresses, network administrators can set edge routers to drop packets engaging in a DoS attack. This practice, called shunning , essentially filters out all traffic from implicated addresses. Real-time monitoring that detects an attack determines the addresses from which the attack is coming and acts quickly to block those addresses. A firewall or router can implement shunning of a particular address
Shunning has a downside, however. If an attacker can detect that a site implements shunning, the attacker can send attack traffic spoofed to appear to be from a legitimate source. That is, the attacker might make it appear as if the attack is originating at a site such as google.com or facebook.com , for example; shunning that apparent attack has the negative outcome of denying legitimate traffic from Google or Facebook.
Blacklisting and Sinkholing
In extreme cases, the network administrator may decide to effectively disconnect the targeted system. The administrator can blacklist the target address, meaning that no traffic goes to that address, from legitimate or malicious sources alike. Alternatively, the administrator may redirect traffic to a valid address where the incoming traffic can be analyzed; this process is called sinkholing .
Shunning, blacklisting, and sinkholing are extreme network countermeasures blocking all traffic from or to a specific address.
Both of these countermeasures can be applied at the network edge, before the overload volume of traffic is allowed to overwhelm an internal subnetwork. Otherwise, the excessive traffic could overwhelm all of an internal subnetwork, thereby denying or degrading service to all hosts on the subnetwork, not just the one host that was the target of the attack.
All these administrative measures carry potential risks. Network monitoring affects network performance because intercepting, analyzing, and forwarding traffic takes time and therefore imposes a delay. In normal operation the delay is minor, but at the moment of an attack, this delay, which affects good as well as malicious traffic, further slows an already stressed system. Furthermore, good management requires detailed analysis, to see, for example, not only that the traffic is a SYN packet but that the SYN packet came from address a.b.c.d, which is the same address from which 250 unmatched SYN packets have recently originated. Recognizing a SYN packet can be done instantly; recognizing address a.b.c.d as involved in 250 previous attacks requires analysis of retained historical data. More precise inspection produces more useful information but also takes more time for the inspection.
Network appliances such as firewalls, routers, switches, and load balancers often provide data for people to analyze and manage the network. Too much information can overwhelm a human network administrator, especially someone whose security skills are limited. Thus, management countermeasures are more appropriate for networks large or important enough to have an experienced security staff with adequate resources.
Security Information and Event Management
In this chapter we have discussed networking and security products, including routers, switches, VPNs, and several varieties of firewalls, IDSs, and IPSs. A large enterprise can have hundreds or even thousands of such products, often of different brands and models, as well as tens of thousands of servers and workstations, all of which need to be monitored by security personnel. In this section we discuss the security management (known as security information and event management or SIEM) tools that make it possible for a small security team to monitor and respond to security issues from all over such an enterprise.
Consider the challenges a network security administrator faces. A large network will have
-
network structure tools, such as switches and routers, some of which are integrated with firewalls
-
security tools, such as stand-alone firewalls, IDS/IPS devices, guards or outbound flow filters, reports from sandboxed code, and other security devices
-
physical security sensors that record entry and exit to the building or to a sensitive space within the building
-
personnel data advising of employees on leave or working from a remote location
-
software, including databases, applications, and conferencing support programs
-
other tools to measure and monitor network performance, such as load balancers and segment traffic flow monitors
Each of these sources produces its own transaction data, some of which is relevant to security. These data sources are depicted in Figure 6-68 .
FIGURE 6-68 Security Data Sources in a Typical Network
External data sources; Threat intelligence; Network performance; Switch, Router/ firewall, Router; Firewall, IDS/IPS, Sandbox, Other security controller, Guard/filter; Physical access/visitor control, WiFi access; Database access, Application, Meeting support are connected to Security administration.
To further complicate the situation, these different tools and applications probably derive from different vendors. Thus, the administrator is likely faced with different security data logs, in different formats, with different degrees of sensitivity, each intended to be reviewed individually. But, of course, no administrator has time to scrutinize these separate outputs carefully, especially if the vast majority of items in the logs are benign: An authorized user took an unremarkable action. Figure 6-68 shows only one of each type of data source; even a medium-sized network will have many instances of some types. Our administrator may also want to consult outside sources, such as advice on emerging threats or an internet database matching an owner with each IP address. Finally, the administrator has to manually correlate events in different logs. Even establishing a common timeline is tricky.
SIEM tools help organizations recognize and act on security threats and vulnerabilities before they have a chance to disrupt business operations. The tools use adaptive strategies to automate many manual processes associated with threat detection and incident response.
The earliest SIEM tools were simple audit log analysis tools. Over the years, SIEM has matured to become more than the log management tools that preceded it. Today’s tools help to correlate data from different sources and over a span of time.
SIEM tools offer significant capabilities, such as these:
-
Real-time threat recognition . The ideal threat response occurs in real time, not after significant time has passed.
-
Regulatory compliance auditing . In some industries, for example, finance and health care, government regulations require a company to demonstrate protection of sensitive resources, especially personal data. SIEM tools can help document compliance with regulations.
-
Adaptive protection . As threat conditions change, SIEM tools can adapt to the changing conditions, both to handle evolving threats and to adapt to change in nonmalicious user behavior.
-
Improved organizational efficiency . One monitoring, management, and control system saves effort from network administrators. Administrators are hard pressed to aggregate and then correlate such data. SIEM tools are designed to parse different data streams and combine all the data into a single, consistent, easy-to-understand structure.
-
Advanced and novel threat detection . As monitoring tools detect new patterns of behavior, tools can feed a centralized database for the benefit of all users. Some tools can share what they have detected with a common data repository, for the benefit of other users (on other networks and for different organizations).
-
Forensic investigation support . In the event of an incident, an organization’s most important task is to determine what happened in order to prevent a reoccurrence. SIEM tools can bring together and filter the data for after-the-fact analysis. Reliable collection and storage of data is important for evidence to be used in legal action.
-
User and application monitoring . Users, applications, and networked devices change over time. Administrators use SIEM tools to track the impact of changes. Trying one approach or allowing an exception on a trial basis works best if the administrator can also observe the actual impact on security.
-
Ease of access . Most SIEM tools present the administrator with a real-time dashboard view of various security aspects of a network. With visual presentations, humans can grasp and appreciate a network situation quickly.
All-of-the-Above Products or Families
These last sections have explored three classes of security tools: firewalls, intrusion detection and prevention systems, and security information and event management tools. Researchers and engineers defined and built each of these approaches to address particular security threats. Each device was a major advance in security technology.
Over time, the good features of one product migrated into others, first into other models of the same kind of product and then into more comprehensive products implementing the best qualities of all. We describe the current state of that amalgamation next.
Next Generation Firewall
A Next-Generation Firewall ( NGFW ) is a product that includes features from several basic firewall types. Firewall vendor Cisco defines a next-generation firewall as “a network security device that provides capabilities beyond a traditional, stateful firewall. While a traditional firewall typically provides stateful inspection of incoming and outgoing network traffic, a next-generation firewall includes additional features like application awareness and control, integrated intrusion prevention, and cloud-delivered threat intelligence.” As firewall vendor Palo Alto Networks describes, “a next-generation firewall (NGFW) is a type of application firewall that combines the best features of a traditional network firewall and a web application firewall [which we describe as an application proxy]. It typically acts as a firewall that blocks incoming requests by inspecting the network layer packets, but it also has additional inspection capabilities that unlock novel ways to block unwanted traffic on your private network.” Gartner group states that an NGFW includes
-
standard firewall capabilities like stateful inspection
-
integrated intrusion prevention
-
application awareness and control to see and block risky apps
-
upgrade paths to include future information feeds
-
techniques to address evolving security threats
Thus, Gartner, and the major product vendors who will be rated by Gartner, expect both a combination of capabilities and a means to enhance the firewall as security threats evolve.
A small, stand-alone organization might need just one firewall to protect the perimeter of its small network against threats from moderately motivated attackers. By contrast, consider a large organization with physically separated campuses, having complex needs for high-performance online access. An example of such an organization is a worldwide hotel chain with an online reservation and client management system or a popular social media company. Such cases require high availability unimpeded by security incidents. These uses will be well served by an integrated, expandable array of network and security products including load balancing, auditing, performance tracking, intrusion detection and prevention, and traffic filtering. Major firewall vendors all offer a suite of products, ranging from simple products to integrated components.
Vendors will gladly sell a single firewall, but they would rather contract for an ongoing relationship that includes maintaining (updating) the firewall, monitoring its activity, and managing the security of the network. A relatively new product type is the firewall as a service or firewall in the cloud . Traditional security products—firewalls and IDS/IPS monitoring devices—reside at the customer’s location, meaning that the customer is responsible for configuring, maintaining and upgrading or downsizing as necessary. Security vendors seized the opportunity for outsourcing the product management. A cloud firewall is, essentially, a security device located anywhere that intercepts and screens traffic to a user, as depicted in Figure 6-69 . All the familiar firewall features still apply, except that now the device is remote.
FIGURE 6-69 Cloud-Based Security Devices
A Security enforcement device is linked to four routers. Each router is connected to the following: Security device management, Campus/headquarters site, Remote branches, and Remote users.
The advantage to the customer is that the vendor company assumes responsibility for maintaining the device, monitoring its operation, updating any security databases (such as signatures of attack types), and reporting problems to the user. Additionally, the vendor gets to review all traffic to the customer, so the vendor’s security analysts can learn about attack types as they evolve and, more important, use that learning to secure other customers. Security seems to be moving in this direction of outsourcing.
Since their appearance in the early 1990s, firewalls have been an important addition to network security because they automate security analysis. Network speed has made such automation necessary; no human could possibly review even a minute fraction of network traffic. Combining network security devices and outsourcing to security professionals are a natural progression. In Chapter 8 we address cloud computing and the Internet of Things, two advances that will continue the increase of networked computing and consequently of its threats.
As the number and types of threats grow, two principles from Chapter 1 are key. No matter how networked computing evolves, the threats will still seek to disrupt some combination of confidentiality, integrity, and availability, the familiar C–I–A triad. And the (human) attackers will require method (skills or knowledge), opportunity, and motive. Protection products will evolve, as will the threat types. But at each change to the computing environment, you should continue to ask yourself how such a change fits with C–I–A and M–O–M. Such questions will remain critical even as uses, products, and capabilities progress.
6.10 Conclusion
In this chapter we have covered many details of network communications and security. Some of the material has expanded on previous topics (such as interception and modification) in a new context, while some has been unlike topics we have previously explored (such as DDoS). We have explored technology (including WiFi communications and security protocols, DNS, firewalls, and intrusion detection devices) and policy and practice (network management). Network security is extraordinarily important in the larger field of computer security, but it builds on many of the elements we have already established (encryption, identification and authentication, access control, resilient design, least privilege, trust, threat modeling). Thus, although this chapter has presented many new terms and concepts, much of the material should seem like reasonable extensions and expansions of what you already know.
As we lay out in Chapter 1 , our order of topics in Chapters 2 through 6 intentionally moves from things closest to the user (programs) to those most remote (networks). In the next chapter we take yet one more step away by looking at data and how it is collected, aggregated, and analyzed. With networks, the user has some control of one end of the connection. However, the user gives up data almost imperceptibly and has little, if any, control over how it is used, by whom, and when.
6.11 Exercises
1. In this chapter we describe sequence numbers between a sender and receiver as a way to protect a communication stream against substitution and replay attacks. Describe a situation in which an attacker can substitute or replay in spite of sequence numbers. For which type of sequence numbering—one general stream of sequence numbers or a separate stream for each pair of communicators—is this attack effective?
2. Does a gasoline engine have a single point of failure? Does a motorized fire truck? Does a fire department? How can a fire department protect against a single point of failure in the engine of a fire truck? Explain your answers.
3. Telecommunications network providers and users are concerned about the single point of failure in “the last mile,” which is the single cable from the network provider’s last switching station to the customer’s premises. How can a customer protect against that single point of failure? Comment on whether your approach presents a good cost-benefit tradeoff.
4. You are designing a business in which you will host companies’ websites. What issues can you see as single points of failure? List the resources that could be involved. State ways to overcome each resource’s being a single point of failure.
5. The human body exhibits remarkable resilience. State three examples in which the body compensates for failure of single body parts.
6. How can hardware be designed for fault tolerance? Are these methods applicable to software? Why or why not?
7. The old human telephone “switches” were quaint but slow. You would signal the operator and say you wanted to speak to Ruth, but the operator, knowing Ruth was visiting Sally, would connect you there. Other than slowness or inefficiency, what are two other disadvantages of this scheme?
8. An analog telephone call is “circuit based,” meaning that the system chooses a wire path from sender to receiver and that path or circuit is dedicated to the call until it is complete. What are two disadvantages of circuit switching?
9. The OSI model is inefficient; each layer must take the work of higher layers, add some result, and pass the work to lower layers. This process ends with the equivalent of a gift inside seven nested boxes, each one wrapped and sealed. Surely this wrapping (and unwrapping) is inefficient. (Proof of this slowness is that the protocols that implement the internet—TCP, UDP, and IP—are represented by a four-layer architecture.) From reading earlier chapters of this book, cite a security advantage of the layered approach. Explain your answer: Why is the approach an advantage? To what degree; that is, does it outweigh the overhead? Could your advantage be woven into a smaller protocol stack, such as TCP/IP?
10. Obviously, the physical layer has to be at the bottom of the OSI stack, with applications at the top. Justify the order of the other five layers as moving from low to high abstraction.
11. List the major security issues dealt with at each level of the OSI protocol stack.
12. What security advantage occurs from a packet’s containing the source NIC address and not just the destination NIC address? But because the source NIC address can be falsified, suggest one way a receiving site could validate the source NIC address if that became important.
13. TCP is a robust protocol: Sequencing and error correction are ensured, but there is a penalty in overhead (for example, if no resequencing or error correction is needed). UDP does not provide these services but is correspondingly simpler. Cite specific situations in which the lightweight UDP protocols could be acceptable, that is, when error correction or sequencing is not needed.
14. Assume no mail transfer protocol (such as SMTP) for the sending of email messages exists. List three security features or mechanisms you would include in your protocol.
15. Suppose you are designing an online file-sharing capability such as Dropbox. List three security functions you would include in your capability.
16. A 32-bit IP addressing scheme affords approximately 4 billion addresses. Compare this number to the world’s population. Every additional bit doubles the number of potential addresses. Although 32 bits is becoming too small, 128 bits seems excessive, even allowing for significant growth. But not all bits have to be dedicated to specifying an address. Cite a security use for a few bits in an address.
17. When a new domain is created, for example, yourdomain.com , a table in the .com domain has to receive an entry for yourdomain. What security attack might someone try against the registrar of .com (the administrator of the .com table) during the creation of yourdomain.com ?
18. A port scanner is a tool useful to an attacker to identify possible vulnerabilities in a potential victim’s system. Cite a situation in which someone who is not an attacker could use a port scanner for a nonmalicious purpose.
19. Compare copper wire, microwave, optical fiber, infrared, and (radio frequency) wireless in their resistance to passive and active wiretapping.
20. Explain why the onion router prevents any intermediate node from knowing the true source and destination of a communication.
21. Is there a necessary minimum number of intermediate nodes in onion routing? That is, would the privacy goals be met if there were only two nodes: source and destination? Three (one intermediate)? Four? Justify your answer.
22. Suppose an intermediate node for onion routing were malicious, exposing the source and destination of communications it forwarded. Clearly this disclosure would damage the confidentiality onion routing was designed to achieve. If the malicious node were one of two in the middle, what would be exposed? If it were one of three, what would be lost? Explain your answer in terms of the malicious node in each of the first, second, and third positions. How many nonmalicious nodes are necessary to preserve privacy?
23. A problem with pattern-matching is synonyms. If the current directory is bin, and . denotes the current directory and .. its parent, then bin, ../bin, ../bin/., .././bin/../bin all denote the same directory. If you are trying to block access to the bin directory in a command script, you need to consider all these variants (and an infinite number more). Cite a means by which a pattern-matching algorithm copes with synonyms.
24. HTTP is by definition stateless, meaning that it has no mechanism for “remembering” data from one interaction to the next. (a) Suggest a means by which you can preserve state between two HTTP calls. For example, you may send the user a page of books and prices matching a user’s query, and you want to avoid having to look up the price of each book again once the user chooses one to purchase. (b) Suggest a means by which you can preserve some notion of state between two web accesses many days apart. For example, the user may prefer prices quoted in euros instead of dollars, and you want to present prices in the preferred currency next time without asking the user.
25. How can a website distinguish between lack of capacity and a DoS attack? For example, websites often experience a tremendous increase in volume of traffic right after an advertisement displaying the site’s URL is shown on television during a popular broadcast. How can a site administrator determine when high traffic is reasonable?
26. SYN flood is the result of some incomplete protocol exchange: The client initiates an exchange but does not complete it. Unfortunately, these situations can also occur normally. Describe a benign situation that could cause a protocol exchange to be incomplete.
27. A DDoS attack requires zombies running on numerous machines to perform part of the attack simultaneously. If you were a system administrator looking for zombies on your network, what would you look for?
28. Suppose you were drafting legislation to prevent zombies from being hosted by servers in your community. Consider that many system owners or administrators would not be conscious that a host was being used for DDoS activity. What rules or regulations would you include in your legislation to prevent zombies?
29. Signing of mobile code is a suggested approach for addressing the vulnerability of hostile code. Outline what a code-signing scheme would have to do.
30. The system must control applets’ accesses to sensitive system resources, such as the file system, the processor, the network, and internal state variables. But the term “the file system” is very broad, and useful applets usually need some persistent storage. Suggest controls that could be placed on access to the file system. Your answer has to be more specific than “allow all reads” or “disallow all writes.” Your answer should essentially differentiate between what is “security critical” and not, or “harmful” and not.
31. Suppose you have a high-capacity network connection coming into your home and a wireless network access point. Also suppose you do not use the full capacity of your network connection. List three reasons you might still want to prevent an outsider from obtaining free network access by intruding into your wireless network.
32. Why is segmentation recommended for network design? That is, what makes it better to have a separate network segment for web servers, one for the back-end office processing, one for testing new code, and one for system management?
33. For large applications, some websites use load balancers to distribute traffic evenly among several equivalent servers. For example, a search engine might have a massive database of content and URLs, and several front-end processors that formulate queries to the database manager and format results to display to an inquiring client. A load balancer would assign each incoming client request to the least busy front-end processor. What is a security advantage of using a load balancer?
34. Can link and end-to-end encryption both be used on the same communication? What would be the advantage of that? Cite a situation in which both forms of encryption might be desirable.
35. Does a VPN use link encryption or end-to-end? Justify your answer.
36. Why is a firewall a good place to implement a VPN? Why not implement it at the actual server(s) being accessed?
37. Does a VPN use symmetric or asymmetric encryption? Explain your answer.
38. What is the security purpose for the sequence number field of an IPsec packet?
39. ACLs on routers slow throughput of a heavily used system resource. List two advantages of using ACLs. List a situation in which you might want to block (reject) certain traffic through an ACL on a router, that is, a situation in which the performance penalty would not be the deciding factor.
40. What information might a stateful inspection capability of a firewall want to examine from multiple packets?
41. Recall that packet reordering and reassembly occur at the transport level of the TCP/IP protocol suite. A firewall will operate at a lower layer, either the internet or data layer. How can a stateful inspection firewall determine anything about a traffic stream when the stream may be out of order or damaged?
42. Do firewall rules have to be symmetric? That is, does a firewall have to block a particular traffic type both inbound (to the protected site) and outbound (from the site)? Why or why not?
43. The FTP is relatively easy to proxy; the firewall decides, for example, whether an outsider should be able to access a particular directory in the file system and issues a corresponding command to the inside file manager or responds negatively to the outsider. Other protocols are not feasible to proxy. List two protocols that it would be prohibitively difficult or impossible to proxy. Explain your answer.
44. How would the content of the audit log differ for a screening router versus an application proxy firewall?
45. A problem with auditing is volume of output. Although it is possible to log every packet passing through a firewall, the volume of data generated can be huge. Suggest a pruning strategy by which to reduce the volume of log data while still maintaining security. Explain what capability is lost by having less data.
46. Cite a reason why an organization might want two or more firewalls on a single network.
47. Firewalls are targets for penetrators. Why are there few compromises of firewalls?
48. Should a network administrator put a firewall in front of a honeypot (introduced in Chapter 5 )? Why or why not?
49. Can a firewall block attacks that use server scripts, such as the attack in which the user could change a price on an item offered by an e-commerce site? Why or why not?
50. Why does a stealth mode IDS need a separate network to communicate alarms and to accept management commands?
51. One form of IDS starts operation by generating an alert for every action. Over time, the administrator adjusts the setting of the IDS so that common, benign activities do not generate alarms. What are the advantages and disadvantages of this design for an IDS?