JustAnswer.com

Saturday, January 19, 2008

Tcp Tutorial-18

HACKING TRUTH: Well there is definitely a cooler way of establishing a trust relationship with a remote host, using Telnet. The default port numbers at which the R services run are 512, 513,514 **************

So how do I spoof my IP? Well in short, to spoof your IP, you need to be able to predict sequence numbers, this will clearer after reading then next few paragraphs.

To understand Sequence Numbers you need to go back to, how the TCP protocol works. You already know that TCP is a reliable protocol and has certain in-built features which have the ability to rearrange, re- send lost, duplicated or out of sequence data. To make sure that the destination is able to rearrange the datagrams in the correct order, TCP inserts two sequence numbers into each TCP datagram. One Sequence number tells the receiving computer where a particular datagram belongs while the second sequence number says how much data has been received by the sender. Anyway, let's move on, TCP also relies on ACK and NACK messages to ensure that all datagrams have reached the destination error free. Now we need to reanalyze the TCP Header to understand certain other aspects of sequence numbers and the ACK Number.

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Port | Destination Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Acknowledgment Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

| Offset| Reserved |R|C|S|S|Y|I| Window |

| | |G|K|H|T|N|N| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | Urgent Pointer | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | The Actual Data form the next 500 octets | | |

You see the TCP Header contains a Sequence Number which actually represents the sequence number of the first byte of that particular TCP segment. A sequence number is a 32 Bit number which is attached to all bytes (data) being exchanged across a Network. The ACK Number Field in the TCP header, actually contains the value of the sequence number which it expects to be the next. Not only that, it also does what it was meant to do, acknowledge data received. Confused? Read it again till you get the hang of it.

No comments: