Linux SYN cookies - Avoiding flooding when we act as a firewall!

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

I've found a very interesting kernel patch, it's amazing... as always it's a problem because it isn't part of the standard kernel.

The linux kernel is protected against flood attacks, therefore it's capable of protecting itself against the typical abuse of IPSpoof on semi-open ports (Servers waiting for the ACK).

The problem is that linux, when it acts as a firewall and dedicates itself to passing packets through, doesn't allow TCP SYN cookies, which is the way the attacks described above are avoided. So no matter how many random numbers are placed in the sequence number (cookies) to confirm the authenticity of the SYN request, linux won't let them through encapsulated inside it, since they'll be lost in the frame when linux does the forwarding of the packet.

So this patch only does one thing: it adds the cookie to the SYN-ACK frame that the server answering a SYN request sends back. So that when the server receives the ACK, it will certainly be from the client that sent the SYN and nobody will be able to tamper with the semi-open connection thanks to an IPSpoof. Therefore, it solves the flooding problem in a very simple and logical way.

The address of the patch is:

http://www.bronzesoft.org/

There are very interesting documents in the Documentation section too.

3 comments

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

  1. pau

    joer, ho acabo de veure a freshmeat i entraba per a anyadir-ho al portal...
    pero t'has adelantat mamonah ;)

  2. Oriol Rius

    http://www.bronzesoft.org/docs/security/security.html

    Documents del projecte molt currats...

  3. Oriol Rius

    A aquesta URL: ftp://koobera.math.uic.edu/syncookies.html hi ha una bona
    descripció del tema de les TCP cookies i no és massa llarga.
    Obviament esta en anglès però és molt útil.