network security - attacks against the tcp/ip stackchris/teaching/cs177/doc/cs177-02.pdftcpsynscans...

99
Network Security Attacks Against the TCP/IP Stack Christopher Kruegel Spring 2020 UC Santa Barbara

Upload: others

Post on 12-Jun-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Network Security

Attacks Against the TCP/IP Stack

Christopher Kruegel

Spring 2020

UC Santa Barbara

Page 2: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Outline

(1) The TCP/IP model(2) Link-layer security(3) Internet-layer security(4) Transport-layer security(5) Wireless security

1

Page 3: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

The TCP/IP Model

2

Page 4: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP
Page 5: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP
Page 6: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP/IP Model

Application

Transport

Internet

Link

Application

Transport

Internet

Link

Internet

Link

Internet

Link

Figure 1: TCP/IP model 5

Page 7: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Link-Layer Security

6

Page 8: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Ethernet (802.3) [1]

struct EthernetFrame {mac_destination: [u8; 6],mac_source: [u8; 6],vlan_tag: Option<u32>,type_or_length: u16,payload: Vec<u8>,crc: u32,

}

– Ubiquitous link-layermedium for wired networks

– Frames labeled with sourceand destination physical(MAC) addresses

How are IP addresses translated to physical addresses?

7

Page 9: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Ethernet (802.3) [1]

struct EthernetFrame {mac_destination: [u8; 6],mac_source: [u8; 6],vlan_tag: Option<u32>,type_or_length: u16,payload: Vec<u8>,crc: u32,

}

– Ubiquitous link-layermedium for wired networks

– Frames labeled with sourceand destination physical(MAC) addresses

How are IP addresses translated to physical addresses?7

Page 10: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Address Resolution Protocol (ARP) [2]

Figure 2: ARP messages

– Protocol to establish IP ↔ physical address mapping– Mappings are cached and commonly preemptively established

(gratuitous ARP)

8

Page 11: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

ARP Cache

$ ip neigh10.254.1.1 dev wlp58s0 lladdr 8c:ae:4c:ff:c6:06 REACHABLE10.254.1.2 dev wlp58s0 lladdr 2c:30:33:9e:33:22 STALE10.254.1.150 dev wlp58s0 lladdr b4:f6:1c:53:8d:b9 STALE10.254.1.120 dev wlp58s0 lladdr 50:f5:da:57:19:62 STALE10.254.1.118 dev wlp58s0 lladdr 00:1e:06:34:96:cd STALE10.254.1.176 dev wlp58s0 lladdr d8:50:e6:87:d6:ca STALE10.254.1.189 dev wlp58s0 lladdr 18:b4:30:57:5d:c6 STALE

How trustworthy are ARPmessages?

9

Page 12: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

ARP Cache

$ ip neigh10.254.1.1 dev wlp58s0 lladdr 8c:ae:4c:ff:c6:06 REACHABLE10.254.1.2 dev wlp58s0 lladdr 2c:30:33:9e:33:22 STALE10.254.1.150 dev wlp58s0 lladdr b4:f6:1c:53:8d:b9 STALE10.254.1.120 dev wlp58s0 lladdr 50:f5:da:57:19:62 STALE10.254.1.118 dev wlp58s0 lladdr 00:1e:06:34:96:cd STALE10.254.1.176 dev wlp58s0 lladdr d8:50:e6:87:d6:ca STALE10.254.1.189 dev wlp58s0 lladdr 18:b4:30:57:5d:c6 STALE

How trustworthy are ARPmessages?

9

Page 13: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

ARP Cache Poisoning

Figure 3: ARP cache poisoning

– Hosts can inject arbitrary ARP messages!– Can spoof messages from existing hosts– Can redirect traffic from legitimate host to attacker

10

Page 14: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Broadcast vs. Switched Ethernet

– Switched Ethernet learns physical address ↔ port mappings topartition LANs and avoid broadcast behavior– Mappings contained in a content-addressablememory (CAM)

– But, ARP cache poisoning requires victim addresses!– MAC flooding can overflow the CAM

How should a switch respond to this condition?

11

Page 15: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Broadcast vs. Switched Ethernet

