All of lore.kernel.org
 help / color / mirror / Atom feed
* QUEUE - ipq_set_verdict overridden?
@ 2007-01-14 21:10 TheGesus
  2007-01-14 21:49 ` Pablo Neira Ayuso
  2007-01-14 22:05 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 5+ messages in thread
From: TheGesus @ 2007-01-14 21:10 UTC (permalink / raw)
  To: netfilter

I am writing a userland process in C to take care of a few unpatched
issues in Unreal Tournament '99 and, if possible, to additionally
create a set of rules to make a generalized anti-cheat for UT99.

This code is derived from the sample code in the October 2001 man page
for libipq (2001 was an excellent year for man pages).

I am doing my testing on a Debian Etch (Debian kernel 2.6.18-3-486) VM
with iptables 1.3.6.  All the libraries, headers & etc are from the
Debian repositories.  I'm trying to keep it as plain vanilla as
possible.

So far, it half-works.

If the (udp port 7777) packets I want to drop are within the first 20
or so of the connection, it drops the offending packet like a rock, as
advertised.  No problem there.

However, for any "ESTABLISHED" connections nothing happens.
ipq_set_verdict returns the same status (IPQM_PACKET - 0x1C) in both
cases but the packets breeze on through for "ESTABLISHED" connections.

I should note I'm doing nothing to the packets and simply returning an
NF_DROP or NF_ACCEPT.

The iptables rules are kept as simple as possible.  I have tried both

-A INPUT -p udp -m udp --dport 7777 -j QUEUE

and

-A INPUT -p udp -m udp --dport 7777 -m state --state
NEW,ESTABLISHED,RELATED -j QUEUE

with the same results.  That is, the "NEW" connections can be dropped
but it has no affect whatsoever on the "ESTABLISHED" connections.

I am aware of libnetfilter-queue but until there is some documentation
I'm sticking with libipq.


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

* Re: QUEUE - ipq_set_verdict overridden?
  2007-01-14 21:10 QUEUE - ipq_set_verdict overridden? TheGesus
@ 2007-01-14 21:49 ` Pablo Neira Ayuso
  2007-01-14 22:24   ` TheGesus
  2007-01-14 22:05 ` Pablo Neira Ayuso
  1 sibling, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2007-01-14 21:49 UTC (permalink / raw)
  To: TheGesus; +Cc: netfilter

TheGesus wrote:
> I am aware of libnetfilter-queue but until there is some documentation
> I'm sticking with libipq.

It would be a good idea moving to libnetfilter_queue since libipq is
deprecated.

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris


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

* Re: QUEUE - ipq_set_verdict overridden?
  2007-01-14 21:10 QUEUE - ipq_set_verdict overridden? TheGesus
  2007-01-14 21:49 ` Pablo Neira Ayuso
@ 2007-01-14 22:05 ` Pablo Neira Ayuso
  2007-01-14 22:44   ` TheGesus
  1 sibling, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2007-01-14 22:05 UTC (permalink / raw)
  To: TheGesus; +Cc: netfilter

TheGesus wrote:
> However, for any "ESTABLISHED" connections nothing happens.
> ipq_set_verdict returns the same status (IPQM_PACKET - 0x1C) in both
> cases but the packets breeze on through for "ESTABLISHED" connections.
> 
> I should note I'm doing nothing to the packets and simply returning an
> NF_DROP or NF_ACCEPT.
> 
> The iptables rules are kept as simple as possible.  I have tried both
> 
> -A INPUT -p udp -m udp --dport 7777 -j QUEUE

Probably there is one rule before this one above that let packets that
belong to establish connections go through.

-- 
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris


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

* Re: QUEUE - ipq_set_verdict overridden?
  2007-01-14 21:49 ` Pablo Neira Ayuso
@ 2007-01-14 22:24   ` TheGesus
  0 siblings, 0 replies; 5+ messages in thread
From: TheGesus @ 2007-01-14 22:24 UTC (permalink / raw)
  To: Pablo Neira Ayuso, netfilter

On 1/14/07, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> TheGesus wrote:
> > I am aware of libnetfilter-queue but until there is some documentation
> > I'm sticking with libipq.
>
> It would be a good idea moving to libnetfilter_queue since libipq is
> deprecated.
>
> --
> The dawn of the fourth age of Linux firewalling is coming; a time of
> great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
>

I understand that, but there is more documentation on libipq.  Plus
there is that one, lonely piece of (GPL'd) sample code.  There is
nothing on libnetfilter_queue anywhere, as far as I can tell.

I am also aware of the libipq "compatibility layer" in
libnetfilter_queue and I have tried working with it on an Ubuntu 6.06
VM but got nowhere (I switched over to the vanilla Etch VM primarily
to simplify things).  Since I'm getting more results with libipq I
have decided to "go where the docs are" regardless of what wonderful
things are coming in the fourth age.  I had a lot of pain during the
dawn of the last two ages (and I didn't even jump into the 3rd age
until about 10PM that evening).

I guess it's always darkest before the dawn.

If you have any pointers on getting the compatibility layer to work,
I'm all ears.  Or if there is some libnetfiler-queue sample code "out
there" that I missed, please let me know.

Thank you for your reply.


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

* Re: QUEUE - ipq_set_verdict overridden?
  2007-01-14 22:05 ` Pablo Neira Ayuso
@ 2007-01-14 22:44   ` TheGesus
  0 siblings, 0 replies; 5+ messages in thread
From: TheGesus @ 2007-01-14 22:44 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter

On 1/14/07, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> TheGesus wrote:
> > However, for any "ESTABLISHED" connections nothing happens.
> > ipq_set_verdict returns the same status (IPQM_PACKET - 0x1C) in both
> > cases but the packets breeze on through for "ESTABLISHED" connections.
> >
> > I should note I'm doing nothing to the packets and simply returning an
> > NF_DROP or NF_ACCEPT.
> >
> > The iptables rules are kept as simple as possible.  I have tried both
> >
> > -A INPUT -p udp -m udp --dport 7777 -j QUEUE
>
> Probably there is one rule before this one above that let packets that
> belong to establish connections go through.
>

No.  There isn't.  There is one ACCEPT rule beyond it which deals with
the other ports (udp 7778-7790), which are of no interest to the QUEUE
code.  There are only two rules.


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

end of thread, other threads:[~2007-01-14 22:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-14 21:10 QUEUE - ipq_set_verdict overridden? TheGesus
2007-01-14 21:49 ` Pablo Neira Ayuso
2007-01-14 22:24   ` TheGesus
2007-01-14 22:05 ` Pablo Neira Ayuso
2007-01-14 22:44   ` TheGesus

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.