Info in the TCP header

Translation of the original in Catalan. Read it in: CatalàCastellano

This week I took the networks 2 exam and, studying the TCP header, I remembered a document that some time ago explained how to encapsulate information inside the TCP headers.

Well then, if we think back a little or else look at any manual we'll see that TCP headers have at least 20octets organised like this:

NOTE:1Octet -> 8bits

Source port: 16bits

Destination port: 16bits

Seq.Num.:32bits

ACK Num. :32bits

Data OffSet: 4bits

FLAGS: 6bits
UnUsed: 6bits

Window: 16bits

CHK: 32bits

So if we look at it there are 6bits that we aren't using, at first they seem very little but anyone who has ever put a sniffer on a network knows that a crazy number of TCP packets are generated per second. That is, without doing too many numbers we can see that every 4 TCP segments sent I can send 3bytes of information (1byte->8bits -> 4*6=24bits/8bits=3bytes).

Now we only need someone who gets a bit bored to go to the linux source code and modify the tcp. So that every time it sends the 6 unused bits, it encapsulates 6bits of a byte that it can extract from the file it wants to send.

As an idea to take advantage of the bandwidth it's nonsense, since, nowadays things go too fast to be taking advantage of these 6bits, but if what we want is to send information without anyone even knowing that we are sending it, it's a very interesting method.

It could even be sent encrypted, this information, we'd only need the bytes that are sent encapsulated inside these 6bits of each TCP segment to belong to a file encrypted -for example- in PGP ASCII mode.

So far the delirium that I read one day and that the networks exam I took reminded me of.

Some day I'll entertain myself by explaining the subjects of passive fingerprinting, since after doing redes2 and understanding the algorithms by which the credits of the window field are assigned, it's very easy to understand how the passive finger printing mechanisms work.

1 comment

Comments from the old blog, as they were written. Comments are closed.

  1. Oriol Rius

    The TCP/IP protocol suite has a number of weaknesses that allow an attacker
    to

    leverage techniques in the form of covert channels to surreptitiously pass
    data

    in otherwise benign packets. This paper attempts to illustrate these
    weaknesses

    in both theoretical and practical examples.



    http://www.psionic.com/papers/covert