TCP/IP security CS642: Computer Security Professor - - PowerPoint PPT Presentation

tcp ip security cs642 computer security
SMART_READER_LITE
LIVE PREVIEW

TCP/IP security CS642: Computer Security Professor - - PowerPoint PPT Presentation

TCP/IP security CS642: Computer Security Professor Ristenpart h9p://www.cs.wisc.edu/~rist/ rist at cs dot wisc dot edu University of Wisconsin CS 642


slide-1
SLIDE 1

CS642: ¡ ¡ Computer ¡Security ¡

Professor ¡Ristenpart ¡ h9p://www.cs.wisc.edu/~rist/ ¡ rist ¡at ¡cs ¡dot ¡wisc ¡dot ¡edu ¡

University ¡of ¡Wisconsin ¡CS ¡642 ¡

TCP/IP ¡security ¡

slide-2
SLIDE 2

University ¡of ¡Wisconsin ¡CS ¡642 ¡

Moving ¡up ¡the ¡network ¡stack ¡

Denial ¡of ¡Service ¡ Internet ¡protocol ¡and ¡ICMP ¡ TCP ¡ IP ¡spoofing, ¡fragmentaKon ¡ IP ¡traceback, ¡filtering ¡

slide-3
SLIDE 3

Internet ¡

backbone ¡ ISP1 ¡ ISP2 ¡ Local ¡area ¡network ¡ ¡ (LAN) ¡ Internet ¡ Ethernet ¡ 802.11 ¡ BGP ¡ ¡(border ¡gateway ¡protocol) ¡ DNS ¡(domain ¡name ¡system) ¡ Alice ¡ Bob ¡ TCP/IP ¡ ¡

slide-4
SLIDE 4

Internet ¡threat ¡models ¡

backbone ¡ ISP1 ¡ ISP2 ¡

(1) ¡Malicious ¡hosts ¡ (2) ¡Subverted ¡routers ¡or ¡links ¡ (3) ¡Malicious ¡ISPs ¡or ¡backbone ¡

slide-5
SLIDE 5

Internet ¡protocol ¡stack ¡

ApplicaKon ¡ HTTP, ¡FTP, ¡SMTP, ¡SSH, ¡etc. ¡ Transport ¡ TCP, ¡UDP ¡ Network ¡ IP, ¡ICMP, ¡IGMP ¡ Link ¡ 802x ¡(802.11, ¡Ethernet) ¡ ApplicaKon ¡ Transport ¡ Network ¡ Link ¡ ApplicaKon ¡ Transport ¡ Network ¡ Link ¡ Network ¡ Link ¡

slide-6
SLIDE 6

IP ¡protocol ¡(IPv4) ¡

  • ConnecKonless ¡

– no ¡state ¡

  • Unreliable ¡

– no ¡guarantees ¡

  • ICMP ¡(Internet ¡Control ¡Message ¡Protocol) ¡

– error ¡messages, ¡etc. ¡ – o\en ¡used ¡by ¡tools ¡such ¡as ¡ping, ¡traceroute ¡

slide-7
SLIDE 7

Internet ¡protocol ¡stack ¡

ApplicaKon ¡ TCP ¡ IP ¡ Ethernet ¡ user ¡data ¡ user ¡data ¡ Appl ¡ hdr ¡ user ¡data ¡ Appl ¡ hdr ¡ TCP ¡ hdr ¡ user ¡data ¡ Appl ¡ hdr ¡ TCP ¡ hdr ¡ IP ¡ hdr ¡ user ¡data ¡ Appl ¡ hdr ¡ TCP ¡ hdr ¡ IP ¡ hdr ¡ ENet ¡ hdr ¡ ENet ¡ tlr ¡ TCP ¡segment ¡ IP ¡datagram ¡ Ethernet ¡frame ¡ 14 ¡ 20 ¡ 20 ¡ 46 ¡to ¡1500 ¡bytes ¡

slide-8
SLIDE 8

IPv4 ¡