– Switched Ethernet learns physical address ↔ port mappings topartition LANs and avoid broadcast behavior– Mappings contained in a content-addressablememory (CAM)

– But, ARP cache poisoning requires victim addresses!– MAC flooding can overflow the CAM

How should a switch respond to this condition?

11

Page 16: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Virtual Local Area Networks (VLAN, 802.1Q)

struct EthernetFrame {// ...vlan_tag: Option<u32>,// ...

}

– Mechanism for partitioningphysical networks intoseparate broadcast domains

– If enforced at network switches, operators can isolate untrustedtraffic → compartmentalization

– Contains damage of an endpoint compromise12

Page 17: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Internet-Layer Security

13

Page 18: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Internet Protocol [3]

– Standard for “internetworking” ⇝ “Internet”– Standardized addresses and routing

– v4: 4 bytes, v6: 16 bytes– e.g., 127.0.0.1 ≡ 0x7f000001

– Packet abstraction– Datagrams can be dropped or reordered– Payloads can be corrupted

14

Page 19: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IPv4 Packet Format

struct IPv4Datagram {version: u4, header_length: u4, differentiated_services: u6,explicit_congestion: u2, total_length: u16, identifier: u16,reserved: bool, do_not_fragment: bool, more_fragments: bool,fragment_offset: u13, time_to_live: u8, protocol: u8,header_checksum: u16, source_address: u32, destination_address: u32,options: Vec<u8>,

}

15

Page 20: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Addresses

– IP addresses are used as access control principals– Host-based authentication– Security middlebox whitelists, blacklists

– But, are IP addresses an appropriate authentication factor?

– Absolutely not!– Addresses can be spoofed– Addresses can be reassigned– (Under what constraints?)

16

Page 21: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Addresses

– IP addresses are used as access control principals– Host-based authentication– Security middlebox whitelists, blacklists

– But, are IP addresses an appropriate authentication factor?

– Absolutely not!– Addresses can be spoofed– Addresses can be reassigned– (Under what constraints?)

16

Page 22: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Flooding

– IP flooding is a canonical denial-of-service (DoS) attack– One version

– Many attackers send ICMP PINGmessages to a victim– Victim’s uplink bandwidth is overwhelmed

– Another (stealthier) version– Many attackers send ICMP PINGmessages to other machines with

the victim as the source IP address– Victim’s uplink bandwidth is overwhelmed without revealing theattackers’ identities 17

Page 23: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

DoS Amplification

Figure 4: Smurf attack

18

Page 24: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Spoofing Defenses

– Detection– Backscatter via network telescopes– Traceback using unused IP packet header fields

– Filtering– Egress checks (e.g., validation against local network allocations)– Ingress checks (e.g., validation against routing tables)– Reverse path forwarding

19

Page 25: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Unicast Reverse Path Forwarding (uRPF) [4]

Idea: Validate source addresses against the routing table, anddrop “unlikely” packets

Strict Source must match the best routeFeasible Source must match “reasonable” routes

Loose Source can match any route

20

Page 26: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

uRPF Example

Table 1: Example routing table

Network Next Hop Metric

10.61.0.0/16 192.168.27.11 100010.61.72.0/24 192.168.31.2 100010.61.72.0/26 192.168.136.5 100… … …

Strict uRPF, source 10.61.72.129, last hop 192.168.27.11? FeasibleuRPF? Loose uRPF? 21

Page 27: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Fragmentation

– IP datagrams must tolerate varying segmentmaximumtransmission units (MTUs)

– One strategy: datagrams are fragmented– Total length field set to fragment length– “More fragment” bit set unless last fragment– Fragment offset set to original offset / 8– Checksum recomputed

– Subsequent router or receiving endpoint reassemblesfragments into the original packet 22

Page 28: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Fragment Reassembly

– Endpoints must buffer fragments for reassembly

– Maximum size of an IP packet? Of a reassembled packet?

(216 − 1) − 20 =Ping of Death

⏞⏞⏞⏞⏞⏞⏞65515 < 65528 = (213 − 1) ⋅ 8

23

Page 29: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Fragment Reassembly

– Endpoints must buffer fragments for reassembly

– Maximum size of an IP packet? Of a reassembled packet?

(216 − 1) − 20 =Ping of Death

