CSc 466/566. Computer Security. 18 : Network Security Introduction

Similar documents
Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

CSCI 1800 Cybersecurity and Interna4onal Rela4ons. Design and Opera-on of the Internet John E. Savage Brown University

ELEC5616 COMPUTER & NETWORK SECURITY

Network Security. Thierry Sans

ARP, IP, TCP, UDP. CS 166: Introduction to Computer Systems Security 4/7/18 ARP, IP, TCP, UDP 1

CIT 380: Securing Computer Systems. Network Security Concepts

Networking: Network layer

Layer 4: UDP, TCP, and others. based on Chapter 9 of CompTIA Network+ Exam Guide, 4th ed., Mike Meyers

ENEE 457: Computer Systems Security 11/07/16. Lecture 18 Computer Networking Basics

Lecture 6. Internet Security: How the Internet works and some basic vulnerabilities. Thursday 19/11/2015

CS 457 Lecture 11 More IP Networking. Fall 2011

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

CSC 574 Computer and Network Security. TCP/IP Security

DDoS Testing with XM-2G. Step by Step Guide

Single Network: applications, client and server hosts, switches, access links, trunk links, frames, path. Review of TCP/IP Internetworking

CSE 565 Computer Security Fall 2018

Introduction to TCP/IP networking

ICS 451: Today's plan

Protocol Layers & Wireshark TDTS11:COMPUTER NETWORKS AND INTERNET PROTOCOLS

Guide to Networking Essentials, 6 th Edition. Chapter 5: Network Protocols

Computer Networks Security: intro. CS Computer Systems Security

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

Distributed Systems. 27. Firewalls and Virtual Private Networks Paul Krzyzanowski. Rutgers University. Fall 2013

TCP/IP Networking. Training Details. About Training. About Training. What You'll Learn. Training Time : 9 Hours. Capacity : 12

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

ECE4110 Internetwork Programming. Introduction and Overview

Internet Protocol and Transmission Control Protocol

20-CS Cyber Defense Overview Fall, Network Basics

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Prof. Shervin Shirmohammadi SITE, University of Ottawa. Internet Protocol (IP) Lecture 2: Prof. Shervin Shirmohammadi CEG

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

Chapter 8 roadmap. Network Security

CS670: Network security

Configuring attack detection and prevention 1

Networks Fall This exam consists of 10 problems on the following 13 pages.

IP Packet Switching. Goals of Todayʼs Lecture. Simple Network: Nodes and a Link. Connectivity Links and nodes Circuit switching Packet switching

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

Computer Networks (Introduction to TCP/IP Protocols)

Scribe Notes -- October 31st, 2017

CSCD 433/533 Advanced Networks

Introduction to computer networking

Introduction to Internet. Ass. Prof. J.Y. Tigli University of Nice Sophia Antipolis

Administrivia CSC458 Lecture 4 Bridging LANs and IP. Last Time. This Time -- Switching (a.k.a. Bridging)

Sirindhorn International Institute of Technology Thammasat University

Introduction to Computer Networks. CS 166: Introduction to Computer Systems Security

Review of Important Networking Concepts

Internet Infrastructure

Need For Protocol Architecture

Chapter 5 Network Layer

On Distributed Communications, Rand Report RM-3420-PR, Paul Baran, August 1964

Internetworking/Internetteknik, Examination 2G1305 Date: August 18 th 2004 at 9:00 13:00 SOLUTIONS

Internet. Organization Addresses TCP/IP Protocol stack Forwarding. 1. Use of a globally unique address space based on Internet Addresses

Configuring attack detection and prevention 1

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

CCNA 1 Chapter 7 v5.0 Exam Answers 2013

Introduction to Computer Security

Chapter 09 Network Protocols

interface Question 1. a) Applications nslookup/dig Web Application DNS SMTP HTTP layer SIP Transport layer OSPF ICMP IP Network layer

Packet Header Formats

Denial of Service (DoS)

CHAPTER-2 IP CONCEPTS

Closed book. Closed notes. No electronic device.

ECE 4450:427/527 - Computer Networks Spring 2017

Introduction to routing in the Internet

Introduction to routing in the Internet

Vorlesung Kommunikationsnetze

cs144 Midterm Review Fall 2010

CS 161 Computer Security

Information Network Systems The network layer. Stephan Sigg

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Need For Protocol Architecture

ETSF05/ETSF10 Internet Protocols Network Layer Protocols

Fundamental Questions to Answer About Computer Networking, Jan 2009 Prof. Ying-Dar Lin,

This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples.

ch02 True/False Indicate whether the statement is true or false.

IP Protocols. ALTTC/Oct

TCP /IP Fundamentals Mr. Cantu

IPv4 addressing, NAT. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.

ECE 435 Network Engineering Lecture 10

Networking Security SPRING 2018: GANG WANG

Outline. What is TCP protocol? How the TCP Protocol Works SYN Flooding Attack TCP Reset Attack TCP Session Hijacking Attack

INSTRUCTIONS TO CANDIDATES

Router Architecture Overview

Network Security. Evil ICMP, Careless TCP & Boring Security Analyses. Mohamed Sabt Univ Rennes, CNRS, IRISA Thursday, October 4th, 2018

CS61C Machine Structures Lecture 37 Networks. No Machine is an Island!

Lecture 33. Firewalls. Firewall Locations in the Network. Castle and Moat Analogy. Firewall Types. Firewall: Illustration. Security April 15, 2005

DDoS and Traceback 1

Our Narrow Focus Computer Networking Security Vulnerabilities. Outline Part II

network security s642 computer security adam everspaugh

TCP/IP Protocol Suite

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

AN TOÀN LỚP 4: TCP/IP ATTACKS NGUYEN HONG SON PTITHCM

The Internetworking Problem. Internetworking. A Translation-based Solution

EE 610 Part 2: Encapsulation and network utilities

(ICMP), RFC

CSC 6575: Internet Security Fall Attacks on Different OSI Layer Protocols OSI Layer Basic Attacks at Lower Layers

Network Security. Tadayoshi Kohno

Unit 2.

CSCD58 WINTER 2018 WEEK 6 - NETWORK LAYER PART 1. Brian Harrington. February 13, University of Toronto Scarborough

Transcription:

1/81 CSc 466/566 Computer Security 18 : Network Security Introduction Version: 2012/05/03 13:57:28 Department of Computer Science University of Arizona collberg@gmail.com Copyright c 2012 Christian Collberg Christian Collberg

Outline 1 Introduction Internet Protocol Layers Packets Network Security Issues 2 The Link Layer Hubs and Switches Ethernet Frames ARP Spoofing 3 The Network Layer ICPM IP Spoofing 4 The Transport Layer TCP Session Hijacking 5 Denial-of-Service ICPM Attacks SYN Flood Attacks 6 Summary Introduction 2/81

LAN Gateway router Autonomous system Switch

Introduction 4/81 Network Topology Computers are host nodes they send and receive messages. Routers are communication nodes they pass on messages. Local Area Network (LAN) private network of physically close computers. Wide Area Network (WAN) many physically separated machines/groups of machines. Autonomous Systems (AS) clusters of routers.

Introduction 5/81 Autonomous Systems Controlled by a single organizational entity. Consist of clusters of routers. Routing within an AS is done by shortest route. Routing between ASs is by contractual agreements.

Introduction 6/81 Internet Protocol Layers Physical Layer Describes how bitstreams are transferred from one node to another over a physical medium.

Introduction 6/81 Internet Protocol Layers Physical Layer Describes how bitstreams are transferred from one node to another over a physical medium. Abstraction:

Introduction 6/81 Internet Protocol Layers Physical Layer Describes how bitstreams are transferred from one node to another over a physical medium. Abstraction: 1 Source/Destination: networking hardware

Introduction 6/81 Internet Protocol Layers Physical Layer Describes how bitstreams are transferred from one node to another over a physical medium. Abstraction: 1 Source/Destination: networking hardware 2 Data: raw bits

Introduction 6/81 Internet Protocol Layers Physical Layer Describes how bitstreams are transferred from one node to another over a physical medium. Abstraction: 1 Source/Destination: networking hardware 2 Data: raw bits 3 Link: copper, coaxial, optical fiber, WiFi...

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN.

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction:

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction: 1 Source/Destination: LAN nodes

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction: 1 Source/Destination: LAN nodes 2 Data: frames

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction: 1 Source/Destination: LAN nodes 2 Data: frames 3 Link: Ethernet, Wireless

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction: 1 Source/Destination: LAN nodes 2 Data: frames 3 Link: Ethernet, Wireless 4 Addressing: Media Access Control Addresses (MAC).

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction: 1 Source/Destination: LAN nodes 2 Data: frames 3 Link: Ethernet, Wireless 4 Addressing: Media Access Control Addresses (MAC). Detects errors occurring in the physical layer.

Introduction 7/81 Internet Protocol Layers Link Layer Describes how collections of bits (frames) are transferred (on top of the physical layer) in a LAN. Abstraction: 1 Source/Destination: LAN nodes 2 Data: frames 3 Link: Ethernet, Wireless 4 Addressing: Media Access Control Addresses (MAC). Detects errors occurring in the physical layer. Finds a good routing path in the network.

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet.

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet. Abstraction:

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet. Abstraction: 1 Source/Destination: Internet nodes

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet. Abstraction: 1 Source/Destination: Internet nodes 2 Data: IP packets

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet. Abstraction: 1 Source/Destination: Internet nodes 2 Data: IP packets 3 Addressing: Internet Protocol (IP) addresses.

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet. Abstraction: 1 Source/Destination: Internet nodes 2 Data: IP packets 3 Addressing: Internet Protocol (IP) addresses. IPv4 32-bit addresses, IPv6 128-bit addresses.

Introduction 8/81 Internet Protocol Layers Network (Internet) Layer Describes how to move packets between any two hosts on the Internet. Abstraction: 1 Source/Destination: Internet nodes 2 Data: IP packets 3 Addressing: Internet Protocol (IP) addresses. IPv4 32-bit addresses, IPv6 128-bit addresses. Best effort delivery no guarantees a packet will be delivered.

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet.

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet. Abstraction:

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet. Abstraction: 1 Source/Destination: Ports connected to processes

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets 3 Addressing: IP address + port number

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets 3 Addressing: IP address + port number Transmission Control Protocol (TCP) connection-based protocol; guaranteed and ordered delivery of packets.

Introduction 9/81 Internet Protocol Layers Transport Layer Describes how to communicate between two applications (services) running on hosts on the Internet. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets 3 Addressing: IP address + port number Transmission Control Protocol (TCP) connection-based protocol; guaranteed and ordered delivery of packets. User Datagram Protocol (UDP) connection-less protocol; quick delivery without guarantees.

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet Examples:

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet Examples: 1 HTTP web browsing over TCP

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet Examples: 1 HTTP web browsing over TCP 2 DNS domain name lookup over UDP

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet Examples: 1 HTTP web browsing over TCP 2 DNS domain name lookup over UDP 3 SMTP/IMAP email over TCP

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet Examples: 1 HTTP web browsing over TCP 2 DNS domain name lookup over UDP 3 SMTP/IMAP email over TCP 4 SSL encrypted connections over TCP

Introduction 10/81 Internet Protocol Layers Application Layer Uses the transport layer to provide protocols that support useful functions on the Internet Examples: 1 HTTP web browsing over TCP 2 DNS domain name lookup over UDP 3 SMTP/IMAP email over TCP 4 SSL encrypted connections over TCP 5 VoIP Internet telephony over UDP.

Introduction 11/81 Network Packets A packet consists of: 1 A header (metadata) 2 Payload (actual data) 3 A footer (metadata, sometimes) Metadata routing and control information.

Introduction 12/81 Packet Encapsulation The payload of each packet encapsulates the packet of a higher layer: 1 A frame packet encapsulates an IP packet. 2 An IP packet encapsulates a TCP/UDP packet. 3 A TCP packet encapsulates application data.

Application Data Application Layer

Application Data Application Layer TCP Header TCP Data Application Data Transport Layer

Application Data Application Layer TCP Header TCP Data Application Data Transport Layer IP Header TCP Header IP Data TCP Data Application Data Network Layer

Application Data Application Layer TCP Header TCP Data Application Data Transport Layer IP Header TCP Header IP Data TCP Data Application Data Network Layer Frame Header IP Header TCP Header Frame Data IP Data TCP Data Application Data Frame Footer Link Layer

Introduction 14/81 Packet Encapsulation HTTP When Web browsing: 1 An HTTP packet would be contained in a TCP packet. 2 The TCP packet would be contained IP packet. 3 The IP packet would be contained in (for example) an Ethernet frame.

Introduction 15/81 Networking Examples OSI model animation: http://www.youtube.com/watch?v=fimswfo45dq Animation - Networking Tutorial: http://www.youtube.com/watch?v=xv-qq0ahs1o

Introduction 16/81 Network Security Issues Confidentiality Packet data is not kept confidential. Two solutions: 1 Encrypt data at the application level (https); 2 Revise lower level protocol to include encryption (IPsec).

Introduction 17/81 Network Security Issues Integrity Packet header/footers include simple checksums: can detect a few communication bit errors; not cryptographically strong. Two solutions: 1 MACs at the application level; 2 Revise lower level protocol.

Introduction 18/81 Network Security Issues Availability Denial of Service attacks: could be just Christmas rush on amazon.com! concerted attacks. Two solutions: 1 Applications need to scale with communication requests; 2 Block illegitimate requests.

Introduction 19/81 Network Security Issues Assurance Assurance is the way in which trust is provided and managed in a system. Packets can travel between any two nodes in a network. Solution: 1 If we want to control packet flow, permissions have to be added on top of the network. Example: Firewalls allows us to block flows of packets we don t trust from entering our system.

Introduction 20/81 Network Security Issues Authenticity Packets have no space for digital signatures! IP has no concept of identity. Two solutions: 1 Add signatures at application layer; 2 Revise lower level layers.

Introduction 21/81 Network Security Issues Anonymity No concept of identity on the Internet anonymous by default! Good for human rights worker. Not good when we can t identify a malicious user. Solutions: 1 Achieve higher level of anonymity by replicating processes in many places on the network.

Outline 1 Introduction Internet Protocol Layers Packets Network Security Issues 2 The Link Layer Hubs and Switches Ethernet Frames ARP Spoofing 3 The Network Layer ICPM IP Spoofing 4 The Transport Layer TCP Session Hijacking 5 Denial-of-Service ICPM Attacks SYN Flood Attacks 6 Summary The Link Layer 22/81

