Re: Why open? How do I close?

From: Jean-Pierre Menicucci (jean-pierre.menicucci_at_studioware.com)
Date: 09/18/03


Date: Thu, 18 Sep 2003 08:32:34 +0200

Your policy is to accept everything by default

> :INPUT ACCEPT [0:0]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]

You'd better have this in your script :

# drop by default
$IPTABLES -P INPUT DROP
$IPTABLES -P FORWARD DROP
$IPTABLES -P OUTPUT DROP

For more information see this link -> http://www.netfilter.org/

Regards,

Jean-Pierre Menicucci,

"Patrick Cairpre" <cairpre409@yahoo.com> a écrit dans le message de
news:aba9f5d4.0309171849.5fc3752d@posting.google.com...
> I am running redhat 9 using their standard firewall. I thought that
> only the ports I explicitly opened would be open. In addition to the
> ones that I did open an online security scan has found the following
> ports open.
>
> TCP
> 111
> 113
> 139
> 143
> 443
> 688
> 696
> 709
> 879
> 901
> 935
>
> I don't understand why these ports are open? How do I lock them down?
>
> I expicitly left port 153 open to udp so that my dns would update my
> secondary.
> But the scan shows no ports open for udp.
>
> ****************
> This is my iptables file:
>
> # Firewall configuration written by lokkit
> # Manual customization of this file is not recommended.
> # Note: ifup-post will punch the current nameservers through the
> # firewall; such entries will *not* be listed here.
> *filter
> :INPUT ACCEPT [0:0]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]
> :RH-Lokkit-0-50-INPUT - [0:0]
> -A INPUT -j RH-Lokkit-0-50-INPUT
> -A FORWARD -j RH-Lokkit-0-50-INPUT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 53 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 53 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 80 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 21 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 22 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 25 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 23 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 119 --syn -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -i lo -j ACCEPT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 0:1023 --syn -j REJECT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 2049 --syn -j REJECT
> -A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 0:1023 -j REJECT
> -A RH-Lokkit-0-50-INPUT -p udp -m udp --dport 2049 -j REJECT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 6000:6009 --syn -j
> REJECT
> -A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 7100 --syn -j REJECT
> COMMIT
> ************
>
> I know this is a fairly primative firewall that has other problems,
> but why is it not doing what it is supposed to?
> I think there are some basics I am misunderstanding.
> Can someone point me in the right direction?
>
> Thanks



Relevant Pages

  • IPTABLES Question
    ... I have what I think is a Noob IPTABLES question. ... This appears to work for the game ports only AFTER I reboot the firewall. ... Again, doing this on the fly is crucial to the way I run, a firewall reboot ...
    (linux.redhat)
  • Re: Gui for configuring NTP
    ... >>> behind a firewall that does not have these ports opened. ... As I became more proficient with iptables and trimmed cruft (and used ... The medium hard part is opening a specific second hole to a single address "out there" using the trusted machine acccess to get in so I can perform the tweak. ...
    (Fedora)
  • Re: is it rational to close the 139 port
    ... You use iptables to reject all connections. ... the services on ports 22 and 80 become unavailable, ... You now poke two holes in the firewall to reverse what you did in 2. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: how nmap can know my firewalled servers ?
    ... block localhost with iptables ... Dropping traffic at a firewall violates RFC and makes it ... True, I am using DROP state on my iptables, but even when I changed ... GMT+2 Interesting ports on localhost: ...
    (Security-Basics)
  • Re: Question about iptables in edgy
    ... does the iptables file configure the chains ... I don't really need a firewall, and lokkit is not the ...
    (Ubuntu)