⏞⏞⏞⏞⏞⏞⏞65515 < 65528 = (213 − 1) ⋅ 8

23

Page 30: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IP Fragment Reassembly

– Endpoints must buffer fragments for reassembly

– Maximum size of an IP packet? Of a reassembled packet?

(216 − 1) − 20 =Ping of Death

⏞⏞⏞⏞⏞⏞⏞65515 < 65528 = (213 − 1) ⋅ 8

23

Page 31: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Transport-Layer Security

24

Page 32: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Transmission Control Protocol (TCP) [5]

– TCP provides a stream abstraction on top of the IP layer– Bytes as opposed to datagrams– TCP transparently segments byte stream into packets

– Provides some reliability– Data integrity– In-order presentation of byte stream– Retransmission of dropped or corrupted packets– Flow and congestion control

25

Page 33: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Packet Format

struct TCPPacket {source_port: u16, destination_port: u16,sequence_number: u32, acknowledgment: u32,data_offset: u4, reserved: u3, ns: bool,cwr: bool, ece: bool, urg: bool, ack: bool,psh: bool, rst: bool, syn: bool, fin: bool,window_size: u16, checksum: u16, urg_ptr: u16,options: Vec<u8>,

}26

Page 34: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connections

– TCP is connection-oriented– Clients connect to a server– Servers bind to a port, listen for connections, and accepts them

– TCP tracks both client- and server-side states

27

Page 35: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP State Diagram [6]

Figure 5: TCP/IP state-transition graph

28

Page 36: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Flags

SYN Synchronize sequence numbersACK Sequence number acknowledgmentPSH Flush any buffered dataFIN End of data from senderRST Reset the stream

– TCP flag bits dictate transitions through TCP state diagram

29

Page 37: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Establishment

Figure 6: TCP three-way handshake

30

Page 38: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Data Transmission

Figure 7: TCP data transmission

31

Page 39: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Graceful Shutdown

Figure 8: TCP graceful shutdown

32

Page 40: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Berkeley Sockets API

1 // Initialize a server address descriptor2 struct sockaddr_in server_addr;3 memset(&server_addr, 0, sizeof(server_addr));4 server_addr.sin_family = AF_INET;5 server_addr.sin_addr = htonl(0x7f000001);6 server_addr.sin_port = htons(22);7

8 // Create a TCP socket9 int sk = socket(AF_INET, SOCK_STREAM, 0);

10

11 // Connect to the server12 connect(sk, (struct sockaddr*) &server_addr, sizeof(server_addr));

33

Page 41: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Berkeley Sockets API

1 // Initialize a server address descriptor2 struct sockaddr_in server_addr;3 memset(&server_addr, 0, sizeof(server_addr));4 server_addr.sin_family = AF_INET;5 server_addr.sin_addr = INADDR_ANY;6 server_addr.sin_port = htons(22);78 // Create and bind a TCP server socket9 int server_sk = socket(AF_INET, SOCK_STREAM, 0);

10 bind(server_sk, (const struct sockaddr*) &server_addr, sizeof(server_addr));11 listen(server_sk, 1);1213 // Accept a client connection14 struct sockaddr_in client_addr;15 memset(&client_addr, 0, sizeof(client_addr));16 socklen_t client_addr_len = sizeof(client_addr);17 int client_sk = accept(server_sk, (struct sockaddr*) &client_addr, &client_addr_len); 34

Page 42: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Raw Sockets

– Raw sockets allow user programs to bypass layers of thenetworking stack

– Distinction between “raw” and “cooked” packets– Raw socket creation requires high privilege (Why?)

35

Page 43: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP SYN Flooding

– Attackers send many SYN packets to a victim– Server creates transmission control blocks (TCB) to track

connection states– Creates memory pressure and long connection queues– No analogous client-side requirement ⇒ asymmetric advantage

– Defending against SYN floods not straightforward– Any defense must retain backwards-compatibility

36

Page 44: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

SYN Cookies [7]

Idea: Avoid the need to keep server-side state until aconnection is fully opened

(1) Server encodes a “cookie” into its initial sequence number (ISN)𝑛

(2) Client response ACKs 𝑛 + 1(3) Server verifies that the cookie is correct(4) Connection state created from the decoded cookie

37

Page 45: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

SYN Cookies

Let 𝑡 be the current timestamp >> 6 bits, 𝑚 be a 3-bit encoding ofthe initial MSS, and 𝑆𝑘 be a keyed cryptographic 24-bit hashfunction. Then, given a connection tuple⟨𝑎𝑠𝑟𝑐, 𝑝𝑠𝑟𝑐, 𝑎𝑑𝑠𝑡, 𝑝𝑑𝑠𝑡⟩, a SYN cookie 𝑐 is

𝑐 = (𝑡 mod 32) ∥ 𝑚 ∥ 𝑆𝑘(𝑎𝑠𝑟𝑐, 𝑝𝑠𝑟𝑐, 𝑎𝑑𝑠𝑡, 𝑝𝑑𝑠𝑡, 𝑡).

38

Page 46: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Resets

– Attackers can send RST packets to victims to destroy existingconnections– Addresses and ports must be correctly spoofed– Sequence number must be within the destination’s receive

window

– Simple and effective attack for an on-path network adversary

39

Page 47: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Resets

Figure 9: TCP connection reset attack example

40

Page 48: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Resets

– What if an attacker is off-path; can a reset attack still bemounted?

– Yes, by predicting sequence numbers!– One can assume that all other information is known or trivially

guessable– Requires exploitable determinism in ISN selection (Why?)

41

Page 49: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Resets

– What if an attacker is off-path; can a reset attack still bemounted?

– Yes, by predicting sequence numbers!– One can assume that all other information is known or trivially

guessable– Requires exploitable determinism in ISN selection (Why?)

41

Page 50: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Hijacking

– Attacks can hijack existing TCP connections– Requires sending forged packets to one host participating in the

connection– If one spoofed packet is accepted by the receiver, the connection

can be desynchronized from the other victim host

– More difficult than resetting connections– Victim hosts can easily reset the connection during the attack

42

Page 51: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP Connection Hijacking

Figure 10: TCP connection hijacking

43

Page 52: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Port Scanning

– Reconnaissance is often a prerequisite for launching attacks– Port scanning is a technique for remotely gathering information

on target networks– Topology, access control policy, network service availability and

versions– Relies on combination of direct and side-channel leakage

– nmap is the de facto standard scanner

44

Page 53: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP SYN Scans

IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200IP 10.254.1.119.55054 > 10.254.1.118.23: Flags [S], seq 1770108639, win 29200IP 10.254.1.118.22 > 10.254.1.119.32996: Flags [S.], seq 245736174, ack 1186093763, win 28960IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [.], ack 1, win 229IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [R.], seq 1, ack 1, win 229IP 10.254.1.119.55098 > 10.254.1.118.23: Flags [S], seq 2435541012, win 29200IP 10.254.1.119.33072 > 10.254.1.118.22: Flags [S], seq 2969806151, win 29200IP 10.254.1.118.22 > 10.254.1.119.33072: Flags [S.], seq 4159765487, ack 2969806152, win 28960IP 10.254.1.119.33072 > 10.254.1.118.22: Flags [.], ack 1, win 229IP 10.254.1.119.33072 > 10.254.1.118.22: Flags [R.], seq 1, ack 1, win 229

45

Page 54: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

TCP ACK Scans

IP 10.254.1.119.48479 > 10.254.1.118.22: Flags [.], ack 2601494423, win 1024IP 10.254.1.118.22 > 10.254.1.119.48479: Flags [R], seq 2601494423, win 0IP 10.254.1.119.48479 > 10.254.1.118.23: Flags [.], ack 2601494423, win 1024IP 10.254.1.119.48480 > 10.254.1.118.23: Flags [.], ack 2601428886, win 1024IP 10.254.1.119.48490 > 10.254.1.118.22: Flags [.], ack 2584716951, win 1024IP 10.254.1.118.22 > 10.254.1.119.48490: Flags [R], seq 2584716951, win 0IP 10.254.1.119.48491 > 10.254.1.118.22: Flags [.], ack 2567939479, win 1024IP 10.254.1.118.22 > 10.254.1.119.48491: Flags [R], seq 2567939479, win 0

46

Page 55: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

UDP Scans

