§1.6Networks Under Attack

Cross-layer Kurose & Ross pp. 54–57 · ~12 min read

  • malware
  • botnet
  • denial-of-service attack
  • distributed denial-of-service attack
  • packet sniffer
  • ip spoofing
  • end-point authentication

Where you are

  • Application layer you are here
  • Transport layer you are here
  • Network layer you are here
  • Link layer you are here
  • Physical layer you are here

The Internet was designed for people who trusted each other, and every attack in this section is a consequence of that one decision.

Words you will meet

  • Malware — harmful software that reaches your device over the Internet.
  • Botnet — thousands of infected machines under one attacker’s control.
  • DoS — denial of service: making a service unusable by real users.
  • DDoS (Distributed Denial of Service) — the same attack launched from many machines at once.
  • Packet sniffer — a passive receiver that records copies of packets.
  • IP (Internet Protocol) spoofing — sending a packet with a false source address.
  • End-point authentication — proving a message came from where it claims.

Why this matters

This section is a survey, not a solution. Its job is to make you ask the right question at every later chapter: what would an attacker do here?

Chapter 8 answers the survey point by point. Everything named on this page is picked up there: cryptography against sniffing, authentication against masquerading, firewalls and intrusion detection against flooding.

What this page is and is not

Everything here is at the level the book puts it: what kind of attack exists and why the network permits it. That is what a defender needs to know, and it is what the rest of the book builds on.

There are no recipes here, and there are none in the book either.

Malware

We attach devices to the Internet because we want to send and receive data. Along with everything useful, malware can arrive and infect those devices.

Once it does, it can delete files. It can install spyware that collects private information — passwords, keystrokes, identification numbers — and sends it back over the Internet to the attacker. Your compromised host may also be enrolled into a botnet . That is thousands of similarly compromised devices, controlled together by the attacker and used for spam distribution or for the distributed attacks described below.

Self-replication is what makes it spread

Much malware is self-replicating. Once it infects one host, from that host it seeks entry into other hosts over the Internet. From each newly infected host it seeks yet more.

Every new victim becomes a new source. That is why self-replicating malware spreads exponentially fast, and why a few hours of delay in responding matters so much.

Attacks on servers and network infrastructure

A DoS (Denial of Service) attack renders a network, host or other piece of infrastructure unusable by legitimate users. Web servers, e-mail servers, DNS (Domain Name System) servers and whole institutional networks can all be targets.

Most fall into one of three categories.

The three kinds of denial-of-service attack
Vulnerability attacka few packetsBandwidth floodingvolumeConnection floodingvolume
How it works
What it exhausts
Traffic needed
Effect on the victim
Why it is hard to stop

Cells marked ⓘ have a reason behind them — click to read it.

The book stresses that these three need different defences. Read the “What it exhausts” row: they attack three different resources.

Why flooding became distributed

Look more closely at bandwidth flooding. If the victim’s server has an access rate of RR bits per second, the attacker must send traffic at about RR to cause damage.

That creates two problems for a single attacker:

  • If RR is large, one attacking machine may simply be unable to generate enough traffic.
  • If all the traffic comes from one source, an upstream router may detect the attack and block that source before the traffic gets near the server.
Live calculator — why flooding had to become distributed

What each symbol means

  • Rthe rate of the victim’s access link (bits per second)
  • rate per machinewhat one controlled machine can send (bits per second)

Read aloud: to clog the link you must fill it, so divide the link rate by what one machine can manage.

Machines needed2,000 machines

to clog the link, arriving traffic ≈ R
machines needed = R / rate per machine
                = 10.0 Gbps / 5.00 Mbps
                = 2,000 machines
no single source suffices, and traffic from 2,000 different addresses is far harder to tell from real users

Change any number above and the arithmetic re-runs, carrying the units through.

Set R to 5 Mbps — a single home connection — and one machine suffices, which is exactly the case an upstream router can block. Set R to 10,000 Mbps and the answer explains the whole shift to botnets.

Both problems disappear if the traffic comes from many machines at once.

In plain words

In a distributed DDoS (Distributed Denial of Service) attack, the attacker controls multiple sources and has each one blast traffic at the target. The aggregate rate across all of them needs to be about RR.

Attacks using botnets of thousands of compromised hosts are a common occurrence today. They are much harder to detect and defend against than an attack from a single host. Traffic arriving from thousands of ordinary-looking addresses is very hard to distinguish from a surge of real users.

Figure 1.25 — a distributed denial-of-service attack
1 hops: attacker → zombie
“start attack”access link, rate Rattackerzombiezombiezombiezombievictim’s access routervictim

Drag any device to rearrange the picture. Hover a link to see its rate, delay and length.

The attacker never sends anything to the victim. It sends a command to machines it already controls — the book calls them zombies — and each of those blasts traffic at the target. Real attacks use botnets of thousands.

Read this diagram as text
  • attacker wired link zombie
  • attacker wired link zombie
  • attacker wired link zombie
  • attacker wired link zombie
  • zombie wired link victim’s access router
  • zombie wired link victim’s access router
  • zombie wired link victim’s access router
  • zombie wired link victim’s access router
  • victim’s access router wired link victim (1 Gbps)

Notice what the attacker’s own machine does in that diagram: it sends a short command, and nothing else. It never contacts the victim at all.

The book asks a question here and leaves it open for the whole book: what can network designers do to defend against these attacks? The answer differs for all three kinds, which is why the table above separates them.

Sniffing

Many people reach the Internet over WiFi (IEEE 802.11 wireless LAN) or a cellular connection. That convenience creates a security problem, because radio is broadcast: placing a passive receiver near a wireless transmitter is enough to obtain a copy of every packet transmitted.

Those packets can contain passwords, identification numbers, trade secrets and private messages.

A passive receiver that records a copy of every packet that flies by is a packet sniffer .

Sniffing: radio is broadcast, so a copy is free
message 3 of 3
Lin’s laptopsendingTimeTrudypassive receiverTimeAccess pointthe intended receiverTimepassword=…30 msthe same bits18 msACK30 ms

Click any arrow to see what that message says and why it is sent.

Count the arrows leaving Trudy: there are none. A sniffer injects nothing into the channel, and that is exactly why it is so hard to detect.

Read this diagram as text
  1. Lin’s laptop sends password=… to Access point (30 ms). The laptop transmits into the air. It is aimed at the access point, but radio does not travel in a straight private line.
  2. Lin’s laptop sends the same bits to Trudy — duplicate (18 ms). Trudy is simply within range. She placed a passive receiver near the transmitter and recorded a copy. She sent nothing to obtain it.
  3. Access point sends ACK to Lin’s laptop (30 ms). The exchange continues perfectly normally. Nothing has gone wrong, and nothing looks wrong.

Lifelines, left to right: Lin’s laptop (host), Trudy (mobile device), Access point (access point).

Sniffers work in wired settings too. In wired broadcast environments — as in many Ethernet LAN (Local Area Network) s — a sniffer can obtain copies of the broadcast packets. Cable access technologies also broadcast packets, and are vulnerable in the same way. An attacker who reaches an institution’s access router or access link can do worse still. They may plant a sniffer that copies every packet going to and from the whole organisation, to be analysed later.

Passive means undetectable

Packet sniffers do not inject packets into the channel. There is no transmission to notice, no probe to trace, nothing anomalous to log.

So when we send packets into a wireless channel we must simply accept the possibility that somebody is recording copies of them. That is not a defeatist conclusion — it is the reason the defence has to be cryptography rather than detection. Chapter 8 builds it.

The Wireshark labs in this book use exactly this kind of packet sniffer, turned to a legitimate purpose: watching your own traffic so that you can understand the protocols.

Masquerading