The Link Layer 23/81 The Link Layer The Link Layer sits on top of the physical layer. Ethernet IEEE 802.3. Ethernet cables connect computers on a LAN. Collision: Two computers on the same network segment send a packet at the same time. History of Ethernet: http://www.youtube.com/watch?v=g5mezxmcrmk.

The Link Layer 24/81 Ethernet Collision LAN wait 5 wait 23 Collision algorithm: 1 Each computer waits a random length of time; 2 Retransmit! 3 Another collision? Repeat from 1!

The Link Layer 25/81 Hubs and Switches Hubs and Switches connect devices on a LAN. Ethernet Hub: Forward all frames to all attached devices. Lots of extra traffic: all frames are duplicated! All devices are on the same network segment, and must do collision avoidance. Ethernet Switch: Initially works like a hub. Over time, learns the addresses of attached devices. Eventually, only forwards a frame to the destination device. Fewer collisions.

to:a Hub A B to:a Switch to:a A to:b B

The Link Layer 27/81 MAC Addresses MAC address: 48 bits assigned to network interface. MAC structure: locally assigned (1 bit) manufacturer (23 bits) unique number (24 bits) Software (Unix: ifconfig) can change a device s MAC: locally assigned=1.

The Link Layer 28/81 Ethernet Frame Format Preamble (7 bytes) Start-of-Frame delimiter (1 byte) MAC destination (6 bytes) MAC source (6 bytes) Ethertype/length (2 bytes) Payload (45-1500 bytes) CRC-32 Checksum (4 bytes) Interframe Gap (12 bytes)

The Link Layer 29/81 Ethernet Frame Format... The CRC-32 checksum can catch simple transmission errors. Switches learn the location of network devices from the MAC addresses.

The Link Layer 30/81 Address Resolution Protocol Address Resolution Protocol (ARP): Find the MAC address given the IP address. Algorithm (Bob wants to know the MAC address of IP address A): 1 Broadcast to all network interfaces: Who has IP address A?. 2 Wait for a response A is at MAC address M! from the devices with IP address A. 3 Store A M in the ARP cache. Problem: no authentication.

The Link Layer 31/81 ARP Spoofing Any computer on the network could claim to have a particular IP address. Machines will update their ARP cache whenever they see an ARP reply even if there was no corresponding ARP request! Attack: 1 Eve sends ARP reply(bob s IP Eve s MAC) to Alice. 2 Alice puts Bob s IP Eve s MAC in her ARP cache. 3 Eve sends ARP reply(alice s IP Eve s MAC) to Bob. 4 Bob puts Alice s IP Eve s MAC in his ARP cache.

Alice Eve Bob

Bob s IP Eve s MAC Eve ARP reply(bob s IP Eve s MAC) Alice Bob

Bob s IP Eve s MAC Eve ARP reply(bob s IP Eve s MAC) Alice ARP reply(alice s IP Eve s MAC) Bob Alice s IP Eve s MAC

The Link Layer 33/81 ARP Spoofing... After the ARP cache poisoning all traffic between Alice and Bob is routed through Eve: 1 MITM attack; 2 Denial of Service attack.

The Link Layer 34/81 ARP Spoofing Countermeasures 1 Restrict LAN access to trusted users.

The Link Layer 34/81 ARP Spoofing Countermeasures 1 Restrict LAN access to trusted users. 2 Check for multiple occurrences of the same MAC address on the LAN.

The Link Layer 34/81 ARP Spoofing Countermeasures 1 Restrict LAN access to trusted users. 2 Check for multiple occurrences of the same MAC address on the LAN. 3 Static ARP tables: the system adminstrator manually sets up the routers ARP caches.

The Link Layer 34/81 ARP Spoofing Countermeasures 1 Restrict LAN access to trusted users. 2 Check for multiple occurrences of the same MAC address on the LAN. 3 Static ARP tables: the system adminstrator manually sets up the routers ARP caches. 4 Inspect all ARP packets, detecting attempted spoofing.

Outline 1 Introduction Internet Protocol Layers Packets Network Security Issues 2 The Link Layer Hubs and Switches Ethernet Frames ARP Spoofing 3 The Network Layer ICPM IP Spoofing 4 The Transport Layer TCP Session Hijacking 5 Denial-of-Service ICPM Attacks SYN Flood Attacks 6 Summary The Network Layer 35/81

The Network Layer 36/81 The Network (Internet) Layer Best effort routing of packets between any two hosts on the Internet. Abstraction: 1 Source/Destination: Internet nodes 2 Data: IP packets 3 Addressing: Internet Protocol (IP) addresses. IPv4 32-bit addresses, IPv6 128-bit addresses. No guarantees a packet will be delivered.

The Network Layer 37/81 Routing Algorithm From a Host Node Sending a packet P from a host node N: 1 If P s destination is on this LAN: Use the ARP protocol to find the MAC address, deliver directly. 2 Otherwise: use the ARP protocol to find the MAC address of the gateway, forward.

