From: Eric Dumazet <eric.dumazet@gmail.com>
To: Denys Fedoryshchenko <denys@visp.net.lb>
Cc: netdev@vger.kernel.org
Subject: Re: SYN attack, with FIN flag set
Date: Sat, 03 Dec 2011 09:53:21 +0100 [thread overview]
Message-ID: <1322902401.2762.85.camel@edumazet-laptop> (raw)
In-Reply-To: <b3ae04aef6b0ce233e8e8978782d1ccc@visp.net.lb>
Le samedi 03 décembre 2011 à 10:18 +0200, Denys Fedoryshchenko a écrit :
> On Sat, 03 Dec 2011 08:55:02 +0100, Eric Dumazet wrote:
> > Le samedi 03 décembre 2011 à 08:27 +0100, Eric Dumazet a écrit :
> >
> >> I believe netfilter tcp conntrack considers SYN|FIN as INVALID
> >>
> >
> > Or if you cannot afford conntracking, just do
> >
> > iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
>
> Sure i did,thanks, but i just was curious, why connection with such
> flags are threated as SYN.
>
TCP stack first tries to lookup a socket, given the tuple found in
incoming packet.
This is where your machine is hit : we find the listener socket and lock
it.
Then, once socket was found and locked, state machine handle various
possible states.
In your case, you want to bypass the lookup, and eventually bypass the
IP route lookup as well (to keep IP route cache small)
iptables -t raw -I PREROUTING -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
next prev parent reply other threads:[~2011-12-03 8:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-02 22:29 SYN attack, with FIN flag set Denys Fedoryshchenko
2011-12-03 7:27 ` Eric Dumazet
2011-12-03 7:55 ` Eric Dumazet
2011-12-03 8:18 ` Denys Fedoryshchenko
2011-12-03 8:53 ` Eric Dumazet [this message]
2011-12-03 9:03 ` Michael Tokarev
2011-12-03 9:07 ` Denys Fedoryshchenko
2011-12-03 9:41 ` Eric Dumazet
2011-12-03 10:02 ` Eric Dumazet
2011-12-03 18:40 ` Denys Fedoryshchenko
2011-12-04 6:26 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1322902401.2762.85.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=denys@visp.net.lb \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox