From: Evgeniy Polyakov <zbr@ioremap.net>
To: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Netfilter Development Mailinglist
<netfilter-devel@vger.kernel.org>,
Jan Engelhardt <jengelh@medozas.de>
Subject: Re: Passive OS fingerprint xtables match.
Date: Tue, 10 Mar 2009 19:01:51 +0300 [thread overview]
Message-ID: <20090310160151.GA13742@ioremap.net> (raw)
In-Reply-To: <20090310151357.GA10658@ioremap.net>
On Tue, Mar 10, 2009 at 06:13:57PM +0300, Evgeniy Polyakov (zbr@ioremap.net) wrote:
> Passive OS fingerprinting netfilter module allows to passively detect
> remote OS and perform various netfilter actions based on that knowledge.
> This module compares some data (WS, MSS, options and it's order, ttl, df
> and others) from packets with SYN bit set with dynamically loaded OS
> fingerprints.
>
> Fingerprint matching rules can be downloaded from OpenBSD source tree
> and loaded via netlink connector into the kernel via special util found
> in archive. It will also listen for events about matching packets.
>
> Archive also contains library file (also attached), which was shipped
> with iptables extensions some time ago (at least when ipt_osf existed
> in patch-o-matic).
>
> This release implements suggestions found during the code review like
> codying style, structure split and tighter packing, bool and %pi4
> usage and similar changes.
Not the latest version, it misses the following fix from the parallel
tree.
Fixed TCP header copy to the userspace when given option is enabled.
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c
index 3114bbd..e619f09 100644
--- a/net/netfilter/xt_osf.c
+++ b/net/netfilter/xt_osf.c
@@ -83,7 +83,7 @@ static void ipt_osf_send_connector(struct ipt_osf_user_finger *f,
struct ipt_osf_message *msg = &per_cpu(ipt_osf_mbuf, smp_processor_id());
struct ipt_osf_nlmsg *data = &msg->nlmsg;
struct iphdr *iph = ip_hdr(skb);
- struct tcphdr *tcph = tcp_hdr(skb);
+ struct tcphdr *tcp;
memcpy(&msg->cmsg.id, &cn_osf_id, sizeof(struct cn_msg));
msg->cmsg.seq = osf_seq++;
@@ -92,7 +92,9 @@ static void ipt_osf_send_connector(struct ipt_osf_user_finger *f,
memcpy(&data->f, f, sizeof(struct ipt_osf_user_finger));
memcpy(&data->ip, iph, sizeof(struct iphdr));
- memcpy(&data->tcp, tcph, sizeof(struct tcphdr));
+ tcp = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(struct tcphdr), &data->tcp);
+ if (tcp)
+ memcpy(&data->tcp, tcp, sizeof(struct tcphdr));
cn_netlink_send(&msg->cmsg, CN_IDX_OSF, GFP_ATOMIC);
}
--
Evgeniy Polyakov
next prev parent reply other threads:[~2009-03-10 16:01 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 15:13 Passive OS fingerprint xtables match Evgeniy Polyakov
2009-03-10 16:01 ` Evgeniy Polyakov [this message]
2009-03-10 16:07 ` Jan Engelhardt
2009-03-11 21:43 ` Evgeniy Polyakov
2009-03-10 16:12 ` Passive OS fingerprint xtables match (iptables) Jan Engelhardt
2009-03-10 21:01 ` Passive OS fingerprint xtables match Jesper Dangaard Brouer
2009-03-10 21:54 ` Evgeniy Polyakov
2009-03-16 14:40 ` Patrick McHardy
2009-03-11 9:54 ` Pablo Neira Ayuso
2009-03-11 10:00 ` Evgeniy Polyakov
2009-03-16 14:42 ` Patrick McHardy
-- strict thread matches above, loose matches on Subject: below --
2009-06-07 15:17 Evgeniy Polyakov
2009-06-08 15:06 ` Patrick McHardy
2009-06-08 17:25 ` Evgeniy Polyakov
2009-06-04 16:22 Evgeniy Polyakov
2009-06-05 11:54 ` Patrick McHardy
2009-06-05 13:10 ` Jan Engelhardt
2009-06-05 13:30 ` Patrick McHardy
2009-06-05 13:44 ` Jan Engelhardt
2009-06-07 15:12 ` Evgeniy Polyakov
2009-03-26 14:14 Evgeniy Polyakov
2009-03-26 14:18 ` Patrick McHardy
2009-03-26 14:59 ` Evgeniy Polyakov
2009-03-26 15:08 ` Patrick McHardy
2009-03-26 15:41 ` Evgeniy Polyakov
2009-03-26 15:47 ` Patrick McHardy
2009-03-30 6:20 ` Evgeniy Polyakov
2009-05-01 20:15 ` Evgeniy Polyakov
2009-02-12 17:12 Evgeniy Polyakov
2009-02-12 17:42 ` Paul E. McKenney
2009-02-12 17:51 ` Evgeniy Polyakov
2009-02-12 20:41 ` Paul E. McKenney
2009-02-18 14:55 ` Patrick McHardy
2009-02-12 18:22 ` Jan Engelhardt
2009-02-12 18:57 ` Evgeniy Polyakov
2009-02-12 20:12 ` Jan Engelhardt
2009-02-13 13:03 ` Evgeniy Polyakov
2009-02-13 13:51 ` Jan Engelhardt
2009-02-13 14:22 ` Evgeniy Polyakov
2009-02-13 14:41 ` Jan Engelhardt
2009-02-15 17:32 ` Evgeniy Polyakov
2009-02-18 15:02 ` Patrick McHardy
2009-02-18 15:07 ` Evgeniy Polyakov
2009-02-18 15:30 ` Jan Engelhardt
2009-02-19 11:56 ` Evgeniy Polyakov
2009-02-18 15:00 ` Patrick McHardy
2009-02-18 15:28 ` Jan Engelhardt
2009-02-18 15:14 ` Patrick McHardy
2009-01-29 17:20 Evgeniy Polyakov
2009-01-30 1:05 ` Paul E. McKenney
2009-02-09 16:09 ` Patrick McHardy
2009-02-13 12:49 ` Evgeniy Polyakov
2009-01-27 22:55 Evgeniy Polyakov
2009-01-29 3:36 ` Paul E. McKenney
2009-01-29 15:03 ` Evgeniy Polyakov
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=20090310160151.GA13742@ioremap.net \
--to=zbr@ioremap.net \
--cc=davem@davemloft.net \
--cc=jengelh@medozas.de \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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.