Docsity

13-tcp-dns.pdf, Slides of Topology

Partial preview of the text

Download 13-tcp-dns.pdf and more Slides Topology in PDF only on Docsity!

Internet Security:

How the Internet works and

some basic vulnerabilities

Dan Boneh

CS 155

Backbone ISP

ISP

Internet Infrastructure

Local and interdomain routing

n TCP/IP for routing and messaging n BGP for routing announcements

Domain Name System

n Find IP address from symbolic name (www.cs.stanford.edu)

Data Formats

Application Transport (TCP, UDP) Network (IP) Link Layer Application message - data TCP data TCP data TCP data TCP Header IP TCP data IP Header ETH IP TCP data ETF Link (Ethernet) Header Link (Ethernet) Trailer segment packet frame message

Internet Protocol

Connectionless

n Unreliable

n Best effort

Notes:

n src and dest ports

not parts of IP hdr

IP

Version Header Length Type of Service Total Length Identification Flags Time to Live Protocol Header Checksum Source Address of Originating Host Destination Address of Target Host Options Padding IP Data Fragment Offset

IP Protocol Functions (Summary)

Routing

n IP host knows location of router (gateway) n IP gateway must know route to other networks

Fragmentation and reassembly

n If max-packet-size less than the user-data-size

Error reporting

n ICMP packet to source if packet is dropped

TTL field: decremented after every hop

n Packet dropped if TTL=0. Prevents infinite loops.

Problem: no src IP authentication

Client is trusted to embed correct source IP

n Easy to override using raw sockets

n Libnet : a library for formatting raw packets with

arbitrary IP headers

Anyone who owns their machine can send packets

with arbitrary source IP

§ … response will be sent back to forged source IP

§ Implications: (solutions in DDoS lecture)

§ Anonymous DoS attacks;

§ Anonymous infection attacks (e.g. slammer worm)

TCP Header (protocol=6)

Source Port Dest port SEQ Number ACK Number Other stuff

U

R

G

P

S

R

A

C

K

P

S

H

S

Y

N

F

I

N

TCP Header

Review: TCP Handshake

C S

SYN :

SYN/ACK :

ACK :

Listening

Store SNC , SNS

Wait

Established

SNC⟵randC ANC⟵ 0 SNS⟵randS ANS⟵SNC SN⟵SNC+ AN⟵SNS Received packets with SN too far out of window are dropped

Why random initial sequence numbers?

Suppose initial seq. numbers (SNC , SNS ) are predictable:

n Attacker can create TCP session on behalf of forged source IP

n Breaks IP-based authentication (e.g. SPF, /etc/hosts )

w Random seq. num. do not prevent attack, but make it harder Victim Server

SYN/ACK

dstIP=victim SN=server SNS

ACK

srcIP=victim AN=predicted SNS command server thinks command is from victim IP addr attacker

TCP SYN

srcIP=victim

Example DoS vulnerability: Reset

Attacker sends a Reset packet to an open socket

n If correct SNS then connection will close ⇒ DoS

n Naively, success prob. is 1/

32

(32-bit seq. #’s).

w … but, many systems allow for a large window of acceptable seq. #‘s. Much higher success probability.

n Attacker can flood with RST packets until one works

Most effective against long lived

connections, e.g. BGP

Interdomain Routing

connected group of one or more Internet Protocol prefixes under a single routing policy (aka domain)

OSPF

BGP

Autonomous

System

earthlink.net Stanford.edu (AS#4355) (AS#32)

Routing Protocols

ARP (addr resolution protocol): IP addr ⟶ eth addr

Security issues: (local network attacks)

n Node A can confuse gateway into sending it traffic for Node B n By proxying traffic, node A can read/inject packets into B’s session (e.g. WiFi networks)

OSPF: used for routing within an AS

BGP: routing between Autonomous Systems

Security issues: unauthenticated route updates

n Anyone can cause entire Internet to send traffic for a victim IP to attacker’s address w Example: Youtube-Pakistan mishap (see DDoS lecture) n Anyone can hijack route to victim (next slides)

Security Issues

BGP path attestations are un-authenticated

n Anyone can inject advertisements for arbitrary routes n Advertisement will propagate everywhere n Used for DoS, spam, and eavesdropping (details in DDoS lecture) n Often a result of human error

Solutions:

• RPKI: AS obtains a certificate (ROA) from regional

authority (RIR) and attaches ROA to path advertisement.

Advertisements without a valid ROA are ignored.

Defends against a malicious AS (but not a network attacker)

• SBGP: sign every hop of a path advertisement

Example path hijack (source: Renesys 2013)

Feb 2013: Guadalajara ⟶ Washington DC via Belarus

Normally: Alestra (Mexico) ⟶ PCCW (Texas) ⟶ Qwest (DC)

Reverse route (DC ⟶ Guadalajara) is unaffected:

• Person browsing the Web in DC cannot tell by traceroute

that HTTP responses are routed through Moscow

route in effect for several hours