All of lore.kernel.org
 help / color / mirror / Atom feed
* Netfilter as an application.
@ 2004-01-16 16:39 kernel_learner
  0 siblings, 0 replies; 7+ messages in thread
From: kernel_learner @ 2004-01-16 16:39 UTC (permalink / raw)
  To: netfilter



Dear All,

 How's it going! I am looking for something that I am
not sure currently exists. Basically I want to make a
version of netfilter that's free from all the
kernel-level and networking stack hooks. I am looking
for a plain simpler version of netfilter which does
not interact with the kernel or the networking stack
in any way. It would be a standard user program which
a person with normal privelges could compile and run.
What would it do? It could do the same things that
netfilter does...i.e. filter packets/NAT etc. However
the input could be driven from a "main" function which
"fakes" packets arriving on the network (this could be
driven from a trace).

Does such a thing exist?

How easy/difficult would it be to hack into the
current netfilter code to remove all the
networking/kernel hooks it has?

Could someone guide me as to how exactly to go about
doing this? i.e. where the hooks are..in the code?

I was also looking for documentation on the code...I
mean is there a documentation that explains the
software architecture?

Sorry for too many questions! :|

Cheers!
KeRNEL_LeaRNER

"Metallica- The mother of all ye metal bands."






__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus


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

* Netfilter as an application
@ 2004-01-16 19:47 kernel_learner
  2004-01-16 20:06 ` Allen Francom
  2004-01-17  2:00 ` Jeremy Kerr
  0 siblings, 2 replies; 7+ messages in thread
From: kernel_learner @ 2004-01-16 19:47 UTC (permalink / raw)
  To: netfilter-devel


Dear All,

 How's it going! I am looking for something that I am
not sure currently exists. Basically I want to make a
version of netfilter that's free from all the
kernel-level and networking stack hooks. I am looking
for a plain simpler version of netfilter which does
not interact with the kernel or the networking stack
in any way. It would be a standard user program which
a person with normal privelges could compile and run.
What would it do? It could do the same things that
netfilter does...i.e. filter packets/NAT etc. However
the input could be driven from a "main" function which
"fakes" packets arriving on the network (this could be
driven from a trace).

Does such a thing exist?

How easy/difficult would it be to hack into the
current netfilter code to remove all the
networking/kernel hooks it has?

Could someone guide me as to how exactly to go about
doing this? i.e. where the hooks are..in the code?

Sorry for too many questions! :|

Cheers!
KeRNEL_LeaRNER

P.S: SORRY for first Posting to Users...didn't realise
it was the wrong place to post such a question.

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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

* Re: Netfilter as an application
  2004-01-16 19:47 Netfilter as an application kernel_learner
@ 2004-01-16 20:06 ` Allen Francom
  2004-01-16 21:47   ` kernel_learner
  2004-01-17  2:00 ` Jeremy Kerr
  1 sibling, 1 reply; 7+ messages in thread
From: Allen Francom @ 2004-01-16 20:06 UTC (permalink / raw)
  To: kernel_learner; +Cc: netfilter-devel


Um...

One way or another I think the "user" will at least
have to have "root" privileges.

Netfilter I don't think will do what you want, I think
it is totally dependent on the kernel.

You might look at Snort.  www.snort.org

-AEF

On Fri, 16 Jan 2004, kernel_learner wrote:
>  How's it going! I am looking for something that I am
> not sure currently exists. Basically I want to make a
> version of netfilter that's free from all the
> kernel-level and networking stack hooks. I am looking
> for a plain simpler version of netfilter which does
> not interact with the kernel or the networking stack
> in any way. It would be a standard user program which
> a person with normal privelges could compile and run.

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

* Re: Netfilter as an application
  2004-01-16 20:06 ` Allen Francom
@ 2004-01-16 21:47   ` kernel_learner
  2004-01-16 22:40     ` Henrik Nordstrom
  2004-01-17  5:35     ` Allen Francom
  0 siblings, 2 replies; 7+ messages in thread
From: kernel_learner @ 2004-01-16 21:47 UTC (permalink / raw)
  To: Allen Francom; +Cc: netfilter-devel

Thanks Allen,

 However I am not sure why you think user should have
user priveleges. I am not saying I will use netfilter
as it is. I am thinking of modifying netfilter so that
I can use it as a user application just for
demonstration purposes. I just need some initial
guidance to start off in the right direction:

What exactly does the netfilter use from the Linux
kernel?

Where exactly does it interact with the kernel? 

I am wading through the source code right now but I am
unable to find those exact points.

Most of the extensions are modules..which is fine..I
can easily convert them to user-application-code.

I hope I am making myself clear...

_LEARNer



--- Allen Francom <aef@tempest.prismnet.com> wrote:
> 
> Um...
> 
> One way or another I think the "user" will at least
> have to have "root" privileges.
> 
> Netfilter I don't think will do what you want, I
> think
> it is totally dependent on the kernel.
> 
> You might look at Snort.  www.snort.org
> 
> -AEF
> 
> On Fri, 16 Jan 2004, kernel_learner wrote:
> >  How's it going! I am looking for something that I
> am
> > not sure currently exists. Basically I want to
> make a
> > version of netfilter that's free from all the
> > kernel-level and networking stack hooks. I am
> looking
> > for a plain simpler version of netfilter which
> does
> > not interact with the kernel or the networking
> stack
> > in any way. It would be a standard user program
> which
> > a person with normal privelges could compile and
> run.
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

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

* Re: Netfilter as an application
  2004-01-16 21:47   ` kernel_learner
