Skip to contentSkip to conversation

TCP sequence checking

DISCUSSION Lukas Hubschmid (s) 2 participants 4 messages Jun 3, 2015

lore
Share & tools
lore
#0 lore raw

Hello everybody,

Does iptables support TCP sequence checking, to check if a TCP packet has a valid sequence number (according to previous packets of the same TCP connection)?

Many thanks in advance!

KR,
Lukas

#1 lore raw
Quoted 3 lines · Lukas Hubschmid (s)

Does iptables support TCP sequence checking, to check if a TCP packet has a valid sequence number (according to previous packets of the same TCP connection)?

Yes, have a look at net/netfilter/nf_conntrack_proto_tcp.c in the kernel source tree.

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences

          H-1525 Budapest 114, POB. 49, Hungary
#2 lore raw

Thank you Jozsef!
I am not quite sure if I read the C-code correctly - so TCP sequence checking seems to be enabled by default, right? Or do I need to set some flag when adding a rule?

KR,
Lukas

Am 03.06.2015 um 19:16 schrieb Jozsef Kadlecsik:

Quoted 15 lines · Lukas Hubschmid (s)
Quoted 4 lines

Does iptables support TCP sequence checking, to check if a TCP packet has a valid sequence number (according to previous packets of the same TCP connection)?

Yes, have a look at net/netfilter/nf_conntrack_proto_tcp.c in the kernel source tree.

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences

           H-1525 Budapest 114, POB. 49, Hungary
#3 lore raw
Quoted 3 lines · Lukas Hubschmid (s)

I am not quite sure if I read the C-code correctly - so TCP sequence checking seems to be enabled by default, right? Or do I need to set some flag when adding a rule?

No, it's default enabled. You can (partiall) switch it off globally via a sysctl setting, not with some flag in a rule.

Best regards,
Jozsef
-
E-mail : [email protected], [email protected] PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences

          H-1525 Budapest 114, POB. 49, Hungary