data ¡ ENet ¡ hdr ¡ ENet ¡ tlr ¡ Ethernet ¡frame ¡ ¡ containing ¡ ¡ IP ¡datagram ¡ IP ¡ hdr ¡ 4-­‑bit ¡ version ¡ 4-­‑bit ¡ hdr ¡len ¡ 8-­‑bit ¡ ¡ type ¡of ¡service ¡ 16-­‑bit ¡ ¡ idenKficaKon ¡ 16-­‑bit ¡ ¡ total ¡length ¡(in ¡bytes) ¡ 3-­‑bit ¡ flags ¡ 13-­‑bit ¡ ¡ fragmentaKon ¡offset ¡ 8-­‑bit ¡ ¡ Kme ¡to ¡live ¡(TTL) ¡ 8-­‑bit ¡ ¡ protocol ¡ 16-­‑bit ¡ ¡ header ¡checksum ¡ 32-­‑bit ¡ ¡ source ¡IP ¡address ¡ 32-­‑bit ¡ ¡ desKnaKon ¡IP ¡address ¡

  • pKons ¡(opKonal) ¡
slide-9
SLIDE 9

Classless ¡Inter-­‑Domain ¡rouKng ¡(CIDR) ¡

128.168.0.0/16 ¡ a.b.c.d ¡/ ¡x ¡ ¡

x ¡indicates ¡number ¡of ¡bits ¡used ¡for ¡a ¡rouKng ¡prefix ¡ IP ¡addresses ¡with ¡same ¡/x ¡prefix ¡share ¡some ¡porKon ¡of ¡route ¡

slide-10
SLIDE 10

From ¡h9p://en.wikipedia.org/wiki/IPv4 ¡

slide-11
SLIDE 11

CIDR ¡addressing ¡

backbone ¡ ISP1 ¡ ISP2 ¡

Prefixes ¡used ¡to ¡setup ¡hierarchical ¡rouKng: ¡ ¡ ¡-­‑ ¡An ¡organizaKon ¡assigned ¡ ¡ ¡a.b.c.d/x ¡ ¡ ¡-­‑ ¡It ¡manages ¡addresses ¡prefixed ¡by ¡a.b.c.d/x ¡ ¡

…1111001 ¡ 10110… ¡1110000 ¡ 5.6.7.8 ¡ 10110… ¡1111000 ¡ …1111011 ¡ 10110… ¡1100011 ¡

slide-12
SLIDE 12

RouKng ¡

backbone ¡ ISP1 ¡ ISP2 ¡

Autonomous ¡systems ¡(AS) ¡are ¡organizaKonal ¡building ¡blocks ¡ ¡-­‑ ¡CollecKon ¡of ¡IP ¡prefixes ¡under ¡single ¡rouKng ¡policy ¡ ¡-­‑ ¡wisc.edu ¡ Within ¡AS, ¡might ¡use ¡RIP ¡(RouKng ¡InformaKon ¡Protocol) ¡ Between ¡AS, ¡use ¡BGP ¡(Border ¡Gateway ¡Protocol) ¡

…1111001 ¡ 10110… ¡1110000 ¡ 5.6.7.8 ¡ 10110… ¡1111000 ¡ …1111011 ¡ 10110… ¡1100011 ¡

slide-13
SLIDE 13

backbone ¡

Security ¡issues ¡with ¡IP ¡

ISP1 ¡ ISP2 ¡

RouKng ¡has ¡issues, ¡we’ll ¡get ¡to ¡that ¡later ¡ What ¡else? ¡ ¡-­‑ ¡Anyone ¡can ¡talk ¡to ¡anyone ¡ ¡-­‑ ¡No ¡source ¡address ¡authenKcaKon ¡in ¡general ¡

5.6.7.8 ¡ 1.2.3.4 ¡

slide-14
SLIDE 14

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

Goal: ¡prevent ¡legiKmate ¡users ¡from ¡accessing ¡ ¡ vicKm ¡(1.2.3.4) ¡ ¡ ICMP ¡ping ¡flood ¡

slide-15
SLIDE 15

8-­‑bit ¡ ¡ code ¡

ICMP ¡ ¡ (Internet ¡Control ¡Message ¡Protocol) ¡

ICMP ¡message ¡ IP ¡ hdr ¡ 8-­‑bit ¡ ¡ type ¡ 16-­‑bit ¡ ¡ checksum ¡ ICMP hdr ¡ 4-­‑byte ¡ more ¡of ¡header ¡(depends ¡on ¡type) ¡ message ¡… ¡

slide-16
SLIDE 16

8-­‑bit ¡ ¡ code ¡= ¡0 ¡

ICMP ¡ ¡ (Internet ¡Control ¡Message ¡Protocol) ¡

