* Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering?
@ 2010-02-24 8:18 paddy joesoap
2010-02-24 11:12 ` Mart Frauenlob
0 siblings, 1 reply; 5+ messages in thread
From: paddy joesoap @ 2010-02-24 8:18 UTC (permalink / raw)
To: netfilter
Hello everyone,
When preventing (nmap) port scans is it better to use the
connection-tracking INVALID option or use a set of TCP flag filters or
both?
Note, by my calculations there are 21 possible combinations of TCP
flags, this includes legal and illegal flag combinations.
ASIDE:
Can stateful filtering using NEW and ESTABLISHED on their own also
work, given that connection-tracking is supposed to be tracking
connections?
For example, allow outbound NEW and ESTABLISHED traffic and allow
inbound traffic recognised as ESTABLISHED.
Would these stateful operations prevent nmap scanning?
I saw a few examples where the stateless tcp syn flag match was used
(by checking that no other flag was set) in conjunction with the NEW
operator.
For example, iptables -A INPUT -p tcp ! --syn -m state --state NEW -j
DROP # using the not (!) operator
Why is this the case? I would have imagined that the NEW operator,
would require by default that only a syn flag be present. Unless the
NEW operator does not check by default that no other flag is enabled
in conjunction with the syn flag. Would this be the case?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering?
2010-02-24 8:18 Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering? paddy joesoap
@ 2010-02-24 11:12 ` Mart Frauenlob
2010-02-24 11:20 ` Mart Frauenlob
2010-02-25 3:32 ` J. Bakshi
0 siblings, 2 replies; 5+ messages in thread
From: Mart Frauenlob @ 2010-02-24 11:12 UTC (permalink / raw)
To: netfilter
On 24.02.2010 09:18, netfilter-owner@vger.kernel.org wrote:
> Hello everyone,
>
> When preventing (nmap) port scans is it better to use the
> connection-tracking INVALID option or use a set of TCP flag filters or
> both?
>
> Note, by my calculations there are 21 possible combinations of TCP
> flags, this includes legal and illegal flag combinations.
>
> ASIDE:
> Can stateful filtering using NEW and ESTABLISHED on their own also
> work, given that connection-tracking is supposed to be tracking
> connections?
> For example, allow outbound NEW and ESTABLISHED traffic and allow
> inbound traffic recognised as ESTABLISHED.
> Would these stateful operations prevent nmap scanning?
Why are you so much afraid of nmap scans???
You cannot prevent them, you can just drop them.
It's not the first time you come here to ask the same thing.
Did you ever TRY IT OUT?
iptables -I INPUT -m state --state INVALID -j LOG
iptables -I INPUT -m state --state INVALID -j DROP
then start your nmap scans... you will see what it catches....
http://jengelh.medozas.de/projects/chaostables/ <- read this!
http://xtables-addons.sf.net/ <- includes portscan detection module.
>
> I saw a few examples where the stateless tcp syn flag match was used
> (by checking that no other flag was set) in conjunction with the NEW
> operator.
> For example, iptables -A INPUT -p tcp ! --syn -m state --state NEW -j
> DROP # using the not (!) operator
Any new tcp connection attempt that does NOT have the SYN bit set -j DROP.
>
> Why is this the case? I would have imagined that the NEW operator,
> would require by default that only a syn flag be present. Unless the
> NEW operator does not check by default that no other flag is enabled
> in conjunction with the syn flag. Would this be the case?
State NEW is any packet not already known to be
ESTABLISHED,RELATED,INVALID,(UNTRACKED).
regards
Mart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering?
2010-02-24 11:12 ` Mart Frauenlob
@ 2010-02-24 11:20 ` Mart Frauenlob
2010-02-26 6:52 ` ratheesh k
2010-02-25 3:32 ` J. Bakshi
1 sibling, 1 reply; 5+ messages in thread
From: Mart Frauenlob @ 2010-02-24 11:20 UTC (permalink / raw)
To: netfilter
On 24.02.2010 12:14, netfilter-owner@vger.kernel.org wrote:
> On 24.02.2010 09:18, netfilter-owner@vger.kernel.org wrote:
>> Hello everyone,
>>
>
> iptables -I INPUT -m state --state INVALID -j LOG
> iptables -I INPUT -m state --state INVALID -j DROP
just the other way round...
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering?
2010-02-24 11:20 ` Mart Frauenlob
@ 2010-02-26 6:52 ` ratheesh k
0 siblings, 0 replies; 5+ messages in thread
From: ratheesh k @ 2010-02-26 6:52 UTC (permalink / raw)
To: netfilter
awesome document .
On Wed, Feb 24, 2010 at 4:50 PM, Mart Frauenlob
<mart.frauenlob@chello.at> wrote:
> On 24.02.2010 12:14, netfilter-owner@vger.kernel.org wrote:
>> On 24.02.2010 09:18, netfilter-owner@vger.kernel.org wrote:
>>> Hello everyone,
>>>
>
>>
>> iptables -I INPUT -m state --state INVALID -j LOG
>> iptables -I INPUT -m state --state INVALID -j DROP
> just the other way round...
>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering?
2010-02-24 11:12 ` Mart Frauenlob
2010-02-24 11:20 ` Mart Frauenlob
@ 2010-02-25 3:32 ` J. Bakshi
1 sibling, 0 replies; 5+ messages in thread
From: J. Bakshi @ 2010-02-25 3:32 UTC (permalink / raw)
To: netfilter
On 02/24/2010 04:42 PM, Mart Frauenlob wrote:
> iptables -I INPUT -m state --state INVALID -j LOG
> iptables -I INPUT -m state --state INVALID -j DROP
>
> then start your nmap scans... you will see what it catches....
>
> http://jengelh.medozas.de/projects/chaostables/ <- read this!
> http://xtables-addons.sf.net/ <- includes portscan detection module.
>
>
Mart, thanks a lot for the links. I was also looking for such a solution
but didn't know much about xtable and add-on.
wish you a nice day.
--
জয়দীপ বক্সী
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-02-26 6:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24 8:18 Port Scanning: Is there a difference between stateful INVALID filtering and stateless TCP flag filtering? paddy joesoap
2010-02-24 11:12 ` Mart Frauenlob
2010-02-24 11:20 ` Mart Frauenlob
2010-02-26 6:52 ` ratheesh k
2010-02-25 3:32 ` J. Bakshi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.