#!/bin/sh # powered by Andre' Lue # ident @(#)fxsnort version 0.9.1 c:01.02.03 m:01.02.03 ASL # signature Are You not Entertained! # if [ "$1" = "" -o "$2" = "" ] ; then echo "\nusage: $0 rule_path output.conf" echo " $0 snort-2.3.0RC2/rules out.conf" exit 1 fi IDS="/export/home/ids" PATH="/usr/bin:/sbin:/usr/sbin:$IDS/tmp" OUT="$2" export PATH CDIR=`pwd` RULES="$CDIR/$1" cd $RULES if [ -L$RULES/snort.conf ] ; then (cd $RULES ; ln -s ../etc/snort.conf .) fi if [ -L$RULES/classification.config ] ; then (cd $RULES ; ln -s ../etc/classification.config .) fi cat $RULES/snort.conf | grep -v "^#" | grep -v "^$" | grep -v "^include " | \ sed 's/TERNAL_NET/TERNAL/g;s/HOME_NET/INTERNAL/g' | \ sed 's/SMTP_SERVERS/INTERNAL/g;s/HTTP_SERVERS/INTERNAL/g' | \ sed 's/SQL_SERVERS/INTERNAL/g;s/DNS_SERVERS/INTERNAL/g' > $OUT cat classification.config | grep -v "^#" | grep -v "^$" >> $OUT for RF in `ls $RULES/*.rules` do cat $RF | grep -v "^#" | grep -v "^$" | \ sed 's/TERNAL_NET/TERNAL/g;s/HOME_NET/INTERNAL/g' | \ sed 's/SMTP_SERVERS/INTERNAL/g;s/HTTP_SERVERS/INTERNAL/g' | \ sed 's/SQL_SERVERS/INTERNAL/g;s/DNS_SERVERS/INTERNAL/g' >> $OUT done cat $RULES/$OUT | uniq >> $CDIR/snort.conf