ICMP ¡message ¡ IP ¡ hdr ¡ 8-­‑bit ¡ ¡ type ¡(0 ¡or ¡8) ¡ 16-­‑bit ¡ ¡ checksum ¡ ICMP hdr ¡ Echo ¡request ¡(used ¡by ¡ping) ¡ 16-­‑bit ¡ ¡ sequence ¡number ¡ 16-­‑bit ¡ ¡ idenKfier ¡ ¡

  • pKonal ¡data ¡
slide-17
SLIDE 17

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

Goal ¡is ¡to ¡prevent ¡legiKmate ¡users ¡from ¡accessing ¡ ¡ vicKm ¡(1.2.3.4) ¡ ¡ ICMP ¡ping ¡flood ¡

  • ­‑

A9acker ¡sends ¡ICMP ¡pings ¡as ¡fast ¡as ¡possible ¡to ¡vicKm ¡

  • ­‑

When ¡will ¡this ¡work ¡as ¡a ¡DoS? ¡ ¡

  • ­‑

How ¡can ¡this ¡be ¡prevented? ¡ ¡ ¡Ingress ¡filtering ¡near ¡vicKm ¡

A9acker ¡resources ¡> ¡vicKm’s ¡

slide-18
SLIDE 18

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

How ¡can ¡a9acker ¡avoid ¡ingress ¡filtering? ¡

A9acker ¡can ¡send ¡packet ¡with ¡fake ¡source ¡IP ¡ ¡“spoofed” ¡packet ¡ Packet ¡will ¡get ¡routed ¡correctly ¡ Replies ¡will ¡not ¡

source: ¡8.7.3.4 ¡ dest: ¡1.2.3.4 ¡ Send ¡IP ¡packet ¡with ¡ ¡ from ¡5.6.7.8 ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

Filter ¡based ¡on ¡source ¡may ¡be ¡incorrect ¡

slide-19
SLIDE 19

DoS ¡reflecKon ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡

Note ¡a ¡valid ¡packet ¡sends ¡a ¡reply ¡to ¡8.7.3.4 ¡ ¡-­‑ ¡A9acker ¡can ¡bounce ¡an ¡a9ack ¡against ¡8.7.3.4 ¡off ¡1.2.3.4 ¡ ¡ ¡-­‑ ¡“Frame” ¡1.2.3.4 ¡ ¡-­‑ ¡Single-­‑packet ¡exploit ¡(1.2.3.4 ¡in ¡foreign ¡country) ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-20
SLIDE 20

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

DoS ¡works ¡be9er ¡when ¡there ¡is ¡asymmetry ¡between ¡ vicKm ¡and ¡a9acker ¡

  • ­‑

A9acker ¡uses ¡few ¡resources ¡to ¡cause ¡

  • ­‑

VicKm ¡to ¡consume ¡lots ¡of ¡resources ¡

slide-21
SLIDE 21

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

DoS ¡works ¡be9er ¡when ¡there ¡is ¡asymmetry ¡between ¡ vicKm ¡and ¡a9acker ¡

  • ­‑

A9acker ¡uses ¡few ¡resources ¡to ¡cause ¡

  • ­‑

VicKm ¡to ¡consume ¡lots ¡of ¡resources ¡ Old ¡example: ¡Smurf ¡a9ack ¡ Router ¡allows ¡a9acker ¡to ¡send ¡broadcast ¡ICMP ¡ping ¡on ¡

  • network. ¡A9acker ¡spoofs ¡SRC ¡address ¡to ¡be ¡1.2.3.4 ¡
slide-22
SLIDE 22

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

DoS ¡works ¡be9er ¡when ¡there ¡is ¡asymmetry ¡between ¡ vicKm ¡and ¡a9acker ¡

  • ­‑

A9acker ¡uses ¡few ¡resources ¡to ¡cause ¡

  • ­‑

VicKm ¡to ¡consume ¡lots ¡of ¡resources ¡ More ¡recent: ¡DNS ¡reflecKon ¡a9acks ¡ Send ¡DNS ¡request ¡w/ ¡spoofed ¡target ¡IP ¡(~65 ¡byte ¡request) ¡ DNS ¡replies ¡sent ¡to ¡target ¡(~512 ¡byte ¡response) ¡

ISP3 ¡ ¡ 8.7.3.4 ¡ Short ¡DNS ¡request ¡ Longer ¡DNS ¡reply ¡

slide-23
SLIDE 23

Denial ¡of ¡Service ¡(DoS) ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡

DoS ¡works ¡be9er ¡when ¡there ¡is ¡asymmetry ¡between ¡ vicKm ¡and ¡a9acker ¡

  • ­‑