The Network Layer 38/81 Routing Algorithm From a Router Router gateways and other network nodes that handle routing of packages on the Internet. A router typically connects two or more LANs. Routing tables describe the next router to which a packet should be forwarded.

The Network Layer 39/81 Router Operations For each packet, the router decides whether to 1 Drop expired packets (TTL=0) are dropped. 2 Deliver if the packet is going to a machine on this LAN, deliver it. 3 Forward otherwise, send to neighboring router. TTL (time to live): a field in the IP header, decremented by each router, used to prevent packets from living forever.

The Network Layer 40/81 Routing Table Protocols Open Shortest Path First (OSPF) how should packets be routed within an autonomous system? packets should travel along shortest paths. Border Gateway Protocol (BGP) how should packets be routed between autonomous systems? packets are routed based on contractual agreements. Routing animation: http://www.youtube.com/watch?v=rby8hb6abbg

The Network Layer 41/81 Routing vs. Switch Switch: forwards packets on a single LAN. learns routes over time. Router: can belong to multiple LANs. uses routing tables to forward packets.

The Network Layer 42/81 IPv4 Packet Format Version (4 bits) Header length (4 bits) Service type (8 bits) Total length (16 bits) Identification (16 bits) Flags (3 bits) Fragment offset (13 bits) Time-to-Live (8 bits) Protocol (8 bits) Header Checksum (16 bits) Source Address (32 bits) Destination Address (32 bits) Payload

The Network Layer 43/81 IP Address Format IPv4 address: 32 bits. IPv4 address structure: network portion host portion Network portion: IP prefix for all machines on a network. Host portion: identifies a particular device Peter Packet & Subnetting: http://www.youtube.com/watch?v=x-qc6l9khqy&feature=related Class A Reserved for government organizations, telcos. Class B Reserved for ISPs, large businesses. Class C Reserved for smaller organizations.

The Network Layer 44/81 IP Address Classes Class Leading bits Size of network number bit field Size rest field of bit Number of networks A 0 8 24 2 7 2 24 B 10 16 16 2 14 2 16 C 110 24 8 2 21 2 8 Class Start address End address A 0.0.0.0 127.255.255.255 B 128.0.0.0 191.255.255.255 C 192.0.0.0 223.255.255.255 Addresses per network

The Network Layer 45/81 Internet Control Message Protocol Internet Control Message Protocol (ICMP) used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge receipt of packet.

The Network Layer 45/81 Internet Control Message Protocol Internet Control Message Protocol (ICMP) used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge receipt of packet. 2 Echo response: packet receipt is acknowledged.

The Network Layer 45/81 Internet Control Message Protocol Internet Control Message Protocol (ICMP) used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge receipt of packet. 2 Echo response: packet receipt is acknowledged. 3 Time exceeded: notify that packet has expired (TTL=0).

The Network Layer 45/81 Internet Control Message Protocol Internet Control Message Protocol (ICMP) used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge receipt of packet. 2 Echo response: packet receipt is acknowledged. 3 Time exceeded: notify that packet has expired (TTL=0). 4 Destination unreachable: notify that packet could not be delivered.

Ping Protocol

Ping Protocol ECHO request()

The Network Layer 46/81 Ping Protocol ECHO request() ECHO response() Diagnostic tool too see if a host is working.

The Network Layer 47/81 Traceroute Protocol How do we find the path a packet takes to a node N? Algorithm: 1 Send ECHO request(ttl=1) to N. 2 A router that receives ECHO request(ttl=1) responds with TIME exceeded(). 3 Send ECHO request(ttl=2) to N. 4 Repeat, increasing TTL each time, until N is reached, responding with ECHO response().

ECHO request(ttl=1)

ECHO request(ttl=1) TIME exceeded()

ECHO request(ttl=1) TIME exceeded() ECHO request(ttl=2)

ECHO request(ttl=1) TIME exceeded() ECHO request(ttl=2) TIME exceeded()

ECHO request(ttl=1) TIME exceeded() ECHO request(ttl=2) TIME exceeded() ECHO request(ttl=3)

ECHO request(ttl=1) TIME exceeded() ECHO request(ttl=2) TIME exceeded() ECHO request(ttl=3) TIME exceeded()

ECHO request(ttl=1) TIME exceeded() ECHO request(ttl=2) TIME exceeded() ECHO request(ttl=3) TIME exceeded() ECHO request(ttl=4)

ECHO request(ttl=1) TIME exceeded() ECHO request(ttl=2) TIME exceeded() ECHO request(ttl=3) TIME exceeded() ECHO request(ttl=4) ECHO response()

The Network Layer 49/81 IP Spoofing The source address in an IP packet is never checked: overwrite it! The sender will never get a response! So, why? Denial of service attack. HEADER Source//////////// Address Destination Address Payload

The Network Layer 50/81 Countermeasures to IP Spoofing Bob s LAN Border router Source: Bob s Lan Border router can block packets whose source address appears to be from inside the subnetwork, although they come from outside the subnetwork.

The Network Layer 51/81 Countermeasures to IP Spoofing... Bob s LAN Border router Source: Alice LAN Border router can block outgoing packets whose source address appears to be from outside the subnetwork. Maybe a node has been compromised by malware?

The Network Layer 52/81 Countermeasures to IP Spoofing... Alice Bob s LAN Source: Eve Block Alice! Block Alice! Block Alice! IP Traceback determining the origin of a packet, without using the source field. Once we know the actual source address, we can ask 1 the ASs to block packets from this location. 2 the ISP controlling the source address to block suspicious machines.

IP Traceback Techniques... Packet marking routers add information to packets, so that their path can be reconstructed. Naive approach: each router adds its address to the end of the packet: HEADER Source//////////// Address Destination Address Payload Router 1 Router 2 Router 3 Router 4 Advantages: Easy to reconstruct path. Disadvantages: Router overhead, how to know if there s space in the packet?, packet fragmentation. The Network Layer 53/81

The Network Layer 54/81 IP Traceback Techniques Node Sampling Node sampling: Only one router address can be stored in the packet. A router writes its address with probability p. HEADER Source//////////// Address Destination Address Payload Router address Given enough packets, the path can be reconstructed.

Probability the packet will be marked by C: p Probability the packet will be marked by B: p (1 p) Probability the packet will be marked by A: p (1 p) (1 p) The Network Layer 55/81 IP Traceback Technique Node Sampling... Alice Bob s LAN D C B A Source: Eve Router: A

Probability the packet will be marked by C: p Probability the packet will be marked by B: p (1 p) Probability the packet will be marked by A: p (1 p) (1 p) The Network Layer 55/81 IP Traceback Technique Node Sampling... Alice Bob s LAN A D C B Source: Eve Router: B

Probability the packet will be marked by C: p Probability the packet will be marked by B: p (1 p) Probability the packet will be marked by A: p (1 p) (1 p) The Network Layer 55/81 IP Traceback Technique Node Sampling... Alice Bob s LAN Source: Eve Router: B A D C B

Probability the packet will be marked by C: p Probability the packet will be marked by B: p (1 p) Probability the packet will be marked by A: p (1 p) (1 p) The Network Layer 55/81 IP Traceback Technique Node Sampling... Alice Bob s LAN Source: Eve Router: B A D C B

The Network Layer 56/81 IP Traceback Technique Other Techniques Many other techniques have been proposed. Most not implemented require cooperation from Internet routers.

Outline 1 Introduction Internet Protocol Layers Packets Network Security Issues 2 The Link Layer Hubs and Switches Ethernet Frames ARP Spoofing 3 The Network Layer ICPM IP Spoofing 4 The Transport Layer TCP Session Hijacking 5 Denial-of-Service ICPM Attacks SYN Flood Attacks 6 Summary The Transport Layer 57/81

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports.

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports. Abstraction:

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports. Abstraction: 1 Source/Destination: Ports connected to processes

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets 3 Addressing: IP address + port number

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets 3 Addressing: IP address + port number Transmission Control Protocol (TCP) connection-based protocol; guaranteed and ordered delivery of packets.

The Transport Layer 58/81 The Transport Layer Communication between processes connected to ports. Abstraction: 1 Source/Destination: Ports connected to processes 2 Data: TCP/UDP packets 3 Addressing: IP address + port number Transmission Control Protocol (TCP) connection-based protocol; guaranteed and ordered delivery of packets. User Datagram Protocol (UDP) connection-less protocol; quick delivery without guarantees.

The Transport Layer 59/81 TCP Packet Format Source Port (16 bits) Destination Port (16 bits) Sequence Number (32 bits) Acknowledgement Number (32 bits) Offset (4 bits) Reserved (4 bits) Flags (8 bits) Window size (16 bits) Checksum (16 bits) Urgent Pointer (16 bits) Payload

TCP Sequence Number seq=9 Incremented for every packet by payload length. Allows us to determine when packets arrive out of order. Allows us to determine when packets don t arrive.

TCP Sequence Number seq=10 seq=9 seq=10 Incremented for every packet by payload length. Allows us to determine when packets arrive out of order. Allows us to determine when packets don t arrive.

TCP Sequence Number seq=10 seq=11 seq=9 seq=10 seq=11 Incremented for every packet by payload length. Allows us to determine when packets arrive out of order. Allows us to determine when packets don t arrive.

The Transport Layer 60/81 TCP Sequence Number seq=10 seq=11 seq=13 seq=9 seq=10 seq=11 Incremented for every packet by payload length. Allows us to determine when packets arrive out of order. Allows us to determine when packets don t arrive.

TCP Acknowledgement Number seq=9 Receiver sends an acknowledgement package with the sequence number of the next payload byte it wants to receive.

TCP Acknowledgement Number seq=10 seq=9 seq=10 Receiver sends an acknowledgement package with the sequence number of the next payload byte it wants to receive.

