1

ATTACK ON NETWORK AND DEFENSE

Developed and Presented By Dr. Mehrdad Sepehri SharbafCSUDHComputer Science Department

http://csc.csudh.edu/

The some of the materials are excerpted from Michael T. Goodrich & Roberto Tamassia,’s Book, and Ross Anderson’s Book

http://www.csudh.edu/univadv/dateline/archives/20080725/facstaffnews/branding_03.jpg

NETWORKS: IP AND TCP

2

INTERNET PROTOCOL

3

Data link frame

IP packet

TCP or UDP packet

IP ADDRESSES AND PACKETS

  • header includes
  • 4

    fragmentation info

    source

    destination

    TTL

    prot.

    length

    v

    IP ADDRESS SPACE AND ICANN

  • Examples
    1. 8 May 94 General Electric
    2. 8 Aug 92 IBM
    3. 8 Jun 95 AT&T Bell Labs
    4. 8 Sep 91 Xerox Corporation
    5. 8 Jul 94 Hewlett-Packard
    6. 8 Jul 92 Apple Computer
    7. 8 Jan 94 MIT
    8. 8 May 95 Ford Motor
    9. 8 Jun 94 Eli Lily
    10. 8 Jan 91 Japan Inet
    11. 8 Jul 92 Amateur Radio Digital
    12. 8 Jan 91 Bell-Northern Res.
    13. 8 May 95 Prudential Securities
    14. 8 Mar 92 Merck
    15. 8 Apr 95 Boeing
    16. 8 Jun 94 U.S. Postal Service

    5

    A TYPICAL UNIVERSITY’S IP SPACE

    6

    IP ROUTING

    7

    INTERNET CONTROL MESSAGE PROTOCOL (ICMP)

    8

    ICMP ATTACKS

    9

    SMURF ATTACK

    10

    Attacker

    Victim

    Amplifying

    Network

    echorequest

    echoresponse

    echoresponse

    echoresponse

    IP VULNERABILITIES

    11

    DENIAL OF SERVICE ATTACK

    12

    Source:

    M.T. Goodrich, Probabalistic Packet Marking for Large-Scale IP Traceback, IEEE/ACM Transactions on Networking 16:1, 2008.

    IP TRACEBACK

    13

    PROBABILISTIC PACKET MARKING

    14

    TRANSMISSION CONTROL PROTOCOL

    15

    PORTS

    16

    TCP PACKET FORMAT

    17

    Bit Offset

    1. 3
    2. 7
    3. 15
    4. 18
    5. 31

    0

    Source Port

    Destination Port

    32

    Sequence Number

    64

    Acknowledgment Number

    96

    Offset

    Reserved

    Flags

    Window Size

    128

    Checksum

    Urgent Pointer

    160

    Options

    >= 160

    Payload

    ESTABLISHING TCP CONNECTIONS

    18

    SYN

    Seq = x

    SYN-ACK

    Seq = y

    Ack = x + 1

    ACK

    Seq = x + 1

    Ack = y + 1

    SYN FLOOD

    19

    TCP DATA TRANSFER

    20

    TCP DATA TRANSFER AND TEARDOWN

    21

    Data seq=x

    Ack seq=x+1

    Data seq=y

    Ack seq=y+1

    Client

    Server

    Client

    Server

    Fin seq=x

    Ack seq=x+1

    Fin seq=y

    Ack seq=y+1

    TCP CONGESTION CONTROL

    22

    OPTIMISTIC ACK ATTACK

    23

    SESSION HIJACKING

    24

    IP SPOOFING

    25

    BLIND IP SPOOFING

    26

    NON-BLIND IP SPOOFING

    27

    PACKET SNIFFERS

    28

    DETECTING SNIFFERS

    29

    STOPPING PACKET SNIFFING

    30

    PORT KNOCKING

    31

    USER DATAGRAM PROTOCOL

    32

    NETWORK ADDRESS TRANSLATION

    33

    TRANSLATION

    34

    NAT route

    global realm

    private realm

    1. 168.10.237
    2. 192.168.10.237d=128.148.36. 11
    3. 128.148.36.179
    4. 128.148.36.11
    5. 128.148.36.11
    6. 128.148.36.179
    7. 128.148.36.11
    8. 192.168.10.237
    9. 148.36.11

    IP PACKET MODIFICATIONS

    35

    source IP address

    type of service

    total length

    ident

    header checksum

    destination IP address

    options

    data

    vers

    len

    flags

    fragment offset

    time to live

    proto

    padding

    0

    31

    Modified on input

    Modified on output

    ????

    Computed

    COMPUTER NETWORKS

    36

    PACKET SWITCHING

    37

    A

    C

    B

    D

    F

    E

    3

    2

    1

    PACKET SWITCHING

    38

    A

    C

    B

    D

    F

    E

    3

    2

    1

    PACKET SWITCHING

    39

    A

    C

    B

    D

    F

    E

    3

    2

    1

    PACKET SWITCHING

    40

    A

    C

    B

    D

    F

    E

    3

    2

    1

    PROTOCOLS

    41

    ENCAPSULATION

    42

    Header

    Payload

    Footer

    Header

    Payload

    Footer

    NETWORK LAYERS

    43

    INTERNET LAYERS

    44

    Application

    Transport

    Network

    Link

    Application

    Transport

    Network

    Link

    Network

    Link

    Network

    Link

    Ethernet

    Fiber Optics

    Wi-Fi

    Physical Layer

    INTERMEDIATE LAYERS

    45

    INTERNET PACKET ENCAPSULATION

    46

    Application Packet

    TCP Data

    TCP

    Header

    IP

    Header

    Frame

    Header

    Frame

    Footer

    Link Layer

    Network Layer

    Transport Layer

    IP Data

    Frame Data

    Application Layer

    INTERNET PACKET ENCAPSULATION

    47

    Data link frame

    IP packet

    TCP or UDP packet

    Application packet

    Data link header

    IP header

    TCP or UDP header

    Application packet

    Data link footer

    THE OSI MODEL

    48

    NETWORK INTERFACES

    49

    MAC ADDRESSES

    50

    SWITCH

    51

    COMBINING SWITCHES

    52

    MAC ADDRESS FILTERING

    53

    VIEWING AND CHANGING MAC ADDRESSES

    54

    ARP

    who has <IP address1> tell <IP address2>

    <IP address1> is <MAC address>

    Internet Address Physical Address Type

    128.148.31.1 00-00-0c-07-ac-00 dynamic

    128.148.31.15 00-0c-76-b2-d7-1d dynamic

    128.148.31.71 00-0c-76-b2-d0-d2 dynamic

    128.148.31.75 00-0c-76-b2-d7-1d dynamic

    128.148.31.102 00-22-0c-a3-e4-00 dynamic

    128.148.31.137 00-1d-92-b6-f1-a9 dynamic

    55

    ARP SPOOFING

    56

    ARP POISONING (ARP SPOOFING)

    57

    ARP CACHES

    58

    IP: 192.168.1.1

    MAC: 00:11:22:33:44:01

    IP: 192.168.1.105

    MAC: 00:11:22:33:44:02

    ARP Cache

    1. 168.1.105
    2. 11:22:33:44:02

    ARP Cache

    1. 168.1.1
    2. 11:22:33:44:01

    Data

    192.168.1.1 is at 00:11:22:33:44:01

    192.168.1.105 is at 00:11:22:33:44:02

    POISONED ARP CACHES

    59

    192.168.1.105 is at 00:11:22:33:44:03

    Poisoned ARP Cache

    1. 168.1.1
    2. 11:22:33:44:03

    Poisoned ARP Cache

    1. 168.1.105
    2. 11:22:33:44:03

    Data

    Data

    192.168.1.1 is at 00:11:22:33:44:03

    1. 168.1.1
    2. 11:22:33:44:01
    3. 168.1.105
    4. 11:22:33:44:02
    5. 168.1.106
    6. 11:22:33:44:03

    ROOT CAUSE AND DEFENSE

    60

    61

    Domain Name System

    MP900444414.JPG

    Vacation

    Savings

    DNS

    http://208.77.188.166

    My Example Blog Spot

    MP900444414.JPG

    http://www.example.com

    My Example Blog Spot

    Vacation

    Savings

    www.example.com

    208.77.188.166

    62

    Domain Name System

    Example DNS entries from http://www.maradns.org/tutorial/recordtypes.html

    63

    Name Servers

    64

    Domain namesand labels

    65

    Namespace Management

    66

    TOP LEVEL DOMAINS

    67

    Domains

    68

    Hierarchy of name servers

    69

    Zones and domains

    70

    Name Resolution

    Where is www.example.com?

    Where is www.example.com?

    Try com nameserver

    Where is www.example.com?

    Try example.com nameserver

    Where is www.example.com?

    1. 77.188.166
    2. 77.188.166

    Client

    ISP DNS

    Server

    root

    name server

    com

    name server

    example.com

    name server

    05-01c.wmf
    05-01c.wmf
    05-01c.wmf
    05-01c.wmf
    05-01a.wmf

    71

    Recursive resolution

    72

    Iterative resolution

    73

    AUTHORITATIVE NAME SERVERS

    74

    DYNAMIC RESOLUTION

    75

    DNS Caching

    76

    DNS CACHING

    Step 1: query yourdomain.org

    Local Machine

    Application

    Resolver

    cache

    Local NS

    Resolver

    cache

    Authoritative

    Name Server

    Step 2: receive reply and cache at local NS and host

    Local Machine

    Application

    Resolver

    cache

    Local NS

    Resolver

    cache

    Authoritative

    Name Server

    query

    query

    answer

    answer

    77

    DNS CACHING (CON'D)

    Step 3: use cached results rather than querying the ANS

    Local Machine 1

    Application

    Resolver

    cache

    Local NS

    Resolver

    cache

    Local Machine 2

    Application

    Resolver

    cache

    Step 4: Evict cache entries upon ttl expiration

    query

    answer

    78

    PHARMING: DNS HIJACKING

    Untitled-1.tif
    Untitled-1.tif

    http://www.example.com

    My Premium Blog Spot

    userID:

    password:

    http://www.example.com

    My Premium Blog Spot

    www.example.com

    Normal

    DNS

    74.208.31.63

    www.example.com

    Pharming

    attack

    Phishing: the different web sites look the same.

    userID:

    password:

    208.77.188.166

    06-5b.tif
    06-5c.tif
    06-5b.tif
    06-5a.tif

    79

    DNS Cache Poisoning

    80

    DNS Cache Poisoning Prevention

    81

    DNSSEC

    8-82

    FIREWALLS

    isolates organization’s internal net from larger Internet, allowing some packets to pass, blocking others.

    firewall

    administered

    network

    public

    Internet

    firewall

    8-83

    FIREWALLS: WHY

    prevent denial of service attacks:

    prevent illegal modification/access of internal data.

    allow only authorized access to inside network (set of authenticated users/hosts)

    three types of firewalls:

    8-84

    STATELESS PACKET FILTERING

    Should arriving packet be allowed in? Departing packet let out?

    8-85

    STATELESS PACKET FILTERING: EXAMPLE

    8-86

    Policy

    Firewall Setting

    No outside Web access.

    Drop all outgoing packets to any IP address, port 80

    No incoming TCP connections, except those for institution’s public Web server only.

    Drop all incoming TCP SYN packets to any IP except 130.207.244.203, port 80

    Prevent Web-radios from eating up the available bandwidth.

    Drop all incoming UDP packets - except DNS and router broadcasts.

    Prevent your network from being used for a smurf DoS attack.

    Drop all ICMP packets going to a “broadcast” address (eg 130.207.255.255).

    Prevent your network from being tracerouted

    Drop all outgoing ICMP TTL expired traffic

    STATELESS PACKET FILTERING: MORE EXAMPLES

    8-87

    action

    source

    address

    dest

    address

    protocol

    source

    port

    dest

    port

    flag

    bit

    allow

    1. 22/16
    2. utside of
    3. 22/16

    TCP

    > 1023

    80 (web)

    any

    allow

    TCP

    80

    > 1023

    ACK

    allow

    1. 22/16
    2. utside of
    3. 22/16

    UDP

    > 1023

    1. (DNS)
    2. --

    allow

    UDP

    53

    > 1023

    ----

    deny

    all

    all

    all

    all

    all

    all

    ACCESS CONTROL LISTS

    88

    STATEFUL PACKET FILTERING

    action

    source

    address

    dest

    address

    protocol

    source

    port

    dest

    port

    flag

    bit

    allow

    TCP

    80

    > 1023

    ACK

    8-89

    action

    source

    address

    dest

    address

    proto

    source

    port

    dest

    port

    flag

    bit

    check conxion

    allow

    1. 22/16
    2. utside of
    3. 22/16

    TCP

    > 1023

    80

    any

    allow

    TCP

    80

    > 1023

    ACK

    x

    allow

    1. 22/16
    2. utside of
    3. 22/16

    UDP

    > 1023

    53

    ---

    allow

    UDP

    53

    > 1023

    ----

    x

    deny

    all

    all

    all

    all

    all

    all

    STATEFUL PACKET FILTERING

    STATEFULL FIREWALL EXAMPLE

    90

    06-17f.png
    05-01c.wmf
    05-09b.tif

    Trusted internal

    network

    05-01a.wmf

    SYN

    Seq = x

    Port=80

    SYN-ACK

    Seq = y

    Ack = x + 1

    ACK

    Seq = x + 1

    Ack = y + 1

    Allow outbound TCP sessions,

    destination port=80

    Client

    SYN-ACK

    Seq = y

    Port=80

    Attacker

    (blocked)

    Established TCP session:

    1. 34.78.55, 76.120.54.101)
    2. 34.78.55
    3. 120.54.101

    Firewall state table

    Server

    06-11.png

    Firewall

    8-91

    APPLICATION GATEWAYS

    host-to-gateway

    telnet session

    gateway-to-remote

    host telnet session

    application

    gateway

    router and filter

    1. require all telnet users to telnet through gateway.
    2. for authorized users, gateway sets up telnet connection to dest host. Gateway relays data between 2 connections
    3. router filter blocks all telnet connections not originating from gateway.
    4. 92

    LIMITATIONS OF FIREWALLS AND GATEWAYS

  • filters often use all or nothing policy for UDP.
  • tradeoff: degree of communication with outside world, level of security
  • many highly protected sites still suffer from attacks.
  • 8-93

    INTRUSION DETECTION SYSTEMS

    8-94

    Web

    server

    FTP

    server

    DNS

    server

    application

    gateway

    Internet

    demilitarized

    zone

    internal

    network

    firewall

    IDS

    sensors

    INTRUSION DETECTION SYSTEMS

    95

    IP SECURITY (IPSEC)

    96

    IP SECURITY ISSUES

    97

    TYPICAL USAGE

    98

    IPSEC SERVICES

    99

    Major IPSec Components

    100

    USES OF IPSEC

    101

    WEB SECURITY

    102

    SSL (SECURE SOCKET LAYER)

    103

    SSL ARCHITECTURE

    104

    SSL ARCHITECTURE

    105

    SSL RECORD PROTOCOL

    106

    107

    SSL CHANGE CIPHER SPEC PROTOCOL

    108

    TLS (TRANSPORT LAYER SECURITY)

    8-109

    IEEE 802.11 SECURITY

    8-110

    WIRED EQUIVALENT PRIVACY (WEP):

    8-111

    WEP DATA ENCRYPTION

    ci = di XOR kiIV

    8-112

    802.11 WEP ENCRYPTION

    Sender-side WEP encryption

    8-113

    BREAKING 802.11 WEP ENCRYPTION

    security hole:

    8-114

    802.11I: IMPROVED SECURITY

    8-115

    chztfzup[1]

    AP: access point

    AS:

    Authentication

    server

    wired

    network

    CS:

    client station

    1 Discovery of

    security capabilities

    3

    CS and AS mutually authenticate, together

    generate Master Key (MK). AP servers as “pass through”

    2

    3

    CS derives

    Pairwise Master

    Key (PMK)

    AS derives

    same PMK,

    sends to AP

    4

    CS, AP use PMK to derive

    Temporal Key (TK) used for message

    encryption, integrity

    802.11I: FOUR PHASES OF OPERATION

    VIRUSES, WORMS, TROJANS, ROOTKITS

    116

    INSIDER ATTACKS

    117

    DEFENSES AGAINST INSIDER ATTACKS

    118