IP 10.254.1.119.54491 > 10.254.1.1.54: UDP, length 0IP 10.254.1.119.54491 > 10.254.1.1.53: 0 stat [0q] (12)IP 10.254.1.119.54492 > 10.254.1.1.53: 0 stat [0q] (12)IP 10.254.1.119.54492 > 10.254.1.1.54: UDP, length 0IP 10.254.1.119.54493 > 10.254.1.1.54: UDP, length 0IP 10.254.1.119.54493 > 10.254.1.1.53: 0 stat [0q] (12)IP 10.254.1.119.54494 > 10.254.1.1.53: 0 stat [0q] (12)IP 10.254.1.119.54494 > 10.254.1.1.54: UDP, length 0IP 10.254.1.119.54495 > 10.254.1.1.53: 0 stat [0q] (12)

47

Page 56: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

OS and Service Fingerprinting

– Differences in TCP/IP implementations can be used tofingerprint remote operating systems [8, Ch. 8]– Due to specification ambiguity and implementation flaws

– Most services can also be trivially fingerprinted– Banners are very helpful– Services are also prone to information leakage

48

Page 57: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Remote Host Scanning

$ nmap -A 10.254.1.118Nmap scan report for 10.254.1.118Host is up (0.018s latency).

PORT STATE SERVICE VERSION22/tcp open ssh OpenSSH 7.6 (protocol 2.0)| ssh-hostkey:| 2048 e2:e5:b6:ea:1e:c1:d9:42:08:d5:94:21:8b:23:59:83 (RSA)| 256 09:c6:cf:47:84:aa:d0:11:e7:3f:ac:48:c2:78:99:06 (ECDSA)|_ 256 fc:47:e0:bd:18:0d:a1:53:36:35:e8:5f:46:a1:40:26 (EdDSA)[...]MAC Address: 00:1E:06:34:96:CD (Wibrain)OS details: Linux 3.10 - 4.8, Linux 3.2 - 4.8Network Distance: 1 hop 49

Page 58: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Firewalls

– Firewalls inspect network traffic and filter or modify it accordingto some predicates (a ruleset) [9]

Packet filters Operate over individual packetsStateful filters Operate over connection abstractionApplication-level Operate over application features

50

Page 59: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Clients

Web Servers

Developers

Staff

Databases

Page 60: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Intrusion Detection (IDS)

– General term for detecting attacks against systems, networks,and software

– Many ways to characterize an IDS

Domain Network, host, application eventsModels Misuse/signature/negative vs. anomaly/positive

State Stateless vs. stateful

52

Page 61: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Detection Domains

– Detection is pattern matching over an event stream– Network packets, connection streams– System calls, control-flow transfers– Application events (e.g., HTTP messages, user logins)

– Detection over IDS alerts → correlation

53

Page 62: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Misuse Detection

alert tcp any any -> 192.168.0.0/24 80 \(content: ”|90 90 90 90|”; msg: ”NOP sled”;)

– Misuse detection searches for direct evidence of attacks– Models of malice encoded as signatures– Capable of precise matching (low false positives)– Prone to evasion and ineffective for 0-days

54

Page 63: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Anomaly Detection

benign any any -> 192.168.0.0/24 80 \(content: ascii; msg: ”Non-ASCII request”;)

– Anomaly detection identifies previously unseen behavior– Assumes unknown behavior is indicative of an attack– Models can be specified or built using machine learning– Can detect 0-day attacks– Prone to false positives

55

Page 64: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Machine Learning Pitfalls

Training data is synthetic, or is attack-free real behavior

– What if the synthetic data is not representative of real behavior?[10]

– What if the real data does contain attacks? How can you be sureit doesn’t? [11]

56

Page 65: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Machine Learning Pitfalls

Training data is synthetic, or is attack-free real behavior

– What if the synthetic data is not representative of real behavior?[10]

– What if the real data does contain attacks? How can you be sureit doesn’t? [11]

56

Page 66: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Machine Learning Pitfalls

“Normal behavior” is constant

– What if normal behavior changes over time?– Concept drift [12]– If models can be updated, what if the attacker can influence the

retraining procedure?

57

Page 67: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Machine Learning Pitfalls

“Normal behavior” is constant

– What if normal behavior changes over time?– Concept drift [12]– If models can be updated, what if the attacker can influence the

retraining procedure?

57

Page 68: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Machine Learning Pitfalls

Attacks are distinguishable from normal behavior

– What if an attacker can create “normal-looking” attacks?– Mimicry attacks [13]

58

Page 69: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Machine Learning Pitfalls

Attacks are distinguishable from normal behavior

– What if an attacker can create “normal-looking” attacks?– Mimicry attacks [13]

58

Page 70: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IDS Limitations

def check_malware():if not D(check_malware):

execute_attack()– Intrusion detection has been reduced to the halting problem

[14]– In practice, false positives are the limiting factor for an IDS

– Base rate of attacks is low in most environments– Even miniscule false positives rates are magnified 59

Page 71: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Detection Theory

Table 2: Confusion matrix for a binary classifier

Event occurred Event did not occur

Event detected True positive False positiveEvent not detected False negative True negative

60

Page 72: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Base Rate Fallacy

Let 𝐴, 𝐼 be two boolean random variables where 𝐼 is whether anevent represents an intrusion and 𝐴 is whether an alert is raised.Then,

𝑃(𝐴|𝐼) Probability of a true positive𝑃(𝐴|¬𝐼) Probability of a false positive

Given this, we can calculate 𝑃(𝐼|𝐴)…61

Page 73: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Base Rate Fallacy

𝑃(𝐼) = 2 ⋅ 10−5

𝑃(𝐴|𝐼) = 𝑃(𝐴) ⋅ 𝑃 (𝐼|𝐴)𝑃(𝐼)

𝑃 (𝐼|𝐴) = 𝑃(𝐼) ⋅ 𝑃 (𝐴|𝐼)𝑃 (𝐼) ⋅ 𝑃 (𝐴|𝐼) + 𝑃 (¬𝐼) ⋅ 𝑃 (𝐴|¬𝐼)

= 2 ⋅ 10−5 ⋅ 𝑃 (𝐴|𝐼)2 ⋅ 10−5 ⋅ 𝑃 (𝐴|𝐼) + 0.99998 ⋅ 𝑃 (𝐴|¬𝐼)

62

Page 74: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Base Rate Fallacy

𝑃(𝐼) = 2 ⋅ 10−5

𝑃(𝐴|𝐼) = 𝑃(𝐴) ⋅ 𝑃 (𝐼|𝐴)𝑃(𝐼)

𝑃 (𝐼|𝐴) = 𝑃(𝐼) ⋅ 𝑃 (𝐴|𝐼)𝑃 (𝐼) ⋅ 𝑃 (𝐴|𝐼) + 𝑃(¬𝐼) ⋅ 𝑃 (𝐴|¬𝐼)

= 2 ⋅ 10−5 ⋅ 𝑃 (𝐴|𝐼)2 ⋅ 10−5 ⋅ 𝑃 (𝐴|𝐼) + 0.99998 ⋅ 𝑃 (𝐴|¬𝐼)⏟⏟⏟⏟⏟⏟⏟

This term dominates 𝑃(𝐼|𝐴) 63

Page 75: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Base Rate Fallacy Example

Consider the case of a medical test that has 99% accuracy(𝑃(𝐴|𝐼) = 0.99, 𝑃(¬𝐴|¬𝐼) = 0.99). During consultation, thedoctor tells you that you tested positive, but only 1 in 10,000 havethe condition (𝑃(𝐼) = 0.0001).What is the probability that you have the condition?

64

Page 76: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Base Rate Fallacy Example

𝑃(𝐼|𝐴) = 𝑃(𝐼) ⋅ 𝑃 (𝐴|𝐼)𝑃 (𝐼) ⋅ 𝑃 (𝐴|𝐼) + 𝑃(¬𝐼) ⋅ 𝑃 (𝐴|¬𝐼)

= 0.0001 ⋅ 0.990.0001 ⋅ 0.99 + (1 − 0.0001) ⋅ 0.01

= 0.0098≈ 1%

65

Page 77: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

False Positives

– A higher false positive rate has several negative effects asidefrom increasing inaccuracy– Desensitizes users (user fatigue)– Decreases trust– Can have a high cost [15]

