Introduction to Computer Security Network Security Pavel Laskov Wilhelm Schickard Institute for Computer Science
Circuit switching vs. packet switching
OSI and TCP/IP layered models
TCP/IP encapsulation
TCP connection synchronization Initial handshake Termination Host Host Host Host Send SYN seq=x Send FIN seq=x Receive SYN Receive FIN Send SYN seq=y, CK x+1 Send CK x+1 Receive SYN + CK Receive CK Send CK y+1 Send FIN seq=y, CK x+1. data transmission Receive CK Receive FIN + CK Send CK y+1 Receive CK
What can go wrong: TCP session hijacking C() Seq: x PSH/CK: y (60) Seq: y PSH/CK: x+60 (20) Seq: x+60 PSH/CK: y+20 (30) Seq: y+20 PSH/CK: x+90 (20) Seq: x+90 PSH/CK: y+40 (30) Seq: y+40 PSH/CK: x+120 (20)
Example: SYN flood Normal TCP handshake SYN flood
Placement of security instruments Network layer Transport layer pplication layer
IP layer security: IPsec Objectives: secure connectivity of branch offices secure remote access dvantages: bypass resistance transparency to end users and applications Disadvantages: infrastructure support needed performance degradation
IPsec services and protocols H: uthentication Header ESP: Encapsulating Security Payload Services / Protocols H ESP ESP + auth. ccess control Connectionless integrity Data origin authentication Replay protection Confidentiality Traffic flow confidentiality
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 IPsec modes
ration allows the hosts to avoid implementing the security capability. The former technique is supported by a transport mode S, while the latter technique uses a tunnel mode S. In this section, we look at the scope of ESP for the two modes. The considerations are somewhat different for IPv4 and IPv6. We use the packet formats of Figure 8.8a as a starting point. TRNSPORT MODE ESP Transport mode ESP is used to encrypt and optionally authenticate the data carried by IP (e.g., a TCP segment), as shown in Figure 8.8b. Transport mode vs. tunnel mode Encrypted TCP session Internal network External network (a) Transport-level security Corporate network Corporate network Encrypted tunnels carrying IP traffic Internet Corporate network Corporate network (b) virtual private network via tunnel mode Figure 8.7 Transport-Mode versus Tunnel-Mode Encryption
(a) efore pplying H orig IP IPv4 TCP Data authenticated except for mutable fields H service IPv6 orig IP extension orig IP headers IPv4 (if present) H TCP Data IPv6 Transport mode orig IP (a) efore pplying H authenticated except for mutable fields authenticated except for mutable fields hop-by-hop, dest, routing, fragment H dest TCP Data orig IP IPv4 H TCP Data (b) Transport Mode IPv6 Tunnel mode orig IP authenticated except for mutable fields authenticated except for mutable fields in the new IP header hop-by-hop, dest, routing, fragment H dest TCP Data New IP orig IP IPv4 H TCP Data (b) Transport Mode IPv6 new IP ext headers authenticated except for mutable fields in new IP header and its extension headers authenticated except for mutable orig IP fields extin the new IP header H headers TCP Data New IP orig IP IPv4 H TCP Data
IPv4 orig IP ESP TCP authenticated encrypted Data ESP ESP service trlr auth IPv6 Transport mode orig IP hop-by-hop, dest, routing, fragment ESP authenticated encrypted authenticated dest TCP encrypted Data ESP ESP trlr auth IPv4 orig IP ESP (a) TCP Transport Mode Data ESP ESP trlr auth IPv6 Tunnel mode orig IP authenticated authenticated encrypted encrypted hop-by-hop, dest, ESP dest TCP Data routing, New fragment IP ESP orig IP IPv4 TCP Data (a) Transport Mode ESP ESP ESP trlr auth ESP trlr auth authenticated encrypted new IP ext ESP authenticated orig IP ext ESP ESP
Transport layer security: SSL/TLS Objectives: secure information transmission in Internet applications mutual authentication in Internet applications dvantages: secure end-to-end communication over TCP (not limited to HTTP) Disadvantages: PKI support needed potential use of weak cryptographic algorithms (e.g. RC4)
SSL architecture SSL connection corresponds to TCP connections. SSL sessions represent an association between a client and a server. Sessions define parameters that can be share between connections.
SSL Record Protocol Carries out information transfer Provides confidentiality and message integrity services.
SSL handshake protocol Client Server Random number Crypto info Random number Crypto info Server certificate Request 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
pplication layer security: SSH pplications secure remote login secure services (e.g. FTP, copy) over an insecure network secure port forwarding dvantages various authentication methods a neat way to circumvent firewalls Disadvantages point-to-point only some security vulnerabilities
SSH architecture Client Server known-hosts H host keys H host key H H SSH Connection H session key interactive session secure copy port forwarding... session key User ccount User ccount U user key U U user key
SSH functionality Remote Login Username / password Public key Remote command execution Remote copying (rcp) Secure ftp service (sftp) Remote synchronization (rsync) Port forwarding and tunneling Secure file system mounting (sshfs)
SSH port forwarding Syntax: Local forwarding: ssh -L <lport>:<rhost>:<rport> username@host Remote forwarding: ssh -R <port>:<lhost>:<lport> username@host
SSH port forwarding: examples IMP requiests for an intermal IMP server: ssh -L 8143:exchange.first.fraunhofer.de:993 laskov@vnc00.first.fraunhofer.de Sending mail over an internal server: ssh -L 8025:smtpserv.uni-tuebingen.de:25 laskov@smb1.cs.uni-tuebingen.de rowsing with an external IP address: ssh -L 8081:proxy0.first.fraunhofer.de:3128 -L 8080:proxy0.first.fraunhofer.de:3128 laskov@vnc00.first.fraunhofer.de External SSH access bypassing a firewall: ssh -R 22:montreal.cs.uni-tuebingen.de:22 laskov@sshgw.cs.uni-tuebingen.de
Summary Network security technologies can be deployed at all layers of network protocols. IP layer security provides a transparent security service; needs, however, infrastructure support. Trasport layer security provides a reliable end-to-end security services. pplication layer security mechanisms can be tailored to specific application needs.