Skip to contentSkip to conversation

2 of 3 for patch-o-matic-ng

PATCH New Tim Gardner 1 participant 1 message Mar 17, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2 of 3 for patch-o-matic-ng

This match filter is an extension of the ideas in PSD, though it is a complete rewrite. It matches TCP/UDP/ICMP connections on a per IP basis that exceed a proscribed weight. I use it to detect port scan attacks from a single source.

Signature · 2 lines
Tim Gardner - [email protected]
www.tpi.com 406-443-5357
psdp/help +12 -0
diff -r -u --new-file patch-o-matic-ng/psdp/help patch-o-matic-ng.psdp.fuzzyp/psdp/help
@@ -0,0 +1,12 @@
+This filter extends the original PSD filter. It will keep track
+of connections from a single source IP address and assign weighting
+based on the destination port (for TCP/UDP) or ICMP type.
+
+Examples:
+
+# This will match all packets from a single IP source address that exceed the weight
+# threshold of 16. The memory for this IP address is  released after 20 seconds
+# of inactivity. The filter information for active IP addresses can be seen in
+# /proc/net/mypsdp.
+#
+iptables -A FORWARD -m psdp --psdp-name mypsdp --psdp-weight-threshold 16 --psdp-delay-threshold 20000 --psdp-lo-ports-weight 1 --psdp-hi-ports-weight 3 -j DROP
psdp/info +6 -0
diff -r -u --new-file patch-o-matic-ng/psdp/info patch-o-matic-ng.psdp.fuzzyp/psdp/info
@@ -0,0 +1,6 @@
+Author: Tim Gardner <[email protected]>
+Status: Stable
+Repository: extra
+Depends: hash
+Recompile: netfilter
+Recompile: iptables
psdp/iptables/extensions/libipt_psdp.c +288 -0

288 lines not on this page · raw message

psdp/iptables/extensions/libipt_psdp.man +2 -0
diff -r -u --new-file patch-o-matic-ng/psdp/iptables/extensions/libipt_psdp.man patch-o-matic-ng.psdp.fuzzyp/psdp/iptables/extensions/libipt_psdp.man
@@ -0,0 +1,2 @@
+This filter is used to detect an excessive number of connections from any
+single IP address. 
psdp/iptables/extensions/.psdp-test +3 -0
diff -r -u --new-file patch-o-matic-ng/psdp/iptables/extensions/.psdp-test patch-o-matic-ng.psdp.fuzzyp/psdp/iptables/extensions/.psdp-test
@@ -0,0 +1,3 @@
+#!/bin/sh
+# True if psdp is applied.
+[ -f $KERNEL_DIR/include/linux/netfilter_ipv4/ipt_psdp.h ] && echo psdp
psdp/linux/include/linux/netfilter_ipv4/ipt_psdp.h +72 -0

72 lines not on this page · raw message

psdp/linux/net/ipv4/netfilter/Config.in.ladd +2 -0
diff -r -u --new-file patch-o-matic-ng/psdp/linux/net/ipv4/netfilter/Config.in.ladd patch-o-matic-ng.psdp.fuzzyp/psdp/linux/net/ipv4/netfilter/Config.in.ladd
@@ -0,0 +1,2 @@
+  dep_tristate '  MAC address match support' CONFIG_IP_NF_MATCH_MAC $CONFIG_IP_NF_IPTABLES
+  dep_tristate '  PSD Plus filter support.' CONFIG_IP_NF_PSDP $CONFIG_IP_NF_HASH
psdp/linux/net/ipv4/netfilter/ipt_psdp.c +1152 -0

1,152 lines not on this page · raw message

psdp/linux/net/ipv4/netfilter/Kconfig.ladd +6 -0
diff -r -u --new-file patch-o-matic-ng/psdp/linux/net/ipv4/netfilter/Kconfig.ladd patch-o-matic-ng.psdp.fuzzyp/psdp/linux/net/ipv4/netfilter/Kconfig.ladd
@@ -0,0 +1,6 @@
+config IP_NF_PSDP
+	tristate "PSD Plus match filter support"
+	help
+	  Allows Port Scan Detection of multiple destinations from
+	  one source address.
+
psdp/linux/net/ipv4/netfilter/Makefile.ladd +2 -0
diff -r -u --new-file patch-o-matic-ng/psdp/linux/net/ipv4/netfilter/Makefile.ladd patch-o-matic-ng.psdp.fuzzyp/psdp/linux/net/ipv4/netfilter/Makefile.ladd
@@ -0,0 +1,2 @@
+obj-$(CONFIG_IP_NF_NAT) += iptable_nat.o
+obj-$(CONFIG_IP_NF_PSDP) += ipt_psdp.o