Introduction to Computer Security
Network Security
Pavel Laskov
Circuit switching vs. packet switching
A B A A B B B A A B A A A A A B B B ATCP connection synchronization
Initial handshake
Host A Host B
Send SYN seq=x
Receive SYN
Send SYN seq=y, ACK x+1
Receive SYN + ACK
Send ACK y+1
Receive ACK ... data transmission
Termination
Host A Host BSend FIN seq=x
Receive FIN Send ACK x+1 Receive ACK
Send FIN seq=y, ACK x+1 Receive FIN + ACK
Send ACK y+1
What can go wrong: TCP session hijacking
Seq: x PSH/ACK: y (60) Seq: y PSH/ACK: x+60 (20) Seq: x+60 PSH/ACK: y+20 (30) Seq: y+20 PSH/ACK: x+90 (20) Seq: x+90 PSH/ACK: y+40 (30) Seq: y+40 PSH/ACK: x+120 (20)
A
A
A
A
C(A)
A
B
B
B
B
B
B
Example: SYN flood
Placement of security instruments
IP layer security: IPsec
Objectives:
secure connectivity of branch offices
secure remote access
Advantages:
bypass resistence
transparency to end users and applications
Disadvantages:
infrastructure support needed
performance degradation
IPsec application example
IP
Header PayloadIP
IP
HeaderHeaderIPSec Secure IPPayload
IP Head er IPSe c Head er Secu re IP Payl oad IP Head er IPSec Head er Secu re IP Paylo ad IP Header PayloadIP Networking device with IPSec User system with IPSec Networking device with IPSec
Figure 6.1 An IP Security Scenario
Public (Internet) or Private
IPsec services and protocols
Services / Protocols
AH
ESP
ESP + auth.
Access control
X
X
X
Connectionless integrity
X
X
Data origin authentication
X
X
Replay protection
X
X
X
Confidentiality
X
X
IPsec modes
Transport mode
Protection of packet payload
Used for end-to-end communication
Small performance overhead
Tunnel mode
Protection of entire packet (payload and headers)
Communication between gateways
Invisible to intermediate routers
Considerable performance overhead
AH service
Transport mode
orig IP
hdr routing, fragment AHhop-by-hop, dest, dest TCP Data IPv6
authenticated except for mutable fields orig IP
hdr AH TCP Data IPv4
authenticated except for mutable fields
orig IP hdr New IP
hdr AH TCP Data
IPv4
authenticated except for mutable fields in the new IP header (b) Transport Mode
orig IP
hdr extension headers(if present) TCP Data IPv6
orig IP
hdr TCP Data IPv4
(a) Before Applying AH
new IP
hdr headersext AH orig IPhdr headersext TCP Data IPv6
authenticated except for mutable fields in new IP header and its extension headers
(c) Tunnel Mode
Figure 6.6 Scope of AH Authentication
Tunnel mode
orig IP
hdr routing, fragment AHhop-by-hop, dest, dest TCP Data IPv6
authenticated except for mutable fields orig IP
hdr AH TCP Data IPv4
authenticated except for mutable fields
orig IP hdr New IP
hdr AH TCP Data
IPv4
authenticated except for mutable fields in the new IP header (b) Transport Mode
orig IP
hdr extension headers(if present) TCP Data IPv6
orig IP
hdr TCP Data IPv4
(a) Before Applying AH
new IP
hdr headersext AH orig IPhdr headersext TCP Data IPv6
authenticated except for mutable fields in new IP header and its extension headers
(c) Tunnel Mode
ESP service
Transport mode
orig IP
hdr routing, fragmenthop-by-hop, dest, IPv6 orig IP hdr IPv4 New IP hdr IPv4
(a) Transport Mode
new IP hdr headersext IPv6 authenticated encrypted authenticated encrypted authenticated encrypted authenticated encrypted (b) Tunnel Mode
Figure 6.9 Scope of ESP Encryption and Authentication
orig IP
hdr headersext TCP Data ESPtrlrauthESP ESP hdr ESP auth orig IP hdr TCP Data ESPtrlr ESP auth ESP hdr dest TCP Data TCP Data ESP trlr ESP auth ESP trlr ESP hdr ESP hdr
Tunnel mode
orig IPhdr routing, fragmenthop-by-hop, dest, IPv6 orig IP hdr IPv4 New IP hdr IPv4
(a) Transport Mode
new IP hdr headersext IPv6 authenticated encrypted authenticated encrypted authenticated encrypted authenticated encrypted (b) Tunnel Mode
Figure 6.9 Scope of ESP Encryption and Authentication
orig IP
hdr headersext TCP Data ESPtrlrauthESP ESP hdr ESP auth orig IP hdr TCP Data ESPtrlr ESP auth ESP hdr dest TCP Data TCP Data ESP trlr ESP auth ESP trlr ESP hdr ESP hdr
Transport layer security: SSL/TLS
Objectives:
secure information transmission in Internet applications
mutual authentication in Internet applications
Advantages:
secure end-to-end communication over TCP (not limited to
HTTP)
Disadvantages:
PKI support needed
SSL architecture
SSL connection
corresponds to
TCP connections.
SSL sessions
represent an
association between a cliend and
a server. Sessions define
parameters that can be share
between connections.
SSL Record Protocol
Carries out information transfer
SSL handshake protocol
Client Server Random number Crypto info Random number Crypto info Server certificateRequest client auth.
Extract server public key
Client certificate
Hash over prev. messages
Extract client public key
Random pre-master secret
Calculate master secret Calculate master secret
Switch to master secret End handshake
Switch to master secret End handshake