It is more important to minimize false positives rather than falsenegatives

66

Page 78: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP
Page 79: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Comparing Detection Systems

Figure 11: ROC plot

– Receiver operatingcharacteristic (ROC) plotsused to compare IDSs

– Plots true positives vs. falsepositives while varyingthreshold

– Indicates the expectedTPR/FPR trade-off

68

Page 80: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IDS Evasion [16]

– Overwhelm the IDS– Overwhelm the operators– Desynchronization from network, system, and service states

How does the IDS know the actual state of monitored hosts andservices?

69

Page 81: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IDS Evasion [16]

– Overwhelm the IDS– Overwhelm the operators– Desynchronization from network, system, and service states

How does the IDS know the actual state of monitored hosts andservices?

69

Page 82: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

IDS Evasion

Figure 12: Overlapping TCP segments

– What bytestream is received by the victim?– Depends on packet ordering, victim OS!

70

Page 83: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Wireless Networking

71

Page 84: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Wireless Networking [17]

– Link-layer attacks are new again in a wireless environment(Why?)

– Wireless networks reintroduce a shared broadcast medium!– ARP spoofing is a major problem

– Possible to MITM many sensitive protocols

Idea: Introduce cryptographic controls

72

Page 85: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Wireless Networking [17]

– Link-layer attacks are new again in a wireless environment(Why?)

– Wireless networks reintroduce a shared broadcast medium!– ARP spoofing is a major problem

– Possible to MITM many sensitive protocols

Idea: Introduce cryptographic controls

72

Page 86: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Wired Equivalent Privacy (WEP)

– First standard for wireless network security– RC4𝐾∥𝑉 ⊕ 𝑃 = 𝐶 (one-time pad)– 40/104-bit key, 24-bit IV

– Quickly broken: Fluhrer-Mantin-Shamir (FMS) attack [18]– Exploits reuse of weak IVs– Made more efficient with DEAUTH packets and ARP re-injection

What sorts of threats does WEP et al. defend against?

73

Page 87: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Wired Equivalent Privacy (WEP)

– First standard for wireless network security– RC4𝐾∥𝑉 ⊕ 𝑃 = 𝐶 (one-time pad)– 40/104-bit key, 24-bit IV

– Quickly broken: Fluhrer-Mantin-Shamir (FMS) attack [18]– Exploits reuse of weak IVs– Made more efficient with DEAUTH packets and ARP re-injection

What sorts of threats does WEP et al. defend against?

73

Page 88: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Wi-Fi Protected Access (WPA)

– Standard introduced in 2003 to replace WEP– Adopted the Temporal Key Integrity Protocol (TKIP)

– Per-packet 128-bit keys to prevent WEP-like vulnerabilities

– Introduced cryptographically-strong integrity checks instead ofweak CRCs

– WPA2 added CCMP, an AES-based encryption mode– WPA3 adds additional cryptographic protocols

e.g., AES256-GCM-HMAC-SHA38474

Page 89: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

WPAModes of Operation

– WPA Personal– 256-bit pre-shared key derived using PBKDF2

– WPA Enterprise– Builds on 802.1X authentication protocol– Requires additional infrastructure

e.g., RADIUS server, PKI

– Wi-Fi Protected Setup (WPS)

75

Page 90: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

802.1X Authentication

– Standard for port-based network access control (PNAC)– Three participants: supplicant, authenticator, and

authentication server– Supplicant port starts in uncontrolled state– Supplicant exchanges EAPOL frames with the authenticator– Authenticator proxies messages to authentication server– If successful, supplicant port transitions to controlled state

76

Page 91: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

802.1X Authentication

Figure 13: 802.1X authentication protocol

77

Page 92: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Access Point Spoofing [19]

Figure 14: Spoofed SSID example

– How do you verify that you’reconnecting to the network you thinkyou are?

– How are SSIDs allocated?– How are SSIDs bound to an

organization?

78

Page 93: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

DEAUTH Attacks

– 802.11 standard [17] supports a deauthentication frame, a“sanctioned technique to inform a rogue station that they havebeen disconnected from the network”

– Anybody can send DEAUTH frames!– Useful for forcing clients to connect to a rogue access point– Also useful for gathering packets useful for WPA password

cracking

79

Page 94: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Conclusions

80

Page 95: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

Conclusions

In this module, we covered:

(1) The TCP/IP model(2) Link-layer security(3) Internet-layer security(4) Transport-layer security(5) Wireless security

81

Page 96: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

References

[1] “A Standard for the Transmission of IP Datagrams over Ethernet Networks,” Apr-1984. [Online]. Available:https://tools.ietf.org/rfc/rfc894.txt. [Accessed: 13-Jan-2018].

[2] “An Ethernet Address Resolution Protocol,” Nov-1982. [Online]. Available: https://tools.ietf.org/rfc/rfc826.txt. [Accessed:13-Jan-2018].

[3] “Internet Protocol,” Sep-1981. [Online]. Available: https://tools.ietf.org/rfc/rfc791.txt. [Accessed: 13-Jan-2018].

[4] “Ingress Filtering for Multihomed Networks,” Mar-2004. [Online]. Available: https://tools.ietf.org/rfc/rfc3704.txt.[Accessed: 13-Jan-2018].

[5] “Transmission Control Protocol,” Sep-1981. [Online]. Available: https://tools.ietf.org/rfc/rfc793.txt. [Accessed:13-Jan-2018].

82

Page 97: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

References (cont.)

[6], “TCP State Diagram.” [Online]. Available: https://commons.wikimedia.org/w/index.php?curid=30810617. [Accessed:18-Jan-2018].

[7] “SYN Cookies,” Sep-1996. [Online]. Available: http://cr.yp.to/syncookies.html. [Accessed: 13-Jan-2018].

[8] G. Lyon, Nmap Network Scanning. 2011.

[9] W. R. Cheswick, S. M. Bellovin, and A. D. Rubin, Firewalls and Internet Security: Repelling theWily Hacker. 2003.

[10] J. McHugh, “Testing Intrusion Detection Systems,” ACM Transactions on Information and System Security (TISSEC), vol. 3,no. 4, Nov. 2000.

[11] G. Cretu, A. Stavrou, M. E. Locasto, S. J. Stolfo, and A. D. Keromytis, “Casting Out Demons: Sanitizing Training Data forAnomaly Sensors,” in Proceedings of the IEEE Symposium on Security and Privacy (Oakland), 2008.

83

Page 98: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

References (cont.)

[12] F. Maggi, W. Robertson, C. Kruegel, and G. Vigna, “Protecting a Moving Target: Addressing Web Application ConceptDrift,” in Proceedings of the Symposium on Recent Advances in Intrusion Detection (RAID), 2009.

[13] D. Wagner and P. Soto, “Mimicry Attacks on Host-Based Intrusion Detection Systems,” in Proceedings of the ACMConference on Computer and Communications Security, 2002.

[14] F. Cohen, “Computational Aspects of Computer Viruses,” Computers & Security, vol. 8, no. 4, Jun. 1989.

[15] “Hawaii Panics After Alert About Incoming Missile Is Sent in Error,” 13-Jan-2018. [Online]. Available:https://www.nytimes.com/2018/01/13/us/hawaii-missile.html. [Accessed: 14-Jan-2018].

[16] T. H. Ptacek and T. N. Newsham, “Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection,” SecureNetworks, Inc., 1998.

84

Page 99: Network Security - Attacks Against the TCP/IP Stackchris/teaching/cs177/doc/cs177-02.pdfTCPSYNScans IP 10.254.1.119.32996 > 10.254.1.118.22: Flags [S], seq 1186093762, win 29200 IP

References (cont.)

[17], “802.11-2016 - IEEE Standard for Information technology,” 14-Dec-2016. [Online]. Available:https://ieeexplore.ieee.org/document/7786995. [Accessed: 24-Jan-2020].

[18] S. Fluhrer, I. Mantin, and A. Shamir, “Weaknesses in the Key Scheduling Algorithm of RC4,” in Proceedings of SelectedAreas in Cryptography, 2001.

[19] A. Cassola, W. Robertson, E. Kirda, and G. Noubir, “A Practical, Targeted, and Stealthy Attack Against WPA Enterprise,” inProceedings of the ISOC Network and Distributed System Security Symposium (NDSS), 2013.

85