Linux Netfilter discussions
 help / color / mirror / Atom feed
* RE: new tcp connections, without SYN
@ 2003-04-09 16:04 dhiraj.2.bhuyan
  2003-04-10  8:48 ` Cedric Blancher
  0 siblings, 1 reply; 12+ messages in thread
From: dhiraj.2.bhuyan @ 2003-04-09 16:04 UTC (permalink / raw)
  To: mklingens, netfilter

I tried sending an "ACK" packet from behind my Netfilter firewall to a
machine on the public side that actually doesn't exist.

A look in the /proc/net/ip_conntrack tells me that Netfilter tracked this
connection as "ESTABLISHED" but "UNREPLIED". So Netfilter does infact allow
starting a TCP connection with an ACK packet.

dhiraj


-----Original Message-----
From: Martijn Klingens [mailto:mklingens@ism.nl]
Sent: 09 April 2003 14:59
To: netfilter@lists.netfilter.org
Subject: Re: new tcp connections, without SYN


On Wednesday 09 April 2003 15:06, Cedric Blancher wrote:
> Timers for Netfilter's conntrack should be the same as TCP stacks. So,
> if conntrack times out, then destination TCP stack should time out too.
> that means if a ACK gets so delayed that related conntrack entry gets
> dropped, than it would be also dropped by destination TCP stack.

Aaah... that might explain my problem with 'new, not syn'.

Problem is that our firewall is a non-masquerading router for a class C
subnet 
and that we don't have the ability to set the timeouts on all machines
behind 
it.

Isn't there a workaround to avoid this problem on the netfilter machine?

-- 
Martijn




^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: new tcp connections, without SYN
@ 2003-04-09 13:00 dhiraj.2.bhuyan
  2003-04-09 13:06 ` Cedric Blancher
  2003-04-09 14:00 ` Martin Josefsson
  0 siblings, 2 replies; 12+ messages in thread
From: dhiraj.2.bhuyan @ 2003-04-09 13:00 UTC (permalink / raw)
  To: netfilter, carlosble, blancher

As far as I understand, an "ACK" packet can also start a "NEW" connection.
If the connection remains idle for long, the Netfilter's connection tracking
engine times out that connection and removes it's entry from the state
table. Now when an "ACK" packet comes back after sometime, the connection
tracking engine marks this as a "NEW" connection. However am not sure how
the state changes to "ESTABLISHED".

dhiraj

-----Original Message-----
From: Cedric Blancher [mailto:blancher@cartel-securite.fr]
Sent: 09 April 2003 11:33
To: carlosble@terra.es
Cc: netfilter@lists.netfilter.org
Subject: Re: new tcp connections, without SYN


Le mer 09/04/2003 à 13:16, Carlos Ble a écrit :
> Hi all. Two days ago, i added the policy that drops all new tcp
connections
> that starts without SYN to prevent port scaners and other attacks:
> iptables -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j LOG \
> --log-prefix "NEW tcp try no SYN:"
> iptables -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP

You can add RELATED state to this :

	iptables -A bad_tcp_packets -p tcp ! --syn -m state \
		--state NEW,RELATED -j DROP

> Another question: I had disabled the icmp answers :
> echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
> echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
> to try to be "invisible" for some wicked programs .
> will i have problems with some other programas that makes ping 
> before establish a connection? 

If a program waits for a ping reply before attempting connection, sure
you'll have problems. You can mitigeate this issue dealing echo requests
with your ruleset, and so having some addresses that still can ping.

-- 
Cédric Blancher  <blancher@cartel-securite.fr>
IT systems and networks security - Cartel Sécurité
Phone : +33 (0)1 44 06 97 87 - Fax: +33 (0)1 44 06 97 99
PGP KeyID:157E98EE  FingerPrint:FA62226DA9E72FA8AECAA240008B480E157E98EE



^ permalink raw reply	[flat|nested] 12+ messages in thread
* new tcp connections, without SYN
@ 2003-04-09 11:16 Carlos Ble
  2003-04-09 11:33 ` Cedric Blancher
  0 siblings, 1 reply; 12+ messages in thread
From: Carlos Ble @ 2003-04-09 11:16 UTC (permalink / raw)
  To: netfilter

Hi all. Two days ago, i added the policy that drops all new tcp connections
that starts without SYN to prevent port scaners and other attacks:

iptables -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j LOG \
--log-prefix "NEW tcp try no SYN:"
iptables -A bad_tcp_packets -p tcp ! --syn -m state --state NEW -j DROP

Now the system is registering this event every minute from diferents ip. 
Is this usual?. What kind of programs tries to start a new tcp connection 
without a SYN ?. 
Im no so worried because scaning the ports of my server from another computer 
in the internet, using nmap , the answer is that all ports al filtered. 

Another question: I had disabled the icmp answers :
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
to try to be "invisible" for some wicked programs .
will i have problems with some other programas that makes ping 
before establish a connection? 

Thanks in advance


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-04-11  8:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-09 16:04 new tcp connections, without SYN dhiraj.2.bhuyan
2003-04-10  8:48 ` Cedric Blancher
2003-04-10 17:53   ` Rahul Jadhav
2003-04-11  8:37     ` Cedric Blancher
  -- strict thread matches above, loose matches on Subject: below --
2003-04-09 13:00 dhiraj.2.bhuyan
2003-04-09 13:06 ` Cedric Blancher
2003-04-09 14:58   ` Martijn Klingens
2003-04-09 14:00 ` Martin Josefsson
2003-04-09 11:16 Carlos Ble
2003-04-09 11:33 ` Cedric Blancher
2003-04-09 12:31   ` Martijn Klingens
2003-04-09 14:36     ` Cedric Blancher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox