Re: Can IPTABLES stop port scans by NMAP?

From: jayjwa (jayjwa_at_atr2.ath.cx)
Date: 03/17/05

  • Next message: Thomas: "Re: /etc/pam.d/remote"
    Date: Thu, 17 Mar 2005 10:36:29 -0000
    
    

    On 2005-03-15, sylo@perknet.net <sylo@perknet.net> wrote:
    > Can you configure IPTABLES on Fedora to stop port scans that are
    > performed with nmap?

    Yes.

    > If the answer is yes how to you do this?

    By looking for certain flags which nmap typically sets in the packets and then
    dropping those when the patterns match. Something like:

    iptables -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -m limit --limit 3/min
    --limit-burst 5 -j LOG --log-level 7 --log-prefix "Xmas Scan: "
    iptables -A INPUT -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP

    Record some nmap traffic coming at you and look at the patters it makes.

    > Also can you return bogus data to an nmap scan? If the answer is yes
    > how do you do this?

    I've only seen them dropped, and even then this may not be such a good idea
    because the method isn't 100% fail-proof. That is, maybe sometimes you'll drop
    "good" packets that appear to be scan probes. But, since iptables gives you
    very fine controll over what you take in and what you do with it, I'd think
    that maybe there's a way. You'll probably want to check into the Netfilter
    Patch'O Matic (http://www.netfilter.org/). It patches your kernel to include
    some extra abilities. I use it currently and it works well, just don't try to
    enable all of the extras ;) Just pick a couple you'll really use and go with
    that. Then recompile your kernel, install the mods, modprobe the mods and
    you're ready to go. I build all of mine as kmods to keep the kernel size down.
    This way I don't have to load extensions I'm not using at the time.

    -- 
    RedHat Linux: How linux would have looked if
    Micro$oft had written it.
    HP/UX & AIX: What keeps linux users still using
    30yr old "compatibility" defaults in our builds
    

  • Next message: Thomas: "Re: /etc/pam.d/remote"

    Relevant Pages

    • Help with Linux Basics
      ... I'm a Linux newbie who has set up a RH9 workstation. ... need to know how to make my configuration changes to iptables permanent. ... make the changes there and recompile the Kernel. ... would need to uninstall iptables and reinstall, ...
      (alt.os.linux.redhat)
    • Re: Using another computer networked as a Firewall
      ... > In Linux, iptables is in the kernel. ... > (although I've never yet come across an example of iptables failing). ... like to use Windows, so; Ok, let's go for windows, and the ...
      (comp.security.firewalls)
    • Re: Per application TCP/IP traffic filtering in Linux (sort of personal firewall)
      ... > I have the latest Mandrake 8.2 which comes with iptables 1.2.5 ... > Thanks for the help Ian. ... This is why we love linux! ... own kernel and have at it right now. ...
      (comp.os.linux.security)
    • Re: Small linux distro?
      ... >>I need a linux distro that is small that has these features. ... >>ip masq built in kernel for iptables ... >>compact flash modules built in kernel if possible. ...
      (alt.os.linux)
    • Re: Small linux distro?
      ... >>I need a linux distro that is small that has these features. ... >>ip masq built in kernel for iptables ... >>compact flash modules built in kernel if possible. ...
      (alt.linux)

    Loading