All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Leblond <eric@inl.fr>
To: Luis Floreani <lucholaf@gmail.com>
Cc: netfilter-devel@lists.netfilter.org,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	"J. Federico Hernandez" <fede.hernandez@gmail.com>
Subject: Re: new match extension to implement port knocking in one
Date: Wed, 25 Oct 2006 08:31:10 +0200	[thread overview]
Message-ID: <1161757870.11648.9.camel@localhost> (raw)
In-Reply-To: <cd08d610610241621o12c67455rf0c3a7778f6b6f7f@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

Hi,

Le mardi 24 octobre 2006 à 20:21 -0300, Luis Floreani a écrit :
> On 10/23/06, Eric Leblond <eric@inl.fr> wrote:
> >
> > Let's say port knocking is 4138 2345 4577 to open port 22
> >
> > Then just do
> > iptables -A INPUT -p tcp -m multiport --dports 4138,2345,4577,22 -j QUEUE
> >
> > Your userspace application wait for packets coming from queue, drop them
> > when they come from knocking ports (but store the knock) and accept
> > packet to port 22 if we just had a correct knocking sequence before.
> >
> > This is simple, do not use complex algorithms and should fit on all
> > small routers.
> >
> 
> The idea of having an userspace application receiving the queued
> packets from netfilter is much better than scanning firewall logs.
> 
> Actually, I see this issues in the userspace solution:
> 
> 1. (+) Could be safer to run the portknocking logic in userspace,
> rather than kernel.
> 2. It is not clear from a admin point of view that a portknocking
> system is running.
> 3. The port 22 traffic is suffering a small penalty because of
> travelling kenel->userspace->kernel before arriving to the service.

By just queuing the SYN Packets you will introduce a ridiculous delay on
this first packet. The rest of the connectio is handled by conntrack and
there is thus no differences.

> 4. There is not a single point of configuration, if you want to change
> the knock sequence for instance, you have to change the app and then
> the iptables rule.

All can be bundle in a single script. A cleaner way could be to use
ipset to specify the ports list and not to change the rules set.

> 5. question: Is there a way to set two or more different queues? to
> avoid receiving in the userspace, packets from other rules with the
> "-j QUEUE"

No, you have to use NFQUEUE to do so (which come with 2.6.14+). QUEUE is
limited to one queue.

BR,
-- 
Eric Leblond <eric@inl.fr>
INL

[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-10-25  6:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16 15:10 new match extension to implement port knocking in one J. Federico Hernandez
2006-10-17  1:23 ` Pablo Neira Ayuso
2006-10-17 12:19   ` J. Federico Hernandez
2006-10-17 14:05     ` Eric Leblond
2006-10-18  0:32       ` J. Federico Hernandez
2006-10-18 14:46         ` Pablo Neira Ayuso
2006-10-23 13:31           ` J. Federico Hernandez
2006-10-23 19:46             ` Eric Leblond
2006-10-24 23:21               ` Luis Floreani
2006-10-25  6:31                 ` Eric Leblond [this message]
2006-10-26  3:59                   ` J. Federico Hernandez
2006-10-25 15:41                 ` Luis Floreani
2006-10-17 15:12 ` Michael Rash
2006-10-18  1:01   ` J. Federico Hernandez
  -- strict thread matches above, loose matches on Subject: below --
2006-10-13 13:35 J. Federico Hernandez
2006-10-14 17:19 ` Michael Rash
2006-10-11 20:33 Luis Floreani
2006-10-12 20:41 ` Alexey Toptygin
2006-10-12 21:30   ` Alexey Toptygin
2006-10-13  2:50   ` Michael Rash
2006-10-13  2:50   ` Luis Floreani

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=1161757870.11648.9.camel@localhost \
    --to=eric@inl.fr \
    --cc=fede.hernandez@gmail.com \
    --cc=lucholaf@gmail.com \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pablo@netfilter.org \
    /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.