Structure of TCP/IP Internet Internet gateway (router) Internet Address Class A Class B Class C 0 8 31 0 netid hostid 0 16 31 1 0 netid hostid 0 24 31 1 1 0 netid hostid Network Address : (A) 1 ~ 127, (B) 128 ~ 191, (C) 192 ~ 223 10000000 00001010 00000010 00011110 128. 10. 2. 30 1
Subnet Address Internet Network 128.10.0.0 G Network 128.10.64.0 128.10.64.1 128.10.64.2 Network 128.10.128.0 128.10.128.1 128.10.128.2 class B network 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 128 10 0 1 64 2 1 0 128 TCP/IP Network Model Application Layer Transport Layer TCP UDP Network Layer ICMP IP Link Layer ARP RARP Physical Layer 2
Encapsulation TCP IP Application Data TCP-H Application Data TCP Segment IP-H TCP-H Application Data IP Datagram Link-H IP-H TCP-H Application Data Link-T Ethernet Frame IP ( Internet Protocol ) - Unreliable, connectionless delivery system - Routing function - IP Datagram = Header + Data Ver HLen Service Type Total Length Identification Flags Fragment Offset Time to Live Protocol Header Checksum Source IP Address Destination IP Address IP Option (if any) Padding DATA IP Header 3
Flagmentation Net-1 Net-2 G G MTU = 620 Net-3 MTU = 1500 MTU = 1500 IP-Header Data1(600 octets) Data2 (600 octets) Data3 (200 octets) Flagment1-Header Data1 offset 0 Flagment2-Header Data2 offset 600 Flagment3-Header Data3 offset 1200 TCP Segment Format Source Port Destination Port Sequence Number Acknowledgment Number HLen Reserved Code Bits Window CheckSum Urgent Pointer IP Option (if any) Padding DATA TCP Header URG ACK PSH RST SYN FIN 4
TCP Connection Client Server TCP reliable TCP segment TCP IP unreliable IP packet IP TCP ( Transport Control Protocol ) - Reliable Delivery Service - Acknowledgment with Retransmission - Connection-Oriented Service Packet - Full-Duplex Connection lost Packet-1 Start timer Packet-2 Ack-1 Ack-2 Timer expires 5
Open/Close TCP Connection SYN seq=x FIN seq=x ACK y+1 SYN seq=y ACK x+1 ACK y+1 ACK x+1 FIN, ACK x+1 Sniffing LAN analyzer ( sniffer ) - password - - ( ) - protocol crypto123 3812 2345 2321 1212 INTERNET LAN 6
Spoofing IP spoofing Subnet Mask = 255.255.255.0 Network = 135.12.10.0 Subnet Mask = 255.255.255.0 Network = 135.12.11.0 135.12.10.201 Spoofing Denial-of Service : TCP SYN flooding SYN=1 SYN=1 SYN=1 SYN=1, ACK=1 7
Spoofing Plug-In ( NetScape ) ActiveX ( MS Explorer ) / INTERNET SERVER 8
PEM ( Privacy Enhanced Mail ) PGP ( Pretty Good Privacy ) S/MIME MOSS PGP Phil Zimmerman RSA, IDEA, MD5 RSA, IDEA RSA, MD5 ZIP 64 9
PGP m MD5 m MD5 RSA ZIP m RSA(h(m)) ZIP 1 RSA RSA(h(m)) m k s RSA RSA m k s ZIP IDEA IDEA(ZIP(m)) RSA(k s ) IDEA ZIP 1 WWW Browser (Mosaic, Netscape) Server (NCSA HTTP, httpd) URL (Uniform Resource Locator) HTML (HyperText Manipulation Language) CGI (Common Gateway Interface) - e.g. form processing Security Holes FTP Server WWW Browser HTML WWW Server result query CGI Scripts Gopher Server Other Server 10
W W W Client / Server / W W W SSL ( Secure Socket Layer ) PCT ( Privacy Communication Technology ) S-HTTP SSL ( secure socket layer ) Netscape Communications Privacy, Data Integerity, Server [Client] Authentication, RSA, Diffie-Hellman, Fortezza for Key Exchange DES, 3DES, IDEA, RC2, RC4[stream cipher] for Data Encryption MD5, SHA for Hash Function ( MAC ) SSL TCP IP SSL Handshake SSL Record Algorithm Negotiation, Key Exchange, Authentication Data Encapsulation for data protection 11
SSL Handshake Protocol Client_Hello { R, Ciphersuite } Server_Hello { R, Cipher, X.509 Certificate } Client_Key_Exchange Server Client Session_Key_Generation Client_Finished, Server_Finished SSL Client Hello Phase client version 28-byte random number R session ID cipher_suites compression methods SSL Server Hello Phase Client Server_Hello Client_Hello Server client version 28-byte random number R session ID -> If a new session, server s certificate cipher_suite { key exchange algorithm } compression method 12
SSL Client Key Exchange Key Exchange Algorithm s Parameter in Certificate RSA : public exponent k e, modulus n Diffie-Hellman : g, modulus p, g s mod p From Pre_Master_Key To Mater-Key [ MD5, SHA, R, R ] Master_Key = MD5 (Pre_Master_Key + SHA ( A + Pre_Master_Key + R + R ) ) + MD5 ( Pre_Master_Key + SHA ( BB + Pre_Master_Key + R + R )) + MD5 ( Pre_Master_Key + SHA ( CCC + Pre_Master_Key + R + R ) ) Client_Key_Exchange Server Client Pre_Master_Key = g cs mod p { 48-byte random } K e [server] SSL Session Key Generation Keys for data encryption and data integrity Key_Block = MD5 (Master_Key + SHA ( A + Master_Key + R + R ) ) + MD5 ( Master_Key + SHA ( BB + Master_Key + R + R )) + MD5 ( Master_Key + SHA ( CCC + Master_Key + R + R ) ) +... SSL Client-Server Finished Key Exchange, Authentication Negotiated Algorithm, Parameter All Handshaked Messages Sender s value { client[0x434c4e54], server[0x53525652] } 13
SSL Record Protocol Fragmentation Compression Protection Application Data SSL Handshake SSL Record SSL TCP IP SSL_plaintext SSL_plaintext 2 14 bytes or less SSL_compressed SSL_ciphertext Stream Cipher ( RC4 ) with MAC Block Cipher ( RC2, DES ) with MAC FireWall Domain Name Service E-mail Handling Packet Filter Application Gateway 14
Packet Filter Operations yes? no yes yes no no NACK Proxy Server TELNET Client A private LAN TELNET request request ID, Password send ID, Password TELNET Proxy Server FireWall INTERNET TELNET request User Authentication [ One-Time Password ] TELNET Server A Separate Proxy Server for each Application ( FTP, TELNET ) change IP address 15
Externalized FTP Server private LAN FireWall INTERNET anonymous FTP File FTP Server 16