From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: 10d4db,b16f17371f4c406f,start X-Google-Attributes: gid10d4db,public X-Google-Language: ENGLISH,ASCII-7-bit Return-Path: Path: g2news1.google.com!news4.google.com!newsfeed.stanford.edu!cola.stump.algebra.com!robomod!not-for-mail X-COLA-Policy: http://stump.algebra.com/~cola X-COLA-Info-1: Send submissions to cola@stump.algebra.com X-COLA-Info-2: Send complaints to cola-admin@stump.algebra.com X-Comment: moderators do not necessarily agree or disagree with this article. X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) Date: Mon, 21 Feb 2005 04:28:02 CST X-Authentication-Warning: tregonwell.lowth.com: chris owned process doing -bs From: chris lowth Subject: IpTables ROPE 20040214 - packet match rule scripting language Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on ak47.algebra.com X-Spam-Report: * 0.1 RCVD_IN_SORBS RBL: SORBS: sender is listed in SORBS * [80.2.218.11 listed in dnsbl.sorbs.net] X-Spam-Status: No, hits=0.1 required=5.0 tests=RCVD_IN_SORBS autolearn=no version=2.63 Newsgroups: comp.os.linux.announce X-Auth: PGPMoose V1.1 PGP comp.os.linux.announce iQBVAwUAQhm3siFvAtx2nXvNAQFumQIAmbBTWiq6aOBac/HzAu4W2g2t0dXypidR 2K8rbgrJ9BRaMzLO/9PXs64tCXAbJarDBA4BnlGoREcw9Jdr1gZYsA== =yHg8 Xref: g2news1.google.com comp.os.linux.announce:696 A new version of "Rope" has been released. Changes since the last announcement include... . addition of logic for time and date handling in packet matching rule scripts. . new registers: $kernel_time, $packet_time . new actions: localtime, gmtime . new decomposers: tm_day, tm_min, tm_hour .. etc ROPE is a scritable packet match module for Linux iptables / Netfilter. It allows packet matching criteria to be written using a simple scripting language which is executed in and by the Linux kernel. It is available under the GPL from http://www.lowth.com/rope. A simple example :- a rule that limits the size of pages downloaded over HTTP based on the Content-Length header could prevent long downloads before they even start. Here's a trivial ROPE script to provide this logic... $tcp_source 80 eq assert # check that it's HTTP expecti_to( "Content-Length: " ) # find the header expect_while({isdigit}) put($n) # lift the length value if( atoi($n) 1000000 gt { yes } ) # match: if too long no # dont match: if not If this script is stored as "contlen.rope" and compiled as "contlen.rp", then it can be installed into an Iptables chain using a command like. iptables -A FORWARD -m rope --script contlen -j DROP For more information (including a more thorough version of the example script), please refer to: http://www.lowth.com/rope ########################################################################## # Send submissions for comp.os.linux.announce to: cola@stump.algebra.com # # PLEASE remember a short description of the software and the LOCATION. # # This group is archived at http://stump.algebra.com/~cola/ # ##########################################################################