Re: Iptables udp problems
From: C-Pro (c-pro-29a*removeit*@mail.ru)Date: 03/12/02
- Next message: Earl F. Parrish: "Re: KPF 2.1 Final is now released."
- Previous message: C-Pro: "Re: Iptables udp problems"
- In reply to: chris: "Re: Iptables udp problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: C-Pro <c-pro-29a*removeit*@mail.ru> Date: Wed, 13 Mar 2002 00:29:00 +1000
chris wrote:
> In article <3C89D6AE.8010803@mail.ru>, C-Pro wrote:
>
>>I am running iptables on my RH 7.1 (kernel 2.5.0) and when scanning from
>> another computer on my local network, scanner shows all udp ports
>>open. Why?
>>
> Because you seem to be wide open.
Scanner shows open ports only on established connections (i describe a
simple case), and firewall set to "ACCEPT" don't establish connections,
it simply *passes them through*. So if there is no application listening
on this port, scanner will say "closed" anyway.
>
>>my iptables script:
>>
>>#!/bin/bash
>>/sbin/iptables -F
>>/sbin/iptables -P INPUT ACCEPT
>>
>
> Are you sure about this? usually one would put up a deny policy by
> default.
I have closed all ports containing services, listening some ports anyway
(except netbios), so that doesn't matter.
>>/sbin/iptables -P OUTPUT ACCEPT
>>/sbin/iptables -P FORWARD DROP
>>/sbin/iptables -A INPUT -i lo -p ALL -j ACCEPT
>>/sbin/iptables -A INPUT -p tcp --tcp-flags SYN,ACK,RST,FIN RST -m limit
>>--limit 3/second -j ACCEPT
>>/sbin/iptables -A INPUT -p tcp --tcp-flags SYN,ACK,RST,FIN RST -j DROP
>>/sbin/iptables -A INPUT -p tcp --syn -m limit --limit 3/second --dport
>>137:139 -j ACCEPT
>>/sbin/iptables -A INPUT -p tcp --syn -j REJECT --reject-with tcp-reset
>
> I am no expert on iptables, but the rules are read top down. With your
> first INPUT -p tcp you accept all incoming traffic.
With my first INPUT -p tcp i allow *only* 3 rst packets per second.
With my second INPUT -p tcp i deny remaining rst packets.
With my third INPUT -p tcp i allow establishing max 3 tcp connections
per second. And so on...
> Beside that,
> you have no rules concerning udp traffic at all. With the default ACCEPT
> policy of course your ports show open. You do not mention open tcp ports,
> yet I suspect they are wide open as well.
See the top.
> I would definitely change the first INPUT -p tcp rule to LOG
> (I think you meant this with your use of the limit matching) and the INPUT
> policy to DROP.
> Of course this would mean you have to add something for your LAN traffic.
Thanck you anyway.
C-Pro
- Next message: Earl F. Parrish: "Re: KPF 2.1 Final is now released."
- Previous message: C-Pro: "Re: Iptables udp problems"
- In reply to: chris: "Re: Iptables udp problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|