* (unknown),
@ 2008-07-27 1:11 David Boulding
2008-07-28 14:14 ` your mail Eric Leblond
0 siblings, 1 reply; 8+ messages in thread
From: David Boulding @ 2008-07-27 1:11 UTC (permalink / raw)
To: netfilter
Hey all,
I'm developing with libnetfilter_queue, using "iptables -A FORWARD ." to
capture packets of interest on a bridge for analysis (firewall).
I use nfq_get_payload() to grab everything from the IP layer and on, but I
was wondering if there was any way to get the raw MAC layer.
Is there any command like nfq_get_payload() that will return everything
similar to what you would get using wireshark or ethereal?
Thanks,
Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: your mail
2008-07-27 1:11 (unknown), David Boulding
@ 2008-07-28 14:14 ` Eric Leblond
2008-07-28 14:42 ` David Boulding
[not found] ` <5226fb870807280721kaa95f6esc6955cc87da42c18@mail.gmail.com>
0 siblings, 2 replies; 8+ messages in thread
From: Eric Leblond @ 2008-07-28 14:14 UTC (permalink / raw)
To: David Boulding; +Cc: netfilter
Hello,
On Saturday, 2008 July 26 at 21:11:08 -0400, David Boulding wrote:
> Hey all,
>
> I'm developing with libnetfilter_queue, using "iptables -A FORWARD ." to
> capture packets of interest on a bridge for analysis (firewall).
> I use nfq_get_payload() to grab everything from the IP layer and on, but I
> was wondering if there was any way to get the raw MAC layer.
> Is there any command like nfq_get_payload() that will return everything
> similar to what you would get using wireshark or ethereal?
You can use nfq_get_packet_hw():
Retrieves the hardware address associated with the given queued packet.
For ethernet packets, the hardware address returned (if any) will be the
MAC address of the packet source host. The destination MAC address is not
known until after POSTROUTING and a successful ARP request, so cannot
currently be retrieved.
The nfqnl_msg_packet_hw structure is defined in "libnetfilter_queue/libnetfilter_queue.h" as:
struct nfqnl_msg_packet_hw {
u_int16_t hw_addrlen;
u_int16_t _pad;
u_int8_t hw_addr[8];
} __attribute__ ((packed));
.
http://lists.netfilter.org/pipermail/netfilter-devel/2006-February/023286.html
BR,
--
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: your mail
2008-07-28 14:14 ` your mail Eric Leblond
@ 2008-07-28 14:42 ` David Boulding
[not found] ` <5226fb870807280721kaa95f6esc6955cc87da42c18@mail.gmail.com>
1 sibling, 0 replies; 8+ messages in thread
From: David Boulding @ 2008-07-28 14:42 UTC (permalink / raw)
To: Eric Leblond, David Boulding, netfilter
Thanks for the reply.
I knew of nfq_get_packet_hw(), but I'm looking for a way to get the
raw byte array of the header that I get from the nfq_get_payload()
call. I'm not only looking for the MAC header information (which
nfq_get_packet_hw() will give me easy enough), but whatever else is
there, for example PPPoE and PPP header information. Is there anyway
to get that?
Thanks,
Dave
On Mon, Jul 28, 2008 at 10:14 AM, Eric Leblond <eric@inl.fr> wrote:
>
> Hello,
>
> On Saturday, 2008 July 26 at 21:11:08 -0400, David Boulding wrote:
> > Hey all,
> >
> > I'm developing with libnetfilter_queue, using "iptables -A FORWARD ." to
> > capture packets of interest on a bridge for analysis (firewall).
> > I use nfq_get_payload() to grab everything from the IP layer and on, but I
> > was wondering if there was any way to get the raw MAC layer.
> > Is there any command like nfq_get_payload() that will return everything
> > similar to what you would get using wireshark or ethereal?
>
> You can use nfq_get_packet_hw():
>
> Retrieves the hardware address associated with the given queued packet.
> For ethernet packets, the hardware address returned (if any) will be the
> MAC address of the packet source host. The destination MAC address is not
> known until after POSTROUTING and a successful ARP request, so cannot
> currently be retrieved.
>
> The nfqnl_msg_packet_hw structure is defined in "libnetfilter_queue/libnetfilter_queue.h" as:
>
> struct nfqnl_msg_packet_hw {
> u_int16_t hw_addrlen;
> u_int16_t _pad;
> u_int8_t hw_addr[8];
> } __attribute__ ((packed));
> .
>
> http://lists.netfilter.org/pipermail/netfilter-devel/2006-February/023286.html
>
> BR,
> --
> Eric Leblond
> INL: http://www.inl.fr/
> NuFW: http://www.nufw.org/
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <5226fb870807280721kaa95f6esc6955cc87da42c18@mail.gmail.com>]
* Re: your mail
[not found] ` <5226fb870807280721kaa95f6esc6955cc87da42c18@mail.gmail.com>
@ 2008-07-28 14:43 ` Eric Leblond
2008-07-28 15:33 ` David Boulding
0 siblings, 1 reply; 8+ messages in thread
From: Eric Leblond @ 2008-07-28 14:43 UTC (permalink / raw)
To: David Boulding; +Cc: netfilter
[-- Attachment #1: Type: text/plain, Size: 727 bytes --]
Hello,
On Monday, 2008 July 28 at 10:21:43 -0400, David Boulding wrote:
> Thanks for the reply.
> I knew of nfq_get_packet_hw(), but I'm looking for a way to get the raw byte
> > >
> > > I'm developing with libnetfilter_queue, using "iptables -A FORWARD ." to
> > > capture packets of interest on a bridge for analysis (firewall).
As you said "analysis", you may only want to "sniff" packet. In that case,
you can use NFLOG (latest git) or ULOG.
NFQUEUE moudle uses the dev_parse_header() function which only return the
source hardware address. You will not be able to retrieve the wanted
information without patching the kernel.
BR,
--
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: your mail
2008-07-28 14:43 ` Eric Leblond
@ 2008-07-28 15:33 ` David Boulding
2008-07-29 7:11 ` Eric Leblond
0 siblings, 1 reply; 8+ messages in thread
From: David Boulding @ 2008-07-28 15:33 UTC (permalink / raw)
To: Eric Leblond, David Boulding, netfilter
I've never heard of NFLOG or ULOG, is there any documentation under
netfilter on how to use it? How would I get the data that I want (to
sniff) using NFLOG/ULOG?
Dave
On Mon, Jul 28, 2008 at 10:43 AM, Eric Leblond <eric@inl.fr> wrote:
> Hello,
>
> On Monday, 2008 July 28 at 10:21:43 -0400, David Boulding wrote:
>> Thanks for the reply.
>> I knew of nfq_get_packet_hw(), but I'm looking for a way to get the raw byte
>> > >
>> > > I'm developing with libnetfilter_queue, using "iptables -A FORWARD ." to
>> > > capture packets of interest on a bridge for analysis (firewall).
>
> As you said "analysis", you may only want to "sniff" packet. In that case,
> you can use NFLOG (latest git) or ULOG.
>
> NFQUEUE moudle uses the dev_parse_header() function which only return the
> source hardware address. You will not be able to retrieve the wanted
> information without patching the kernel.
>
> BR,
> --
> Eric Leblond
> INL: http://www.inl.fr/
> NuFW: http://www.nufw.org/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkiN2x0ACgkQnxA7CdMWjzJSmQCdHBt2ro5Tx7m5GbWhl7uGZz7l
> 5H8Anjc9CaBwO/tOVaywfm+WwzeeBayE
> =felb
> -----END PGP SIGNATURE-----
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: your mail
2008-07-28 15:33 ` David Boulding
@ 2008-07-29 7:11 ` Eric Leblond
2008-07-29 20:09 ` David Boulding
0 siblings, 1 reply; 8+ messages in thread
From: Eric Leblond @ 2008-07-29 7:11 UTC (permalink / raw)
To: David Boulding; +Cc: netfilter
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
Hello,
On Monday, 2008 July 28 at 11:33:24 -0400, David Boulding wrote:
> I've never heard of NFLOG or ULOG, is there any documentation under
> netfilter on how to use it? How would I get the data that I want (to
> sniff) using NFLOG/ULOG?
For ULOG, you can have a look at ulogd or ulogd2 code.
http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2.git;a=blob;f=input/packet/ulogd_inppkt_ULOG.c;h=c00d9bf8a965be7f961738892e19191efcf8f691;hb=0b789ea9bf810497845456e9b83bff8c5ae5ca23
By the way, as ulogd2 uses a plugin mechanism, you may be able to build
what you want by coding an ulogd2 plugin. It can provide you a way to
code something independant from low level (NFLOG or ULOG can be used as
input without changing your plugin).
A mini doc about ulogd2 hacking is available here:
http://home.regit.org/?page_id=90
For NFLOG, you need to use latest git for kernel and libnetfilter_log.
The following functions are available:
- nflog_get_hwtype: to fetch hardware type (and thus give the parser to
use)
- nflog_get_msg_packet_hwhdrlen: to get hardware header len
- nflog_get_msg_packet_hwhdr: get hardware datas
BR,
--
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: your mail
2008-07-29 7:11 ` Eric Leblond
@ 2008-07-29 20:09 ` David Boulding
0 siblings, 0 replies; 8+ messages in thread
From: David Boulding @ 2008-07-29 20:09 UTC (permalink / raw)
To: Eric Leblond, David Boulding, netfilter
Thanks for the help!
Dave
On Tue, Jul 29, 2008 at 3:11 AM, Eric Leblond <eric@inl.fr> wrote:
> Hello,
>
> On Monday, 2008 July 28 at 11:33:24 -0400, David Boulding wrote:
>> I've never heard of NFLOG or ULOG, is there any documentation under
>> netfilter on how to use it? How would I get the data that I want (to
>> sniff) using NFLOG/ULOG?
>
> For ULOG, you can have a look at ulogd or ulogd2 code.
> http://git.netfilter.org/cgi-bin/gitweb.cgi?p=ulogd2.git;a=blob;f=input/packet/ulogd_inppkt_ULOG.c;h=c00d9bf8a965be7f961738892e19191efcf8f691;hb=0b789ea9bf810497845456e9b83bff8c5ae5ca23
> By the way, as ulogd2 uses a plugin mechanism, you may be able to build
> what you want by coding an ulogd2 plugin. It can provide you a way to
> code something independant from low level (NFLOG or ULOG can be used as
> input without changing your plugin).
>
> A mini doc about ulogd2 hacking is available here:
> http://home.regit.org/?page_id=90
>
> For NFLOG, you need to use latest git for kernel and libnetfilter_log.
>
> The following functions are available:
>
> - nflog_get_hwtype: to fetch hardware type (and thus give the parser to
> use)
> - nflog_get_msg_packet_hwhdrlen: to get hardware header len
> - nflog_get_msg_packet_hwhdr: get hardware datas
>
> BR,
> --
> Eric Leblond
> INL: http://www.inl.fr/
> NuFW: http://www.nufw.org/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIjsKinxA7CdMWjzIRAofmAJ9mi4P5SRkPugu8wADwtmB2LlHmigCfWjNn
> E77TPzKV3LStdfYgpFCobVA=
> =ruvK
> -----END PGP SIGNATURE-----
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <CAK9MGy3D5UBf06OY16UW=c+Cybm67x+0kH_OWJkX7ywdQD9CNA@mail.gmail.com>]
end of thread, other threads:[~2020-06-28 6:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-27 1:11 (unknown), David Boulding
2008-07-28 14:14 ` your mail Eric Leblond
2008-07-28 14:42 ` David Boulding
[not found] ` <5226fb870807280721kaa95f6esc6955cc87da42c18@mail.gmail.com>
2008-07-28 14:43 ` Eric Leblond
2008-07-28 15:33 ` David Boulding
2008-07-29 7:11 ` Eric Leblond
2008-07-29 20:09 ` David Boulding
[not found] <CAK9MGy3D5UBf06OY16UW=c+Cybm67x+0kH_OWJkX7ywdQD9CNA@mail.gmail.com>
2020-06-28 6:27 ` G.W. Haywood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox