All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter unclean match extension
@ 2002-10-22 14:40 Harald Welte
  2002-10-22 21:57 ` David S. Miller
  2002-10-23 11:03 ` David S. Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Harald Welte @ 2002-10-22 14:40 UTC (permalink / raw)
  To: David Miller; +Cc: Netfilter Development Mailinglist

Hi Dave!

Below is a non-crucial extension of the ipt_unclean.c module (courtesy
of Maciej Soltysiak).  Inclusion of this patch has time until
2.4.21-preX, no need for this in 2.4.20.

This patch extends unclean's module to match packets with IP unused bit
set.  This bit is the first bit in the fragmentation offset field of the
IP header. 

Exerpt from RFC 791: Various Control Flags.  Bit 0: reserved, must be zero

Checking for this zero-ness of Bit 0 is what the patch adds.

The bit may be used in very discrete OS fingerprinting as described by
Ofir Arkin in "Unverified Fields - A Problem with Firewalls & Firewall
Technology Today" available to read at:
http://www.sys-security.com/archive/papers/Unverified_Fields_1.0.pdf
http://www.sys-security.com/archive/papers/Unverified_Fields_1.0.ps

Please apply, thanks.


diff -Nru linux.orig/net/ipv4/netfilter/ipt_unclean.c linux/net/ipv4/netfilter/ipt_unclean.c
--- linux.orig/net/ipv4/netfilter/ipt_unclean.c	Thu Jan  1 01:00:00 1970
+++ linux/net/ipv4/netfilter/ipt_unclean.c	Tue Jun 11 19:26:11 2002
@@ -522,6 +522,16 @@
 		return 0;
 	}
 
+	/* CHECK: Do not use what is unused.
+	 * First bit of fragmentation flags should be unused.
+	 * May be used by OS fingerprinting tools.
+	 * 04 Jun 2002, Maciej Soltysiak, solt@dns.toxicfilms.tv
+	 */
+	if (ntohs(iph->frag_off)>>15) {
+		limpk("IP unused bit set\n");
+		return 0;
+	}
+
 	/* Per-protocol checks. */
 	switch (iph->protocol) {
 	case IPPROTO_ICMP:
-- 
Live long and prosper
- Harald Welte / laforge@gnumonks.org               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M- 
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)

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

end of thread, other threads:[~2002-10-23 11:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-22 14:40 [PATCH] netfilter unclean match extension Harald Welte
2002-10-22 21:57 ` David S. Miller
2002-10-23 11:03 ` David S. Miller
2002-10-23 11:22   ` Harald Welte
2002-10-23 11:21     ` David S. Miller
2002-10-23 11:26   ` Maciej Soltysiak
2002-10-23 11:25     ` David S. Miller

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.