A9acker ¡uses ¡few ¡resources ¡to ¡cause ¡

  • ­‑

VicKm ¡to ¡consume ¡lots ¡of ¡resources ¡ Big ¡asymmetry: ¡ping ¡of ¡death ¡ ¡ A ¡single ¡packet ¡that ¡causes ¡crash ¡on ¡remote ¡system ¡ Early ¡on: ¡ping ¡packet ¡with ¡size ¡> ¡65,535 ¡

slide-24
SLIDE 24

IPv4 ¡fragmenKng ¡

data ¡ ENet ¡ hdr ¡ ENet ¡ tlr ¡ Ethernet ¡frame ¡ ¡ containing ¡ ¡ IP ¡datagram ¡ IP ¡ hdr ¡

IP ¡allows ¡datagrams ¡of ¡size ¡from ¡ ¡ ¡ ¡20 ¡bytes ¡ ¡up ¡to ¡ ¡ ¡65535 ¡bytes ¡ ¡ Some ¡link ¡layers ¡only ¡allow ¡MTU ¡of ¡1500 ¡bytes ¡ IP ¡figures ¡out ¡MTU ¡of ¡next ¡link, ¡and ¡fragments ¡packet ¡if ¡ necessary ¡into ¡smaller ¡chunk ¡

slide-25
SLIDE 25

IPv4 ¡fragmenKng ¡

data ¡ ENet ¡ hdr ¡ ENet ¡ tlr ¡ Ethernet ¡frame ¡ ¡ containing ¡ ¡ IP ¡datagram ¡ IP ¡ hdr ¡ 4-­‑bit ¡ version ¡ 4-­‑bit ¡ hdr ¡len ¡ 8-­‑bit ¡ ¡ type ¡of ¡service ¡ 16-­‑bit ¡ ¡ idenKficaKon ¡ 16-­‑bit ¡ ¡ total ¡length ¡(in ¡bytes) ¡ 3-­‑bit ¡ flags ¡ 13-­‑bit ¡ ¡ fragmentaKon ¡offset ¡ 8-­‑bit ¡ ¡ Kme ¡to ¡live ¡(TTL) ¡ 8-­‑bit ¡ ¡ protocol ¡ 16-­‑bit ¡ ¡ header ¡checksum ¡ 32-­‑bit ¡ ¡ source ¡IP ¡address ¡ 32-­‑bit ¡ ¡ desKnaKon ¡IP ¡address ¡

  • pKons ¡(opKonal) ¡
slide-26
SLIDE 26

IPv4 ¡fragmenKng ¡

data ¡ ENet ¡ hdr ¡ ENet ¡ tlr ¡ Ethernet ¡frame ¡ ¡ containing ¡ ¡ IP ¡datagram ¡ IP ¡ hdr ¡ 16-­‑bit ¡ ¡ idenKficaKon ¡ 3-­‑bit ¡ flags ¡ 13-­‑bit ¡ ¡ fragmentaKon ¡offset ¡ Source-­‑specified ¡“unique” ¡number ¡ idenKfying ¡datagram ¡ Flags: ¡ 0 ¡ ¡b1 ¡ ¡b2 ¡ ¡ where ¡b1 ¡ ¡= ¡May ¡Fragment ¡(0) ¡ ¡/ ¡Don’t ¡Fragment ¡(1) ¡ where ¡b1 ¡ ¡= ¡Last ¡Fragment ¡(0) ¡ ¡/ ¡ ¡More ¡Fragments ¡(1) ¡ Fragment ¡offset ¡in ¡8-­‑byte ¡ units ¡

slide-27
SLIDE 27

FragmentaKon ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡

FragmentaKon ¡abused ¡in ¡lots ¡of ¡vulnerabiliKes: ¡

  • Ping ¡of ¡death: ¡allows ¡sending ¡65,536 ¡byte ¡packet, ¡overflows ¡ ¡

¡buffer. ¡ ¡

  • Teardrop ¡DoS: ¡mangled ¡fragmentaKon ¡crashes ¡reconstrucKon ¡

¡ ¡ ¡ ¡ ¡code ¡(Set ¡offsets ¡so ¡that ¡two ¡packets ¡have ¡overlapping ¡data) ¡ ¡ ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-28
SLIDE 28

FragmentaKon ¡a9acks ¡

ISP1 ¡ ISP2 ¡ ¡