It is surprisingly easy to create a packet with any source address, any content and any destination address. You can then transmit that hand-crafted packet into the Internet, and the Internet will dutifully forward it.

Now imagine the receiver. It might be an Internet router. It takes the false source address as truthful, and performs some command embedded in the packet’s contents — modifying its forwarding table, for example.

Masquerading: the Internet does not check who sent a packet
message 2 of 2
Trudythe real senderTimeA routerthe unsuspecting receiverTimesrc = a trusted host (false)acts on it

Click any arrow to see what that message says and why it is sent.

The defence is end-point authentication: a way to determine with certainty that a message really came from where it appears to. Chapter 8 builds it.

Read this diagram as text
  1. Trudy sends src = a trusted host (false) to A router. It is surprisingly easy to create a packet with an arbitrary source address, content and destination, and transmit it into the Internet — which forwards it dutifully.
  2. A router sends acts on it to Trudy — corrupted. The router takes the false source address as truthful and performs the command in the packet. Nothing in ordinary forwarding checks whether the sender is who it claims to be.

Lifelines, left to right: Trudy (mobile device), A router (router).

The ability to inject packets with a false source address is IP spoofing , and it is only one of many ways for one user to masquerade as another.

The fix is end-point authentication : a mechanism that lets us determine with certainty whether a message originates from where we think it does. Chapter 8 explores how.

Why the Internet is like this

It is worth asking how the Internet became such an insecure place to begin with.

The answer

It was designed that way. The original design was based on the model of

a group of mutually trusting users attached to a transparent network

— a model in which, by definition, there is no need for security.

Many aspects of the original architecture still reflect that assumption:

  • The ability for one user to send a packet to any other user is the default, rather than a capability that must be requested and granted.
  • User identity is taken at declared face value, rather than being authenticated by default.

Today’s Internet plainly does not consist of mutually trusting users. And yet today’s users still need to communicate when they do not trust one another. They may wish to communicate anonymously. They may communicate indirectly through third parties — Web caches in chapter 2, mobility agents in chapter 7. They may distrust the hardware, the software, and even the air through which they communicate.

Everyday picture

A village where nobody locked their doors, because everyone knew everyone. Then the village became a city of billions, and the doors stayed as they were.

Retrofitting locks is possible, and that is largely what chapter 8 is about. But it is much harder than building them in. Some things cannot be changed now at all, such as the fact that anyone may send you a packet without asking.

Where the picture breaks: much of the Internet’s openness is not an omission but a deliberate design property. Anyone can reach any service without asking permission, which is exactly why anyone was able to publish one.

Keep the closing line in mind for the rest of the book: communication among mutually trusted users is the exception, not the rule.

Check yourself

Check yourself — §1.6

0 of 7 answered
  1. 1.What makes malware self-replicating malware?

  2. 2.Which of these is a vulnerability attack rather than a flooding attack?

  3. 3.predictIn the calculator, a victim has a 10 Gbps access link and each controlled machine can send 5 Mbps. Roughly how many machines does the attacker need?

    Set R = 10,000 Mbps and the per-machine rate to 5 Mbps.

  4. 4.Why is a distributed attack harder to defend against than one from a single machine?

  5. 5.predictIn the sniffing diagram, the attacker's lifeline receives a copy of the message but never sends anything. What follows from that?

    Look at how many arrows point away from Trudy.

  6. 6.What is IP spoofing?

  7. 7.Why is the Internet insecure by default, according to the book?

What to remember

  • Malware can delete files, spy, and enrol your host into a botnet. Self-replicating malware spreads exponentially, because every victim becomes a source.
  • DoS attacks come in three kinds: vulnerability (a few crafted packets), bandwidth flooding (clog the access link), connection flooding (exhaust connection state). Each needs a different defence.
  • The Internet is insecure by original design: it assumed mutually trusting users on a transparent network. That assumption no longer holds, and chapter 8 is the repair.