Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Martín <martin@familia-fiumara.com.ar>
To: tsh@mrc-lmb.cam.ac.uk
Cc: "netfilter@lists.netfilter.org" <netfilter@lists.netfilter.org>
Subject: Re: Port Scanner
Date: Wed, 05 Nov 2003 12:25:58 -0300	[thread overview]
Message-ID: <oprx57tkiopvmot6@192.168.2.1> (raw)
In-Reply-To: <200311051507.hA5F74O37678@alf1.lmb.internal>

The bestway to stop portscanning is useing something like PORTSENTRY. I 
dont think useing iptables for this is a good idea, you may DROP legal 
traffic this way, PORTSENTRY is more inteligent and is specially developed 
for this task (and works together eith iptables by the way)



En Wed, 5 Nov 2003 15:06:55 +0000 (GMT), <tsh@mrc-lmb.cam.ac.uk> escribió:

> I was thinking about just this the other night, and is seems
> to me that such a rule should be rejecting stuff which exceeds the rate
> limit rather than accepting stuff which doesnt exceed it,
> since the -j ACCEPT will mean that any subsequent rules in
> a FORWARD table wont be tested.
>
> Something like
>
> iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit ! 
> limit 1/s -j DROP
>
> Cheers,
> Terry
>
>
>
>
>
>>> On Wednesday 05 November 2003 2:14 pm, Leandro Takashi Hirano wrote:
>>>
>>>> How does this rule work?
>>>>
>>>> iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit
>>>> ?limit 1/s -j ACCEPT
>>>
>>> It means that any packets which have the RST flag set, and the SYN, 
>>> ACK,
>>> FIN  flags cleared, will only be allowed *through* the firewall at a
>>> maximum rate  of one packet per second.
>>>
>>>> Is it safe to use only this rule to avoid port scanners?
>>>
>>> Depends what you mean by "safe" and "avoid" :)
>>>
>>> Here are some observations on the above rule:
>>>
>>> 1. It is in the FORWARD chain, therefore it has no effect on people 
>>> port
>>> scanning the firewall itself (it would need to be in the INPUT chain to
>>> affect that).
>>>
>>> 2. One packet per second will be ACCEPTed.   What happens to the other
>>> packets (and whether anything gets returned to the scanner) depends on
>>> the  other rules following this one in the chain.
>>
>>
>> OK, one packet per second will be ACCEPTed, but aren_t the other packets
>> going to be DROPed?
>>
>>
>>
>>>
>>> 3. The rule only applies to packets with RST set, and SYN, ACK, FIN
>>> clear.    Therefore it will incfluence the outcome of a RST port scan,
>>> but have no  effect on a FIN scan, or a SYN scan.
>>>
>>
>> Do I have also to create a rule for FIN scan and SYN scan?
>> Do you have some port scanners rules to show me? (and other protection
>> rules too)
>>
>> And thanks very much for the help!!!
>>
>>> I think in order to answer your question we first need to know:
>>>
>>> - what response do you want someone to get when they attempt to port
>>> scan
>>> your system?
>>>
>>
>> no answer....
>>
>>> Regards,
>>>
>>> Antony.
>>>
>>>
>>> --
>>>
>>> "It is not the strongest of the species that survive, nor the most
>>> intelligent, but the ones most responsive to change."
>>>
>>> - Charles Darwin
>>> Please reply to the
>>> list;
>>> please don't
>>> CC me.
>>
>
>
>
>
> ----- End of forwarded message from Leandro Takashi Hirano -----
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


  parent reply	other threads:[~2003-11-05 15:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-05 15:06 Port Scanner tsh
2003-11-05 15:22 ` Antony Stone
2003-11-05 15:25 ` Martín [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-11-05 16:38 tsh
2003-11-05 17:07 ` Antony Stone
2003-11-05 19:19   ` SBlaze
2003-11-05 14:14 Leandro Takashi Hirano
2003-11-05 14:19 ` Antony Stone
2003-11-05 14:44   ` Leandro Takashi Hirano
2003-11-05 15:15     ` Antony Stone
2003-11-05 14:37 ` Cedric Blancher
2003-11-05 15:15   ` hare ram
2003-11-05 15:28     ` Antony Stone

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=oprx57tkiopvmot6@192.168.2.1 \
    --to=martin@familia-fiumara.com.ar \
    --cc=netfilter@lists.netfilter.org \
    --cc=tsh@mrc-lmb.cam.ac.uk \
    /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