@ 2004-01-16 22:40     ` Henrik Nordstrom
  2004-01-17  5:35     ` Allen Francom
  1 sibling, 0 replies; 7+ messages in thread
From: Henrik Nordstrom @ 2004-01-16 22:40 UTC (permalink / raw)
  To: kernel_learner; +Cc: Allen Francom, netfilter-devel

On Fri, 16 Jan 2004, kernel_learner wrote:

> What exactly does the netfilter use from the Linux kernel?

Not much. It is essentially a separate entity called by the hooks in the 
Linux TCP/IP stack.

There is some dependencies on routing etc, but this is only relevant if
you are planning on doing stuff related to routing such as mangle or NAT.

> Where exactly does it interact with the kernel? 

The kernel sends packets to the Netfilter modules via the netfilter 
hooks.

If netfilter selects to delay a packet then the packet is later 
reintroduced to the kernel via the nf_reinject() function.

The userspace communicates with iptables via getsockopt() calls to install 
iptables rulesets etc.

Netfilter is fully contained in the netfilter directories and headers,
plus some support functions in net/core/netfilter.c taking care of the
gory details of registering new hook handlers, getsockopt operations etc.


The Netfilter hacking howto guide has some good information on how a 
Netfilter module such as iptables interacts with the kernel.



Personally I find using the user-mode-linux approach very suitable if one
want to use netfilter as an application. You then have a 100% complete
application running iptables (or whatever) with all of the support given
by the kernel without requiring any root privileges. Root is only required
if you want to set up network connectivity to the host, not for
communication between user-mode-linux nodes.

Regards
Henrik

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

* Re: Netfilter as an application
  2004-01-16 19:47 Netfilter as an application kernel_learner
  2004-01-16 20:06 ` Allen Francom
@ 2004-01-17  2:00 ` Jeremy Kerr
  1 sibling, 0 replies; 7+ messages in thread
From: Jeremy Kerr @ 2004-01-17  2:00 UTC (permalink / raw)
  To: kernel_learner, netfilter-devel


> Basically I want to make a
> version of netfilter that's free from all the
> kernel-level and networking stack hooks. 

The Netfilter Simulation Environment (nfsim) provides exactly that - a 
userspace environment for running and testing netfilter code. It's up at:

http://ozlabs.org/~jk/projects/nfsim/


Jeremy

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

* Re: Netfilter as an application
  2004-01-16 21:47   ` kernel_learner
  2004-01-16 22:40     ` Henrik Nordstrom
@ 2004-01-17  5:35     ` Allen Francom
  1 sibling, 0 replies; 7+ messages in thread
From: Allen Francom @ 2004-01-17  5:35 UTC (permalink / raw)
  To: kernel_learner; +Cc: netfilter-devel


Hi,

Well, in order for a user-space application to get
at the raw packets and presumably do things like
set promiscuous mode on ethernet adapter(s), that
takes root privileges for one thing ( last I tried )

Netfilter, what I know of it and what I've tried,
has cornfused me because it seemed intertwined
/ interdependent with kernel code and libraries
and gets packets in a structure that is generated
by the kernel etc., and so on.  ( too much for
me to try and deal with given limited time )

To me, netfilter does not look or feel like an
application having much if anything to do with
user-space.

However, I have done a few things with the IPQUEUE
"userspace module" extension ability.

This is where you can run a user program that gets
packets out of the kernel NETFILTER via a -j IPQUEUE
rule and it goes to your listening program.

Then you can in your program inspect the packets,
Accept, Deny or Drop them, and even modify the packets.

That's one thing.

I suggested Snort because it is all user-space and might
be more appropriate for your tinkerings due to the
way your request sounded.

Snort I believe throws promiscous mode on the
adapters and that takes root privileges.

Netfilter code itself to me ( and I'm no genius here )
but it is not what I'd start with for anything in
user-space, and from what I've seen I wouldn't even
try to fanagle the code to working in user-space.

It is kernel stuff with some command-line utilities
to manipulate the rules.  That's how I look at
netfilter.

Indeed, build a linux kernel and see all the kernel
modules.  Then look at the code to those modules
and see all the dependencies on other kernel code.

If I'm not mistaken, netfilter relies entirely on
the kernel network stack and cannot "stand-alone".

Too yucky to try in my book.

So I second my own recommendation to look at things
like Snort instead.

Also maybe try hogwash, and there are a couple other similar
projects.

Perhaps though what you want after reflecting on it
is to use the Netfilter IPQUEUE extension.

But not if you truly need or want an entirely
userspace self-contained something.

IMHO
-AEF


On Fri, 16 Jan 2004, kernel_learner wrote:

> Thanks Allen,
>
>  However I am not sure why you think user should have
> user priveleges. I am not saying I will use netfilter
> as it is.

> What exactly does the netfilter use from the Linux
> kernel?
>
> Where exactly does it interact with the kernel?
>
> Most of the extensions are modules..which is fine..I
> can easily convert them to user-application-code.
> I hope I am making myself clear...

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

end of thread, other threads:[~2004-01-17  5:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-16 19:47 Netfilter as an application kernel_learner
2004-01-16 20:06 ` Allen Francom
2004-01-16 21:47   ` kernel_learner
2004-01-16 22:40     ` Henrik Nordstrom
2004-01-17  5:35     ` Allen Francom
2004-01-17  2:00 ` Jeremy Kerr
  -- strict thread matches above, loose matches on Subject: below --
2004-01-16 16:39 kernel_learner

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.