FragmentaKon ¡abused ¡in ¡lots ¡of ¡vulnerabiliKes: ¡

  • Ping ¡of ¡death: ¡allows ¡sending ¡65,536 ¡byte ¡packet, ¡overflows ¡ ¡

¡buffer. ¡ ¡

  • Teardrop ¡DoS: ¡mangled ¡fragmentaKon ¡crashes ¡reconstrucKon ¡

¡ ¡ ¡ ¡ ¡code ¡(Set ¡offsets ¡so ¡that ¡two ¡packets ¡have ¡overlapping ¡data) ¡

  • Avoiding ¡IDS ¡systems: ¡IDS ¡scans ¡packets ¡for ¡exploit ¡strings; ¡

¡ ¡ ¡ ¡ ¡add ¡random ¡data ¡into ¡packets, ¡overwrite ¡later ¡during ¡ ¡ ¡ ¡ ¡ ¡ ¡reconstrucKon ¡due ¡to ¡overlapping ¡fragments ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-29
SLIDE 29

Dealing ¡with ¡spoofing: ¡IP ¡traceback ¡

  • Spoofed ¡IPs ¡means ¡we ¡cannot ¡know ¡where ¡

packets ¡came ¡from ¡

  • IP ¡traceback ¡is ¡problem ¡of ¡determining ¡the ¡
  • riginaKon ¡of ¡one ¡or ¡more ¡packets ¡
slide-30
SLIDE 30

IP ¡traceback ¡

ISP1 ¡ ISP2 ¡ ¡

IP ¡traceback ¡approaches: ¡

  • Logging ¡– ¡each ¡router ¡keeps ¡logs ¡of ¡packets ¡going ¡by ¡
  • Input ¡debugging ¡– ¡feature ¡of ¡routers ¡allowing ¡filtering ¡egress ¡ ¡

¡ ¡ ¡ ¡ ¡port ¡traffic ¡based ¡on ¡ingress ¡port. ¡Associate ¡egress ¡with ¡ingress ¡ ¡

  • Controlled ¡flooding ¡– ¡mount ¡your ¡own ¡DoS ¡on ¡links ¡selecKvely ¡to ¡

¡ ¡ ¡ ¡ ¡see ¡how ¡it ¡affects ¡malicious ¡flood ¡

  • Marking ¡– ¡router ¡probabilisKcally ¡marks ¡packets ¡with ¡info ¡
  • ICMP ¡traceback ¡– ¡router ¡probabilisKcally ¡sends ¡ICMP ¡packet ¡

¡ ¡ ¡ ¡ ¡with ¡info ¡to ¡desKnaKon ¡ ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-31
SLIDE 31

Dealing ¡with ¡spoofing: ¡BCP ¡38 ¡

  • Spoofed ¡IPs ¡means ¡we ¡cannot ¡know ¡where ¡

packets ¡came ¡from ¡

  • BCP ¡38 ¡(RFC ¡2827): ¡upstream ¡ingress ¡filtering ¡

to ¡drop ¡spoofed ¡packets ¡

slide-32
SLIDE 32

BCP ¡38 ¡

ISP1 ¡ ISP2 ¡ ¡

Before ¡forwarding ¡on ¡packets, ¡check ¡at ¡ingress ¡that ¡ ¡ source ¡IP ¡legiKmate ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-33
SLIDE 33

BCP ¡38 ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡ h9p://spoofer.cmand.org/summary.php ¡

slide-34
SLIDE 34

Botnets ¡and ¡DDoS ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡ 8.7.1.3 ¡ 1.2.4.3 ¡

April ¡27, ¡2007 ¡ ConKnued ¡for ¡weeks, ¡with ¡varying ¡levels ¡of ¡intensity ¡ Government, ¡banking, ¡news, ¡university ¡websites ¡ Government ¡shut ¡down ¡internaKonal ¡Internet ¡connecKons ¡

slide-35
SLIDE 35

Internet ¡protocol ¡stack ¡

ApplicaKon ¡ HTTP, ¡FTP, ¡SMTP, ¡SSH, ¡etc. ¡ Transport ¡ TCP, ¡UDP ¡ Network ¡ IP, ¡ICMP, ¡IGMP ¡ Link ¡ 802x ¡(802.11, ¡Ethernet) ¡ ApplicaKon ¡ Transport ¡ Network ¡ Link ¡ ApplicaKon ¡ Transport ¡ Network ¡ Link ¡ Network ¡ Link ¡