TCP Acknowledgement Number seq=10 seq=11 seq=9 seq=10 seq=11 Receiver sends an acknowledgement package with the sequence number of the next payload byte it wants to receive.

TCP Acknowledgement Number seq=10 seq=11 seq=13 seq=9 seq=10 seq=11 seq=11 Receiver sends an acknowledgement package with the sequence number of the next payload byte it wants to receive.

TCP Acknowledgement Number seq=10 seq=11 seq=13 ack=12 seq=9 seq=10 seq=11 seq=11 seq=12 Receiver sends an acknowledgement package with the sequence number of the next payload byte it wants to receive.

The Transport Layer 61/81 TCP Acknowledgement Number seq=10 seq=11 seq=13 ack=12 seq=12 seq=9 seq=10 seq=11 seq=11 seq=12 Receiver sends an acknowledgement package with the sequence number of the next payload byte it wants to receive.

TCP Connections TCP uses a 3-way handshake to set up a connection. The protocol includes a random initialization of the sequence number.

TCP Connections SYN(seq=42) TCP uses a 3-way handshake to set up a connection. The protocol includes a random initialization of the sequence number.

TCP Connections SYN(seq=42) SYN-ACK(seq=99,ack=42+1) TCP uses a 3-way handshake to set up a connection. The protocol includes a random initialization of the sequence number.

The Transport Layer 62/81 TCP Connections SYN(seq=42) SYN-ACK(seq=99,ack=42+1) ACK(seq=42+1,ack=99+1) TCP uses a 3-way handshake to set up a connection. The protocol includes a random initialization of the sequence number.

The Transport Layer 63/81 TCP Session Hijacking TCP Session Hijacking an attacker 1 hijacks another user s TCP connection; 2 alters another user s TCP connection.

The Transport Layer 64/81 TCP Sequence Prediction Attack Session spoofing The attacker is able to create a TCP session with a server, who thinks it is talking to another client. Early TCP implementations had easily guessable sequence numbers. Attack: 1 Eve launches a denial-of-service attack against Alice so she can t interfere with the attack. 2 Eve sends a SYN(src=Alice) to Bob. 3 Bob responds with a SYN-ACK to Alice, who cannot respond since she s under attack. 4 Eve guesses N, Bob s next sequence number. 5 Eve sends a ACK(seq=N) to Bob. 6 Eve talks to Bob as if she is Alice. Blind injection attack: Eve won t receive replies from Bob.

Alice Bob Eve

Alice Bob DOS attack Eve

Alice Bob Eve SYN(src=Alice)

Alice SYN-ACK Bob Eve

Alice Bob ACK(seq=?) Eve Eve establishes a TCP connection with Bob, who thinks he s talking to Alice. Eve needs to guess the next sequence number Bob will use.

TCP Session Spoofing ACK Storms Alice Bob Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice ACK(seq=?) Bob Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice Bob ACK(seq=?) Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice ACK(seq=?) Bob Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice Bob ACK(seq=?) Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice ACK(seq=?) Bob Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice Bob ACK(seq=?) Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice ACK(seq=?) Bob Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice Bob ACK(seq=?) Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

TCP Session Spoofing ACK Storms Alice ACK(seq=?) Bob Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

The Transport Layer 66/81 TCP Session Spoofing ACK Storms Alice Bob ACK(seq=?) Eve Blind injection attacks can cause an ACK Storm, when the client and server try to resynchronize their sequence numbers. A firewall can, eventually, detect the ACK Storm.

The Transport Layer 67/81 Complete Session Hijacking Eve is on the same network segment as Alice and Bob, and packet sniffs on them as they establish their TCP connection. Eve guesses the next sequence number and sends a spoofed attack command to Bob, appearing to be Alice.

Complete Session Hijacking... Alice Bob Eve

Complete Session Hijacking... Alice SYN,SYN-ACK,ACK Bob Eve

Complete Session Hijacking... Alice SYN,SYN-ACK,ACK Bob Sniff seq=? Eve

The Transport Layer 68/81 Complete Session Hijacking... Alice Bob Eve "attack",seq=?,src=alice

The Transport Layer 69/81 Countermeasures Don t use predictable sequence numbers. Encrypt at the network layer (IPsec). Encrypt at the application layer (https).

Outline 1 Introduction Internet Protocol Layers Packets Network Security Issues 2 The Link Layer Hubs and Switches Ethernet Frames ARP Spoofing 3 The Network Layer ICPM IP Spoofing 4 The Transport Layer TCP Session Hijacking 5 Denial-of-Service ICPM Attacks SYN Flood Attacks 6 Summary Denial-of-Service 70/81

Denial-of-Service 71/81 Denial-of-Service Attacks Web servers have limited bandwidth. Once the server has used up bandwidth/cpu, it starts dropping requests. Denial-of-Service Attacks: Any attack that targets a machine/software s availability. Source addresses are spoofed to hide the attacker s identity.

