TCP/IP: TCP
Network Security Lecture 7
Eike Ritter 1 Network Security - Lecture 7
TCP/IP: TCP Network Security Lecture 7 Eike Ritter Network - - PowerPoint PPT Presentation
TCP/IP: TCP Network Security Lecture 7 Eike Ritter Network Security - Lecture 7 1 TCP spoofing Alice trusts Bob (e.g., logins on Alice are allowed with no password if TCP connection comes from host Bob) Mallory wants to impersonate
Eike Ritter 1 Network Security - Lecture 7
– M kills B (e.g., flooding) – M sends SYN segment to A with source IP address set to B’s IP address – A sends a SYN/ACK to B, with its initial sequence number IA – M completes the 3-way handshake, with ACK set to IA + 1
Eike Ritter 2 Network Security - Lecture 7
Software
Supercomputer Center
Number Attacks
– Set initial sequence number to the timer prescribed originally + the value of a cryptographic hash function of each connection:
ISN = M + F(localhost, localport, remotehost, remoteport)
– It is vital that F not be computable from the outside, so it is keyed with with some secret data
– Thus, each connection is given a separate sequence number space
Eike Ritter 3 Network Security - Lecture 7
– Are the different OSes correctly implementing initial sequence number generators? – How do you test it?
Number Analysis and the follow-up study One Year Later
say, looking at their implementation)
191541, 4294445483, 4294608504, 4288751770, 88040492, ...
– Represent a sequence of ISNs in a 3-d space: x[t] = seq[t] - seq[t-1] y[t] = seq[t-1] - seq[t-2] z[t] = seq[t-2] - seq[t-3] – Look for unexpected regularities in this space (“attractors”) – Use attractor to build “Spoofing Sets”, i.e., likely values for the next ISN
Eike Ritter 4 Network Security - Lecture 7
Eike Ritter 5 Network Security - Lecture 7
Eike Ritter 6 Network Security - Lecture 7
Eike Ritter 7 Network Security - Lecture 7
Eike Ritter 8 Network Security - Lecture 7
Eike Ritter 9 Network Security - Lecture 7
– What if authentication is performed by other means, e.g., password-based? – Attacker needs a more powerful attack
desynchronized state on both ends of the connection
– Two points cannot communicate
– At this point, attacker completely controls the connection
– Insert data in the streams – Reset an existing connection (denial of service)
Eike Ritter 10 Network Security - Lecture 7
– Think of telnet connection between A and B – M wants to hijack connection to inject commands that will be executed on B
– All the sent data has been acknowledged
– echo “+ +” > ~/.rhosts – Source IP is spoofed to A’s IP address – SEG.SEQ = last ACK from the server – SEG.ACK = last SEQ from the server
Eike Ritter 11 Network Security - Lecture 7
– Remember: attacker is spoofing A’s address – SRV.ACK = M
– CLN.ACK = N (N < M)
– SRV.ACK = M
Eike Ritter Network Security - Lecture 7 12
Eike Ritter 13 Network Security - Lecture 7
172.16.48.2.1026 > 172.16.48.1.23: P 1015112:1015133(21) ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923 172.16.48.1.23 > 172.16.48.2.1026: . seq 4056578923 ack 1015133 172.16.48.2.1026 > 172.16.48.1.23: . seq 1015112 ack 4056578923
– Send “null data” to client so that it resyncs with the server – In telnet, NOP commands
– ACKs that carry no data are not retransmitted if lost – ACK storm will congest the network – So eventually, ACKs will be lost
– Spoofs client so that server ACKs only reach the attacker
Eike Ritter Network Security - Lecture 7 14
– Internally, the victim allocates resources to keep track of the half-open connection – “Transmission Control Block” (TCB) – In practice, some memory
– When limit is reached, it will not accept any other connection
Eike Ritter 15 Network Security - Lecture 7
– To block spoofed packets
– Time waited between receiving a SYN and recycling the resources allocated to this connection
– SYN cookie
Eike Ritter 16 Network Security - Lecture 7
– t: timestamp – m: MSS – s: result of crypto function on server address and port, client address and port, t
– Recover the ISN (ACK – 1) – Check t against current timestamp and check that it is close enough – Recompute s and check that it is valid – Decode m
Eike Ritter 17 Network Security - Lecture 7