slide-36
SLIDE 36

UDP ¡(user ¡datagram ¡protocol) ¡

data ¡ IP ¡ hdr ¡ 16-­‑bit ¡ ¡ source ¡port ¡number ¡ 16-­‑bit ¡ ¡ desKnaKon ¡port ¡number ¡ 16-­‑bit ¡ ¡ UDP ¡checksum ¡ UDP hdr ¡ 16-­‑bit ¡ ¡ UDP ¡length ¡ length ¡= ¡header ¡len ¡+ ¡data ¡len ¡

slide-37
SLIDE 37

TCP ¡(transport ¡control ¡protocol) ¡

  • ConnecKon-­‑oriented ¡

– state ¡iniKalized ¡during ¡handshake ¡and ¡maintained ¡

  • Reliability ¡is ¡a ¡goal ¡

– generates ¡segments ¡ – Kmeout ¡segments ¡that ¡aren’t ¡ack’d ¡ – checksums ¡headers, ¡ ¡ – reorders ¡received ¡segments ¡if ¡necessary ¡ – flow ¡control ¡

slide-38
SLIDE 38

TCP ¡(transport ¡control ¡protocol) ¡

data ¡ IP ¡ hdr ¡ TCP ¡ hdr ¡ 16-­‑bit ¡ ¡ source ¡port ¡number ¡ 16-­‑bit ¡ ¡ desKnaKon ¡port ¡number ¡ 32-­‑bit ¡ ¡ sequence ¡number ¡ 32-­‑bit ¡ ¡ acknowledgement ¡number ¡ 4-­‑bit ¡ hdr ¡len ¡ 6-­‑bits ¡ ¡ reserved ¡ 16-­‑bit ¡ ¡ window ¡size ¡ 6-­‑bits ¡ ¡ flags ¡ 16-­‑bit ¡ ¡ TCP ¡checksum ¡ 16-­‑bit ¡ ¡ urgent ¡pointer ¡

  • pKons ¡(opKonal) ¡

data ¡(opKonal) ¡

slide-39
SLIDE 39

TCP ¡(transport ¡control ¡protocol) ¡

data ¡ IP ¡ hdr ¡ TCP ¡ hdr ¡ URG ¡ urgent ¡pointer ¡valid ¡ ACK ¡ acknowledgement ¡number ¡ valid ¡ PSH ¡ pass ¡data ¡to ¡app ¡ASAP ¡ RST ¡ reset ¡connecKon ¡ SYN ¡ synchronize ¡sequence ¡#’s ¡ FIN ¡ finished ¡sending ¡data ¡

TCP ¡flags: ¡

slide-40
SLIDE 40

TCP ¡handshake ¡

SYN ¡ ¡seqC ¡, ¡0 ¡ ¡ Client ¡C ¡ Server ¡S ¡ SYN/ACK ¡ ¡seqS ¡, ¡seqC+1 ¡ ¡ ACK ¡seqC ¡+ ¡1, ¡seqS ¡+ ¡1 ¡ ¡ ¡ SYN ¡= ¡syn ¡flag ¡set ¡ ACK ¡= ¡ack ¡flag ¡set ¡ x,y ¡ ¡= ¡x ¡is ¡sequence ¡#, ¡y ¡is ¡acknowledge ¡# ¡

slide-41
SLIDE 41

TCP ¡teardown ¡

FIN ¡ ¡seqC ¡, ¡seqS ¡ ¡ ¡ Client ¡C ¡ Server ¡S ¡ ACK ¡ ¡seqC+1 ¡ ¡ ACK ¡ ¡seqS ¡+ ¡2 ¡ ¡ ¡ SYN ¡= ¡syn ¡flag ¡set ¡ ACK ¡= ¡ack ¡flag ¡set ¡ x,y ¡ ¡= ¡x ¡is ¡sequence ¡#, ¡y ¡is ¡acknowledge ¡# ¡ FIN ¡ ¡seqS ¡+ ¡1, ¡seqC ¡+1 ¡ ¡

slide-42
SLIDE 42

TCP ¡SYN ¡floods ¡

ISP1 ¡ ISP2 ¡ ¡

Send ¡lots ¡of ¡TCP ¡SYN ¡packets ¡to ¡1.2.3.4 ¡

  • 1.2.3.4 ¡maintains ¡state ¡for ¡each ¡SYN ¡packet ¡for ¡some ¡amount ¡

¡ ¡ ¡ ¡ ¡window ¡of ¡Kme ¡

  • If ¡5.6.7.8 ¡sets ¡SRC ¡IP ¡to ¡be ¡8.7.3.4, ¡what ¡does ¡8.7.3.4 ¡receive? ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-43
SLIDE 43

TCP ¡handshake ¡

SYN ¡ ¡seqC ¡, ¡0 ¡ ¡ Client ¡C ¡ Server ¡S ¡ SYN/ACK ¡ ¡seqS ¡, ¡secC+1 ¡ ¡ ACK ¡seqC ¡+ ¡1, ¡seqS ¡+ ¡1 ¡ ¡ ¡

How ¡are ¡secC ¡and ¡seqS ¡ selected? ¡

IniKal ¡sequence ¡numbers ¡must ¡ vary ¡over ¡Kme ¡so ¡that ¡different ¡ connecKons ¡don’t ¡get ¡confused ¡

slide-44
SLIDE 44

Predictable ¡sequence ¡ ¡ numbers ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

4.4BSD ¡used ¡predictable ¡iniKal ¡sequence ¡numbers ¡(ISNs) ¡

  • At ¡system ¡iniKalizaKon, ¡set ¡ISN ¡to ¡1 ¡
  • Increment ¡ISN ¡by ¡64,000 ¡every ¡half-­‑second ¡

What ¡can ¡a ¡clever ¡a9acker ¡do? ¡

slide-45
SLIDE 45

Predictable ¡sequence ¡ ¡ numbers ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡ src: ¡8.7.3.4 ¡ dst: ¡1.2.3.4 ¡ ¡ seq#(8.7.3.4) ¡ FIN ¡ src: ¡8.7.3.4 ¡ dst: ¡1.2.3.4 ¡ ¡ seq#(8.7.3.4) ¡ “rsh ¡rm ¡–rf ¡ ¡/” ¡

Forge ¡a ¡FIN ¡packet ¡from ¡ ¡ 8.7.3.4 ¡to ¡1.2.3.4 ¡ Forge ¡some ¡applicaKon-­‑layer ¡ packet ¡from ¡8.7.3.4 ¡to ¡1.2.3.4 ¡

ConnecKon ¡b/w ¡1.2.3.4 ¡and ¡8.7.3.4 ¡

slide-46
SLIDE 46

Predictable ¡sequence ¡ ¡ numbers ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

Fix ¡idea ¡1: ¡

  • Random ¡ISN ¡at ¡system ¡startup ¡
  • Increment ¡by ¡64,000 ¡each ¡half ¡second ¡

Be9er ¡fix: ¡

  • Random ¡ISN ¡for ¡every ¡connecKon ¡

SKll ¡issues: ¡

  • Any ¡FIN ¡accepted ¡with ¡seq# ¡in ¡receive ¡window: ¡217 ¡a9empts ¡
slide-47
SLIDE 47

TCP/IP ¡security: ¡other ¡issues ¡

  • CongesKon ¡control ¡abuse ¡

– can ¡allow ¡cheaper ¡DoS ¡

  • No ¡crypto ¡

– We’ll ¡talk ¡about ¡IPsec ¡and ¡TLS ¡later ¡

  • BGP ¡rouKng ¡ ¡

– we’ll ¡talk ¡about ¡later ¡

  • DNS ¡(mapping ¡from ¡IP ¡to ¡domain ¡names) ¡

– We’ll ¡talk ¡about ¡later ¡

slide-48
SLIDE 48

More ¡about ¡DoS ¡

ISP1 ¡ ISP2 ¡ ¡

DoS ¡is ¡sKll ¡a ¡big ¡problem ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

How ¡big? ¡

slide-49
SLIDE 49

Backsca9er ¡

ISP1 ¡ ISP2 ¡ ¡

Can ¡we ¡measure ¡the ¡level ¡of ¡DoS ¡a9acks ¡on ¡Internet? ¡

  • If ¡we ¡can ¡measure ¡spurious ¡packets ¡at ¡8.7.3.4, ¡we ¡might ¡

¡ ¡ ¡ ¡ ¡infer ¡something ¡about ¡DoS ¡at ¡1.2.3.4 ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡

slide-50
SLIDE 50

Types ¡of ¡responses ¡to ¡floods ¡