Denial-of-Service 72/81 Internet Control Message Protocol The Internet Control Message Protocol is used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge reciept of packet.

Denial-of-Service 72/81 Internet Control Message Protocol The Internet Control Message Protocol is used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge reciept of packet. 2 Echo response: packet receipt is acknowledged.

Denial-of-Service 72/81 Internet Control Message Protocol The Internet Control Message Protocol is used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge reciept of packet. 2 Echo response: packet receipt is acknowledged. 3 Time exceeded: notify that packet has expired (TTL=0).

Denial-of-Service 72/81 Internet Control Message Protocol The Internet Control Message Protocol is used for network diagnostics. ICMP messages: 1 Echo request: please acknowledge reciept of packet. 2 Echo response: packet receipt is acknowledged. 3 Time exceeded: notify that packet has expired (TTL=0). 4 Destination unreachable: notify that packet could not be delivered.

Ping Flood Attack A powerful machine can attack a less powerful one by sending it a large number of ECHO requests.

Ping Flood Attack ECHO request(src="bob") A powerful machine can attack a less powerful one by sending it a large number of ECHO requests.

Ping Flood Attack ECHO request(src="eve") A powerful machine can attack a less powerful one by sending it a large number of ECHO requests.

Ping Flood Attack ECHO request(src="sam") A powerful machine can attack a less powerful one by sending it a large number of ECHO requests.

Ping Flood Attack ECHO request(src="joe") A powerful machine can attack a less powerful one by sending it a large number of ECHO requests.

Denial-of-Service 73/81 Ping Flood Attack ECHO request(src="pat") A powerful machine can attack a less powerful one by sending it a large number of ECHO requests.

Denial-of-Service 74/81 Smurf Attack A broadcast address sends to all IP addresses on the network. In a smurf attack, we get an amplification effect by creating an ECHO request with a spoofed source address (of the target) and broadcasting this to all nodes on the network. Attack: 1 Broadcast the packet ECHO request(src="target",dest="everybody") to the nodes on the network.

Denial-of-Service 74/81 Smurf Attack A broadcast address sends to all IP addresses on the network. In a smurf attack, we get an amplification effect by creating an ECHO request with a spoofed source address (of the target) and broadcasting this to all nodes on the network. Attack: 1 Broadcast the packet ECHO request(src="target",dest="everybody") to the nodes on the network. 2 Each node N will respond with ECHO response(src=n,dest="target").

Smurf Attack... Bob

Smurf Attack... ECHO req(dest=all,src="bob") ECHO req(dest=all,src="bob") ECHO req(dest=all,src="bob") Bob

Denial-of-Service 75/81 Smurf Attack... ECHO res(dest="bob",src="eve") ECHO res(dest="bob",src="sam") ECHO res(dest="bob",src="joe") Bob

Denial-of-Service 76/81 Smurf Attack... Countermeasures: 1 Make hosts and routers ignore broadcasts. 2 Make servers ignore all PINGs.

Denial-of-Service 77/81 SYN Flood Attacks Idea: Start lots of connections to a server, but never finish the SYN/SYN-ACK/ACK sequence, causing the server s memory to fill up. Attack: 1 Eve sends a SYN(src="joe") packet to Alice s server.

Denial-of-Service 77/81 SYN Flood Attacks Idea: Start lots of connections to a server, but never finish the SYN/SYN-ACK/ACK sequence, causing the server s memory to fill up. Attack: 1 Eve sends a SYN(src="joe") packet to Alice s server. 2 Server responds with SYN-ACK, sent to joe.

Denial-of-Service 77/81 SYN Flood Attacks Idea: Start lots of connections to a server, but never finish the SYN/SYN-ACK/ACK sequence, causing the server s memory to fill up. Attack: 1 Eve sends a SYN(src="joe") packet to Alice s server. 2 Server responds with SYN-ACK, sent to joe. 3 Eve repeats from 1.

SYN Flood Attacks...

SYN Flood Attacks... SYN(src="joe")

SYN Flood Attacks... SYN-ACK SYN(src="joe")

SYN Flood Attacks... SYN(src="sam")

SYN Flood Attacks... SYN(src="sam") SYN-ACK

SYN Flood Attacks... SYN(src="pat")

Denial-of-Service 78/81 SYN Flood Attacks... SYN(src="pat") SYN-ACK

Denial-of-Service 79/81 SYN Flood Attacks Countermeasures SYN Cookies (see the book). Microsoft Windows: A special queue for half-open connections. Don t allocate resources for the TCP connection until the ACK has been received.

Outline 1 Introduction Internet Protocol Layers Packets Network Security Issues 2 The Link Layer Hubs and Switches Ethernet Frames ARP Spoofing 3 The Network Layer ICPM IP Spoofing 4 The Transport Layer TCP Session Hijacking 5 Denial-of-Service ICPM Attacks SYN Flood Attacks 6 Summary Summary 80/81

Summary 81/81 Readings and References Chapter 5 in Introduction to Computer Security, by Goodrich and Tamassia.