From: Patrick McHardy <kaber@trash.net>
To: philipc@snapgear.com
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH 4/4] drop ftp bounce attacks
Date: Wed, 24 May 2006 18:31:09 +0200 [thread overview]
Message-ID: <44748A4D.1070905@trash.net> (raw)
In-Reply-To: <20060524040951.217594000@snapgear.com>
philipc@snapgear.com wrote:
> FTP bounce attacks work by specifying a different IP address in
> the PORT command for active mode. This causes the FTP server to
> open a connection to another machine.
>
> The best solution for this problem is to fix the FTP server.
> This is a well known problem, and all major FTP servers should
> have been fixed.
>
> An alternative solution is to drop the packet in connection tracking.
> Dropping packets isn't the intended use of connection tracking,
> but creating a new match to do this seems inefficient.
The best solution would be to mark the packet INVALID and let the
user decide using the state match. But that isn't possible in the
current infrastructure anymore because helpers get called last.
Just dropping is also not really nice, rejecting would be better
IMO. But again that is a policy decision that shouldn't be hard-coded,
I actually don't want any helper to drop packets on my firewall.
I think we really want a more generic solution.
> Signed-off-by: Philip Craig <philipc@snapgear.com>
>
> Index: linux-2.6.17-rc4.orig/net/ipv4/netfilter/ip_conntrack_ftp.c
> ===================================================================
> --- linux-2.6.17-rc4.orig.orig/net/ipv4/netfilter/ip_conntrack_ftp.c 2006-05-24 11:57:28.000000000 +1000
> +++ linux-2.6.17-rc4.orig/net/ipv4/netfilter/ip_conntrack_ftp.c 2006-05-24 13:09:44.000000000 +1000
> @@ -405,8 +405,14 @@ static int help(struct sk_buff **pskb,
> problem (DMZ machines opening holes to internal
> networks, or the packet filter itself). */
> if (!loose) {
> - ret = NF_ACCEPT;
> - goto out_put_expect;
> + if (net_ratelimit())
> + printk("conntrack_ftp: ip mismatch: "
> + "%u,%u,%u,%u != %u.%u.%u.%u\n",
> + array[0], array[1], array[2], array[3],
> + NIPQUAD(ct->tuplehash[dir].tuple.src.ip));
> + ret = NF_DROP;
> + ip_conntrack_expect_put(exp);
> + goto out;
> }
> exp->tuple.dst.ip = htonl((array[0] << 24) | (array[1] << 16)
> | (array[2] << 8) | array[3]);
> @@ -436,7 +442,6 @@ static int help(struct sk_buff **pskb,
> ret = NF_ACCEPT;
> }
>
> -out_put_expect:
> ip_conntrack_expect_put(exp);
>
> out_update_nl:
>
> --
>
>
next prev parent reply other threads:[~2006-05-24 16:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-24 4:04 [PATCH 0/4] netfilter patches for consideration philipc
2006-05-24 4:04 ` [PATCH 1/4] TCPMSS: dont drop packets philipc
2006-05-24 16:16 ` Patrick McHardy
2006-05-24 23:42 ` Philip Craig
2006-05-26 14:40 ` Patrick McHardy
2006-05-24 4:04 ` [PATCH 2/4] TCPMSS: clamp to input interface MTU too philipc
2006-05-24 16:18 ` Patrick McHardy
2006-05-24 4:04 ` [PATCH 3/4] log dropped ICMP redirects philipc
2006-05-24 16:26 ` Patrick McHardy
2006-05-25 2:34 ` Philip Craig
2006-05-26 14:49 ` Patrick McHardy
2006-05-24 4:04 ` [PATCH 4/4] drop ftp bounce attacks philipc
2006-05-24 16:31 ` Patrick McHardy [this message]
2006-05-25 2:55 ` Philip Craig
2006-05-26 14:51 ` Patrick McHardy
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=44748A4D.1070905@trash.net \
--to=kaber@trash.net \
--cc=netfilter-devel@lists.netfilter.org \
--cc=philipc@snapgear.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.