Packet sent Response from victim TCP SYN (to open port) TCP SYN/ACK TCP SYN (to closed port) TCP RST (ACK) TCP ACK TCP RST (ACK) TCP DATA TCP RST (ACK) TCP RST no response TCP NULL TCP RST (ACK) ICMP ECHO Request ICMP Echo Reply ICMP TS Request ICMP TS Reply UDP pkt (to open port) protocol dependent UDP pkt (to closed port) ICMP Port Unreach ... ...

Table 1: A sample of victim responses to typical attacks. From ¡Moore ¡et ¡al., ¡“Inferring ¡Internet ¡Denial-­‑of-­‑Service ¡AcKvity” ¡

slide-51
SLIDE 51

Internet ¡telescopes ¡

ISP1 ¡ ISP2 ¡ ¡ 1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡ 7.4.0.0/16 ¡ 12.4.0.0/8 ¡

Setup ¡some ¡computers ¡to ¡watch ¡traffic ¡sent ¡to ¡darknets ¡

  • Darknet ¡= ¡unused ¡routable ¡space ¡

0 ¡ 232 ¡

2001: ¡ ¡ ¡400 ¡SYN ¡a9acks ¡per ¡week ¡ ¡ ¡ 2008: ¡ ¡ ¡4425 ¡SYN ¡a9acks ¡per ¡24 ¡hours ¡

slide-52
SLIDE 52

PrevenKng ¡DoS: ¡Prolexic ¡approach ¡

1.2.3.4 ¡ Filtering ¡box ¡ Lots ¡of ¡SYNs ¡ Lots ¡of ¡SYN/ACKs ¡ Few ¡ACKs ¡

Just ¡need ¡a ¡beefy ¡box ¡to ¡help ¡with ¡filtering. ¡ ¡ Companies ¡pay ¡Prolexic ¡to ¡do ¡it ¡for ¡them ¡

slide-53
SLIDE 53
slide-54
SLIDE 54

Hierarchical ¡addressing ¡

Class ¡A ¡ 0 ¡ 7 ¡bits ¡ neKd ¡ 24 ¡bit ¡ ¡ hosKd ¡ Class ¡B ¡ 1 ¡ 14 ¡bits ¡ neKd ¡ 16 ¡bits ¡ ¡ hosKd ¡ 0 ¡ Class ¡C ¡ 1 ¡ 21 ¡bits ¡ neKd ¡ 8 ¡bits ¡ ¡ hosKd ¡ 1 ¡ 0 ¡ Class ¡D ¡ 1 ¡ 28 ¡bits ¡ mulKcast ¡group ¡ID ¡ 1 ¡ 1 ¡ 0 ¡ Class ¡E ¡ 1 ¡ 28 ¡bits ¡ reserved ¡for ¡future ¡use ¡ 1 ¡ 1 ¡ 1 ¡

128.168.3.4 ¡

slide-55
SLIDE 55

Anonymous ¡single-­‑packet ¡ ¡ a9acks ¡

ISP1 ¡ ISP2 ¡ ¡

1.2.3.4 ¡contains ¡a ¡buffer ¡overflow ¡in ¡web ¡server ¡

1.2.3.4 ¡ 5.6.7.8 ¡ Backbone ¡ ¡ ISP3 ¡ ¡ 8.7.3.4 ¡ src: ¡8.7.3.4 ¡ dst: ¡1.2.3.4 ¡ ¡ HTTP/1.1 ¡ ¡GET ¡ AAAAAAAAAAA…. ¡ Untraceable ¡packet ¡of ¡death ¡ src: ¡8.7.3.4 ¡ dst: ¡1.2.3.4 ¡ ¡ HTTP/1.1 ¡ ¡GET ¡ exploit ¡buffer ¡ Untraceable ¡single-­‑packet ¡exploit ¡+ ¡payload ¡

slide-56
SLIDE 56

IP ¡traceback ¡

Management Network Router Distributed Post-mortem Preventative/

  • verhead
  • verhead
  • verhead

capability capability reactive Ingress filtering Moderate Low Moderate N/A N/A Preventative Link testing Input debugging High Low High Good Poor Reactive Controlled flooding Low High Low Poor Poor Reactive Logging High Low High Excellent Excellent Reactive ICMP Traceback Low Low Low Good Excellent Reactive Marking Low Low Low Good Excellent Reactive Qualitative comparison of existing schemes for combating anonymous attacks and the probabilistic marking appr

From ¡Savage ¡et ¡al., ¡“PracKcal ¡Network ¡Support ¡for ¡IP ¡Traceback” ¡