Index: snort/ChangeLog.snort-wireless diff -u /dev/null snort/ChangeLog.snort-wireless:1.1.2.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/ChangeLog.snort-wireless Sat Apr 23 18:11:15 2005 @@ -0,0 +1,68 @@ +2004-03-30 Sebastien Gracia + + * added src/wifi_statetable.c + * added src/preprocessors/spp_auth_flood.c + * added src/preprocessors/spp_deauth_flood.c + * added src/preprocessors/spp_mac_spoof.c + * src/decode.h: + Additional WSTIdx struct + * src/snort.c: + added call to WSTDoTable() function + +2003-08-25 Andrew Lockhart + + * rules/wifi.rules: + - Changed example addr4 plugin rule to work with fixed plugin. + + * src/detection-plugins/sp_wifi_addr4.c (WifiAddr4ParseMAC): + - Fixed MAC address parsing to cope with snort's option parsing + (was XX:XX:XX:XX:XX:XX, now 0xXXXXXXXXXXXX) + +2003-08-24 Andrew Lockhart + + * rules/wifi.rules: + - Changed example bssid plugin rule to work with fixed plugin. + + * src/detection-plugins/sp_wifi_bssid.c (WifiBssidParseBSSID): + - Fixed MAC address parsing to cope with snort's option parsing + (was XX:XX:XX:XX:XX:XX, now 0xXXXXXXXXXXXX) + +2003-08-23 Andrew Lockhart + + * src/log.c (Print2ndHeader): + - Added case for DLT_PRISM_HEADER. + +2003-08-21 Andrew Lockhart + + * src/decode.c: + - Added DecodePrismHdr() + - Moved bulk of DecodeIEEE80211Pkt() to + DecodeWifiHdr() to prevent duplicate code + + * src/decode.h: + - Added PrismHdr structure + - Added prism_val structure + + * src/snort.c (SetPktProcessor): + - Added case for DLT_PRISM_HEADER + +2003-08-14 Andrew Lockhart + + * rules/wifi.rules: + - Fixed typo in STYPE_ACK sample rule. + + * src/detection-plugins/sp_wifi_stype.c: + - Fixed typo in disassociation subtype string. + - Fixed typo in power-save poll subtype string. + - Removed redundant error check in WifiStypeRuleParseFunction() + that caused an off-by-one error. + + +2003-07-27 Andrew Lockhart + * Added ssid plugin + +2003-07-25 Andrew Lockhart + + * Added seqnum plugin + * Added fragnum plugin + * Added addr4 plugin Index: snort/acconfig.h diff -u /dev/null snort/acconfig.h:1.1.1.3.2.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/acconfig.h Sat Apr 23 02:19:32 2005 @@ -0,0 +1,53 @@ +/* $Id: acconfig.h,v 1.11 2004/03/08 15:29:17 gracia Exp $ */ +#undef PACKAGE +#undef VERSION +#undef BSDI +#undef FREEBSD +#undef IRIX +#undef AIX +#undef LINUX +#undef OPENBSD +#undef PCAP_TIMEOUT_IGNORED +#undef SOLARIS +#undef STUPID_SOLARIS_CHECKSUM_BUG +#undef BROKEN_SIOCGIFMTU +#undef SUNOS +#undef HPUX +#undef OSF1 +#undef MACOS +#undef WORDS_MUSTALIGN +#undef ENABLE_POSTGRESQL +#undef u_int8_t +#undef u_int16_t +#undef u_int32_t +#undef NEED_DECL_PRINTF +#undef NEED_DECL_FPRINTF +#undef NEED_DECL_SYSLOG +#undef NEED_DECL_PUTS +#undef NEED_DECL_PUTC +#undef NEED_DECL_FPUTS +#undef NEED_DECL_FPUTC +#undef NEED_DECL_FOPEN +#undef NEED_DECL_FCLOSE +#undef NEED_DECL_FWRITE +#undef NEED_DECL_FFLUSH +#undef NEED_DECL_GETOPT +#undef NEED_DECL_BZERO +#undef NEED_DECL_BCOPY +#undef NEED_DECL_MEMSET +#undef NEED_DECL_STRTOL +#undef NEED_DECL_STRCASECMP +#undef NEED_DECL_STRNCASECMP +#undef NEED_DECL_STRERROR +#undef NEED_DECL_PERROR +#undef NEED_DECL_SOCKET +#undef NEED_DECL_SENDTO +#undef NEED_DECL_VSNPRINTF +#undef NEED_DECL_SNPRINTF +#undef NEED_DECL_STRTOUL +#undef MAP_ANONYMOUS +#undef HAVE_MAP_ANONYMOUS +#undef ERRLIST_PREDEFINED +#undef HAVE_NETSNMP +#undef HAVE__FUNCTION__ +#undef HAVE__func__ Index: snort/configure.in diff -u snort/configure.in:1.1.1.16 snort/configure.in:1.11.2.9.2.1 --- snort/configure.in:1.1.1.16 Mon Apr 25 03:21:16 2005 +++ snort/configure.in Mon Jun 13 03:27:30 2005 @@ -4,7 +4,7 @@ AM_CONFIG_HEADER(config.h) # When changing the snort version, please also update the VERSION # definition in "src/win32/WIN32-Includes/config.h" -AM_INIT_AUTOMAKE(snort,2.3.3) +AM_INIT_AUTOMAKE(snort-wireless,2.3.3-sgracia) # Since we get -O2 from configure defaults, which doesn't work in 64bit # mode, let's make some changes here before calling _CC macros. @@ -33,6 +33,15 @@ CFLAGS="$CFLAGS -DPROFILE -pg" else CFLAGS="$CFLAGS -DPROFILE" + fi + ],) + +AC_ARG_ENABLE(wireless, + [ --enable-wireless enable wireless options ], + [ if test -n "$GCC"; then + CFLAGS="$CFLAGS -DWIRELESS" + else + CFLAGS="$CFLAGS -DWIRELESS" fi ],) Index: snort/contrib/ACID-0.9.6b21.tar.gz Index: snort/contrib/Guardian.tar.gz Index: snort/contrib/Net-SnortLog-0.1.tar.gz Index: snort/contrib/S99snort diff -u /dev/null snort/contrib/S99snort:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/S99snort Thu Jul 24 02:50:58 2003 @@ -0,0 +1,85 @@ +#!/bin/bash +# $Id: S99snort,v 1.1 2001/12/18 22:14:37 cazz Exp $ +# /etc/init.d/snort : start or stop the SNORT Intrusion Database System +# +# Written by Lukasz Szmit +# +# Configuration + +# set config file & path to snort executable +SNORT_PATH=/usr/local/bin +CONFIG=/usr/local/share/snort/snort.conf + +# set interface +IFACE=eth0 + +# set GID/Group Name +SNORT_GID=nogroup + +# other options +OPTIONS="-D" + +# End of configuration + + +test -x $SNORT_PATH/snort || exit 0 + +case "$1" in + start) + echo "Starting Intrusion Database System: SNORT" + $SNORT_PATH/snort -c $CONFIG -i $IFACE -g $SNORT_GID $OPTIONS + if [ "`pidof $SNORT_PATH/snort`" ]; then + echo "SNORT is up and running!" + else + exit 0 + fi + echo -n "." + ;; + + stop) + echo "Stoping Intrusion Database System: SNORT" + if [ "`pidof $SNORT_PATH/snort`" ] ; then + + kill -TERM `pidof $SNORT_PATH/snort` + + # Wait until the timeout + count=120 + numdots=0 + while ([ $count != 0 ]) do + let count=$count-1 + if [ "`pidof $SNORT_PATH/snort`" ] ; then + echo -n . + let numdots=$numdots+1 + sleep 1 + else + count=0 + fi + done + + # If it's not dead yet, kill it. + + if [ "`pidof $SNORT_PATH/snort`" ] ; then + echo " TIMEOUT!" + kill -KILL `$SNORT_PATH/snort` + else + case $numdots in + 0) echo "." ;; + 1) echo ;; + *) echo " done." ;; + esac + fi + else + echo "SNORT is not running!"; + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo 'Usage: /etc/init.d/snort {start|stop|restart}' + exit 1 + ;; +esac +exit 0 +;; Index: snort/contrib/Spade-092200.1.tar.gz Index: snort/contrib/address_config.sh diff -u /dev/null snort/contrib/address_config.sh:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/address_config.sh Thu Jul 24 01:55:04 2003 @@ -0,0 +1,29 @@ +#!/bin/sh +# address_config.sh -v0.2 +# Handy script for laptop users that change their +# IP address frequently. This automates the +# process of updating your Snort rules file. +# You might find his litle script can be usefull, enjoy... +# Sten Kalenda Apeldoorn The Netherlands +# ------------------ MODIFY HERE --------------------------------------- +IF0=eth0 +MASK="24" +SNORTDIR="/usr/local/bin" +SNORTLIBDIR="$SNORTDIR/snortlib" +SNORTLOGDIR="/var/log/snort" +# ------------------ DO NOT CHANGE BELOW ------------------------------- +if [ ! -d "$SNORTLIBDIR" ] ; then + echo Directory $SNORTLIBDIR not found + exit +fi +cd $SNORTLIBDIR +if [ ! -e "$SNORTLOGDIR" ] ; then + mkdir $SNORTLOGDIR + chmod 700 $SNORTLOGDIR +fi +MYIP=`/sbin/ifconfig $IF0|sed -n -e "s/^[ ]*inet addr\:\([0-9.]*\).*$/\1/p"` +CHG=s\/10\.1\.1\.0\\/24/$MYIP\\/$MASK/g +cat snort-lib | sed $CHG > snort-lib_run + +$SNORTDIR/snort -D -A fast -c $SNORTLIBDIR/snort-lib_run + Index: snort/contrib/create_mssql diff -u /dev/null snort/contrib/create_mssql:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/create_mssql Thu Jul 24 01:55:04 2003 @@ -0,0 +1,203 @@ +-- Copyright (C) 2000-2002 Carnegie Mellon University +-- +-- Author(s): Chris Reid +-- +-- Based on the create_mysql file from: +-- Jed Pickel , +-- Roman Danyliw , +-- Todd Schrubb +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +-- Note that Roman Danyliw graciously provides an Entity Relationship diagram +-- for the Snort / ACID database schema. This ERD is available from the ACID +-- website: +-- +-- http://www.cert.org/kb/acid/ +-- +-- In the comments below, all fields marked as "FK" (foreign key) should +-- be interpreted as "implied" foreign key, not "enforced" foreign key. +-- These comments are intended to be used to help a database administrator +-- construct their own diagram showing relationships between tables. + + + +CREATE TABLE [schema] ( vseq NUMERIC(10,0) NOT NULL, + ctime DATETIME NOT NULL, + PRIMARY KEY (vseq)) +INSERT INTO [schema] (vseq, ctime) VALUES ('106', GETDATE()) + +CREATE TABLE event ( sid NUMERIC(10,0) NOT NULL , -- FK to sensor.sid + cid NUMERIC(10,0) NOT NULL , + signature NUMERIC(10,0) NOT NULL , -- FK to signature.sig_id + timestamp DATETIME NOT NULL , + PRIMARY KEY (sid,cid)) +CREATE INDEX IX_event_signature ON event(signature) +CREATE INDEX IX_event_timestamp ON event(timestamp) + +CREATE TABLE signature ( sig_id NUMERIC(10,0) IDENTITY(1,1) NOT NULL , + sig_name VARCHAR(255) NOT NULL, + sig_class_id NUMERIC(10,0), -- FK to sig_class.sig_class_id + sig_priority NUMERIC(10,0), + sig_rev NUMERIC(10,0), + sig_sid NUMERIC(10,0), + PRIMARY KEY (sig_id)) +CREATE INDEX IX_signature_signame ON signature(sig_name) +CREATE INDEX IX_signature_sigclassid ON signature(sig_class_id) + +CREATE TABLE sig_reference ( sig_id NUMERIC(10,0) NOT NULL, -- FK to signature.sig_id + ref_seq NUMERIC(10,0) NOT NULL, + ref_id NUMERIC(10,0) NOT NULL, -- FK to reference.ref_id + PRIMARY KEY(sig_id, ref_seq)) + +CREATE TABLE reference ( ref_id NUMERIC(10,0) IDENTITY(1,1) NOT NULL, + ref_system_id NUMERIC(10,0) NOT NULL, -- FK to reference_system.ref_system_id + ref_tag VARCHAR(8000) NOT NULL, + PRIMARY KEY (ref_id)) + +CREATE TABLE reference_system ( ref_system_id NUMERIC(10,0) IDENTITY(1,1) NOT NULL, + ref_system_name VARCHAR(20), + PRIMARY KEY (ref_system_id)) + +CREATE TABLE sig_class ( sig_class_id NUMERIC(10,0) IDENTITY(1,1) NOT NULL, + sig_class_name VARCHAR(60) NOT NULL, + PRIMARY KEY (sig_class_id)) +CREATE INDEX IX_sigclass_sigclassid ON sig_class(sig_class_id) +CREATE INDEX IX_sigclass_sigclassname ON sig_class(sig_class_name) + + +-- store info about the sensor supplying data +CREATE TABLE sensor ( sid NUMERIC(10,0) IDENTITY(1,1) NOT NULL , + hostname VARCHAR(100) , + interface VARCHAR(100) , + filter VARCHAR(100) , + detail INT , -- FK to detail.detail_type + encoding INT , -- FK to encoding.encoding_type + last_cid NUMERIC(10,0) NOT NULL, + PRIMARY KEY (sid)) + +-- All of the fields of an ip header +CREATE TABLE iphdr ( sid NUMERIC(10,0) NOT NULL , -- FK to event.sid, event.cid + cid NUMERIC(10,0) NOT NULL , + ip_src NUMERIC(10,0) NOT NULL , + ip_dst NUMERIC(10,0) NOT NULL , + ip_ver TINYINT , + ip_hlen TINYINT , + ip_tos TINYINT , + ip_len INT , + ip_id INT , + ip_flags TINYINT , + ip_off INT , + ip_ttl TINYINT , + ip_proto TINYINT NOT NULL , + ip_csum INT , + PRIMARY KEY (sid,cid) ) +CREATE INDEX IX_iphdr_ipsrc ON iphdr(ip_src) +CREATE INDEX IX_iphdr_ipdst ON iphdr(ip_dst) + +-- All of the fields of a tcp header +CREATE TABLE tcphdr( sid NUMERIC(10,0) NOT NULL , -- FK to event.sid, event.cid + cid NUMERIC(10,0) NOT NULL , + tcp_sport INT NOT NULL , + tcp_dport INT NOT NULL , + tcp_seq NUMERIC(10,0) , + tcp_ack NUMERIC(10,0) , + tcp_off TINYINT , + tcp_res TINYINT , + tcp_flags TINYINT NOT NULL , -- FK to protocols (see snortdb-extra) + tcp_win INT , + tcp_csum INT , + tcp_urp INT , + PRIMARY KEY (sid,cid)) +CREATE INDEX IX_tcphdr_sport ON tcphdr(tcp_sport) +CREATE INDEX IX_tcphdr_dport ON tcphdr(tcp_dport) +CREATE INDEX IX_tcphdr_tcpflags ON tcphdr(tcp_flags) + +-- All of the fields of a udp header +CREATE TABLE udphdr( sid NUMERIC(10,0) NOT NULL , -- FK to event.sid, event.cid + cid NUMERIC(10,0) NOT NULL , + udp_sport INT NOT NULL , + udp_dport INT NOT NULL , + udp_len INT , + udp_csum INT , + PRIMARY KEY (sid,cid)) +CREATE INDEX IX_udphdr_sport ON udphdr(udp_sport) +CREATE INDEX IX_udphdr_dport ON udphdr(udp_dport) + +-- All of the fields of an icmp header +CREATE TABLE icmphdr( sid NUMERIC(10,0) NOT NULL , -- FK to event.sid, event.cid + cid NUMERIC(10,0) NOT NULL , + icmp_type TINYINT NOT NULL , + icmp_code TINYINT NOT NULL , + icmp_csum INT , + icmp_id INT , + icmp_seq INT , + PRIMARY KEY (sid,cid)) +CREATE INDEX IX_icmphdr_icmptype ON icmphdr(icmp_type) + +-- Protocol options +CREATE TABLE opt ( sid NUMERIC(10,0) NOT NULL , -- FK to iphdr.sid, iphdr.cid + cid NUMERIC(10,0) NOT NULL , -- or to tcphdr.sid, tcphdr.cid + optid NUMERIC(10,0) NOT NULL , + opt_proto TINYINT NOT NULL , + opt_code TINYINT NOT NULL , + opt_len INT , + opt_data VARCHAR(8000) , + PRIMARY KEY (sid,cid,optid)) + +-- Packet payload +CREATE TABLE data ( sid NUMERIC(10,0) NOT NULL , -- FK to event.sid, event.cid + cid NUMERIC(10,0) NOT NULL , + data_payload VARCHAR(8000) , + PRIMARY KEY (sid,cid)) + +-- encoding is a lookup table for storing encoding types +CREATE TABLE encoding(encoding_type TINYINT NOT NULL , + encoding_text VARCHAR(50) NOT NULL , + PRIMARY KEY (encoding_type)) +INSERT INTO encoding (encoding_type, encoding_text) VALUES (0, 'hex') +INSERT INTO encoding (encoding_type, encoding_text) VALUES (1, 'base64') +INSERT INTO encoding (encoding_type, encoding_text) VALUES (2, 'ascii') + +-- detail is a lookup table for storing different detail levels +CREATE TABLE detail (detail_type TINYINT NOT NULL , + detail_text VARCHAR(50) NOT NULL , + PRIMARY KEY (detail_type)) +INSERT INTO detail (detail_type, detail_text) VALUES (0, 'fast') +INSERT INTO detail (detail_type, detail_text) VALUES (1, 'full') + +-- be sure to also use the snortdb-extra tables if you want +-- mappings for tcp flags, protocols, and ports + + +grant select, insert on [schema] to public +grant select, insert on signature to public +grant select, insert on sig_reference to public +grant select, insert on reference to public +grant select, insert on reference_system to public +grant select, insert on sig_class to public +grant select, insert on data to public +grant select, insert on detail to public +grant select, insert on encoding to public +grant select, insert on event to public +grant select, insert on icmphdr to public +grant select, insert on iphdr to public +grant select, insert on opt to public +grant select, insert on sensor to public +grant select, insert on tcphdr to public +grant select, insert on udphdr to public + Index: snort/contrib/create_mysql diff -u /dev/null snort/contrib/create_mysql:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/create_mysql Thu Jul 24 01:55:04 2003 @@ -0,0 +1,167 @@ +# Copyright (C) 2000-2002 Carnegie Mellon University +# +# Maintainer: Roman Danyliw , +# +# Original Author(s): Jed Pickel (2000-2001) +# Roman Danyliw +# Todd Schrubb +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +CREATE TABLE schema ( vseq INT UNSIGNED NOT NULL, + ctime DATETIME NOT NULL, + PRIMARY KEY (vseq)); +INSERT INTO schema (vseq, ctime) VALUES ('106', now()); + +CREATE TABLE event ( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + signature INT UNSIGNED NOT NULL, + timestamp DATETIME NOT NULL, + PRIMARY KEY (sid,cid), + INDEX sig (signature), + INDEX time (timestamp)); + +CREATE TABLE signature ( sig_id INT UNSIGNED NOT NULL AUTO_INCREMENT, + sig_name VARCHAR(255) NOT NULL, + sig_class_id INT UNSIGNED NOT NULL, + sig_priority INT UNSIGNED, + sig_rev INT UNSIGNED, + sig_sid INT UNSIGNED, + PRIMARY KEY (sig_id), + INDEX sign_idx (sig_name(20)), + INDEX sig_class_id_idx (sig_class_id)); + +CREATE TABLE sig_reference (sig_id INT UNSIGNED NOT NULL, + ref_seq INT UNSIGNED NOT NULL, + ref_id INT UNSIGNED NOT NULL, + PRIMARY KEY(sig_id, ref_seq)); + +CREATE TABLE reference ( ref_id INT UNSIGNED NOT NULL AUTO_INCREMENT, + ref_system_id INT UNSIGNED NOT NULL, + ref_tag TEXT NOT NULL, + PRIMARY KEY (ref_id)); + +CREATE TABLE reference_system ( ref_system_id INT UNSIGNED NOT NULL AUTO_INCREMENT, + ref_system_name VARCHAR(20), + PRIMARY KEY (ref_system_id)); + +CREATE TABLE sig_class ( sig_class_id INT UNSIGNED NOT NULL AUTO_INCREMENT, + sig_class_name VARCHAR(60) NOT NULL, + PRIMARY KEY (sig_class_id), + INDEX (sig_class_id), + INDEX (sig_class_name)); + +# store info about the sensor supplying data +CREATE TABLE sensor ( sid INT UNSIGNED NOT NULL AUTO_INCREMENT, + hostname TEXT, + interface TEXT, + filter TEXT, + detail TINYINT, + encoding TINYINT, + last_cid INT UNSIGNED NOT NULL, + PRIMARY KEY (sid)); + +# All of the fields of an ip header +CREATE TABLE iphdr ( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + ip_src INT UNSIGNED NOT NULL, + ip_dst INT UNSIGNED NOT NULL, + ip_ver TINYINT UNSIGNED, + ip_hlen TINYINT UNSIGNED, + ip_tos TINYINT UNSIGNED, + ip_len SMALLINT UNSIGNED, + ip_id SMALLINT UNSIGNED, + ip_flags TINYINT UNSIGNED, + ip_off SMALLINT UNSIGNED, + ip_ttl TINYINT UNSIGNED, + ip_proto TINYINT UNSIGNED NOT NULL, + ip_csum SMALLINT UNSIGNED, + PRIMARY KEY (sid,cid), + INDEX ip_src (ip_src), + INDEX ip_dst (ip_dst)); + +# All of the fields of a tcp header +CREATE TABLE tcphdr( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + tcp_sport SMALLINT UNSIGNED NOT NULL, + tcp_dport SMALLINT UNSIGNED NOT NULL, + tcp_seq INT UNSIGNED, + tcp_ack INT UNSIGNED, + tcp_off TINYINT UNSIGNED, + tcp_res TINYINT UNSIGNED, + tcp_flags TINYINT UNSIGNED NOT NULL, + tcp_win SMALLINT UNSIGNED, + tcp_csum SMALLINT UNSIGNED, + tcp_urp SMALLINT UNSIGNED, + PRIMARY KEY (sid,cid), + INDEX tcp_sport (tcp_sport), + INDEX tcp_dport (tcp_dport), + INDEX tcp_flags (tcp_flags)); + +# All of the fields of a udp header +CREATE TABLE udphdr( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + udp_sport SMALLINT UNSIGNED NOT NULL, + udp_dport SMALLINT UNSIGNED NOT NULL, + udp_len SMALLINT UNSIGNED, + udp_csum SMALLINT UNSIGNED, + PRIMARY KEY (sid,cid), + INDEX udp_sport (udp_sport), + INDEX udp_dport (udp_dport)); + +# All of the fields of an icmp header +CREATE TABLE icmphdr( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + icmp_type TINYINT UNSIGNED NOT NULL, + icmp_code TINYINT UNSIGNED NOT NULL, + icmp_csum SMALLINT UNSIGNED, + icmp_id SMALLINT UNSIGNED, + icmp_seq SMALLINT UNSIGNED, + PRIMARY KEY (sid,cid), + INDEX icmp_type (icmp_type)); + +# Protocol options +CREATE TABLE opt ( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + optid INT UNSIGNED NOT NULL, + opt_proto TINYINT UNSIGNED NOT NULL, + opt_code TINYINT UNSIGNED NOT NULL, + opt_len SMALLINT, + opt_data TEXT, + PRIMARY KEY (sid,cid,optid)); + +# Packet payload +CREATE TABLE data ( sid INT UNSIGNED NOT NULL, + cid INT UNSIGNED NOT NULL, + data_payload TEXT, + PRIMARY KEY (sid,cid)); + +# encoding is a lookup table for storing encoding types +CREATE TABLE encoding(encoding_type TINYINT UNSIGNED NOT NULL, + encoding_text TEXT NOT NULL, + PRIMARY KEY (encoding_type)); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (0, 'hex'); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (1, 'base64'); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (2, 'ascii'); + +# detail is a lookup table for storing different detail levels +CREATE TABLE detail (detail_type TINYINT UNSIGNED NOT NULL, + detail_text TEXT NOT NULL, + PRIMARY KEY (detail_type)); +INSERT INTO detail (detail_type, detail_text) VALUES (0, 'fast'); +INSERT INTO detail (detail_type, detail_text) VALUES (1, 'full'); + +# be sure to also use the snortdb-extra tables if you want +# mappings for tcp flags, protocols, and ports Index: snort/contrib/create_oracle.sql diff -u /dev/null snort/contrib/create_oracle.sql:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/create_oracle.sql Thu Jul 24 01:55:04 2003 @@ -0,0 +1,289 @@ +-- Copyright (C) 2000-2002 Carnegie Mellon University +-- Portions Copyright (C) 2000 Mike Andersen +-- Portions Copyright (C) 2001 Andrew Stubbs +-- Portions Copyright (C) 2001 Jed Pickel +-- +-- Author(s): Mike Andersen +-- Thomas Stenhaug +-- +-- Maintainer: Roman Danyliw , +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, +-- MA 02111-1307, USA. +-- +-- +-- This file was recently updated by Andrew Stubbs to fix some bugs +-- and make the script more user friendly. +-- +-- Comments from Andrew on his update: +-- +-- There's a trigger in place of the AUTO_INCREMENT-option for the +-- sensor.sid. I don't fully understand how the NUMBER-type conversion +-- works at this point. +-- +-- Oracles DATE seems "bit" more picky on the format than MySQL. +-- +-- Rename it to : create_oracle.sql +-- to run type : sqlplus user/password@db_instance @ create_oracle.sql +-- +-- The drop tables / sequences are a personal preference - remove if +-- you wish the prompt merely echos the stuff after it - useful for +-- figuring out where you are when its running + +prompt schema; +drop table schema; + +CREATE TABLE schema ( vseq INT NOT NULL, + ctime VARCHAR2(24) NOT NULL, + PRIMARY KEY (vseq)); + +INSERT INTO schema (vseq, ctime) VALUES ('106', sysdate); + +prompt event; +drop table event; +CREATE TABLE event ( sid INT NOT NULL, + cid INT NOT NULL, + signature INT NOT NULL, + timestamp DATE NOT NULL, + PRIMARY KEY (sid,cid)); + +prompt signature; +drop table signature; +CREATE TABLE signature ( sig_id INT NOT NULL, + sig_name VARCHAR2(255), + sig_class_id INT, + sig_priority INT, + sig_rev INT, + sig_sid INT, + PRIMARY KEY (sig_id)); + +-- +-- auto-increment the signature.sig_id +-- +drop sequence seq_snort_signature_id ; +CREATE SEQUENCE seq_snort_signature_id START WITH 1 INCREMENT BY 1; + +CREATE or replace TRIGGER tr_snort_signature_id + BEFORE INSERT ON signature + FOR EACH ROW + BEGIN + SELECT seq_snort_signature_id.nextval INTO :new.SIG_ID FROM +dual; + END; +/ +prompt sig_reference; +drop table sig_reference; +CREATE TABLE sig_reference (sig_id INT NOT NULL, + ref_seq INT NOT NULL, + ref_id INT NOT NULL, + PRIMARY KEY(sig_id, ref_seq)); + +prompt reference; +drop table reference; +CREATE TABLE reference ( ref_id INT NOT NULL, + ref_system_id INT NOT NULL, + ref_tag VARCHAR2(100) NOT NULL, + PRIMARY KEY (ref_id)); +-- +-- auto-increment the reference.ref_id +-- + +drop sequence seq_snort_reference_id; +CREATE SEQUENCE seq_snort_reference_id START WITH 1 INCREMENT BY 1; + +CREATE or replace TRIGGER tr_snort_reference_id + BEFORE INSERT ON reference + FOR EACH ROW + BEGIN + SELECT seq_snort_reference_id.nextval INTO :new.REF_ID FROM +dual; + END; +/ + +prompt reference_system; +drop table reference_system ; +CREATE TABLE reference_system ( ref_system_id INT NOT NULL, + ref_system_name VARCHAR2(20), + PRIMARY KEY (ref_system_id)); + +drop sequence seq_snort_ref_system_id ; +CREATE SEQUENCE seq_snort_ref_system_id START WITH 1 INCREMENT BY 1; +CREATE or replace TRIGGER tr_snort_ref_system_id + BEFORE INSERT ON reference_system + FOR EACH ROW + BEGIN + SELECT seq_snort_ref_system_id.nextval INTO +:new.REF_SYSTEM_ID FROM dual; + END; +/ +prompt sig_class; +drop table sig_class; +CREATE TABLE sig_class ( sig_class_id INT NOT NULL, + sig_class_name VARCHAR(60) NOT NULL, + PRIMARY KEY (sig_class_id)); + +drop sequence seq_snort_sig_class_id ; +CREATE SEQUENCE seq_snort_sig_class_id START WITH 1 INCREMENT BY 1; +CREATE or REPLACE TRIGGER tr_snort_sig_class_id + BEFORE INSERT ON sig_class + FOR EACH ROW + BEGIN + select seq_snort_sig_class_id.nextval into :new.sig_class_id from +dual; + END; +/ +-- +-- store info about the sensor supplying data +-- +prompt sensor; +drop table sensor; +CREATE TABLE sensor ( + sid INT NOT NULL, + hostname VARCHAR2(100), + interface VARCHAR2(100), + filter VARCHAR2(100), + detail INT, + encoding INT, + last_cid INT NOT NULL, + PRIMARY KEY (sid)); + +-- +-- auto-increment the sensor.sid +-- +drop sequence seq_snort_sensor_id ; +CREATE SEQUENCE seq_snort_sensor_id START WITH 1 INCREMENT BY 1; + +CREATE OR REPLACE TRIGGER tr_snort_sensor_id + BEFORE INSERT ON sensor + FOR EACH ROW + BEGIN + SELECT seq_snort_sensor_id.nextval INTO :new.SID FROM dual; + END; +/ + +-- All of the fields of an ip header +prompt iphdr; +drop table iphdr; +CREATE TABLE iphdr ( + sid INT NOT NULL, + cid INT NOT NULL, + ip_src INT NOT NULL, + ip_dst INT NOT NULL, + ip_ver INT, + ip_hlen INT, + ip_tos INT, + ip_len INT, + ip_id INT, + ip_flags INT, + ip_off INT, + ip_ttl INT, + ip_proto INT NOT NULL, + ip_csum INT, + PRIMARY KEY (sid,cid)); + + +-- All of the fields of a tcp header +prompt tcphdr; +drop table tcphdr; +CREATE TABLE tcphdr ( + sid INT NOT NULL, + cid INT NOT NULL, + tcp_sport INT NOT NULL, + tcp_dport INT NOT NULL, + tcp_seq INT, + tcp_ack INT, + tcp_off INT, + tcp_res INT, + tcp_flags INT NOT NULL, + tcp_win INT, + tcp_csum INT, + tcp_urp INT, + PRIMARY KEY (sid,cid)); + + +-- All of the fields of a udp header +prompt udphdr; +drop table udphdr; +CREATE TABLE udphdr ( + sid INT NOT NULL, + cid INT NOT NULL, + udp_sport INT NOT NULL, + udp_dport INT NOT NULL, + udp_len INT, + udp_csum INT, + PRIMARY KEY (sid,cid)); + + +-- All of the fields of an icmp header +prompt icmphdr; +drop table icmphdr; +CREATE TABLE icmphdr( + sid INT NOT NULL, + cid INT NOT NULL, + icmp_type INT NOT NULL, + icmp_code INT NOT NULL, + icmp_csum INT, + icmp_id INT, + icmp_seq INT, + PRIMARY KEY (sid,cid)); + + +-- Protocol options +prompt opt; +drop table opt; +CREATE TABLE opt ( + sid INT NOT NULL, + cid INT NOT NULL, + optid INT NOT NULL, + opt_proto INT NOT NULL, + opt_code INT NOT NULL, + opt_len INT, + opt_data BLOB, + PRIMARY KEY (sid,cid,optid)); + + +-- Packet payload +prompt data; +drop table data; +CREATE TABLE data ( + sid INT NOT NULL, + cid INT NOT NULL, + data_payload BLOB, + PRIMARY KEY (sid,cid)); + + +-- encoding is a lookup table for storing encoding types +prompt encoding +drop table encoding; +CREATE TABLE encoding ( + encoding_type INT NOT NULL, + encoding_text VARCHAR2(50) NOT NULL, + PRIMARY KEY (encoding_type)); + +INSERT INTO encoding (encoding_type, encoding_text) VALUES (0, 'hex'); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (1, 'base64'); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (2, 'ascii'); + + +-- detail is a lookup table for storing different detail levels +prompt detail; +drop table detail; +CREATE TABLE detail ( + detail_type INT NOT NULL, + detail_text VARCHAR2(50) NOT NULL, + PRIMARY KEY (detail_type)); + +INSERT INTO detail (detail_type, detail_text) VALUES (0, 'fast'); +INSERT INTO detail (detail_type, detail_text) VALUES (1, 'full'); Index: snort/contrib/create_postgresql diff -u /dev/null snort/contrib/create_postgresql:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/create_postgresql Thu Jul 24 02:50:58 2003 @@ -0,0 +1,166 @@ +-- Copyright (C) 2000-2002 Carnegie Mellon University +-- +-- Maintainer: Roman Danyliw , +-- +-- Original Author(s): Jed Pickel (2000-2001) +-- Roman Danyliw +-- Todd Schrubb +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +CREATE TABLE schema ( vseq INT4 NOT NULL, + ctime TIMESTAMP with time zone NOT NULL, + PRIMARY KEY (vseq)); +INSERT INTO schema (vseq, ctime) VALUES ('106', now()); + +CREATE TABLE signature ( sig_id SERIAL NOT NULL, + sig_name TEXT NOT NULL, + sig_class_id INT8, + sig_priority INT8, + sig_rev INT8, + sig_sid INT8, + PRIMARY KEY (sig_id)); +CREATE INDEX sig_name_idx ON signature (sig_name); +CREATE INDEX sig_class_idx ON signature (sig_class_id); + +CREATE TABLE sig_reference (sig_id INT4 NOT NULL, + ref_seq INT4 NOT NULL, + ref_id INT4 NOT NULL, + PRIMARY KEY(sig_id, ref_seq)); + +CREATE TABLE reference ( ref_id SERIAL, + ref_system_id INT4 NOT NULL, + ref_tag TEXT NOT NULL, + PRIMARY KEY (ref_id)); + +CREATE TABLE reference_system ( ref_system_id SERIAL, + ref_system_name TEXT, + PRIMARY KEY (ref_system_id)); + +CREATE TABLE sig_class ( sig_class_id SERIAL, + sig_class_name TEXT NOT NULL, + PRIMARY KEY (sig_class_id) ); +CREATE INDEX sig_class_name_idx ON sig_class (sig_class_name); + +CREATE TABLE event ( sid INT4 NOT NULL, + cid INT8 NOT NULL, + signature INT4 NOT NULL, + timestamp timestamp with time zone NOT NULL, + PRIMARY KEY (sid,cid)); +CREATE INDEX signature_idx ON event (signature); +CREATE INDEX timestamp_idx ON event (timestamp); + +-- store info about the sensor supplying data +CREATE TABLE sensor ( sid SERIAL, + hostname TEXT, + interface TEXT, + filter TEXT, + detail INT2, + encoding INT2, + last_cid INT8 NOT NULL, + PRIMARY KEY (sid)); + +-- All of the fields of an ip header +CREATE TABLE iphdr ( sid INT4 NOT NULL, + cid INT8 NOT NULL, + ip_src INT8 NOT NULL, + ip_dst INT8 NOT NULL, + ip_ver INT2, + ip_hlen INT2, + ip_tos INT2, + ip_len INT4, + ip_id INT4, + ip_flags INT2, + ip_off INT4, + ip_ttl INT2, + ip_proto INT2 NOT NULL, + ip_csum INT4, + PRIMARY KEY (sid,cid)); +CREATE INDEX ip_src_idx ON iphdr (ip_src); +CREATE INDEX ip_dst_idx ON iphdr (ip_dst); + +-- All of the fields of a tcp header +CREATE TABLE tcphdr( sid INT4 NOT NULL, + cid INT8 NOT NULL, + tcp_sport INT4 NOT NULL, + tcp_dport INT4 NOT NULL, + tcp_seq INT8, + tcp_ack INT8, + tcp_off INT2, + tcp_res INT2, + tcp_flags INT2 NOT NULL, + tcp_win INT4, + tcp_csum INT4, + tcp_urp INT4, + PRIMARY KEY (sid,cid)); +CREATE INDEX tcp_sport_idx ON tcphdr (tcp_sport); +CREATE INDEX tcp_dport_idx ON tcphdr (tcp_dport); +CREATE INDEX tcp_flags_idx ON tcphdr (tcp_flags); + +-- All of the fields of a udp header +CREATE TABLE udphdr( sid INT4 NOT NULL, + cid INT8 NOT NULL, + udp_sport INT4 NOT NULL, + udp_dport INT4 NOT NULL, + udp_len INT4, + udp_csum INT4, + PRIMARY KEY (sid,cid)); +CREATE INDEX udp_sport_idx ON udphdr (udp_sport); +CREATE INDEX udp_dport_idx ON udphdr (udp_dport); + +-- All of the fields of an icmp header +CREATE TABLE icmphdr( sid INT4 NOT NULL, + cid INT8 NOT NULL, + icmp_type INT2 NOT NULL, + icmp_code INT2 NOT NULL, + icmp_csum INT4, + icmp_id INT4, + icmp_seq INT4, + PRIMARY KEY (sid,cid)); +CREATE INDEX icmp_type_idx ON icmphdr (icmp_type); + +-- Protocol options +CREATE TABLE opt ( sid INT4 NOT NULL, + cid INT8 NOT NULL, + optid INT2 NOT NULL, + opt_proto INT2 NOT NULL, + opt_code INT2 NOT NULL, + opt_len INT4, + opt_data TEXT, + PRIMARY KEY (sid,cid,optid)); + +-- Packet payload +CREATE TABLE data ( sid INT4 NOT NULL, + cid INT8 NOT NULL, + data_payload TEXT, + PRIMARY KEY (sid,cid)); + +-- encoding is a lookup table for storing encoding types +CREATE TABLE encoding(encoding_type INT2 NOT NULL, + encoding_text TEXT NOT NULL, + PRIMARY KEY (encoding_type)); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (0, 'hex'); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (1, 'base64'); +INSERT INTO encoding (encoding_type, encoding_text) VALUES (2, 'ascii'); + +-- detail is a lookup table for storing different detail levels +CREATE TABLE detail (detail_type INT2 NOT NULL, + detail_text TEXT NOT NULL, + PRIMARY KEY (detail_type)); +INSERT INTO detail (detail_type, detail_text) VALUES (0, 'fast'); +INSERT INTO detail (detail_type, detail_text) VALUES (1, 'full'); + +-- be sure to also use the snortdb-extra tables if you want +-- mappings for tcp flags, protocols, and ports Index: snort/contrib/faq2html diff -u /dev/null snort/contrib/faq2html:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/faq2html Thu Jul 24 01:55:04 2003 @@ -0,0 +1,33 @@ +#!/bin/sh +cat <<__EOF__ + + + +SNORT FAQ-v1.8.1 + + +
+
+
+
+

SNORT FAQ Version 1.8 - July 10 2001 v1.8.1 + + +__EOF__ + +cat FAQ | sed '2,$!d' | sed 's/"/\"/g' | sed 's/>/\>/g' | sed 's//' | sed '/HREF=/s/$/<\/A>/' | sed '/HREF=/s/ Q:"/"/' | sed '/SNORT BACKGROUND/,$s/^.* --faq-- --snort-- --faq-- --snort-- --faq-- --snort-- --faq--/&<\/A>

/' | sed '/NAME=/s/ --faq-- --snort-- --faq-- --snort-- --faq-- --snort-- --faq--"/"/' | sed 's/SNORT BACKGROUND/&<\/A>

/' +cat <<__EOF__ +
+
+ +back to
top + +


+
HTML generated by dr using sh, cat and sed.
+
+ + +__EOF__ + + + Index: snort/contrib/ms_unicode_generator.c diff -u /dev/null snort/contrib/ms_unicode_generator.c:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/ms_unicode_generator.c Sat Mar 12 01:51:09 2005 @@ -0,0 +1,183 @@ +/** +** @file ms_unicode_generator.c +** Copyright (C) 2003, Daniel Roelker +** +** @author Daniel Roelker +** +** @brief Program for dumping unicode codepoints that map to ASCII +** chars for each installed and valid codepage. +** +** This program is for dumping installed unicode codepage codepoints that +** map to ASCII chars. This file is used for IDS systems to correctly +** decode unicode encoded URI requests. +** +** This program also shows the Microsoft OS version (we don't care about +** systems that aren't NT-like) and the OEM and ASCII codepages. It +** appears that IIS uses the ASCII default codepage on each system, so +** you should use the ACP when configuring your IDS. +** +** NOTES: +** - Initial development. DJR +*/ +#include +#include + +/** +** NAME +** CovertCodepoint:: +*/ +/** +** Receive a unicodecodepoint and convert to multibyte. If the multibyte +** is really ASCII then return the codepoint mapping. +** +** There is really not much to this function except that we have to check +** multiple return parameters from the function. +** +** @param CP the codepage to iterate through +** @param UnicodeChar the codepoint to check +** +** @return UCHAR +** +** @retval NULL no valid ASCII mapping to codepoint +** @retval !NULL valid ASCII mapping to codepoint +*/ +static UCHAR *ConvertCodepoint(UINT CP, wchar_t UnicodeChar) +{ + BOOL UsedDefaultChar; + static char AsciiString; + int iRet; + + /* + ** We are only interested in the multibyte conversion to one byte values, + ** so we only pass in a buffer of length one. + */ + iRet = WideCharToMultiByte(CP, 0, &UnicodeChar, 1, &AsciiString, 1, NULL, + &UsedDefaultChar); + + /* + ** The return value (iRet) tells us how many chars have been put in the + ** AsciiString, so we only look for the Strings that are one char + ** because we are only looking for ASCII chars. + ** + ** We check the UsedDefaultChar becasue if it is TRUE this means that + ** the routine had no codepoint mapping for this char. We are not + ** interested in those codepoints. + ** + ** We check that the AsciiString and the UnicodeChar are not the same + ** char, since we check the ASCII mappings for anything weird. + ** + ** Last, we check that the AsciiString is actually ASCII, so we don't + ** get any of the Non-ASCII single byte chars. + */ + if((iRet == 1) && (UsedDefaultChar == FALSE) && ((UCHAR)AsciiString != + (UCHAR)UnicodeChar) && ((UCHAR)AsciiString < 0x80)) + { + return (UCHAR *)&AsciiString; + } + + return NULL; +} + +/* +** NAME +** PrintStuff:: +*/ +/** +** This is the callback function for enumerating the installed codepages. +** +** We found out that just because it is installed doesn't mean it's a +** VALID codepage. So after we get the codepage number, we check to +** make sure that it is valid. +** +** We then print out the Windows information about this codepage, like +** the english name, and then iterate through the codepoints and print +** out the ones that map to ascii characters. +** +** @param lpCodePageString pointer to TSTR. +** +** @return BOOL +** +** @retval TRUE continue enumerating codepages +** @retval FALSE stop enumerating codepages +*/ +static BOOL CALLBACK PrintStuff(LPTSTR lpCodePageString) +{ + UINT CodePage; + CPINFOEX CPInfoEx; + UCHAR *AsciiChar; + UINT uCtr; + + CodePage = (UINT)atoi(lpCodePageString); + + if(!IsValidCodePage(CodePage)) + { + printf("#INVALID CODEPAGE: %u\n\n", CodePage); + return TRUE; + } + + if(GetCPInfoEx(CodePage, 0, &CPInfoEx)) + { + printf("%s\n", CPInfoEx.CodePageName); + } + + /* + ** We iterate through all the one byte values because some of the + ** values were mapped to other ASCII values. c1 => 25 or something + ** like that. + */ + for(uCtr = 0x00; uCtr <= 0xFFFF; uCtr++) + { + if((AsciiChar = ConvertCodepoint(CodePage, (wchar_t)uCtr)) != NULL) + printf("%.4x:%.2x ", uCtr, *AsciiChar); + } + + printf("\n\n"); + + return TRUE; +} + +int main(int argc, char* argv[]) +{ + UINT CodePage; + OSVERSIONINFO VersionInfo; + + VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + /* + ** Let's get the version of Windows. + */ + if(GetVersionEx(&VersionInfo)) + { + if(VersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + printf("# Windows Version: %lu.%.2lu.%lu\n", + VersionInfo.dwMajorVersion, VersionInfo.dwMinorVersion, + VersionInfo.dwBuildNumber); + } + else + { + printf("# Not Win32 NT version.\n"); + return 0; + } + + /* + ** We get the OEM codepage for this Windows installation + */ + CodePage = GetOEMCP(); + printf("# OEM codepage: %u\n", CodePage); + + /* + ** We get the ANSII codepage for this Windows installation + */ + CodePage = GetACP(); + printf("# ACP codepage: %u\n\n", CodePage); + + /* + ** Iterate through the INSTALLED codepages on this system + */ + printf("# INSTALLED CODEPAGES\n"); + EnumSystemCodePages(PrintStuff, CP_INSTALLED); + } + + return 0; +} Index: snort/contrib/mysql.php3 diff -u /dev/null snort/contrib/mysql.php3:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/mysql.php3 Thu Jul 24 02:50:58 2003 @@ -0,0 +1,282 @@ + + + + Snort Statistics On-Line + + + + +

Snort Statistics On-Line

+ + + +

Summary

+\n + Timestamp begins at: $row[1]
\n + Timestamp ends at: $row[2]
\n + Total signatures: $tot_sig
\n + Total Destination IP observed: $tot_dip
\n + Total Source IP observed: $tot_sip
\n"; + } + else { + print "Nothing Here\n"; + } + mysql_free_result($Result); + mysql_free_result($Result2); + mysql_free_result($Result3); + mysql_free_result($Result4); +?> +
+

Table Of Contents

+ +
+ + + + +\n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + mysql_free_result($Result); +?> +
10 most recent TCP probe reports
TimestampSource IPSource PortDest PortSignature$row[1]$row[2].$row[3].$row[4].$row[5]$row[6]$row[7]$row[0]
Nothing there!
+Top +
+ + + + +\n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + mysql_free_result($Result); +?> +
10 most recent UDP probe reports
TimestampSource IPSource PortDest PortSignature$row[1]$row[2].$row[3].$row[4].$row[5]$row[6]$row[7]$row[0]
Nothing there!
+Top +
+ + + + +\n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + mysql_free_result($Result); +?> +
10 most recent ICMP probe reports
TimestampSource IPTypeCodeSignature$row[1]$row[2].$row[3].$row[4].$row[5]$row[6]$row[7]$row[0]
Nothing there!
+Top +
+ + + + +\n + \n + "; + } + } + else { + print "\n"; + } + mysql_free_result($Result); +?> +
# of Reports on each signature
NumbersSignatureLatest Timestamp
$row[1]$row[0]$row[2]
Nothing there!
+Top +
+ + + + +\n + \n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + mysql_free_result($Result); +?> +
From the same source IP with the same signature
ReportsSource IPSignatureFrequencyFirst TimestampLatest Timestamp
$row[4]$row[0].$row[1].$row[2].$row[3]$row[5]Once every $freq seconds$row[7]$row[6]
Nothing there!
+Top +
+ + + + + +\n + \n + \n + \n + \n + \n"; + } +?> +
SCANS to the specified IP (not disclosed here)
Reportsstarted atsource IPlast recorded timestampSignatureFrequency
$row[7]$row[1]$row[3].$row[4].$row[5].$row[6]$row[2]$row[0]Once every $freq seconds\n"; + } + } + else { + print "
Nothing there!
+Top + + +
+
Yen-Ming Chen
+ + +Last modified: $Date: 2000/08/07 02:42:53 $ + + + Index: snort/contrib/passiveOS.tar.gz Index: snort/contrib/perfstats.c diff -u /dev/null snort/contrib/perfstats.c:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/perfstats.c Sat Mar 12 01:51:10 2005 @@ -0,0 +1,443 @@ +/* +* perfstats.c +* +* Utility to read and format the 'perfmon' preprocessor 'file' output. Displays +* the csv stats to the console in a simple format. +* +* usage: ./perfstats -q < perf.log <-- displays a summary/average of the stats +* tail -f perf.log | ./perfstats <-- displays the stats info as added to perf.log +* +* Copyright (C) 2002 Sourcefire, Inc. +* +*/ +#include +#include +#include +#include + +int compatable=0; +int cpu_cnt=1; + +enum { + MODE_STATS, + MODE_SRV, +}; + +int quiet = 0; +int mode = MODE_STATS; /* 0-stats, 1-server */ +unsigned nmax = 0xffffffff; + +typedef struct _data +{ + time_t time; + double drop; + double mbits; + double alerts; + double kpkts; + double avgbytes; + double patmatch; + + double syns; + double synacks; + double new; + double del; + double active; + double highwater; + double flushes; + double faults; + double timeouts; + double frag_completes; + double frag_inserts; + double frag_deletes; + double frag_flushes; + double frag_timeouts; + double frag_faults; + + double user1,sys1,idle1; + double user2,sys2,idle2; + +} DATA; + +void printstats( DATA * p) +{ + printf(" Mbits/Sec: %g\n",p->mbits); + printf(" Drop Rate: %g%%\n",p->drop); + printf(" Alerts/Sec: %g\n",p->alerts); + printf(" K-Pkts/Sec: %g\n",p->kpkts); + printf(" Avg Bytes/Pkt: %g\n",p->avgbytes); + printf(" Pat-Matched: %g%%\n",p->patmatch); + printf(" Syns/Sec: %g\n",p->syns); + printf(" SynAcks/Sec: %g\n",p->synacks); + printf(" New/Sec: %g\n",p->new); + printf(" Del/Sec: %g\n",p->del); + printf(" Active: %g\n",p->active); + printf(" Max Active: %g\n",p->highwater); + +if(!compatable ) +{ + printf(" Flushes/Sec: %g\n",p->flushes); + printf(" Faults/Sec: %g\n",p->faults); + printf(" Timeouts: %g\n",p->timeouts); + + printf("Frag-Completes/Sec: %g\n",p->frag_completes); + printf(" Frag-Inserts/Sec: %g\n",p->frag_inserts); + printf(" Frag-Deletes/Sec: %g\n",p->frag_deletes); + printf(" Frag-Flushes/Sec: %g\n",p->frag_flushes); + printf(" Frag-Timeouts: %g\n",p->frag_timeouts); + printf(" Frag-Faults: %g\n",p->frag_faults); +} + +if( cpu_cnt == 2 ) +{ + printf(" Usr1: %g%%\n",p->user1); + printf(" Sys1: %g%%\n",p->sys1); + printf(" Idle1: %g%%\n",p->idle1); + printf(" Usr2: %g%%\n",p->user2); + printf(" Sys2: %g%%\n",p->sys2); + printf(" Idle2: %g%%\n",p->idle2); +}else{ + printf(" Usr: %g%%\n",p->user1); + printf(" Sys: %g%%\n",p->sys1); + printf(" Idle: %g%%\n",p->idle1); +} + printf("\n"); +} + +/* avg, min, max */ +void printstatsex( DATA * p, DATA * q,DATA * r) +{ + printf(" Mbits/Sec: %9.1f %9.1f %9.1f\n", p->mbits,q->mbits,r->mbits); + printf(" Drop Rate: %8.4f%% %8.4f%% %8.4f%%\n", p->drop,q->drop,r->drop); + printf(" Alerts/Sec: %9.1f %9.1f %9.1f\n", p->alerts,q->alerts,r->alerts); + printf(" K-Pkts/Sec: %9.1f %9.1f %9.1f\n", p->kpkts,q->kpkts,r->kpkts); + printf(" Avg Bytes/Pkt: %9.1f %9.1f %9.1f\n", p->avgbytes,q->avgbytes,r->avgbytes); + printf(" Pat-Matched: %9.1f %9.1f %9.1f\n", p->patmatch,q->patmatch,r->patmatch); + printf(" Syns/Sec: %9.1f %9.1f %9.1f\n", p->syns,q->syns,r->syns); + printf(" SynAcks/Sec: %9.1f %9.1f %9.1f\n", p->synacks,q->synacks,r->synacks); + printf(" New/Sec: %9.1f %9.1f %9.1f\n", p->new,q->new,r->new); + printf(" Del/Sec: %9.1f %9.1f %9.1f\n", p->del,q->del,r->del); + printf(" Active: %9.1f\n", p->active); + printf(" Max Active: %9.1f\n", p->highwater); + +if(!compatable ) +{ + printf(" Flushes/Sec: %9.1f %9.1f %9.1f\n",p->flushes,q->flushes,r->flushes); + printf(" Faults: %9.1f \n",p->faults);//,q->faults,r->faults); + printf(" Timeouts: %9.1f \n",p->timeouts); + + printf("Frag-Completes/Sec: %9.1f %9.1f %9.1f\n",p->frag_completes,q->frag_completes,r->frag_completes); + printf(" Frag-Inserts/Sec: %9.1f %9.1f %9.1f\n",p->frag_inserts,q->frag_inserts,r->frag_inserts); + printf(" Frag-Deletes/Sec: %9.1f %9.1f %9.1f\n",p->frag_deletes,q->frag_deletes,r->frag_deletes); + printf(" Frag-Flushes/Sec: %9.1f %9.1f %9.1f\n",p->frag_flushes,q->frag_flushes,r->frag_flushes); + printf(" Frag-Timeouts: %9.1f\n",p->frag_timeouts); + printf(" Frag-Faults: %9.1f\n",p->frag_faults); +} + + +if( cpu_cnt == 2 ) +{ + printf(" Usr1: %9.1f %9.1f %9.1f\n", p->user1,q->user1,r->user1); + printf(" Sys1: %9.1f %9.1f %9.1f\n", p->sys1, q->sys1, r->sys1); + printf(" Idle1: %9.1f %9.1f %9.1f\n", p->idle1,q->idle1,r->idle1); + printf(" Usr2: %9.1f %9.1f %9.1f\n", p->user2,q->user2,r->user2); + printf(" Sys2: %9.1f %9.1f %9.1f\n", p->sys2, q->sys2, r->sys2); + printf(" Idle2: %9.1f %9.1f %9.1f\n", p->idle2,q->idle2,r->idle2); +}else{ + printf(" Usr: %9.1f %9.1f %9.1f\n", p->user1,q->user1,r->user1); + printf(" Sys: %9.1f %9.1f %9.1f\n", p->sys1, q->sys1, r->sys1); + printf(" Idle: %9.1f %9.1f %9.1f\n", p->idle1,q->idle1,r->idle1); +} + printf("\n"); +} + + +#define SETMIN(a,b) if((a)<(b))(b)=(a); +#define SETMAX(a,b) if((a)>(b))(b)=(a); + +void setdata( DATA * q, double val ) +{ + q->drop = val; + q->mbits = val; + q->alerts = val; + q->kpkts = val; + q->avgbytes = val; + q->patmatch = val; + q->syns = val; + q->synacks = val; + q->new = val; + q->del = val; + q->active = val; + + q->flushes = val; + q->faults = val; + q->timeouts = val; + q->frag_completes= val; + q->frag_inserts = val; + q->frag_deletes = val; + q->frag_flushes = val; + q->frag_timeouts = val; + q->frag_faults = val; + + q->user1 = val; + q->sys1 = val; + q->idle1 = val; + + q->user2 = val; + q->sys2 = val; + q->idle2 = val; +} + +void accumdata( DATA * q, DATA * p ) +{ + q->drop += p->drop; + q->mbits += p->mbits; + q->alerts += p->alerts; + q->kpkts += p->kpkts; + q->avgbytes += p->avgbytes; + q->patmatch+= p->patmatch; + q->syns += p->syns; + q->synacks += p->synacks; + q->new += p->new; + q->del += p->del; + q->active += p->active; + + if( p->highwater > q->highwater) + q->highwater += p->highwater; + + q->flushes += p->flushes; + q->faults += p->faults; + q->timeouts += p->timeouts; + q->frag_completes+= p->frag_completes; + q->frag_inserts += p->frag_inserts; + q->frag_deletes += p->frag_deletes; + q->frag_flushes += p->frag_flushes; + q->frag_timeouts += p->frag_timeouts; + q->frag_faults += p->frag_faults; + + q->user1 += p->user1; + q->sys1 += p->sys1; + q->idle1 += p->idle1; + + q->user2 += p->user2; + q->sys2 += p->sys2; + q->idle2 += p->idle2; +} + +void avgdata( DATA * q, int cnt ) +{ + q->drop /= cnt; + q->mbits /= cnt; + q->alerts /= cnt; + q->kpkts /= cnt; + q->avgbytes /= cnt; + q->patmatch /= cnt; + q->syns /= cnt; + q->synacks /= cnt; + q->new /= cnt; + q->del /= cnt; + q->active /= cnt; + + q->flushes /= cnt; + q->faults /= cnt; + q->timeouts /= cnt; + q->frag_completes/= cnt; + q->frag_inserts /= cnt; + q->frag_deletes /= cnt; + q->frag_flushes /= cnt; + q->frag_timeouts /= cnt; + q->frag_faults /= cnt; + + q->user1 /= cnt; + q->sys1 /= cnt; + q->idle1 /= cnt; + + q->user2 /= cnt; + q->sys2 /= cnt; + q->idle2 /= cnt; +} + +void setdataminmax(DATA *p, DATA * qmin, DATA * qmax) +{ + SETMAX(p->drop,qmax->drop); SETMIN(p->drop,qmin->drop); + SETMAX(p->mbits,qmax->mbits); SETMIN(p->drop,qmin->mbits); + SETMAX(p->alerts,qmax->alerts); SETMIN(p->drop,qmin->alerts); + SETMAX(p->kpkts,qmax->kpkts); SETMIN(p->kpkts,qmin->kpkts); + SETMAX(p->avgbytes,qmax->avgbytes); SETMIN(p->avgbytes,qmin->avgbytes); + SETMAX(p->patmatch,qmax->patmatch); SETMIN(p->patmatch,qmin->patmatch); + SETMAX(p->syns,qmax->syns); SETMIN(p->syns,qmin->syns); + SETMAX(p->synacks,qmax->synacks); SETMIN(p->synacks,qmin->synacks); + SETMAX(p->new,qmax->new); SETMIN(p->new,qmin->new); + SETMAX(p->del,qmax->del); SETMIN(p->del,qmin->del); + SETMAX(p->active,qmax->active); SETMIN(p->active,qmin->active); + + SETMAX(p->flushes,qmax->flushes); SETMIN(p->flushes,qmin->flushes); + SETMAX(p->faults,qmax->faults); SETMIN(p->faults,qmin->faults); + SETMAX(p->timeouts,qmax->timeouts); SETMIN(p->flushes,qmin->flushes); + + SETMAX(p->frag_completes,qmax->frag_completes); SETMIN(p->frag_completes,qmin->frag_completes); + SETMAX(p->frag_inserts,qmax->frag_inserts); SETMIN(p->frag_inserts,qmin->frag_inserts); + SETMAX(p->frag_deletes,qmax->frag_deletes); SETMIN(p->frag_deletes,qmin->frag_deletes); + SETMAX(p->frag_flushes,qmax->frag_flushes); SETMIN(p->frag_flushes,qmin->frag_flushes); + SETMAX(p->frag_timeouts,qmax->frag_timeouts); SETMIN(p->frag_timeouts,qmin->frag_timeouts); + SETMAX(p->frag_faults,qmax->frag_faults); SETMIN(p->frag_faults,qmin->frag_faults); + + SETMAX(p->user1,qmax->user1); SETMIN(p->user1,qmin->user1); + SETMAX(p->sys1,qmax->sys1); SETMIN(p->sys1,qmin->sys1); + SETMAX(p->idle1,qmax->idle1); SETMIN(p->idle1,qmin->idle1); + + SETMAX(p->user2,qmax->user2); SETMIN(p->user2,qmin->user2); + SETMAX(p->sys2,qmax->sys2); SETMIN(p->sys2,qmin->sys2); + SETMAX(p->idle2,qmax->idle2); SETMIN(p->idle2,qmin->idle2); +} + +int parsedata( DATA * p, char * t ) +{ + p->time = atoi(t); + + t = strtok( 0," ,\n"); if(!t)return 1; p->drop = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->mbits = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->alerts = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->kpkts = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->avgbytes = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->patmatch = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->syns = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->synacks = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->new = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->del = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->active = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->highwater = atof(t); + +if(!compatable ) +{ + t = strtok( 0," ,\n"); if(!t)return 1; p->flushes = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->faults = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->timeouts= atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->frag_completes = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->frag_inserts = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->frag_deletes = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->frag_flushes = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->frag_timeouts = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->frag_faults = atof(t); +} + + t = strtok( 0," ,\n"); if(!t)return 1; p->user1 = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->sys1 = atof(t); + t = strtok( 0," ,\n"); if(!t)return 1; p->idle1 = atof(t); + + + t = strtok( 0," ,\n"); if(!t)return 0; p->user2 = atof(t); + t = strtok( 0," ,\n"); if(!t)return 0; p->sys2 = atof(t); + t = strtok( 0," ,\n"); if(!t)return 0; { p->idle2 = atof(t); cpu_cnt=2; } + + + return 0; +} + +int do_stats() +{ + char buff[8192], *t; + DATA d1, *p = &d1; + DATA d2, *q = &d2; + DATA d3, *qmin = &d3; + DATA d4, *qmax = &d4; + int cnt = 0; + unsigned n = 0; + + memset(p,0,sizeof(DATA)); + memset(q,0,sizeof(DATA)); + + setdata( qmin, 1.e+22 ); + setdata( qmax, -1.e+22 ); + + while( (n < nmax) && fgets(buff,sizeof(buff),stdin) ) + { + t = strtok( buff, " ,\n"); + if( !t ) continue; + if( *t == '#' ) continue; + + n++; + + if( parsedata(p,t) ) + break; + + /* Get Min-Max Values */ + setdataminmax(p,qmin,qmax); + + /* Accumulate for Averaging */ + accumdata( q, p ); + + if( !quiet ) + { + printf("%s",ctime(&p->time)); + printstats( p ); + } + + cnt++; + } + + if( !n ){ + printf("*** no performance records found, invalid file or file may be empty\n"); + return 0; + } + + /* Calc Average */ + avgdata( q, cnt ); + + printf("%d statistics lines read\n\n",cnt); + + printstatsex( q, qmin, qmax ); + + return 0; +} + + +int do_srv() +{ + return 0; +} + + +void help() +{ + printf("\n"); + printf("usage: perfstats [-q(uiet)] [-n(lines) #] [-c(ompatable mode)]\n"); + printf(" - q only does a summary/avg\n"); + printf(" - n number of lines to process from a file\n"); + printf(" - c (compatability with older versions)\n"); + printf(" notes: you must pass text data via stdin\n"); + printf("\n"); + exit(0); +} + + +int init ( int argc, char ** argv ) +{ + int i; + for(i=1;i + + + Snort Statistics On-Line + + + + +

Snort Statistics On-Line

+ + + +

Summary

+\n + Timestamp begins at: $row[1]
\n + Timestamp ends at: $row[2]
\n + Total signatures: $tot_sig
\n + Total Destination IP observed: $tot_dip
\n + Total Source IP observed: $tot_sip
\n"; + } + else { + print "Nothing Here\n"; + } + pg_freeresult($Result); + pg_freeresult($Result2); + pg_freeresult($Result3); + pg_freeresult($Result4); +?> +
+

Table Of Contents

+ +
+ + + + +\n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + pg_freeresult($Result); +?> +
10 most recent TCP probe reports
TimestampSource IPSource PortDest PortSignature$row[1]$row[2].$row[3].$row[4].$row[5]$row[6]$row[7]$row[0]
Nothing there!
+Top +
+ + + + +\n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + pg_freeresult($Result); +?> +
10 most recent UDP probe reports
TimestampSource IPSource PortDest PortSignature$row[1]$row[2].$row[3].$row[4].$row[5]$row[6]$row[7]$row[0]
Nothing there!
+Top +
+ + + + +\n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + pg_freeresult($Result); +?> +
10 most recent ICMP probe reports
TimestampSource IPTypeCodeSignature$row[1]$row[2].$row[3].$row[4].$row[5]$row[6]$row[7]$row[0]
Nothing there!
+Top +
+ + + + +\n + \n + "; + } + } + else { + print "\n"; + } + pg_freeresult($Result); +?> +
# of Reports on each signature
NumbersSignatureLatest Timestamp
$row[1]$row[0]$row[2]
Nothing there!
+Top +
+ + + + +\n + \n + \n + \n + \n + \n"; + } + } + else { + print "\n"; + } + pg_freeresult($Result); +?> +
From the same source IP with the same signature
ReportsSource IPSignatureFrequencyFirst TimestampLatest Timestamp
$row[4]$row[0].$row[1].$row[2].$row[3]$row[5]Once every $freq seconds$row[7]$row[6]
Nothing there!
+Top +
+ + + + + +\n + \n + \n + \n + \n + \n"; + } + +?> +
SCANS to the specified IP (xanadu.rem.cmu.edu)
Reportsstarted atsource IPlast recorded timestampSignatureFrequency
$row[7]$row[1]$row[3].$row[4].$row[5].$row[6]$row[2]$row[0]Once every $freq seconds\n"; + } + } + else { + print "
Nothing there!
+Top + +
+
Yen-Ming Chen
+ + +Last modified: $Date: 2000/08/07 02:42:53 $ + + + Index: snort/contrib/regen-sidmap diff -u /dev/null snort/contrib/regen-sidmap:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/regen-sidmap Thu Jul 24 02:50:58 2003 @@ -0,0 +1,64 @@ +#!/usr/bin/perl +# $Id: regen-sidmap,v 1.1 2001/10/04 15:02:13 cazz Exp $ +# Copyright (C) 2001 Brian Caswell +# regen-sidmap +# +# Regenerate the sig-msg.map. +# +# NOTE: This does not handle multi line signatures. +# +# USAGE: +# for i in *.rules ; do sid-ref.map $i; done + +### CONFIGURATION +# Where are your snort rules held? +# (CWD by default) + +my $DIR = "./"; + +# Where is your sid-msg.map? +my $SIDREF= "/tmp/sid-msg.map"; +### END OF CONFIGURATION + + +if (($ARGS[0])) +{ + print "USAGE: regen-sidmap []\n"; + exit 0; +} + +if ($ARGS[1]) { $DIR = $ARGS[1]; } + +my $sid; + +open RULES, "$ARGV[0]"; +open REFS, ">>$SIDREF"; + +while () +{ + my $rule = $_; + $rule =~ s/\n$//; + if ($rule !~ /^#/) + { + if ($rule =~ /sid:\s*(\d+);/) + { + my $sid = $1; + + my $msg; + if ($rule =~ /msg\s*:\s*"((?:(?<=\\)"|[^"])*)"\s*;/) { + $msg = $1; + } + + my $ref = $rule; + my @refs; + while ($ref =~ s/(.*)reference\s*:\s*([^\;]+)(.*)$/$1 $3/) + { + push (@refs,$2); + } + print REFS "$sid || $msg"; + foreach (@refs) { print REFS " || $_"; } + print REFS "\n"; + } + } +} +close RULES; Index: snort/contrib/sid-add diff -u /dev/null snort/contrib/sid-add:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/sid-add Thu Jul 24 02:50:58 2003 @@ -0,0 +1,93 @@ +#!/usr/bin/perl +# $Id: sid-add,v 1.3 2001/08/21 17:56:39 cazz Exp $ +# Copyright (C) 2001 Brian Caswell +# +# sid-add - Add SIDs and Revision to any rule that does not have an SID. +# NOTE: This does not handle multi-line rules yet. +# NOTE: This is very ugly code but it works. Feel free to rewrite it +if (($ARGS[0])) +{ + print "USAGE: sid-add []\n"; + exit 0; +} + +if ($ARGS[1]) { $DIR = $ARGS[1]; } + +### CONFIGURATION +# Where are your snort rules held? +# (CWD by default) +my $DIR = "./"; + +# Where is your latest SID? (Personal rules start at 1000000) +my $SID = "$DIR/personal-sid"; + +# Where is your sid-msg.map? +my $SIDMAP = "$DIR/sid-msg.map"; +### END OF CONFIGURATION + + + +open MSG, ">>$SIDMAP"; + +open SID, "<$SID"; +while ($line = ) +{ + if ($line =~ /^\d+$/) + { + $sid = $line; + } +} +close SID; +chomp($sid); + +if ($sid < 1000000) { $sid = 1000000; } + + +open RULES, "$ARGV[0]"; + +while () +{ + $rule = $_; + $rule =~ s/\n$//; + if ($rule !~ /^#/) + { + if ($rule !~ /sid:\d+;/) + { + if ($rule =~ /\(.*\)$/) + { + $rule =~ s/(.*)\s+$/$1/; + $rule =~ s/ (msg:\")/$1/; + $rule =~ s/msg: \"/msg:\"/; + $msg = $rule; + $msg =~ /.*msg:\"([^"]+)/; + $msg = $1; + $ref = $rule; + my @refs; + while ($ref =~ s/(.*)reference:([^\;]+)(.*)$/$1 $3/) + { + push (@refs,$2); + } + + $sid++; + if ($msg) + { + print MSG "$sid || $msg"; + foreach (@refs) { print MSG " || $_"; } + print MSG "\n"; + } + $rule =~ s/(.*)\)$/$1 sid:$sid; rev:1;\)/; + } + } + } + push (@rules,$rule); +} +close RULES; + +open RULES,">$ARGV[0]"; +foreach (@rules) +{ + print RULES "$_\n"; +} + +open SID,">$SID"; +print SID "# \$Id\$\n$sid\n"; Index: snort/contrib/snort-sort.pl diff -u /dev/null snort/contrib/snort-sort.pl:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/snort-sort.pl Thu Jul 24 02:50:58 2003 @@ -0,0 +1,166 @@ +#!/usr/bin/perl +# +# Filename: snort-sort +# Author: Andrew R. Baker +# Modified: 2000.03.06 +# Purpose: this script produces a sorted list of snort alerts +# from a snort alert file +# Version: 0.02 +# +# let me know if you like this and use it -Andrew +# +# Todo: 1) Allow processing of snort alerts from syslog +# 2) Make html output optional +# +# Change History: +# +# 2000.03.07 reverse DNS lookup +# derived from snort_stat.pl +# and code donated by Adam Olson +# whois link option +# derived from code donated by Adam Olson +# +# 2000.03.06 Original script +# +# +# Options: +# -r do reverse DNS lookups (this can slow things down) +# -h produce html output (hardwired) +# -w include links to do whois queries on IP addresses +# (implies -h) +use Getopt::Std; +use Socket; + + +if($ARGV[0] eq undef) +{ + print STDERR "USAGE: snort-sort \n"; + exit; +} + +getopts('rhw'); +$opt_h = 1; +if($opt_w) { + $opt_h = 1; +} + +# set the whois query href +$whois_href = "http://www.arin.net/cgi-bin/whois.pl?queryinput="; + + +open(INFILE,"< $ARGV[0]") || die "Unable to open file $ARGV[0]\n"; + +if($opt_h) { + print "\n"; + print "\n"; + print "Sorted Snort Alerts\n"; + print "\n"; + print "\n"; + print "

Sorted Snort Alerts


\n"; +} else { + #plain old text output goes here +} + +while() { + chomp(); + # if the line is blank, go to the next one + if ( $_ eq "" ) { next } + # is this line an alert message + unless ( $_ =~ /^\[\*\*\]/ ) { + print STDERR "Warning, file may be corrupt.\n"; + next + } + $a = ; + chomp($a); + unless ( $a eq "" ) { + # strip off the [**] from either end. + s/(\s)*\[\*\*\](\s)*//g; + push @{ $alerts{$_} }, $a; + } else { + print STDERR "Warning, file may be incomplete\n"; + } +} +close(LOG); + +if($opt_h) { + # print out the relative html links to each entry + foreach $key (keys (%alerts)) { + $anchor = $key; + $anchor =~ s/ /_/g; + print "$key
\n"; + } +} + +foreach $key (keys (%alerts)) { + $anchor = $key; + $anchor =~ s/ /_/g; + if($opt_h) { + print "
\n"; + print "

$key

\n"; + print "
    \n"; + } else { + #plain text output goes here + } + @list = @{$alerts{$key}}; + $size = @list; + for ( $i = 0 ; $i < $size ; $i++ ) { + $a = $list[$i]; + ($datentime,$src,$arrow,$dest) = split(' ',"$list[$i]"); + ($saddr,$sport) = split(/:/,"$src"); + ($daddr,$dport) = split(/:/,"$dest"); + # reverse DNS lookups + if($opt_r) { + $shost = resolve($saddr); + $dhost = resolve($daddr); + } else { + $shost = $saddr; + $dhost = $daddr; + } + if($opt_w) { + # if saddr did not resolve (or we did not try to resolve it) + if(($shost eq $saddr)) { + $shost = "$saddr"; + } + # same thing for daddr + if(($dhost eq $daddr)) { + $dhost = "$daddr"; + } + } + if($opt_h) { + print "
  • $datentime $shost:$sport $arrow $dhost:$dport
  • \n"; + } else { + #plain text output goes here + } + } + if($opt_h) { + print "
\n"; + } else { + #plain text output goes here + } +} +if($opt_h) { + print "\n"; +} else { + #plain text output goes here +} + +# +# the following code was taken from snort_stat.pl +# +# resolve host name and cache it +# contributed by: Angelos Karageorgiou, +# edited by: $Author: roesch $ +# +sub resolve { + local $mname, $miaddr, $mhost = shift; + $miaddr = inet_aton($mhost); + # print "$mhost\n"; + if (!$HOSTS{$mhost}) { + $mname = gethostbyaddr($miaddr, AF_INET); + if ($mname =~ /^$/) { + $mname = $mhost; + } + $HOSTS{$mhost} = $mname; + } + return $HOSTS{$mhost}; +} Index: snort/contrib/snort2html.pl diff -u /dev/null snort/contrib/snort2html.pl:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/snort2html.pl Thu Jul 24 01:55:04 2003 @@ -0,0 +1,166 @@ +#!/usr/bin/perl -w +# +# Snort2HTML 1.1 by Dan Swan, March 13, 00. +# Special thanks to Martin Roesch for writing a friendly, kickass NIDS, +# and to Max Vision for the use of his attack signatures database. +# +# Distribute and modify freely, but give credit where credit is due! +# +# If you appreciate this product, and would like to give something back, send +# me the url to your snort logs. The information will be seen by nobody +# but myself, and will not be used for malicious purposes. +# +# INSTALLATION: Place this file in /usr/local/bin. To update webpage regularly, +# paste the following quoted text into /etc/cron.hourly/snortupdate: +# "/usr/local/bin/snort2html", and make sure both files are executable. +# +# Also, snort MUST be run with -s option for this program to work. +# +# WARNING: You should consider placing this file into a password protected directory +# on your web server, or simply not putting a link on your default page. +# After all, do you really want strangers to be able to tell what shows up +# (and what doesn't show up) in your logs? + +# TODO: -Display service on Target port +# -More color coding of source port (suggestions welcome!) +# -A cgi wrapper to update page when accessed. +# -Dynamic sorting by clicking on column header. +# -Command line flags to control formatting + +# NOTE: I am interested in any suggestions on improving the code, features +# you'd like to see, or tips on making the output more lynx-freindly. +# Please send them to swan_daniel@hotmail.com +# +# CHANGES: +# +# 1.1 +# - Changed to , fixed perms on outputfile, other minor cosmetic +# changes as suggested by Ralf Hildebrandt. +# - Fixed problem parsing ICMP alerts, optimized code for speed (~10% gain) +# using patch provided by Nico Erfuth. +# + +use Socket; +use POSIX qw(strftime); +use Sys::Hostname; + +$logfile="/var/log/secure"; # Change this variable to specify different logfile +$hostname=hostname(); +$outputfile="/home/httpd/html/snort2html.html"; # HTML file the log will be outputted to +$MASQHOST=0; +$time = strftime "%b %d at %H:%M", localtime; + +############################## +# Main # +############################## + +&generatehtmlheader; # Call funtion to generate HTML header + +open(LOG,"$logfile") || die "Unable to open $logfile"; +my @log = ; # Read whole file into big array +close LOG; +chomp @log; +foreach (@log) { + if ( ! /.*snort*/ ) # If it ain't got the word snort in it... + { + next ; # ...get me another line. + } + +/(.*\s[1-9]*)(\d+\s)(..:..:..\s)(.*:\s)(.*:\s)(.*\d\s)(.*\s)(.*)/; # Pattern matching against each line read from logfile + +# Variables extracted from pattern matching above. +$month=$1; +$day=$2; +$timeofday=$3; +$hour=$3; +$attack=$5; +$sourceip=$6; +$sourceport=$6; +$targetip=$8; +$targetport=$8; + +# Get rid of unwanted characters +$attack=~s/://; +$sourceip=~ s/:.*//; +$hour=~ s/:.*//; +if (!($sourceport =~ s/.*://)) {$sourceport = "-N/A-"}; +$sourcehost=gethostbyaddr(inet_aton($sourceip), AF_INET); +$targetip=~ s/:.*//; +if (!($targetport =~ s/.*://)) {$targetport = "-N/A-"}; +$targethost=gethostbyaddr(inet_aton($targetip), AF_INET); +$searchattack=$attack; +$searchattack=~ s/\s/+/g; +chop $searchattack; + +&timecolor; +&generatehtmlbody # Generate body of HTML from data read from snortlog + } + +&generatehtmlfooter; # Generate footer of HTML + +chmod (0644, $outputfile); # Ensure that output file is world readable + + +############################################################# +####################Subroutines############################## +############################################################# + +sub generatehtmlheader { #Deletes old HTML file, creates new ones, and writes headings. + unlink $outputfile; + open (HTML, ">$outputfile"); + print HTML "\n"; + print HTML "\n"; + print HTML "Hot dog! Jumping frog! Its an html2snort log! \n"; + print HTML "\n"; + print HTML "\n"; + print HTML "

Snort log for $hostname

\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + } + +sub timecolor { # Color code time of day according to daytime, evening, and nighttime. + my $result = int($hour/6); + if ($result == 0) {$hourcolor = "#000000"; } + elsif ($result < 3) {$hourcolor = "#EEEE00"; } + else {$hourcolor = "#FFCC00"; }; + } + +sub generatehtmlbody { # Writes fields to html file. + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + if (($sourceport ne "-N/A-") && ($sourceport>61000) && ($sourceport<65096)) { + $sourceportcolor="#006600"; + $MASQHOST=1; + } + else {$sourceportcolor="#000000";} + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + print HTML "\n"; + } +sub generatehtmlfooter { # Writes end of HTML tags, and closes filehandle. + print HTML "
DateTimeAttackSource HostSource PortTarget HostTarget Port
$month $day$timeofday \;$attack \;", $sourcehost || $sourceip, " \;$sourceport \;", $targethost || $targetip, " \;$targetport
\n"; + if ( $MASQHOST ne "0" ) # Need to include masqsourceport explanation at end?? + { + print HTML " +
DS=Possible masquerading host.
\n"; + } + print HTML "

\n"; + print HTML "This page generated from snort + logs on $time using snort2html by Dan Swan.
\n"; + print HTML "\n"; + print HTML "\n"; + close (HTML); + } + Index: snort/contrib/snort_stat.pl diff -u /dev/null snort/contrib/snort_stat.pl:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/snort_stat.pl Thu Jul 24 02:50:58 2003 @@ -0,0 +1,532 @@ +#!/usr/bin/perl +# +# $Id: snort_stat.pl,v 1.4 2002/03/20 14:53:35 cazz Exp $ +# $Revision: 1.4 $ +# +# snort_stat.pl is a perl script trying to generate statistical data from every +# day snort log file. +# +# USAGE: cat | snort_stat.pl -r -f -h -t n +# -d: debug +# -r: resolve IP address to domain name +# -f: use fixed rather than variable width columns +# -h: produce html output +# -t: threshold +# +# or put it in the root's crontab file: +#59 10 * * * root cat /var/log/authlog | /etc/snort_stat.pl | sendmail root +# +# $Author: cazz $ +# Yen-Ming Chen, +# $Date: 2002/03/20 14:53:35 $ +# + +use Getopt::Std; # use Getopt for options +use Socket; # use socket for resolving domain name from IP +use vars qw($opt_r $opt_f $opt_d $opt_h $opt_t); +%HOSTS = (); # Hash for IP <-> domain name mapping + +getopts('drfht:') || die "Could not getopts"; # get options in command line +$saddr_len = 15; +$daddr_len = 15; +$timeout = 3; # for name resolver +$th = $opt_t || 0; # default threshold + +# process whatever comes in +while (<>) { + my $alert = {}; + chomp; + # if the line is blank, go to the next one + next if $_ eq ""; + # is this line an alert message + if ( $_ =~ /^\[\*\*\]/ ) { + $line = <>; + chomp($line); + unless ( $line eq "" ) { + # strip off the [**] from either end. + s/\s*\[\*\*\]\s*//og; + s/\s*\[[0-9:]+\]\s*//o; + if ($_ =~ /^spp_anomsensor\:[\D]+\:\s([\d\.]+)/ox) { + $alert->{PLUGIN} = "anomsensor"; $alert->{TYPE} = "plugin"; + $alert->{SIG} = $alert->{PLUGIN}; + } elsif ($_ =~ /^spp_portscan\:\sEnd\sof\sportscan\sfrom\s([\d\.]+)/ox) { + $alert->{PLUGIN} = "portscan"; $alert->{TYPE} = "plugin"; + $alert->{SADDR} = $1; $alert->{SIG} = $alert->{PLUGIN}; + process_data($alert); $lastwassnort = 1; next; + } elsif ( $_ =~ /^spp_stream4\:\s(.+)/o ) { + $alert->{SIG} = $1; $alert->{TYPE} = "alert"; + $alert->{PLUGIN} = "stream"; + } elsif ( $_ =~ /[^:]/ox) { + $alert->{SIG} = $_; $alert->{TYPE} = "alert"; + } + if ( $line =~ m/^\[Classification\:([^\]]*)\]\s + \[Priority\:\s(\d+)\]/ox) { + $alert->{CLASS} = $1; $alert->{CONTENT} = $2; $alert->{PRIORITY} = $3; + $line=<>; + } + if ( $line =~ m/^(\d+)\/(\d+)\-(\d+)\:(\d+)\:(\d+)\.(\d+)\s + ([\d\.]+)[\:]*([\d]*)\s[\-\>]+\s([\d\.]+)[\:]*([\d]*)/ox) { + $alert->{MON} = $1; $alert->{DAY} = $2; $alert->{HOUR} = $3; + $alert->{MIN} = $4; $alert->{SEC} = $5; $alert->{SADDR} = $7; + $alert->{SPORT} = $8; $alert->{DADDR} = $9; $alert->{DPORT} = $10; + $alert->{HOST} = "localhost"; + process_data($alert); $lastwassnort = 1; next; + } + } else { + print STDERR "Warning, file may be incomplete\n"; + next; + } + } + # This is syslog format + if ($_ =~ m/^(\w{3}) \s+ (\d+) \s (\d+)\:(\d+)\:(\d+)\s + (\S+?)\ssnort[\[\d+\]]*\:\s+(.+)/ox + || m/^(\d+)\/(\d+)\-(\d+)\:(\d+)\:(\d+)\.(\d+)\s(.+)/ox) + { + $alert->{MON} = $1; $alert->{DAY} = $2; $alert->{HOUR} = $3; + $alert->{MIN} = $4; $alert->{SEC} = $5; $alert->{HOST} = $6; + $alert->{SIG} = $7; + $alert->{SIG} =~ s/\s*\[[\d\:]+\]\s*//; # Get rid of [343:33:31] + $alert->{SIG} =~ s/\[\*\*\]//og; # Get rid of [**] if fast alert + if ($alert->{SIG} =~ m/spp_portscan\:\sEnd\sof\sportscan\sfrom\s + ([\d\.]+)/ox) { # portscan + $alert->{SADDR} = $1; $alert->{TYPE} = "plugin"; + $alert->{PLUGIN} = "portscan"; + process_data($alert); $lastwassnort = 1; next; + } elsif ( $alert->{SIG} =~ s/\s([\d\.]+)[\:]?([\d]*)\s[\-\>]+\s + ([\d\.]+)[\:]?([\d]*)\s*//x) { + $alert->{SADDR} = $1; $alert->{SPORT} = $2; + $alert->{DADDR} = $3; $alert->{DPORT} = $4; + if ($alert->{SIG} =~ m/spp_anomsensor\:\sAnomaly\sthreshold\s + exceeded\:\s([\d\.]+)/ox) { # spade + $alert->{THR} = $1; $alert->{TYPE} = "plugin"; + $alert->{PLUGIN} = "anomsensor"; + process_data($alert); $lastwassnort = 1; next; + } elsif ($alert->{SIG} =~ s/spp_bo\:\s//ox) { # bo + $alert->{TYPE} = "plugin"; $alert->{PLUGIN} = "bo"; + process_data($alert); $lastwassnort = 1; next; + } elsif ($alert->{SIG} =~ s/spp_stream4\:\s//ox) { # stream4 + $alert->{TYPE} = "plugin"; $alert->{PLUGIN} = "stream"; + process_data($alert); $lastwassnort = 1; next; + } else { # normal alert + if ( $alert->{SIG} =~ s/\[Classification\:([^\[|^\]]*?)\]\s* + (?:\[Priority\:\s(\d+)\])//x ) { + $alert->{CLASS} = $1; $alert->{PRIORITY} = $2; + } + $alert->{TYPE} = "sys"; $alert->{PLUGIN} = "none"; + process_data($alert); $lastwassnort = 1; next; + } + } else { + print STDERR "No source/dest IP address found! Skipped!" if $opt_d; + $alert = {}; next; + } + } + # If a snort message has been repeated several times + elsif ($lastwassnort && $_ =~ m/last message repeated (\d+) times/) { + # put the data in the matrix again for each repeat + $repeats = $1; + while ($repeats) { + push @result, $result[-1]; + $repeats--; + } + next; + } else { + $lastwassnort = 0; + next; + } # Message not related to snort +} + +# begin statistics +# I should've used $#result + 1 as $total in the first version! :( +$total = $#result + 1; + +for $i ( 0 .. $#result ) { + # for the same pair of attacker and victim with same sig + # to see the attack pattern + # used in same_attack() + $s0{"$result[$i]->[9],$result[$i]->[7],$result[$i]->[6]"}++; + # for the same pair of attacker and victim + # to see how many ways are being tried + # used in same_host_dest() + $s1{"$result[$i]->[7],$result[$i]->[9]"}++; + # from same host use same method to attack + # to see how many attacks launched from one host + # used in same_host_sig() + $s2{"$result[$i]->[6],$result[$i]->[7]"}++; + # to same victim with same method + # to see how many attacks received by one host + # used in same_dest_sig_stat() + $s3{"$result[$i]->[6],$result[$i]->[9]"}++; + # same signature + # to see the popularity of one attack method + # used in attack_distribution() + $s4{"$result[$i]->[6]"}++; + # source ip + $s5{"$result[$i]->[7]"}++; + # destination ip + $s6{"$result[$i]->[9]"}++; +} + +# begin report + +print_head(); +print_summary(); +print_menu(); +same_attack(); +same_host_dest(); +same_host_sig(); +same_dest_sig_stat(); +attack_distribution(); +if ($opt_p) { + portscan(); +} +if ($opt_n) { + anomsensor(); +} +print_footer(); + +# print the header (e.g. for mail) +sub print_head { + if ($opt_h) { + print "\n\n"; + print "Snort Statistics"; + print "\n\n"; + print "

Snort Statistics

\n"; + } else { + print "Subject: snort daily report\n\n"; + } +} + +# print the time of begin and end of the log +sub print_summary { + if ($opt_h) { + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n" if $opt_p; + print "\n" if $opt_n; + print "
The log begins at:$result[0]->[0] $result[0]->[1] $result[0]->[2]:$result[0]->[3]:$result[0]->[4]
The log ends at:$result[$#result]->[0] $result[$#result]->[1] $result[$#result]->[2]:$result[$#result]->[3]:$result[$#result]->[4]
Total events: $total
Signatures recorded: ". keys(%s4) ."
Source IP recorded: ". keys(%s5) ."
Destination IP recorded: ". keys(%s6) ."
Portscan detected: ", eval '$#posres +1',"
Anomaly detected: ", eval '$#anores +1',"
\n"; + print "
\n"; + } else { + print "The log begins from: $result[0]->[0] $result[0]->[1] $result[0]->[2]:$result[0]->[3]:$result[0]->[4]\n"; + print "The log ends at: $result[$#result]->[0] $result[$#result]->[1] $result[$#result]->[2]:$result[$#result]->[3]:$result[$#result]->[4]\n"; + print "Total events: $total\n"; + print "Signatures recorded: ". keys(%s4) ."\n"; + print "Source IP recorded: ". keys(%s5) ."\n"; + print "Destination IP recorded: ". keys(%s6) ."\n"; + print "Portscan recorded: ", eval '$#posres +1',"\n" if $opt_p; + print "Anomaly recorded: ", eval '$#anores +1',"\n" if $opt_n; + } +} + +# print menu for HTML page +sub print_menu { + if ($opt_h) { + print "
\n"; + } +} + +# to see the frequency of the attack from a certain pair of +# host and destination +sub same_attack { + if ($opt_h) { + print "

Number of attack from same host to same destination using same method

\n"; + print "\n"; + print ""; + foreach $k (sort { $s0{$b} <=> $s0{$a} } keys %s0) { + @_ = split ",",$k; + print " + \n" if $s0{$k} > $th; + } + print "
# of attacksfromtowith
$s0{$k}$_[1]$_[0]".printHref($_[2])."
Top
\n"; + } else { + section_header("The number of attacks from same host to same +destination using same method\n", "asdm"); + foreach $k (sort { $s0{$b} <=> $s0{$a} } keys %s0) { + @_ = split ",",$k; + printf(" %-2d %-${saddr_len}s %-${daddr_len}s %-20s\n", + $s0{$k},$_[1],$_[0],$_[2]) if $s0{$k} > $th; + } + } +} + +# to see the percentage and number of attacks from a host to a destination +sub same_host_dest { + if ($opt_h) { + print "

Percentage and number of attacks from a host to a destination

\n"; + print "\n"; + print "\n"; + foreach $k (sort { $s1{$b} <=> $s1{$a} } keys %s1) { + @_ = split ",",$k; + printf(" +
%# of attacksfromto
%-2.2f%-2d%-20s%-20s\n",$s1{$k}/$total*100,$s1{$k},$_[0],$_[1]) if $s1{$k} > $th; + } + print "
Top
\n"; + } else { + section_header("Percentage and number of attacks from a host to a +destination\n", "pasd"); + foreach $k (sort { $s1{$b} <=> $s1{$a} } keys %s1) { + @_ = split ",",$k; + printf("%5.2f %-2d %-${saddr_len}s %-${daddr_len}s\n", + $s1{$k}/$total*100, $s1{$k},$_[0],$_[1]) if $s1{$k} > $th; + } + } +} + +# to see how many attacks launched from one host +sub same_host_sig { + if ($opt_h) { + print "

Percentage and number of attacks from one host to any with same method

\n"; + print "\n"; + print "\n"; + foreach $k (sort { $s2{$b} <=> $s2{$a} } keys %s2) { + @_ = split ",",$k; + printf(" + \n",$s2{$k}/$total*100,$s2{$k},$_[1],&printHref($_[0])) if $s2{$k} > $th; + } + print "
%# of attacksfromtype
%-2.2f%-4d%-20s%-28s
Top
\n"; + } else { + section_header("Percentage and number of attacks from one host to any +with same method\n", "pasm"); + foreach $k (sort { $s2{$b} <=> $s2{$a} } keys %s2) { + @_ = split ",",$k; + printf("%5.2f %-4d %-${saddr_len}s %-28s\n", + $s2{$k}/$total*100, $s2{$k},$_[1],$_[0]) if $s2{$k} > $th; + } + } +} + +# to see how many attacks received by one host (destination correlated) +sub same_dest_sig_stat { + if ($opt_h) { + print "

Percentage and number of attacks to one certain host

\n"; + print "\n"; + print "\n"; + foreach $k (sort { $s3{$b} <=> $s3{$a} } keys %s3) { + @_ = split ",",$k; + printf("
%# of attackstotype
%-2.2f%-4d%-25s%-28s\n",$s3{$k}/$total*100,$s3{$k},$_[1],&printHref($_[0])) if $s3{$k} > $th; + } + print "
Top
\n"; + } else { + section_header("Percentage and number of attacks to one certain host \n", "padm"); + foreach $k (sort { $s3{$b} <=> $s3{$a} } keys %s3) { + @_ = split ",",$k; + printf("%5.2f %-4d %-${daddr_len}s %-28s\n",$s3{$k}/$total*100 , + $s3{$k},$_[1],$_[0]) if $s3{$k} > $th; + } + } +} + +# to see the popularity of one attack method +sub attack_distribution { + if ($opt_h) { + print "

Distribution of attack methods

\n"; + print "\n"; + print "\n"; + foreach $k (sort { $s4{$b} <=> $s4{$a} } keys %s4) { + @p1 = split ":",$k; + if ($s4{$k} > $th) { + printf(" + \n", $s4{$k}/$total*100,$s4{$k},&printHref($p1[0])); + foreach $k2 (sort { $s0{$b} <=> $s0{$a} } keys %s0) { + @p2 = split ",",$k2; + printf("\n", $s0{$k2}, join(" -> ", $p2[1],$p2[0])) if $p1[0] eq $p2[2]; + } + } + } + print "
%# of attacksmethods
%-2.2f%-4d%-32s
%-4d%-32s
Top
\n"; + } else { + section_header("The distribution of attack methods\n", "pam"); + foreach $k (sort { $s4{$b} <=> $s4{$a} } keys %s4) { + @p1 = split ":",$k; + if ($s4{$k} > $th) { + printf("%5.2f %-4d %-32s\n", $s4{$k}/$total*100,$s4{$k},$p1[0]); + foreach $k2 (sort { $s0{$b} <=> $s0{$a} } keys %s0) { + @p2 = split ",",$k2; + printf("\t\t %-4d %-${saddr_len}s -> %-${daddr_len}s\n", $s0{$k2}, $p2[1],$p2[0]) if $p1[0] eq $p2[2]; + } + } + } + } +} + +# portscan (if enable -p switch) +# Please use '-A fast' to generate the log, so portscan() can process it. +# contributed by: Paul Bobby, +# Jian-Da Li, +sub portscan { + my (%s7, %s8); + # to see how many times a host performs portscan + # used in portscan() + for $i (0 .. $#posres) { + $s7{"$posres[$i]->[0]"}++; + } + if ($opt_h) { + print "

Portscans performed to/from HOME_NET

\n"; + print "\n"; + print "\n"; + foreach $k (sort { $s7{$b} <=> $s7{$a} } keys %s7) { + print "\n" if $s7{$k} > $th; + } + print "
Scan AttemptsSource Address
$s7{$k}$k
Top
\n"; + } else { + section_header("Portscans performed to/from HOME_NET\n", "as"); + foreach $k (sort { $s7{$b} <=> $s7{$a} } keys %s7) { + printf(" %-4d %-${saddr_len}s\n", $s7{$k},$k) if $s7{$k} > $th; + } + } +} + +# anomsensor (if enable -n switch) +# This function process data generated by spp_anomsensor plug-in (SPADE) +# By Yen-Ming Chen +sub anomsensor { + my (%s7); + # to see how many times a host performs portscan + # used in anomsensor() + for $i (0 .. $#anores) { + $s7{"$anores[$i]->[1],$anores[$i]->[3],$anores[$i]->[4]"}++; + } + if ($opt_h) { + print "

Anomaly detected by SPADE

\n"; + print "\n"; + print "\n"; + foreach $k (sort { $s7{$b} <=> $s7{$a} } keys %s7) { + @_ = split(/,/,$k); + print "\n" if $s7{$k} > $th; + } + print "
Scan AttemptsSource AddressDestination AddressDestination Ports
$s7{$k}$_[0]$_[1]$_[2]
Top
\n"; + } else { + section_header("Anomaly detected by SPADE\n", "asdo"); + foreach $k (sort { $s7{$b} <=> $s7{$a} } keys %s7) { + @_ = split(/,/,$k); + printf(" %-4d %-${saddr_len}s %-${daddr_len}s\t%-6d\n", $s7{$k},$_[0],$_[1],$_[2]) if $s7{$k} > $th; + } + } +} + +# print the footer (needed for html) +sub print_footer { + if ($opt_h) { + print "Generated by snort_stat.pl\n"; + print "\n\n"; + } +} + +# +# resolve host name and cache it +# contributed by: Angelos Karageorgiou, +# edited by: $Author: cazz $ +# +sub resolve { + local ($mname, $miaddr, $mhost = shift); + $miaddr = inet_aton($mhost); + if (!$HOSTS{$mhost}) { + $mname =""; + eval { + local $SIG{ALRM} = sub {die "alarm\n" }; # NB \n required + alarm $timeout; + $mname = gethostbyaddr($miaddr, AF_INET); + alarm 0; + }; + die if $@ && $@ ne "alarm\n"; # propagate errors + if ($mname =~ /^$/) { + $mname = $mhost; + } + $HOSTS{$mhost} = $mname; + } + return $HOSTS{$mhost}; +} + +# Use a title and a short code to write the section headers +# This is used in place of a FORMAT as this allows variable column widths +# contributed by: Ned Patterson, +# +sub section_header { + my $linelength; + $title = shift; + $_ = shift; + print("\n\n$title"); + # constant for method length for now + $linelength = (/p/?7:0) + (/a/?20:0) + (/s/?$saddr_len:0) + + (/d/?$daddr_len+3:0) + (/m/?20:0); + print( '=' x $linelength, "\n"); + print(" " x 7, " # of\n") if (/pa.*/); + print(" # of\n attacks ") if (s/^a([sdm]*)/$1/); + print(" % ") if (s/^p([asdm]*)/$1/); + print("attacks ") if (s/^a([sdm]*)/$1/); + printf("%-${saddr_len}s ", "from") if (s/^s([dm]*)/$1/); + printf("%-${daddr_len}s ", "to" ) if (s/^d(m*)/$1/); + printf("%-5s ", "ports" ) if (s/^o(m*)/$1/); + print("method") if (/^m/); + print("\n"); + + print( '=' x $linelength, "\n"); +} + +# Put data $alert into matrix for further process +# INPUT: $alert +sub process_data() { + $self = shift; + # if the resolve switch is on + if ($opt_r) { + $self->{SADDR} = resolve($self->{SADDR}); + unless ($opt_f) { + if ( length($self->{SADDR}) > $saddr_len ) { + $saddr_len = length($self->{SADDR}); + } + } + $self->{DADDR} = resolve($self->{DADDR}); + unless ($opt_f) { + if ( length($self->{DADDR}) > $daddr_len ) { + $daddr_len = length($self->{DADDR}); + } + } + } + # put those data into a big matrix + if ($self->{PLUGIN} eq "anomsensor") { + push @anores , [$self->{THR},$self->{SADDR},$self->{SPORT}, + $self->{DADDR},$self->{DPORT}]; + $opt_n = 1; + } elsif ($self->{PLUGIN} eq "portscan") { + push @posres , [$self->{SADDR}]; + $opt_p = 1; + } elsif ($self->{TYPE} eq "sys" || $self->{TYPE} eq "alert" || + $self->{PLUGIN} eq "stream" || $self->{PLUGIN} eq "bo" ) { + $self->{SIG} =~ s/\:$//o; + push @result ,[$self->{MON},$self->{DAY},$self->{HOUR},$self->{MIN}, + $self->{SEC},$self->{HOST},$self->{SIG},$self->{SADDR}, + $self->{SPORT},$self->{DADDR},$self->{DPORT}]; + $lastwassnort = 1; + } else { + print STDERR "Unknown alert type/plugin! $self->{TYPE}:$self->{PLUGIN} Skipped!\n"; + return; + } + 1; +} + +# Turn IDS into the link to whitehats +sub printHref +{ + my $type = $_[0]; + + if ($type =~ /\A\s*(IDS\d+)\//) + { + return "$type"; + } + return $type; +} Index: snort/contrib/snortdb-extra.gz Index: snort/contrib/snortlog diff -u /dev/null snort/contrib/snortlog:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/snortlog Thu Jul 24 01:55:04 2003 @@ -0,0 +1,73 @@ +#!/usr/bin/perl +# Syslog analysis script orignially written by +# Angelos Karageorgiou and +# tweaked by Martin Roesch + +if($ARGV[1] eq undef) +{ + print "USAGE: snortlog \n"; + print "EXAMPLE: snortlog /var/log/messages sentinel\n"; + print "Note: The machine name is just the hostname, not the FQDN!\n"; + exit; +} + +$machine = $ARGV[1]; + +$targetlen=25; +$sourcelen=35; +$protolen=12; + +use Socket; + + +open(LOG,"< $ARGV[0]") || die "No can do"; + +printf("%15s %-35s %-25s %-25s\n","DATE","WARNING", "FROM", "TO"); +print "=" x 100; +print "\n"; +while() { + chomp(); + if ( + ( ! /.*snort*/gi ) + ) { next ; } + + $_ =~ s/ $machine snort//gi ; + $date=substr($_,0,15); + $rest=substr($_,16,500); + + + + @fields=split(": ", $rest); + $text=$fields[0]; + + + $fields[1] =~ s/ \-\> /-/gi; + ($source,$dest)=split('-', $fields[1]); + + + ($host,$port)=split(':',$source); + + + $iaddr = inet_aton($host); # or whatever address + $name = gethostbyaddr($iaddr, AF_INET); + if ( $name =~ /^$/ ) { + $name=$host; + } + $name = $name . ":" . $port; + + $skipit=0; + + ($shost,$sport)=split(':',$dest); + $sport =~ s/ //gi; + $siaddr = inet_aton($shost); # or whatever address + $sname = gethostbyaddr($siaddr, AF_INET) ; + if ( $sname =~ /^$/ ) { + $sname=$shost; + } + $sname = $sname . ":" . $sport; + printf("%15s %-32s %-30s %s\n", + $date, $text, + $name,$sname); + +} +close(LOG); Index: snort/contrib/snortnet.tar.gz Index: snort/contrib/snortpp.c diff -u /dev/null snort/contrib/snortpp.c:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/snortpp.c Thu Jul 24 02:50:58 2003 @@ -0,0 +1,1459 @@ +/* $Id: snortpp.c,v 1.1 2001/08/11 05:12:27 dragosr Exp $ */ +/* +** Copyright (C) 2001 Dragos Ruiu +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "splay.c" + +#ifndef NULL +#define NULL 0 +#endif +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + + +char *validproto[] = { "ip", "arp", "tcp", "udp", "icmp", "" }; + + +typedef struct ruleip RuleIP; +struct ruleip +{ + char * ipstr; + char any; + char not; + int byte[4]; + int cidr; + char var; + char *varname; + struct ruleip *next; +}; + + +struct ruleport +{ + char *portstr; + char any; + char not; + char var; + char * varname; + int min, max; + struct ruleport *next; +}; + +typedef struct ruleport RulePort; + +struct strlist +{ + char *str; + struct strlist *next; +}; + +typedef struct strlist RuleParm; +typedef struct strlist StrList; + +struct rulekey +{ + char *keystr; + char *key; + RuleParm *parms; + struct rulekey *next; +}; + +typedef struct rulekey RuleKey; + +#define DIRFORW 1 +#define DIRREV 2 +#define DIRBOTH 3 + +struct ruletext +{ + char *rulestr; + char *type; + char *proto; + char *saddrstr; + char *daddrstr; + char *sportstr; + char *dportstr; + char *dirstr; + char *keystr; + RuleIP *saddr, *daddr; + RulePort *sport, *dport; + RuleKey *keys; + int dir; + char *comment; + int sid, rev; + struct ruletext *next; +}; + +typedef struct ruletext Rule; + +char errorstr[32767]; + +struct varlist +{ + char *name; + char *val; + struct varlist *next; +}; + +typedef struct varlist SnortVar; + +SnortVar *variables; +SplayTree *vars, *ruletree, *types; +FILE *outf; +int localsid; + +/**********************End of Global Declaration:Start of Code***********************/ + +int varcmp(SnortVar *x, SnortVar *y) +{ + return(strcmp(x->name, y->name)); +} + +inline void errormsg(char *str) +{ + if(strlen(errorstr) < 32700) + strcat(errorstr,str); +} + +inline char *strquotchr(char *str, char c) +{ + if(!str) + return NULL; +again: + if(strchr(str,(int)'\"') && strchr(str,(int)'\"') < strchr(str,(int)c)) + { + str = strchr(str,(int)'\"'); + if(*(str-1) == '\\') + { + str++; + goto again; + } + if(!str || !*str) + return NULL; + while((*str != '\"' || (*str == '\"' && *((char*)str-1) != '\\')) && *str != c) + { + str++; + if(!str || !*str) + return NULL; + } + if(*str == c) + return str; + return(strquotchr(str,c)); + } + else return(strchr(str,(int)c)); +} + + +inline void splitstr(char *main[], char **split) +{ + if(*split) + { + *((*split)++) = '\0'; + while(isspace(**split)) + (*split)++; + } + if(*main) + while(isspace((*main)[strlen(*main)-1])) + (*main)[strlen(*main)-1] = '\0'; +} + +inline void trim(char *str[]) +{ + if(*str) + { + while(isspace(**str)) + (*str)++; + while(isspace((*str)[strlen(*str)-1])) + (*str)[strlen(*str)-1] = '\0'; + } +} + +int isproto(char *test) +{ + char *p; + int i; + for(i = 0; *(validproto[i]); i++) + if(strcmp(test,validproto[i]) == 0) + return TRUE; + return FALSE; +} + +void parseport(Rule *raw, char *tmp, RulePort **portptr) +{ + char *x, *y; + const char any[] = "any"; + x = tmp; + *portptr = calloc(1,sizeof(RulePort)+1); + if(x && *x) + { + (*portptr)->portstr = calloc(1,strlen(x)+1); + strcpy((*portptr)->portstr, x); + if(strncasecmp(x,any,3) == 0) + (*portptr)->any = TRUE; + else + { + if(*x == '!') + { + (*portptr)->not = TRUE; + splitstr(&tmp,&x); + } + if(*x == '$') + { + (*portptr)->var = TRUE; + splitstr(&tmp,&x); + if(!*x) + { + errormsg("Empty port after \'$\' ignoring and using any.\n"); + (*portptr)->any = TRUE; + (*portptr)->portstr = calloc(4,1); + strcpy((*portptr)->portstr,any); + } + else + { + if(!vars) + { + errormsg("No variables defined, using port = \"any\".\n"); + (*portptr)->any = TRUE; + free((*portptr)->portstr); + (*portptr)->portstr = calloc(4,1); + strcpy((*portptr)->portstr,any); + } + else + { + SnortVar *n; + (*portptr)->var = TRUE; + (*portptr)->varname = calloc(1,strlen(x)+1); + strcpy((*portptr)->varname,x); + n = calloc(sizeof(SnortVar),1); + n->name = (*portptr)->varname; + vars = splay(n,vars,varcmp); + if(vars && varcmp(vars->key,n) != 0) + { + errormsg("Undefined variable, using port = \"any\".\n"); + (*portptr)->any = TRUE; + free((*portptr)->portstr); + (*portptr)->portstr = calloc(4,1); + strcpy((*portptr)->portstr,any); + } + free(n); + } + } + } + else if(y = strchr(x, ':')) + { + splitstr(&x, &y); + if(!*x) + { + errormsg("Empty destination port before \':\' assuming 1 minimum.\n"); + (*portptr)->min = 1; + } + else + sscanf(x,"%d",&((*portptr)->min)); + if(!*y) + { + errormsg("Empty destination port after \':\' assuming 65535 maximum.\n"); + (*portptr)->max = 65535; + } + else + sscanf(y,"%d",&((*portptr)->max)); + } + else + { + if(!*x) + { + errormsg("Empty destination port, ignoring and using any.\n"); + (*portptr)->any = TRUE; + (*portptr)->portstr = calloc(4,1); + strcpy((*portptr)->portstr,any); + } + else + { + sscanf(x,"%d",&((*portptr)->min)); + (*portptr)->max = (*portptr)->min; + } + } + } + } + else if(!x || !*x) + { + errormsg("Missing destination field assuming port = any.\n"); + (*portptr)->any = TRUE; + (*portptr)->portstr = calloc(4,1); + strcpy((*portptr)->portstr,any); + } +} + +void parseaddr(Rule *raw, char *tmp, RuleIP **addrptr) +{ + RuleIP *lastaddr, *newaddr; + char *x, *y, *z; + const char any[] = "Any"; + lastaddr = *addrptr; + if(tmp) + while(isspace(tmp[strlen(tmp)-1])) + tmp[strlen(tmp)-1] = '\0'; + if(!tmp || !*tmp) + { + errormsg("No address found, assuming any.\n"); + *addrptr = calloc(sizeof(RuleIP),1); + (*addrptr)->any = TRUE; + (*addrptr)->ipstr = calloc(4,1); + strcpy((*addrptr)->ipstr,any); + } + else while(tmp && *tmp) + { + trim(&tmp); + x = strchr(tmp,','); + splitstr(&tmp,&x); + if(tmp && !*tmp) + errormsg("No address found before \',\', ignoring.\n"); + else + { + if(lastaddr) + while(newaddr = lastaddr->next) + lastaddr = newaddr; + newaddr = calloc(sizeof(RuleIP),1); + if(lastaddr) + lastaddr->next = newaddr; + else + { + (*addrptr) = newaddr; + lastaddr = newaddr; + } + newaddr->byte[0] = 0; + newaddr->byte[1] = 0; + newaddr->byte[2] = 0; + newaddr->byte[3] = 0; + newaddr->cidr = 0; + newaddr->next = NULL; + newaddr->ipstr = calloc(1,strlen(tmp)+1); + strcpy(newaddr->ipstr,tmp); + if(strncasecmp(tmp,any,3) == 0) + { + newaddr->any = TRUE; + } + else + { + if(*tmp == '!') + { + newaddr->not = TRUE; + splitstr(&tmp,&tmp); + } + if(*tmp == '$') + { + SnortVar n; + splitstr(&tmp,&tmp); + if(tmp && !*tmp) + { + strcat(errorstr,"Empty variable name after \'$\' ignoring."); + free(newaddr->ipstr); + free(newaddr); + } + else + { + if(!vars) + { + errormsg("No variables defined, assuming address = \"Any\".\n"); + newaddr->any = TRUE; + free(newaddr->ipstr); + newaddr->ipstr = calloc(4,1); + strcpy(newaddr->ipstr,any); + } + else + { + SnortVar *n; + newaddr->var = TRUE; + newaddr->varname = calloc(1,strlen(tmp)+1); + strcpy(newaddr->varname,tmp); + n = calloc(sizeof(SnortVar),1); + n->name = newaddr->varname; + vars = splay(n,vars,varcmp); + if(vars && varcmp(vars->key,n) != 0) + { + errormsg("No address found, assuming any.\n"); + newaddr->any = TRUE; + free(newaddr->ipstr); + newaddr->ipstr = calloc(4,1); + strcpy(newaddr->ipstr,any); + } + free(n); + } + } + } + else + { + if(y = strchr(tmp,'/')) + { + splitstr(&tmp,&y); + if(!y || !*y) + { + if(strlen(errorstr) < 32700) + strcat(errorstr,"Empty CIDR ignoring.\n"); + } + else + sscanf(y,"%d",&(newaddr->cidr)); + } + if(tmp && !*tmp) + { + errormsg("Empty address following \'!\', or before \'/\' ignoring.\n"); + free(newaddr->ipstr); + free(newaddr); + } + else if(y = strchr(tmp,'.')) + { + splitstr(&tmp, &y); + if(!*tmp) + errormsg("Empty first address octet, using 0.\n"); + else + sscanf(tmp,"%d",&(newaddr->byte[0])); + tmp = y; + if(y = strchr(tmp,'.')) + { + splitstr(&tmp,&y); + if(!*tmp) + errormsg("Empty second address octet, using 0.\n"); + else + sscanf(tmp,"%d",&(newaddr->byte[1])); + tmp = y; + if(y = strchr(tmp,'.')) + { + splitstr(&tmp,&y); + if(!*tmp) + errormsg("Empty third address octet, using 0.\n"); + else + sscanf(tmp,"%d",&(newaddr->byte[2])); + tmp = y; + if(!tmp || !*tmp) + errormsg("Address missing last octet after \'.\', using 0.\n"); + else + sscanf(tmp,"%d",&(newaddr->byte[3])); + + } + else + errormsg("Address missing missing two octets and \'.\' ignoring, using 0.\n"); + } + else + errormsg("Address missing three octets following \'.\' ignoring, using 0.\n"); + } + else + { + errormsg("Address missing dots... ignoring, using \'Any\'.\n"); + newaddr->any = TRUE; + newaddr->ipstr = calloc(4,1); + strcpy(newaddr->ipstr,any); + } + } + } + } + if(x && !*x) + errormsg("No address found after \',\', ignoring.\n"); + tmp = x; + } + if(!*addrptr) + { + errormsg("Empty address assuming \"Any\".\n"); + *addrptr = calloc(sizeof(RuleIP),1); + (*addrptr)->any = TRUE; + (*addrptr)->ipstr = calloc(4,1); + strcpy((*addrptr)->ipstr,any); + } +} + +void parsekey(Rule *raw, char *tmp) +{ + RuleKey **tkey; + RuleKey *lastkey, *newkey; + char *x, *y, *z; + char sid[] = "sid"; + char rev[] = "rev"; + lastkey = raw->keys; + if(tmp && *tmp) + { + if(isspace(*tmp) || *tmp == ';' || *tmp == '(') + *tmp++ = NULL; + trim(&tmp); + raw->keystr = calloc(1,strlen(tmp)+1); + strcpy(raw->keystr, tmp); + } + else + errormsg("Keywords not found, assuming none... weird!\n"); +//keywords + while(tmp && *tmp) + { + x = strquotchr(tmp,';'); + splitstr(&tmp, &x); + if(tmp && !*tmp) + errormsg("Empty keyword before \';\', ignoring.\n"); + else + { + if(lastkey) + while(newkey = lastkey->next) + lastkey = newkey; + newkey = calloc(sizeof(RuleKey),1); + if(lastkey) + lastkey->next = newkey; + else + { + raw->keys = newkey; + lastkey = newkey; + } + newkey->next = NULL; + newkey->keystr = calloc(1,strlen(tmp)+1); + strcpy(newkey->keystr, tmp); +//parameters + if(y = strquotchr(tmp,':')) + { + splitstr(&tmp, &y); + if(tmp && !*tmp) + errormsg("Empty keyword before \':\'. \n"); + else + { + newkey->key = calloc(1,strlen(tmp)+1); + strcpy(newkey->key, tmp); + } +// parameter lists + if(y && !*y) + { + strcat(errorstr,"Empty parameter after \':\'.\n"); + } + else + { + while(y && *y) + { + RuleParm *lastparm, *newparm; + z = strquotchr(y, ','); + splitstr(&y, &z); + if(y && !*y) + errormsg("Empty parameter before \',\'.\n"); + else + { + lastparm = newkey->parms; + if(lastparm) + while(newparm = lastparm->next) + lastparm = newparm; + newparm = calloc(sizeof(struct strlist),1); + if(lastparm) + lastparm->next = newparm; + else + { + newkey->parms = newparm; + lastparm = newparm; + } + newparm->next = NULL; + newparm->str = calloc(1,strlen(y)+1); + bcopy(y, newparm->str, strlen(y)); + } + if(z && !*z) + errormsg("Empty parameter after \',\'.\n"); + y = z; + } + } + } + else + { + newkey->key = calloc(1,strlen(tmp)+1); + strcpy(newkey->key, tmp); + } + if(newkey && newkey->key && strncmp(newkey->key,sid,3) == 0) + { + if(newkey->parms && newkey->parms->str) + sscanf(newkey->parms->str,"%d",&(raw->sid)); + else + errormsg("No parameter for sid keyword!\n"); + } + if(newkey && newkey->key && strncmp(newkey->key,rev,3) == 0) + { + if(newkey->parms && newkey->parms->str) + sscanf(newkey->parms->str,"%d",&(raw->rev)); + else + errormsg("No parameter for rev keyword!\n"); + } + } + tmp = x; + } +} + + + +int parserule(Rule *raw) +{ +// assumes multi-line rules have been glued +// +char *rulecopy; +char *tmp, *dest, *x, *y, *z; +char preproc[] = "preprocessor"; +char var[] = "var"; + if(!raw->rulestr || !*(raw->rulestr)) + return -2; + rulecopy = (char *)calloc(1,strlen(raw->rulestr)+1); + strcpy(rulecopy, raw->rulestr); + if(tmp = strchr(rulecopy, '#')) + { + splitstr(&rulecopy,&tmp); + if(tmp && *tmp ) + { + raw->comment = calloc(1,strlen(tmp)+1); + bcopy(tmp,raw->comment, strlen(tmp)); + } + if(!*rulecopy) + return 1; + } + else + raw->comment = NULL; + if(strncasecmp(rulecopy,preproc,12) == 0) + { + errormsg("Preprocessor Statement.\n"); + return(0); + } + + if(tmp = strchr(rulecopy, '(')) + { + while(isspace(*tmp)) + tmp++; + while(isspace(tmp[strlen(tmp)-1])) + tmp[strlen(tmp)-1] = '\0'; + for(y = tmp; x = strchr(y+1,')'); y = x) + ; + splitstr(&tmp,&y); + if(y && *y) + errormsg("Junk after keyword end \')\' ignored.\n"); + parsekey(raw,tmp); + } + else //try to salvage + { + if(!raw->comment) + errormsg("Beginning of keywords not found, trying to salvage....\n"); + if(tmp = strchr(rulecopy,';')) + { + while(!isspace(*tmp)) + tmp--; + splitstr(&rulecopy, &tmp); + while(isspace(tmp[strlen(tmp)-1])) + tmp[strlen(tmp)-1] = '\0'; + if(tmp[strlen(tmp)-1] = ')') + tmp[strlen(tmp)-1] = '\0'; + while(isspace(tmp[strlen(tmp)-1])) + tmp[strlen(tmp)-1] = '\0'; + parsekey(raw,tmp); + } + else + if(!raw->comment) + errormsg("Keywords not found, assuming none... strange rule there!\n"); + } +//direction + if(!rulecopy || !*rulecopy) + { + if(!raw->comment) + errormsg("Ok... I give up... where is the rule in all this?\n"); + return -2; + } + dest = NULL; + if(strchr(rulecopy,'<')) + { + tmp = strchr(rulecopy,'<'); + for(x = tmp-1; isspace(*x); x--) + *x = '\0'; // eat spaces before direction + tmp++; + if(*tmp == '-') + { + tmp++; + raw->dir = DIRREV; + } + else if(*tmp == '>') + { + tmp++; + raw->dir = DIRBOTH; + } + else + { + errormsg("Only \'<\' for rule direction found assuming \'<-\'.\n"); + tmp--; + raw->dir = DIRREV; + } + *tmp++ = '\0'; + dest = tmp; + } + else if(strchr(rulecopy,'-')) + { + tmp = strchr(rulecopy,'-'); + for(x = tmp-1; isspace(*x); x--) + *x = '\0'; // eat spaces before direction + *tmp++ = '\0'; + if(*tmp != '>') + errormsg("Only \'-\' for rule direction found assuming \'->\'.\n"); + *tmp++ = '\0'; + raw->dir = DIRFORW; + dest = tmp; + } + else if(strchr(rulecopy,'>')) + { + tmp = strchr(rulecopy,'>'); + for(x = tmp-1; isspace(*x); x--) + *x = '\0'; // eat spaces before direction + *tmp++ = '\0'; + errormsg("Only \'>\' for rule direction found assuming \'->\'.\n"); + raw->dir = DIRFORW; + dest = tmp; + } + else + { + errormsg("No rule direction found. Assuming ->...\n"); + raw->dir = DIRFORW; + } + if(tmp && *tmp) + { + while(isspace(*tmp)) + tmp++; + while(isspace(tmp[strlen(tmp)-1])) + tmp[strlen(tmp)-1] = '\0'; + } + if(rulecopy && *rulecopy) + { + while(isspace(*rulecopy)) + rulecopy++; + while(isspace(rulecopy[strlen(rulecopy)-1])) + rulecopy[strlen(rulecopy)-1] = '\0'; + } + else + { + errormsg("Ok... I give up... where is the rule?\n"); + return -2; + } +//type + if(tmp = strpbrk(rulecopy, " \t")) + { + trim(&rulecopy); + x = strpbrk(rulecopy, "!./$:"); + if(x && x < tmp) + { + char alert[] = "alert"; + errormsg("Hmmm... missing fields trying to salvage, using type = \"alert\"\n"); + raw->type = calloc(1,strlen(alert)+1); + bcopy(alert, raw->type, strlen(alert)); + } + else + { + splitstr(&rulecopy, &tmp); + if(!rulecopy || !*rulecopy) + { + errormsg("Missing fields before source port.\n"); + return -2; + } + types = splay(rulecopy,types,strcmp); + if(types && strcmp(types->key,rulecopy) != 0) + { + char alert[] = "alert"; + errormsg("Messed up rule type, using type = \"alert\"\n"); + raw->proto = raw->type; + raw->type = calloc(1,strlen(alert)+1); + bcopy(alert, raw->type, strlen(alert)); + if(isproto(rulecopy)) + { + errormsg("Looks like the ruletype was missing because a protocol was found, compensating.\n"); + while(*(--tmp)) + ; + while(!*(--tmp)) + *tmp = ' '; + } + else + rulecopy = tmp; + } + else + { + raw->type = calloc(1,strlen(rulecopy)+1); + bcopy(rulecopy, raw->type, strlen(rulecopy)); + rulecopy = tmp; + } + } + } + else + { + errormsg("Ok... I really don't think this is a much of a rule, I give up.\n"); + return -2; + } +// proto + if(tmp = strpbrk(rulecopy, " \t")) + { + char tcp[] = "tcp"; + x = strpbrk(rulecopy, "!./$:"); + if(x && x < tmp) + { + errormsg("Uh... missing fields trying to salvage, using proto = \"tcp\"\n"); + raw->proto = calloc(1,strlen(tcp)+1); + strcpy(raw->proto, tcp); + } + else + { + splitstr(&rulecopy, &tmp); + if(!rulecopy || !*rulecopy) + { + errormsg("Missing fields before source port.\n"); + return -2; + } + if(!isproto(rulecopy)) + { + errormsg("Protocol field trashed, assumming \"tcp\".\n"); + raw->proto = calloc(1,strlen(tcp)+1); + strcpy(raw->proto, tcp); + } + else + { + raw->proto = calloc(1,strlen(rulecopy)+1); + strcpy(raw->proto, rulecopy); + rulecopy = tmp; + } + } + } + +// source address and port + if(tmp = strpbrk(rulecopy, " \t")) + { + while(isspace(tmp[strlen(tmp)-1])) + tmp[strlen(tmp)-1] = '\0'; + if(!dest) + dest = strpbrk(tmp+1," \t"); + else + while(strpbrk(tmp+1, " \t")) + tmp = strpbrk(tmp+1, " \t"); // find last space in field if luser put spaces in IP addr + splitstr(&rulecopy,&tmp); + } + parseport(raw, tmp, &(raw->sport)); + if(rulecopy) + { + raw->daddrstr = calloc(1,strlen(rulecopy)+1); + strcpy(raw->daddrstr,rulecopy); + } + parseaddr(raw, rulecopy, &(raw->saddr)); + +// on to destination address and port fields + + if(!dest && tmp) + dest = strpbrk(tmp," \t"); + if(dest && (x = strpbrk(dest, " \t"))) + { + while(isspace(x[strlen(x)-1])) + x[strlen(x)-1] = '\0'; + while(strpbrk(x+1, " \t")) + x = strpbrk(x+1, " \t"); // find last space in field if luser put spaces in IP addr + splitstr(&dest,&x); + } + parseport(raw, x, &(raw->dport)); + if(dest) + { + raw->daddrstr = calloc(1,strlen(dest)+1); + strcpy(raw->daddrstr,dest); + } + parseaddr(raw, dest, &(raw->daddr)); + +//done + if(strlen(errorstr) > 0) + return 0; + return 1; +} + +void fprintdir(FILE *f, int dir) +{ + + switch(dir) + { + case DIRFORW: + fprintf(f,"->"); + break; + case DIRREV: + fprintf(f,"<-"); + break; + case DIRBOTH: + fprintf(f,"<>"); + break; + } +} + +void fprintip(FILE *f, RuleIP *ip) +{ + if(!ip) + return; + if(ip->any) + fprintf(f,"Any"); + else + { + if(ip->not) + fprintf(f,"!"); + if(ip->var) + { + if(ip->varname) + fprintf(f,"$%s",ip->varname); + } + else + { + fprintf(f,"%d.%d.%d.%d",ip->byte[0], ip->byte[1], ip->byte[2], ip->byte[3]); + if(ip->cidr) + fprintf(f,"/%d",ip->cidr); + } + } + while(ip->next) + { + ip = ip->next; + fprintf(f,","); + if(ip->not) + { + fprintf(f,"!"); + } + if(ip->var) + { + if(ip->varname) + fprintf(f,"$%s",ip->varname); + } + else + { + fprintf(f,"%d.%d.%d.%d",ip->byte[0], ip->byte[1], ip->byte[2], ip->byte[3]); + if(ip->cidr) + fprintf(f,"/%d",ip->cidr); + } + } +} + +void fprintport(FILE *f, RulePort *port) +{ + if(!port) + return; + if(port->any) + { + fprintf(f,"Any"); + } + else + { + if(port->not) + { + fprintf(f,"!"); + } + if(port->var) + { + if(port->varname) + fprintf(f,"$%s",port->varname); + } + else + { + if(port->max && port->max != port->min) + fprintf(f,"%d:%d", port->min, port->max); + else + fprintf(f,"%d", port->min); + } + } +} + +void fprintkey(FILE *f, RuleKey *key) +{ + if(!key) + return; + if(key->keystr) + fprintf(f,"%s",key->key); + if(key->parms) + { + RuleParm *tmp; + if(key->parms->str) + fprintf(f,":%s",key->parms->str); + tmp = key->parms->next; + while(tmp) + { + if(tmp->str) + fprintf(f,",%s",tmp->str); + tmp = tmp->next; + } + } +} + + +void clearrule(Rule *r) +{ + r->rulestr = NULL; + r->type = NULL; + r->proto = NULL; + r->saddrstr = NULL; + r->daddrstr = NULL; + r->sportstr = NULL; + r->dportstr = NULL; + r->dirstr = NULL; + r->keystr = NULL; + r->saddr = (RuleIP*)NULL; + r->daddr = (RuleIP*)NULL; + r->sport = (RulePort*)NULL; + r->dport = (RulePort*)NULL; + r->keys = (RuleKey*)NULL; + r->dir = NULL; + r->comment = NULL; + r->sid = NULL; + r->rev = NULL; + r->next = (Rule*)NULL; +}; + +inline Rule *newrule() +{ + return(calloc(1,sizeof(Rule))); +} + +void freerule(Rule *rule) +{ + if(rule->rulestr) + free(rule->rulestr); + if(rule->type) + free(rule->type); + if(rule->proto) + free(rule->proto); + if(rule->daddrstr) + free(rule->daddrstr); + if(rule->saddrstr) + free(rule->saddrstr); + if(rule->sportstr) + free(rule->sportstr); + if(rule->dirstr) + free(rule->dirstr); + if(rule->keystr) + free(rule->keystr); + if(rule->comment) + free(rule->comment); + while(rule->saddr) + { + RuleIP *tmp; + if(rule->saddr->ipstr) + free(rule->saddr->ipstr); + if(rule->saddr->varname) + free(rule->saddr->varname); + tmp = rule->saddr; + rule->saddr = rule->saddr->next; + free(tmp); + } + while(rule->daddr) + { + RuleIP *tmp; + if(rule->daddr->ipstr) + free(rule->daddr->ipstr); + if(rule->daddr->varname) + free(rule->daddr->varname); + tmp = rule->daddr; + rule->daddr = rule->daddr->next; + free(tmp); + } + while(rule->sport) + { + RulePort *tmp; + if(rule->sport->portstr) + free(rule->sport->portstr); + if(rule->sport->varname) + free(rule->saddr->varname); + tmp = rule->sport; + rule->sport = rule->sport->next; + free(tmp); + } + while(rule->dport) + { + RulePort *tmp; + if(rule->dport->portstr) + free(rule->dport->portstr); + if(rule->dport->varname) + free(rule->daddr->varname); + tmp = rule->dport; + rule->dport = rule->dport->next; + free(tmp); + } + while(rule->keys) + { + RuleKey *tkey; + tkey = rule->keys; + if(tkey->keystr) + free(tkey->keystr); + if(tkey->key) + free(tkey->key); + while(rule->keys->parms) + { + RuleParm *tmp; + tmp = rule->keys->parms; + if(tmp->str) + free(tmp->str); + if(tmp->next) + rule->keys->parms = tmp->next; + free(tmp); + } + rule->keys = rule->keys->next; + free(tkey); + } +} + +rulecmp(Rule *x, Rule *y) +{ + if(x->sid < y->sid) + return 1; + else if(x->sid == y->sid) + return 0; + return -1; +} + +void *fprintrule(FILE *f, Rule *raw) +{ + if(!raw->type || !raw->proto || !raw->saddr || !raw->sport || + !raw->dir || !raw->daddr || !raw->dport) + { + fprintf(stderr,"Not outputing incomplete rule SID:%d\n",raw->sid); + return; + } + if(raw->type) + fprintf(f,"%s ",raw->type); + if(raw->proto) + fprintf(f,"%s ",raw->proto); + fprintip(f,raw->saddr); + fprintf(f," "); + fprintport(f,raw->sport); + fprintf(f," "); + fprintdir(f,raw->dir); + fprintf(f," "); + fprintip(f,raw->daddr); + fprintf(f," "); + fprintport(f,raw->dport); + if(raw->keys) + { + RuleKey *tmp; + fprintf(f," ( "); + fprintkey(f,raw->keys); + tmp = raw->keys->next; + while(tmp) + { + fprintf(f,"; "); + fprintkey(f,tmp); + tmp = tmp->next; + } + fprintf(f,"; )"); + } + if(raw->comment) + { + fprintf(f,"# %s",raw->comment); + } + fputs("\n",f); +} + +parsefile(char *fname) +{ +FILE *fd; +Rule *raw; +char rulebuf[8192]; +size_t len; +char *buf, *rulecopy, *tmp, *x; +char ruletype[] = "ruletype"; +char preprocessor[] = "preprocessor"; +char var[] = "var"; +char include[] = "include"; +char stin[] = "-"; +char type[] = "type"; +char output[] = "output"; +char start[] = "{"; +char stop[] = "}"; + + + fprintf(stderr,"Loading file: %s\n",fname); + if(strcmp(fname,stin) == 0) + { + fd = stdin; + fputs("Reading from standard input...\n",stderr); + } + else if(!(fd = fopen(fname,"r"))) + { + fprintf(stderr,"Rule file not found: %s\n",fname); + return; + } + while(!feof(fd)) + { + fgets(rulebuf, 1024, fd); + if(feof(fd)) + { + printf("\n"); + break; + } +more: + while(rulebuf[strlen(rulebuf)-1] == '\\') + { + fgets(&(rulebuf[strlen(rulebuf)-1]),1024,fd); + if(strlen(rulebuf) > 7168) + break; + } + // brand new fresh and clean blank error message + *errorstr = (char) NULL; + tmp = rulebuf; + trim(&tmp); + if(strncmp(tmp,preprocessor,12) == 0) + fputs("Preprocessor configuration declaration, stripping...\n",stderr); + else if(strncasecmp(tmp, var, 3) == 0) + { + rulecopy = calloc(1,strlen(tmp)+1); + bcopy(tmp,rulecopy,strlen(tmp)); + if(!(tmp = strpbrk(rulecopy, " \t"))) + { + errormsg("Bogus variable declaration, dude.\n"); + } + else + { + splitstr(&rulecopy,&tmp); + if(*tmp == '$') + { + errormsg("Extra \'$\' in var decraration stripped.\n"); + splitstr(&tmp,&tmp); + } + if(tmp && *tmp) + { + SnortVar *n; + if(!(x = strpbrk(tmp, " \t"))) + { + errormsg("Empty variable declaration value, ignoring.\n"); + } + else + { + + splitstr(&tmp,&x); + n = (SnortVar *) calloc(sizeof(SnortVar),1); + n->name = calloc(1,strlen(tmp)+1); + bcopy(tmp,n->name,strlen(tmp)); + n->next = variables; + variables = n; + vars = splay(n,vars,varcmp); + if(vars && varcmp(vars->key,n) == 0) + { + errormsg("Duplicate var declaration.\n"); + free(n); + } + else + { + vars = splayinsert(n,vars,varcmp); + if(*x == '\"' || *x == '\'') + { + x++; + errormsg("Removing broken quotes around variable value.\n"); + if(x[strlen(x)-1] = '\"') + x[strlen(x)-1] = '\0'; + if(x[strlen(x)-1] = '\'') + x[strlen(x)-1] = '\0'; + trim(&x); + } + n->val = calloc(1,strlen(x)+1); + bcopy(x,n->val,strlen(x)); + } + } + } + else + { + errormsg("Messed up variable declaration, no varname.\n"); + } + } + + if(*errorstr) + fprintf(stderr,"Declaration: %s\nErrors: %s\n--\n",rulebuf,errorstr); + free(rulecopy); + } + else if(strncasecmp(tmp,ruletype,8) == 0) + { + char *name; + x = strpbrk(tmp," \t"); + splitstr(&tmp,&x); + if(x) + { + name = calloc(1,strlen(x)+1); + bcopy(x,name,strlen(x)); + fgets(rulebuf,1024,fd); + tmp = rulebuf; + trim(&tmp); + if(strcmp(tmp,start) == 0) + { + fprintf(outf,"ruletype %s\n",name); + types = splayinsert(name,types,strcmp); + fputs(tmp,outf); + fputs("\n",outf); + fgets(rulebuf,1024,fd); + tmp = rulebuf; + trim(&tmp); + while(!strncmp(tmp,type,4) || !strncmp(tmp,output,6)) + { + fputs(rulebuf,outf); + fputs("\n",outf); + fgets(rulebuf,1024,fd); + tmp = rulebuf; + trim(&tmp); + } + if(strncmp(tmp,stop,1)) + { + fputs("Ruletype without closing \'}\', inserting.\n",stderr); + fputs("}\n",outf); + goto more; + } + else + fputs("}\n",outf); + } + else + { + fputs("Ruletype without following declaration, ignoring.\n",stderr); + goto more; + } + } + } + else if(strncmp(tmp,include,7) == 0) + { + x = strpbrk(tmp," \t"); + if(x) + { + splitstr(&tmp,&x); + if(x) + parsefile(x); + else + errormsg("Missing include filename after space...\n"); + } + else + errormsg("Missing include filename...\n"); + } + else + { + raw = newrule(); + raw->rulestr = calloc(1,strlen(rulebuf)+1); + bcopy(rulebuf,raw->rulestr,strlen(rulebuf)); + fflush(stdout); + parserule(raw); + if(!raw->sid) + { + raw->sid = localsid++; + raw->rev = 1; + errormsg("No SID, assigned temporary local SID.\n"); + } + ruletree = splay(raw, ruletree, rulecmp); + if(ruletree && rulecmp(raw,ruletree->key) == 0) + { + if(raw->rev <= ((Rule *)(ruletree->key))->rev) + if(raw->sid) + errormsg("Duplicate SID, ignoring equal or lower rev...\n"); + else + { + freerule((Rule *)(ruletree->key)); + ruletree->key = raw; + errormsg("Replacing with higher revision level.\n"); + } + } + else + ruletree = splayinsert(raw, ruletree, rulecmp); + if(*errormsg) + { + if(raw->sid) + fprintf(stderr,"SID:%d rev:%d\n",raw->sid, raw->rev); + fprintf(stderr, "\nOriginal: %s\n",rulebuf); + fprintf(stderr, "Modified: "); + fprintrule(stderr, raw); + fprintf(stderr,"\nErrors:\n%s",errorstr); + fprintf(stderr,"\n--\n"); + } + } + } +} + + +void usage() +{ + fputs("This program reads in all the snort rules files on the command line\n",stderr); + fputs("and merges their rules while cleaning the sysntax.\n",stderr); + fputs("Default output is stdout unless -o is used.\n",stderr); + fputs("The special filename \"-\" can be used for stdin.\n",stderr); + fputs("Preprocessor configuration statements and duplicate SIDs are removed.\n",stderr); + fputs("In the case of duplicates, the highest rev:number wins.\n",stderr); + fputs("Please send bug reports to . --dr\n",stderr); + fputs("\n",stderr); + exit(1); +} + +// test stub +main(int argc, char *argv[]) +{ +char pass[] = "pass"; +char log[] = "log"; +char alert[] = "alert"; +extern char *optarg; +extern int optind; +extern int errno; +List *outlist; +int ch; + + variables = NULL; + vars = NULL; + ruletree = NULL; + types = NULL; + localsid = 2000000; + outf = stdout; + types = splayinsert(pass,types,strcmp); + types = splayinsert(log,types,strcmp); + types = splayinsert(alert,types,strcmp); + + fputs("snortpp: rules preprocessor - merger cleaner stripper and desert topping (by Dragos Ruiu )\n",stderr); + if(argc < 2) + { + fprintf(stderr,"No arguments given. Blech!\nI suppose now you want some mamby-pamby usage diagnostic... use -h for help.\n"); + exit(1); + } + fprintf(stderr,"\n"); + fflush(stdout); + fflush(stderr); + + + while ((ch = getopt(argc, argv, "ho:")) != -1) + { + switch (ch) + { + case 'o': + if (!(outf = fopen(optarg, "w+"))) + { + fprintf(stderr, "snortpp: %s: %s\n", optarg, strerror(errno)); + exit(1); + } + break; + default: + usage(); + } + } + fputs("# Rules File generated by snortpp \n",outf); + fputs("#\n# Rule Type Definitions\n#\n",outf); + for(ch = optind; ch < argc; ch++) + { + parsefile(argv[ch]); + } + // ok lets print out this junk + fputs("#\n# Variable Declarations\n#\n",outf); + outlist = splaytolist(vars); + while(outlist) + { + fprintf(outf,"var %s %s\n", ((SnortVar *)(outlist->key))->name, ((SnortVar *)(outlist->key))->val); + outlist = outlist->next; + } + fputs("#\n# Rule Definitions\n#\n",outf); + outlist = splaytolist(ruletree); + while(outlist) + { + fprintrule(outf,(Rule *)outlist->key); + outlist = outlist->next; + } + fputs("#\n# end of file generated by snortpp\n#\n",outf); + if(outf != stdout) + fclose(outf); +//phew... --dr +} Index: snort/contrib/snortwatch-0.7.tar.gz Index: snort/contrib/rpm/CHANGES.rpms diff -u /dev/null snort/contrib/rpm/CHANGES.rpms:1.2.2.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/CHANGES.rpms Sat May 14 02:22:34 2005 @@ -0,0 +1,34 @@ +$Id: CHANGES.rpms,v 1.1.2.1 2004/08/09 15:03:49 jhewlett Exp $ + +CHANGES.rpms +By JP Vossen & Dan Wittenberg + +Last Updated: 2004-08-08 + + +"Official" Snort.org RPM Change Log +=================================== + +2.2.0 + +* No changes. See 2.2.0RC1. + + +2.2.0RC1 + +* Better support for 'all' interfaces option. (Thanks to Sandro Poppi) +* Improved support for selecting specific interfaces in snortd and + sysconfig/snort. (Thanks to Sandro Poppi) +* Added BPF option in snortd and sysconfig/snort. (Thanks to Sandro Poppi) +* Added BPFFILE option in snortd and sysconfig/snort. +* Added CHANGES.rpms (this file). +* BUGFIXs for experimental snortd stats option. + + +2.1.3 + +* Experimental support for snortd stats (long|opt) option. + + +See README.rpms for older changes. + Index: snort/contrib/rpm/README.build_rpms diff -u /dev/null snort/contrib/rpm/README.build_rpms:1.1.1.2.2.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/README.build_rpms Sat May 14 02:22:34 2005 @@ -0,0 +1,265 @@ +$Id: README.build_rpms,v 1.1.1.2.2.2 2005/05/14 06:22:34 andrew Exp $ + +README.build_rpms +By JP Vossen & Dan Wittenberg + +Last Updated: 2004-07-16 + + +How to build your own Snort RPMs--Introduction +============================================== +RPM is the accepted package manager for a large number of Linux +distributions. It is designed to allow easy and repeatable builds and +binary installations for software. This is especially important for a +package like Snort, where security and consistency are critical. Since you +should never install a compiler on a hardened machine, and especially +never on a security device like a firewall or IDS, a binary installer like +RPM makes it very easy to install and update software. + +However, many people are not comfortable unless they download and compile +the software themselves. This document will show you how to download the +Snort source code, compile it and build your own RPM very easily. + +RPM requires a SPEC file to provide details on how to compile and build +the source code into an RPM package. The most difficult and time consuming +part of building an RPM is writing a correct SPEC file. We've already done +that for you (and it is heavily commented as well). The Snort.org SPEC +file can build the following packages, with or without flexible response +(see README.flexresp for more details): + + Snort Plain (required for all others) + Snort with MySQL + Snort with PostgreSQL + Snort with Oracle (EXPERIMENTAL) + + +Prerequisites +============= +In order to build RPMs you must install the 'rpm-build' package. You will +also need the following if you plan to build packages other than plain: + + Package Dependency + --------------------- ---------------- + All rpm-build (rpm version 4 and above), + pcre-devel + Snort with MySQL MYSQL-devel, pcre-devel + Snort with PostgreSQL postgresql-devel, pcre-devel + Snort with Oracle Oracle libs in /opt/oracle, pcre-devel + +If you plan to build flexresp, you also need libnet. Depending on which +libnet RPM you install, you may get statically linked binaries. If you +have statically linked libraries you only need the static library on the +build machine, NOT the machine on which the final compiled binary runs. +Given the fact that Snort sensors are security devices and having dynamic +libnet capabilities may be undesirable, static linking is a Good Thing. + +The strongly recommended libnet to use is custom 1.0.2a Packetfactory RPM +Chris Green built a while ago that may be found here [0]. This is the only +Snort.org supported libnet and it allows snort to statically compile +libnet as noted above. + + +Building from a Tarball +======================= +If you have a recent version of RPM which supports the -tx options, you +can build directly from the official Snort.org tarball distribution. RPM +versions 4 and above are known to work. Some versions of rpm 3 have been +known to work, specifically those with SuSE 8.1 and SuSE 8.2 + +Version 4: +rpmbuild {package options} -ta {path/to/snort-n.n.n.tar.gz} + +Version 3: +rpm {package options} -ta {path/to/snort-n.n.n.tar.gz} + +(We will assume version 4 elsewhere in the documentation) + + +rpmbuild Package Options +======================== + + --with flexresp + Add flexresp capability to whatever package(s) you are + building. + + --with mysql + Builds a binary/package with support for MySQL. + + --with postgresql + Builds a binary/package with support for PostgreSQL. + + --with oracle + Builds a binary/package with support for Oracle. + + --with fedora + Builds the same binary packages as above, but will name + the resulting binary RPM's suitable for use with Fedora. + +See below for some examples. + + +Rebuilding from the Source RPM (SRPM) +===================================== +You can also download the source RPM and rebuild from that. Simply get the +SRPM from Snort.org and rebuild: + + rpmbuild --rebuild /path/to/snort-x.x.x-x.src.rpm + + +rpmbuild examples +================= + +$ rpmbuild --with mysql --with postgresql -ta snort-2.0.4.tar.gz + +--OR-- + +$ rpmbuild --with mysql --with postgresql --rebuild snort-2.0.4-1.src.rpm + + + +$ ls -1 /usr/src/redhat/RPMS/i386/snort-* +/usr/src/redhat/RPMS/i386/snort-2.0.4-1.i386.rpm +/usr/src/redhat/RPMS/i386/snort-mysql-2.0.4-1.i386.rpm +/usr/src/redhat/RPMS/i386/snort-postgresql-2.0.4-1.i386.rpm + + +The "Official" Snort.org RPM build +================================== +We build the official Snort.org RPMs with the generate-all-rpms script in +the contribs/rpm directory. + +In theory, anyone can build RPMs that are identical to the official +Snort.org RPMS. However, only the official RPMs will be signed by the +Snort.org GPG key [1]. + +PLEASE verify your RPMs with this key before installing them. + + +Distribution Specific Builds +============================ +The SPEC file contains code to build RPMS for specific Linux +distributions, currently Fedora (fedora.redhat.com) and cAos +(www.caosity.org). In the case of Fedora you will use '--with fedora' on +the rpmbuild command line to build with Fedora's naming scheme. Since the +cAos buildsystem is completely automated, no rpmbuild command line options +are allowed, so the SPEC file looks for the '/usr/lib/rpm/caos' directory +to see if it's running under cAos. This is not ideal as it will build all +packages under any cAos machine--not just the autobuilder. But it's the +best I can do right now. Anyone have any better ideas? + + +Verifying an RPM's PGP/GPG Key +============================== +Download and add the Snort key to RPM: + wget http://www.snort.org/public-key.html + rpm --import public-key.html + +Verify the signature: + rpm --checksig /path/to/snort-x.x.x-x.i386.rpm + rpm -v --checksig /path/to/snort-x.x.x-x.i386.rpm + -- OR -- + rpm -K /path/to/snort-x.x.x-x.i386.rpm + rpm -vK /path/to/snort-x.x.x-x.i386.rpm + +If you see something like the following, it's good. NOTE, you MUST see +"gpg OK" for the signature to exist and be valid! Any random RPM may be +created without a signature, so make sure your official RPM has one. + /path/to/snort-x.x.x-xsnort.i386.rpm: (sha1) dsa sha1 md5 gpg OK + +The -v (for verbose) options give you a little more detail. Again, make +sure the signature lines present and OK. + +If you see a "NOT OK" message, something did not verify. Any items that +were correct will be listed in lower case (e.g. sha1 md5) while any failed +items are in upper case (e.g. GPG). There may also be an error message, +such as "MISSING KEYS." + + +Examining the SPEC file +======================= +We have tried to make the Snort.org SPEC file as "user friendly" as +possible. In particular, it has lots of comments. So it may be useful to +look it over, or you may just want to build the old fashioned way. In any +case, there are three easy ways to get it. + +Get it from Snort's CVS: + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/snort.org.spec + +Get it from the tarball: + tar -xvzf /path/to/snort-x.x.x.tar.gz + +Get it from the SRPM + Get the SRPM from Snort.org + Extract the SRPM: rpm2cpio /path/to/snort-x.x.x-x.src.rpm | cpio -i + -- OR -- + Install the SRPM: rpm -i /path/to/snort-x.x.x-x.src.rpm + + +Building from Snort.org CVS Snapshots [2] +========================================= + +Building from the "stable" snapshot should work as above. However, +building from the "current" snapshot requires some manual intervention. + +1. Cd to /tmp or someplace safe: cd /tmp +2. Untar the source: tar -xvzf /path/to/snort-current.tar.gz +3. Rename the resulting snort directory: mv snort snort-current +4. Edit snort-current/contrib/rpm/snort.org.spec and change the line + %define release {whatever} +to + %define release 1 +and + Version: stable (or 2.1.x or whatever) +to + Version: current +5. Rename the original tarball: mv snort-current.tar.gz snort-current-orig.tar.gz +6. Re-tar the file: tar -cvzf snort-current.tar.gz snort-current +7. Build as usual: rpmbuild -ta snort-current.tar.gz + +If you don't know how to do all of that, you probably want the regular +compiled binary packages or the snort-stable snapshot. + + + +References +========== +[0] Chris Green's Snort Libnet: + http://www.starken.com/snort/index.html#libnet + +[1] Snort.org PGP/GPG key + http://www.snort.org/public-key.html + +[2] Snort.org CVS Snapshots + http://www.snort.org/dl/snapshots/ + +The latest Snort README.rpms + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/README.rpms + +The latest Snort README.build_rpms (this document) + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/README.build_rpms + +The official Snort.org RPM SPEC file: + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/snort.org.spec + +The RPM Homepage + http://www.rpm.org/ + +The RPM FAQ + http://www.rpm.org/RPM-HOWTO/ + +Book: Red Hat Linux RPM Guide + Esp. pgs: 236, 399, 400 + By Eric Foster-Johnson, ISBN: 0-7645-4965-0, 549 pages + http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764549650.html + http://www.bookpool.com/.x/zsz8obm990/sm/0764549650/ + +Book: Maximum RPM (Older, but mostly still valid) + On-Line, free: http://www.rpm.org/max-rpm/ + http://www.bookpool.com/.x/zsz8obm990/sm/0672311054/ + +Note on "rpmbuild -ta {tarfile}" + http://sourceforge.net/mailarchive/forum.php?thread_id=1840467&forum_id=2311 + +Linux RPM Repository and Browse Tool + http://rufus.w3.org/linux/RPM/ + Index: snort/contrib/rpm/README.rpms diff -u /dev/null snort/contrib/rpm/README.rpms:1.1.1.2.2.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/README.rpms Sat May 14 02:22:34 2005 @@ -0,0 +1,106 @@ +$Id: README.rpms,v 1.1.1.2.2.2 2005/05/14 06:22:34 andrew Exp $ + +README.rpms +By JP Vossen & Dan Wittenberg + +Last Updated: 2004-07-16 + + +"Official" Snort.org RPM Documentation +====================================== + +Official Snort.org RPMs are back and better than ever. However, we've +made some changes that you need to be aware of, and we've documented some +other things of interest. + +Thanks to JP Vossen (http://www.jpsdomain.org/security/snort.html) who was +originally guilted into taking over RPM upkeep , and to Daniel +Wittenberg (http://www.starken.com/) who graciously volunteered to help +and to provide a build host. The RPMs are now being co-maintained by them. +Send e-mail to rpms@snort.org with any comments or questions. + + +Improvements +------------ +We've made a lot of changes under the covers to improve the flexibility +and maintainability of the RPMs going forward. See the next section for +details about that. + +The most interesting and significant is the new ability to build RPMs +directly from the source code tarball! That means you can download either +a release tarball or one of the nightly CVS snapshot tarballs and build +RPMs *almost* effortlessly. See README.build_rpms [0] for the details and +the caveat about the "current" snapshot. + + +Changes from the previous Snort RPMs +------------------------------------ + +Use this command to view the most current change log before you install +the latest package: + rpm -q --changelog -p snort-x.x.x-x.i386.rpm | less + + +Beginning with Snort 2.0.2, the official RPMs include the following +changes: + +* snortd has been significantly revised to better conform with the +/etc/sysconfig scheme. See /etc/sysconfig/snort and /etc/init.d/snortd for +details. + +* The doc, contrib and signatures directories are included in your doc +directory (e.g. /usr/share/doc/snort-x.x.x). + +* The signatures directory is gzipped to save space beginning with Snort +2.1.0. + +* The signatures directory is moved out from doc to the root of the Snort +documentation directory to make it more visible. + +* Rules have been moved to /etc/snort/rules for readability and more +compatibility with rule-updating software like oinkmaster. + +* The RPM SPEC file has been significantly revised and documented. It has +also been added to the source tarball (contrib/rpm), facilitating building +your own RPM directly from the tarball. See README.build_rpms [0] and the +SPEC [2] file for details. + +* The binary packages built by the SPEC file have been simplified, and +rpmbuild '--with' options have been added to facilitate easy +do-it-yourself builds. See README.build_rpms [0] and the SPEC [2] file for +details. + +* Neither version of flexresp is included in the official binary RPMs. You +may build it in yourself if needed. + +* We've added a lot of new documentation about RPMs, like this document +you're reading. + + +Supported Distributions +======================= +The rpmbuild -ta method and new SPEC file have been tested and are known +to work on Red Hat 7.3, 8.0, 9, and 2.9.5AS Beta (Taroon). Some basic build +tests have been done on SuSE 8.1 and 8.2 (which use rpm version 3). + +They should also work on any distribution that supports RPM and have rpm v4 +or better. Please submit problems, comments and patches to rpms@snort.org. + +Support for Fedora (fedora.redhat.com) naming convention RPMs is included. +cAos (www.caosity.org) RPMs are also supported so you should be able to +install and maintain Snort via yum and the cAos mirrors without any +additional effort. + + +References +========== +[0] The latest Snort README.build_rpms + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/README.build_rpms + +[1] The official Snort.org RPM SPEC file: + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/snort.org.spec + +The latest Snort README.rpms + http://cvs.snort.org/viewcvs.cgi/snort/contrib/rpm/README.rpms + + Index: snort/contrib/rpm/RPM-TODO diff -u /dev/null snort/contrib/rpm/RPM-TODO:1.1.1.1 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/RPM-TODO Tue Mar 8 16:36:13 2005 @@ -0,0 +1,6 @@ +################################################################ +# Future releases +- get to work better with the CVS current snapshot tarball? +- build chroot RPM package +- Add a 'stats (long|opt)' option to snortd (kill -USR1) + Index: snort/contrib/rpm/generate-all-rpms diff -u /dev/null snort/contrib/rpm/generate-all-rpms:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/generate-all-rpms Thu Mar 10 13:13:36 2005 @@ -0,0 +1,25 @@ +#!/bin/bash +# $Id: generate-all-rpms,v 1.1.1.2 2005/03/10 18:13:36 andrew Exp $ +# Generate the "official" Snort.org RPMs. + +# The following will build 3 binary and 1 source RPM as follows: +# snort-x.x.x-x.i386.rpm +# snort-mysql-x.x.x-x.i386.rpm +# snort-postgresql-x.x.x-x.i386.rpm +# snort-x.x.x-x.src.rpm +# +# mysql and postgresql are probably mutually exclusive when building for +# your own use, and flexresp is optional. We therefor encourage you to +# build your own RPMs as you see fit. See README.build_rpms. + +# If you wish to build with Oracle support, you need to use --with-oracle +# for the build syntax, and have your client libraries installed in +# /opt/oracle + +rpmbuild -bb --target i386 --with mysql --with postgresql snort.org.spec +rpmbuild -bs --target i386 snort.org.spec + +rpmbuild -bb --target i386 --with fedora --with mysql --with postgresql snort.org.spec +rpmbuild -bs --target i386 --with fedora snort.org.spec + + Index: snort/contrib/rpm/snort.logrotate diff -u /dev/null snort/contrib/rpm/snort.logrotate:1.1.1.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/snort.logrotate Thu Mar 10 13:13:36 2005 @@ -0,0 +1,13 @@ +# /etc/logrotate.d/snort +# $Id: snort.logrotate,v 1.1.1.2 2005/03/10 18:13:36 andrew Exp $ + +/var/log/snort/alert /var/log/snort/*log /var/log/snort/*/alert /var/log/snort/*/*log { + daily + rotate 7 + missingok + compress + postrotate + /etc/init.d/snortd restart 1>/dev/null || true + endscript +} + Index: snort/contrib/rpm/snort.org.spec diff -u /dev/null snort/contrib/rpm/snort.org.spec:1.1.1.6.2.3 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/snort.org.spec Sat May 14 02:22:34 2005 @@ -0,0 +1,748 @@ +# $Id: snort.org.spec,v 1.1.1.6.2.3 2005/05/14 06:22:34 andrew Exp $ +# Snort.org's SPEC file for Snort + +################################################################ +# rpmbuild Package Options +# ======================== +# +# See README.build_rpms for more details. +# +# --with flexresp +# Add flexresp capability to whatever package(s) you are +# building. +# +# --with mysql +# Builds a binary/package with support for MySQL. +# +# --with postgresql +# Builds a binary/package with support for PostgreSQL. +# +# --with oracle +# Builds a binary/package with support for Oracle. +# +# --with fedora +# Builds with Fedora's naming scheme +# +# See pg 399 of _Red_Hat_RPM_Guide_ for rpmbuild --with and --without options. +################################################################ + +# Other useful bits +%define OracleHome /opt/oracle/OraHome1 +%define SnortRulesDir /etc/snort/rules + +# Handle the options noted above. +# Default of no flexresp, but --with flexresp will enable it +%define flexresp 0 +%{?_with_flexresp:%define flexresp 1} + +# Default of no MySQL, but --with mysql will enable it +%define mysql 0 +%{?_with_mysql:%define mysql 1} + +# Default of no PostgreSQL, but --with postgresql will enable it +%define postgresql 0 +%{?_with_postgresql:%define postgresql 1} + +# Default of no Oracle, but --with oracle will enable it +%define oracle 0 +%{?_with_oracle:%define oracle 1} + +# In case we are building for Fedora +%define vendor Snort.org +%define for_distro RPMs +%define fedora 0 +%{?_with_fedora:%define vendor Fedora Linux } +%{?_with_fedora:%define for_distro RPMs for Fedora Linux } + +# Look for a directory to see if we're building under cAos +# Exit status is usually 0 if the dir exists, 1 if not, so +# we reverse that with the '!' +%define caos %([ ! -d /usr/lib/rpm/caos ]; echo $?) + +%if %{caos} + # We are building for cAos (www.caosity.org) and the autobuilder doesn't + # have command line options so we have to fake the options for whatever + # packagaes we actually want here, in addition to tweaking the package + # info. + %define vendor cAos Linux + %define for_distro RPMs for cAos Linux + %define mysql 1 + %define postgresql 1 +%endif + + +# Be sure to update the release and fedora release numbers! +########################################################### +%define release 1 +%{?_with_fedora:%define release 0.fdr.1 } +%if %{caos} + %define release 1.caos +%endif +########################################################### + +Summary: An open source Network Intrusion Detection System (NIDS) +Name: snort +Version: 2.2.0 +Release: %{release} +Epoch: 0 +License: GPL +Group: Applications/Internet +Source0: http://www.snort.org/dl/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Url: http://www.snort.org/ +Packager: Official Snort.org %{for_distro} +Vendor: %{vendor} +Distribution: %{vendor} +BuildRequires: pcre-devel, libpcap +Requires: pcre, libpcap + +%if %{flexresp} +BuildRequires: libnet + %define EnableFlexresp --enable-flexresp +%endif + + +%package mysql +Summary: Snort with MySQL support +Group: Applications/Internet +Requires: %{name} = %{epoch}:%{version}-%{release} +%if %{mysql} +BuildRequires: mysql-devel +%endif + +%description mysql +Snort binary compiled with mysql support. + + +%package postgresql +Summary: Snort with PostgreSQL support +Group: Applications/Internet +Requires: %{name} = %{epoch}:%{version}-%{release} +%if %{postgresql} +BuildRequires: postgresql-devel +%endif + +%description postgresql +Snort binary compiled with postgresql support. + + +%package oracle +Summary: Snort with Oracle support +Group: Applications/Internet +Requires: %{name} = %{epoch}:%{version}-%{release} + +%description oracle +Snort binary compiled with Oracle support. + +EXPERIMENTAL!! I don't have a way to test this, so let me know if it works! +ORACLE_HOME=%{OracleHome} + + +%description +Snort is an open source network intrusion detection system, capable of +performing real-time traffic analysis and packet logging on IP networks. +It can perform protocol analysis, content searching/matching and can be +used to detect a variety of attacks and probes, such as buffer overflows, +stealth port scans, CGI attacks, SMB probes, OS fingerprinting attempts, +and much more. + +Snort uses a flexible rules language to describe traffic that it should +collect or pass, as well as a detection engine that utilizes a modular +plugin architecture. Snort 2.1.0 adds regular expressions to the Snort +rules language, allowing almost unlimited flexibility in describing +packets. Snort has a real-time alerting capability as well, incorporating +alerting mechanisms for syslog, a user specified file, a UNIX socket, and +others. + +Snort has three primary uses. It can be used as a straight packet sniffer +like tcpdump(1), a packet logger (useful for network traffic debugging, +etc), or as a full blown network intrusion detection system. + +You MUST edit /etc/snort/snort.conf to configure snort before it will work! + +There are 3 different packages available. All of them require the base +snort rpm (this one). Additionally, you may need to chose a different +binary to install if you want database support. + +If you install a different binary package %{_sbindir}/snort should end up +being a symlink to a binary in one of the following configurations: + + plain Snort (this package, required) + mysql Snort with mysql (optional) + postgresql Snort with postgresql (optional) + oracle Snort with oracle (optional, not official) + +Please see the documentation in %{_docdir}/%{name}-%{version}, especially +README.build_rpms if you would like to build your own custom RPM. + + +%prep +# Make sure buildroot is not insane +if [ "$RPM_BUILD_ROOT" == "/" ]; then + echo 'Invalid Build root' + exit 1 +fi + + +%setup -q -n %{name}-%{version} + +# When building from a Snort.org CVS snapshot tarball, you have to run +# autojunk before you can build. +if [ \( ! -s configure \) -a \( -x autojunk.sh \) ]; then + ./autojunk.sh +fi + +# Make sure it worked, or die with a useful error message. +if [ ! -s configure ]; then + echo "Can't find ./configure. ./autojunk.sh not present or not executable?" + exit 2 +fi + + +%build + +BuildSnort() { + mkdir "$1" + cd "$1" + ln -s ../configure ./configure + + if [ "$1" = "plain" ] ; then + ./configure $SNORT_BASE_CONFIG \ + --without-mysql \ + --without-postgresql \ + --without-oracle \ + %{?EnableFlexresp} %{?EnableFlexresp2} + fi + + if [ "$1" = "mysql" ]; then + ./configure $SNORT_BASE_CONFIG \ + --with-mysql \ + --without-postgresql \ + --without-oracle \ + %{?EnableFlexresp} %{?EnableFlexresp2} + fi + + if [ "$1" = "postgresql" ]; then + ./configure $SNORT_BASE_CONFIG \ + --without-mysql \ + --with-postgresql \ + --without-oracle \ + %{?EnableFlexresp} %{?EnableFlexresp2} + fi + + if [ "$1" = "oracle" ]; then + export ORACLE_HOME=%{OracleHome} + ./configure $SNORT_BASE_CONFIG \ + --without-mysql \ + --without-postgresql \ + --with-oracle=$ORACLE_HOME \ + %{?EnableFlexresp} %{?EnableFlexresp2} + fi + + make + mv src/snort ../snort-"$1" + cd .. +} + + +CFLAGS="$RPM_OPT_FLAGS" +export AM_CFLAGS="-g -O2" +SNORT_BASE_CONFIG="--prefix=%{_prefix} \ + --bindir=%{_sbindir} \ + --sysconfdir=/etc/snort \ + --with-libpcap-includes=%{_includedir} \ + --without-odbc" + +# Always build snort-plain +BuildSnort plain + +# Mayby build the others +%if %{mysql} + BuildSnort mysql +%endif + +%if %{postgresql} + BuildSnort postgresql +%endif + +%if %{oracle} + BuildSnort oracle +%endif + + +%install + +# Remove leftover CVS files in the tarball, if any... +find . -type 'd' -name "CVS" -print | xargs %{__rm} -rf + + +if [ -d doc/signatures/signatures ]; then +# Fix a double path in the signature dir, if still bad, and move signature +# documentation to a more prominent place (not buried under doc). + mv doc/signatures/signatures . + rmdir doc/signatures +elif [ -d doc/signatures ]; then +# Else, move signature documentation to a more prominent place (not buried +# under doc). + mv doc/signatures . +fi + +InstallSnort() { + if [ "$1" = "mysql" ]; then + install -p -m 0755 snort-mysql $RPM_BUILD_ROOT%{_sbindir}/snort-mysql + fi + + if [ "$1" = "postgresql" ]; then + install -p -m 0755 snort-postgresql $RPM_BUILD_ROOT%{_sbindir}/snort-postgresql + fi + + if [ "$1" = "oracle" ]; then + install -p -m 0755 snort-oracle $RPM_BUILD_ROOT%{_sbindir}/snort-oracle + fi + + if [ "$1" = "plain" ]; then + if [ -d $RPM_BUILD_ROOT ] && [ "$RPM_BUILD_ROOT" != "/" ]; then + rm -rf $RPM_BUILD_ROOT + fi + + mkdir -m 0755 -p $RPM_BUILD_ROOT%{_sbindir} + mkdir -m 0755 -p $RPM_BUILD_ROOT%{SnortRulesDir} + mkdir -m 0755 -p $RPM_BUILD_ROOT/etc/snort + mkdir -m 0755 -p $RPM_BUILD_ROOT/etc/sysconfig + mkdir -m 0755 -p $RPM_BUILD_ROOT/etc/logrotate.d + mkdir -m 0755 -p $RPM_BUILD_ROOT/var/log/snort + mkdir -m 0755 -p $RPM_BUILD_ROOT/etc/init.d + mkdir -m 0755 -p $RPM_BUILD_ROOT%{_mandir}/man8 + mkdir -m 0755 -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/contrib + mkdir -m 0755 -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/doc + mkdir -m 0755 -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/signatures + + install -p -m 0755 snort-plain $RPM_BUILD_ROOT%{_sbindir}/snort-plain + install -p -m 0644 snort.8 $RPM_BUILD_ROOT%{_mandir}/man8 + gzip $RPM_BUILD_ROOT%{_mandir}/man8/snort.8 + install -p -m 0755 contrib/rpm/snortd $RPM_BUILD_ROOT/etc/init.d + install -p -m 0644 contrib/rpm/snort.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/%{name} + install -p -m 0644 contrib/rpm/snort.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/snort + install -p -m 0644 rules/*.rules $RPM_BUILD_ROOT/%{SnortRulesDir} + install -p -m 0644 etc/reference.config etc/classification.config \ + etc/unicode.map etc/gen-msg.map etc/sid-msg.map \ + etc/threshold.conf etc/snort.conf etc/generators \ + $RPM_BUILD_ROOT/etc/snort + find contrib -type f -exec chmod 0644 {} \; + find contrib -type d -exec chmod 0755 {} \; + cp -a contrib/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/contrib + install -p -m 0644 doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/doc + install -p -m 0644 signatures/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/signatures + + find $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/signatures/ -type f -exec gzip {} \; + rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/doc/Makefile.* + rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/contrib/Makefile.* + fi +} + +# Fix the RULE_PATH +sed -e 's;var RULE_PATH ../rules;var RULE_PATH %{SnortRulesDir};' \ + < etc/snort.conf > etc/snort.conf.new +rm -f etc/snort.conf +mv etc/snort.conf.new etc/snort.conf + +# Always install snort-plain +InstallSnort plain + +# Maybe install the others +%if %{mysql} + InstallSnort mysql +%endif + +%if %{postgresql} + InstallSnort postgresql +%endif + +%if %{oracle} + InstallSnort oracle +%endif + + +%clean +if [ -d $RPM_BUILD_ROOT ] && [ "$RPM_BUILD_ROOT" != "/" ]; then + rm -rf $RPM_BUILD_ROOT +fi + + +%pre +# Don't do all this stuff if we are upgrading +if [ $1 = 1 ] ; then + groupadd snort 2> /dev/null || true + useradd -M -d %{_var}/log/snort -s /bin/false -c "Snort" -g snort snort 2>/dev/null || true +fi + +%post mysql +if [ -L %{_sbindir}/snort ] || [ ! -e %{_sbindir}/snort ] ; then + rm -f %{_sbindir}/snort; ln -sf %{_sbindir}/snort-mysql %{_sbindir}/snort +fi + +%post postgresql +if [ -L %{_sbindir}/snort ] || [ ! -e %{_sbindir}/snort ] ; then + rm -f %{_sbindir}/snort; ln -sf %{_sbindir}/snort-postgresql %{_sbindir}/snort +fi + +%post oracle +if [ -L %{_sbindir}/snort ] || [ ! -e %{_sbindir}/snort ] ; then + rm -f %{_sbindir}/snort; ln -sf %{_sbindir}/snort-oracle %{_sbindir}/snort +fi + +%post +# Make a symlink if there is no link for snort-plain +if [ -L %{_sbindir}/snort ] || [ ! -e %{_sbindir}/snort ] ; then \ + rm -f %{_sbindir}/snort; ln -sf %{_sbindir}/snort-plain %{_sbindir}/snort; fi + +# We should restart it to activate the new binary if it was upgraded +/etc/init.d/snortd condrestart 1>/dev/null 2>/dev/null + +# Don't do all this stuff if we are upgrading +if [ $1 = 1 ] ; then + chown -R snort.snort /var/log/snort + /sbin/chkconfig --add snortd +fi + + + +%preun +if [ $1 = 0 ] ; then + # We get errors about not running, but we don't care + /etc/init.d/snortd stop 2>/dev/null 1>/dev/null + /sbin/chkconfig --del snortd +fi + +%postun +# Try and restart, but don't bail if it fails +if [ $1 -ge 1 ] ; then + /etc/init.d/snortd condrestart 1>/dev/null 2>/dev/null || : +fi + +# Only do this if we are actually removing snort +if [ $1 = 0 ] ; then + if [ -L %{_sbindir}/snort ]; then rm -f %{_sbindir}/snort; fi + /usr/sbin/userdel snort 2>/dev/null +fi + +%postun mysql +if [ -L %{_sbindir}/snort ]; then + rm -f %{_sbindir}/snort + ln -sf %{_sbindir}/snort-plain %{_sbindir}/snort +fi + +%postun postgresql +if [ -L %{_sbindir}/snort ]; then + rm -f %{_sbindir}/snort + ln -sf %{_sbindir}/snort-plain %{_sbindir}/snort +fi + +%postun oracle +if [ -L %{_sbindir}/snort ]; then + rm -f %{_sbindir}/snort + ln -sf %{_sbindir}/snort-plain %{_sbindir}/snort +fi + +%files +%defattr(-,root,root) +%attr(0755,root,root) %{_sbindir}/snort-plain +%attr(0644,root,root) %{_mandir}/man8/snort.8.gz +%attr(0755,root,root) %dir %{SnortRulesDir} +%attr(0644,root,root) %{SnortRulesDir}/*.rules +%attr(0644,root,root) %config(noreplace) /etc/snort/classification.config +%attr(0644,root,root) %config(noreplace) /etc/snort/reference.config +%attr(0644,root,root) %config(noreplace) /etc/snort/threshold.conf +%attr(0644,root,root) %config(noreplace) /etc/snort/*.map +%attr(0644,root,root) %config(noreplace) /etc/snort/generators +%attr(0644,root,root) %config(noreplace) /etc/logrotate.d/snort +%attr(0644,root,root) %config(noreplace) /etc/snort/snort.conf +%attr(0644,root,root) %config(noreplace) /etc/sysconfig/snort +%attr(0755,root,root) %config(noreplace) /etc/init.d/snortd +%attr(0755,snort,snort) %dir %{_var}/log/snort +%attr(0755,root,root) %dir /etc/snort +%dir %{_docdir}/%{name}-%{version} +%docdir %{_docdir}/%{name}-%{version} +%attr(0755,root,root) %{_docdir}/%{name}-%{version}/* + +%if %{mysql} +%files mysql +%attr(0755,root,root) %{_sbindir}/snort-mysql +%endif + +%if %{postgresql} +%files postgresql +%attr(0755,root,root) %{_sbindir}/snort-postgresql +%endif + +%if %{oracle} +%files oracle +%attr(0755,root,root) %{_sbindir}/snort-oracle +%endif + + +################################################################ +# Thanks to the following for contributions to the Snort.org SPEC file: +# Henri Gomez , Chris Green , Karsten +# Hopp , Tim Powers , William Stearns +# , Hugo van der Kooij , Wim +# Vandersmissen , Dave Wreski , +# JP Vossen , +# Dainel Wittenberg + +%changelog +* Sat Jun 03 2004 JP Vossen +- Bugfix for 'snortd condrestart' redirect to /dev/null in %postun + +* Wed May 12 2004 JP Vossen +- Added code for cAos autobuilder +- Added buildrequires and requires for libpcap + +* Thu May 06 2004 Daniel Wittenberg +- Added JP's stats option to the standard rc script + +* Sat Mar 06 2004 JP Vossen +- Added gen-msg.map and sid-msg.map to /etc/snort + +* Sat Feb 07 2004 Daniel Wittenberg +- Applied postun/snortd patches from Nick Urbanik +- Added threshold.conf, unicode.map and generators to /etc/snort thanks +- to notes from Nick Urbanik + +* Sat Dec 20 2003 Daniel Wittenberg 2.1.0-2 +- Added condrestart option to rc script from patch by +- Nick Urbanik +- Fixed condrestart bug for installs +- Fixed gzip bug that happens on some builds + +* Tue Dec 10 2003 JP Vossen +- Removed flexresp from plain rpm package description +- Added a line about pcre to the package description +- Trivial tweaks to package description + +* Sat Nov 29 2003 Daniel Wittenberg 2.1.0-1 +- Applied some updates from rh0212ms@arcor.de +- Applied some updates from Torsten Schuetze +- Applied some updates from Nick Urbanik +- Fixed ALERTMODE rc script error reported by DFarino@Stamps.com +- Fixed CONF rc script error reported by ?? +- Gzip signature files to save some space +- Added BuildRequires pcre-devel and Requires pcre +- Re-did %post sections so the links are added and removed +- correctly when you add/remove various packages + +* Fri Nov 07 2003 Daniel WIttenberg +- Updated snort.logrotate + +* Thu Nov 06 2003 Daniel Wittenberg 2.0.4 +- Minor updates for 2.0.4 + +* Tue Nov 04 2003 Daniel Wittenberg 2.0.3 +- Updated for 2.0.3 +- Removed 2.0.2 patch +- Remove flexresp2 as it caused too many build problems and doesn't work +- cleanly with 2.0.3 anyway +- Minor documentation updated for 2.0.3 + +* Mon Oct 20 2003 Daniel Wittenberg 2.0.2-6 +- New release version +- Changed /etc/rc.d/init.d to /etc/init.d for more compatibility + +* Fri Oct 17 2003 Daniel Wittenberg +- Changed as many hard-coded references to programs and paths to use +- standard defined macros + +* Fri Oct 10 2003 Daniel Wittenberg +- Include SnortRulesDir in %%files section +- Added classification.config and reference.config in %%files section +- Minor cleanup of the for_fedora macro + +* Sat Oct 04 2003 Dainel Wittenberg +- Nuked post-install message as it caused too many problems +- Changed default ruledir to /etc/snort/rules +- Fixed problem with non-snort-plain symlinks getting created + +* Fri Oct 03 2003 Dainel Wittenberg +- Somehow the snort.logrotate cvs file got copied into the build tree +- and the wrong file got pushed out +- snort.logrotate wasn't included in the %%files section, so added +- it as a config(noreplace) file + +* Thu Oct 02 2003 Dainel Wittenberg 2.0.2-5 +- Added --with fedora for building Fedora RPM's +- Removed references to old snort config patch +- Added noreplace option to /etc/rc.d/init.d/snortd just in case +- Gzip the man page to save (a small tiny) amount of space and make it +- more "standard" +- Added version number to changelog entries to denote when packages were +- released + +* Wed Oct 01 2003 Dainel Wittenberg +- Fixed permission problem with /etc/snort being 644 +- Added noreplace option to /etc/sysconfig/snort + +* Fri Sep 26 2003 Daniel Wittenberg +- Fixed incorrect Version string in cvs version of the spec +- Added snort logrotate file +- Removed |more from output as it confuses some package managers + +* Fri Sep 23 2003 Daniel Wittenberg 2.0.2-4 +- Released 2.0.2-3 and then 2.0.2-4 + +* Sat Sep 20 2003 Daniel Wittenberg +- Added --with flexresp2 build option + +* Fri Sep 19 2003 Daniel Wittenberg 2.0.2-2 +- Gave into JP and changed version back to stable :) + +* Fri Sep 19 2003 Daniel Wittenberg +- Fixed problems in snortd with "ALL" interfaces working correctly +- Removed history from individual files as they will get too big +- and unreadable quickly + +* Thu Sep 18 2003 Daniel Wittenberg 2.0.2-1 +- Updated for 2.0.2 and release 2.0.2-1 + +* Tue Aug 26 2003 JP Vossen +- Added code to run autojunk.sh for CVS tarball builds + +* Mon Aug 25 2003 JP Vossen +- Added missing comments to changelog + +* Sun Aug 20 2003 Daniel Wittenberg +- Moved snortd and snortd.sysconfig to contrib/rpm +- Changed contrib install to a cp -a so the build stops complaining + +* Mon Aug 11 2003 JP Vossen +- Removed the commented patch clutter and a TO DO note +- Fussed with white space + +* Sun Aug 10 2003 Daniel Wittenberg +- Fixed a couple minor install complaints +- userdel/groupdel added back into %%postun +- useradd/groupadd added to %%pre + +* Sat Aug 9 2003 JP Vossen +- Doubled all percent signs in this changelog due to crazy RH9 RPM bug. +- http://www.fedora.us/pipermail/fedora-devel/2003-June/001561.html +- http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=88620 +- Turn off rpm debug due to RH9 RPM issue +- http://www.cs.helsinki.fi/linux/linux-kernel/2003-15/0763.html +- Removed unnecessary SourceX: since they will be in the tarball + +* Thu Aug 7 2003 JP Vossen +- Changed perms from 755 to 644 for %%{_mandir}/man8/snort.8* + +* Sun Aug 3 2003 JP Vossen +- Removed the conf patch (again) as we moved the funcationality +- Added sed to buildrequires and sed it to fix RULE_PATH +- Removed Dan's SPEC code that made a default sysconfig/snort file. + +* Sun Aug 3 2003 JP Vossen +- Trivial changes and additions to documentation and references +- Added --with flexresp option +- Changed libnet buildrequires per Chris +- Added docs and contrib back in, and moved sig docs out of doc. +- Moved CSV and signature 'fixes' into %%install where they should have +- been. Also fixed them. +- Added Dan's new snortd and snort.sysconfig +- Commented out alternate method of creating /etc/sysconfig/snort +- Created %%{OracleHome} +- Added BuildRequires: findutils +- Uncommented the patch and added the patch file + +* Fri Jul 26 2003 Daniel Wittenberg +- commented out the patch for now since it doesn't exist +- if doing a new install echo "INTERFACE=eth0" > /etc/sysconfig/snort +- changed --with-libpcap-includes=/usr/include/pcap to /usr/include since +- that is where the libpcap-snort rpm Chris sent puts things +- added missing " at the end of the SNORT_BASE_CONFIG +- minor change to the ./configure for plain so it actually works +- during an rpm -e of snort do a rm -f to make it a little more quiet in +- case of problems +- massive re-write of multi-package build system +- initial support for compiling with Oracle + +* Sun Jul 20 2003 JP Vossen +- Took over maintenance of Snort.org RPM releases just before v2.0.1 +- Various cleanup of SPEC file and changes to support building from tarball +- Removed some old packages (like SNMP and Bloat), per Chris +- First attempt at using --with option for multi-package build system +- Added a patch to snort.conf for $RULE_PATH and default output plugins + +* Wed Sep 25 2002 Chris Green +- updated to 1.9.0 + +* Tue Nov 6 2001 Chris Green +- merged in Hugo's changes +- updated to 1.8.3 +- fixing symlinks on upgrades + +* Tue Nov 6 2001 Hugo van der Kooij +- added libpcap to the list as configure couldn't find it on RedHat 7.2 +- added several packages to the build requirements + +* Fri Nov 2 2001 Chris Green +- updated to 1.8.2-RELEASE +- adding SQL defines +- created tons of packages so that all popular snort configs are accounted for + +* Sat Aug 18 2001 Chris Green +- 1.8.1-RELEASE +- cleaned up enough to release to general public + +* Tue May 8 2001 Chris Green +- moved to 1.8cvs +- changed rules files +- removed initial configuration + +* Mon Nov 27 2000 Chris Green +- removed strip +- upgrade to cvs version +- moved /var/snort/dev/null creation to install time + +* Tue Nov 21 2000 Chris Green +- changed to %%{SnortPrefix} +- upgrade to patch2 + +* Mon Jul 31 2000 Wim Vandersmissen +- Integrated the -t (chroot) option and build a /home/snort chroot jail +- Installs a statically linked/stripped snort +- Updated /etc/rc.d/init.d/snortd to work with the chroot option + +* Tue Jul 25 2000 Wim Vandersmissen +- Added some checks to find out if we're upgrading or removing the package + +* Sat Jul 22 2000 Wim Vandersmissen +- Updated to version 1.6.3 +- Fixed the user/group stuff (moved to %%post) +- Added userdel/groupdel to %%postun +- Automagically adds the right IP, nameservers to /etc/snort/rules.base + +* Sat Jul 08 2000 Dave Wreski +- Updated to version 1.6.2 +- Removed references to xntpd +- Fixed minor problems with snortd init script + +* Fri Jul 07 2000 Dave Wreski +- Updated to version 1.6.1 +- Added user/group snort + +* Sat Jun 10 2000 Dave Wreski +- Added snort init.d script (snortd) +- Added Dave Dittrich's snort rules header file (ruiles.base) +- Added Dave Dittrich's wget rules fetch script (check-snort) +- Fixed permissions on /var/log/snort +- Created /var/log/snort/archive for archival of snort logs +- Added post/preun to add/remove snortd to/from rc?.d directories +- Defined configuration files as %%config + +* Tue Mar 28 2000 William Stearns +- Quick update to 1.6. +- Sanity checks before doing rm-rf in install and clean + +* Fri Dec 10 1999 Henri Gomez +- 1.5-0 Initial RPM release + Index: snort/contrib/rpm/snort.sysconfig diff -u /dev/null snort/contrib/rpm/snort.sysconfig:1.1.1.2.2.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/snort.sysconfig Sat May 14 02:22:34 2005 @@ -0,0 +1,110 @@ +# /etc/sysconfig/snort +# $Id: snort.sysconfig,v 1.1.1.2.2.2 2005/05/14 06:22:34 andrew Exp $ + +# All of these options with the exception of -c, which tells Snort where +# the configuration file is, may be specified in that configuration file as +# well as the command line. Both the command line and config file options +# are listed here for reference. + + +#### General Configuration + +# What interface should snort listen on? [Pick only 1 of the next 3!] +# This is -i {interface} on the command line +# This is the snort.conf config interface: {interface} directive +INTERFACE=eth0 +# +# The following two options are not directly supported on the command line +# or in the conf file and assume the same Snort configuration for all +# instances +# +# To listen on all interfaces use this: +#INTERFACE=ALL +# +# To listen only on given interfaces use this: +#INTERFACE="eth1 eth2 eth3 eth4 eth5" + + +# Where is Snort's configuration file? +# -c {/path/to/snort.conf} +CONF=/etc/snort/snort.conf + +# What user and group should Snort drop to after starting? This user and +# group should have very few privileges. +# -u {user} -g {group} +# config set_uid: user +# config set_gid: group +USER=snort +GROUP=snort + +# Should Snort change the order in which the rules are applied to packets. +# Instead of being applied in the standard Alert->Pass->Log order, this will +# apply them in Pass->Alert->Log order. +# -o +# config order: {actions in order} +# e.g. config order: log alert pass activation dynamic suspicious redalert +PASS_FIRST=0 + + +#### Logging & Alerting + +# NOTE: NO_PACKET_LOG and BINARY_LOG, ALERTMODE, etc. are mutually +# exclusive. Use either NO_PACKET_LOG or any/all of the other logging +# options. But the more logging options use you, the slower Snort will run. + + +# Where should Snort log? +# -l {/path/to/logdir} +# config logdir: {/path/to/logdir} +LOGDIR=/var/log/snort + +# How should Snort alert? Valid alert modes include fast, full, none, and +# unsock. Fast writes alerts to the default "alert" file in a single-line, +# syslog style alert message. Full writes the alert to the "alert" file +# with the full decoded header as well as the alert message. None turns off +# alerting. Unsock is an experimental mode that sends the alert information +# out over a UNIX socket to another process that attaches to that socket. +# -A {alert-mode} +# output alert_{type}: {options} +ALERTMODE=fast + +# Should Snort dump the application layer data when displaying packets in +# verbose or packet logging mode. +# -d +# config dump_payload +DUMP_APP=1 + +# Should Snort keep binary (AKA pcap, AKA tcpdump) logs also? This is +# recommended as it provides very useful information for investigations. +# -b +# output log_tcpdump: {log name} +BINARY_LOG=1 + +# Should Snort turn off packet logging? The program still generates +# alerts normally. +# -N +# config nolog +NO_PACKET_LOG=0 + +# Print out the receiving interface name in alerts. +# -I +# config alert_with_interface_name +PRINT_INTERFACE=0 + +# When dumping the stats, what log file should we look in +SYSLOG=/var/log/messages + +# When dumping the stats, how long to wait to make sure that syslog can +# flush data to disk +SECS=5 + +# To add a BPF filter to the command line uncomment the following variable +# syntax corresponds to tcpdump(8) +#BPF="not host 192.168.1.1" + +# To use an external BPF filter file uncomment the following variable +# syntax corresponds to tcpdump(8) +# -F {/path/to/bpf_file} +# config bpf_file: /path/to/bpf_file +#BPFFILE=/etc/snort/bpf_file + Index: snort/contrib/rpm/snortd diff -u /dev/null snort/contrib/rpm/snortd:1.1.1.3.2.2 --- /dev/null Mon Jun 13 11:22:42 2005 +++ snort/contrib/rpm/snortd Sat May 14 02:22:34 2005 @@ -0,0 +1,199 @@ +#!/bin/sh +# $Id: snortd,v 1.1.1.3.2.2 2005/05/14 06:22:34 andrew Exp $ +# +# snortd Start/Stop the snort IDS daemon. +# +# chkconfig: 2345 40 60 +# description: snort is a lightweight network intrusion detection tool that \ +# currently detects more than 1100 host and network \ +# vulnerabilities, portscans, backdoors, and more. +# + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source the local configuration file +. /etc/sysconfig/snort + +# Convert the /etc/sysconfig/snort settings to something snort can +# use on the startup line. +if [ "$ALERTMODE"X = "X" ]; then + ALERTMODE="" +else + ALERTMODE="-A $ALERTMODE" +fi + +if [ "$USER"X = "X" ]; then + USER="snort" +fi + +if [ "$GROUP"X = "X" ]; then + GROUP="snort" +fi + +if [ "$BINARY_LOG"X = "1X" ]; then + BINARY_LOG="-b" +else + BINARY_LOG="" +fi + +if [ "$CONF"X = "X" ]; then + CONF="-c /etc/snort/snort.conf" +else + CONF="-c $CONF" +fi + +if [ "$INTERFACE"X = "X" ]; then + INTERFACE="-i eth0" +else + INTERFACE="-i $INTERFACE" +fi + +if [ "$DUMP_APP"X = "1X" ]; then + DUMP_APP="-d" +else + DUMP_APP="" +fi + +if [ "$NO_PACKET_LOG"X = "1X" ]; then + NO_PACKET_LOG="-N" +else + NO_PACKET_LOG="" +fi + +if [ "$PRINT_INTERFACE"X = "1X" ]; then + PRINT_INTERFACE="-I" +else + PRINT_INTERFACE="" +fi + +if [ "$PASS_FIRST"X = "1X" ]; then + PASS_FIRST="-o" +else + PASS_FIRST="" +fi + +if [ "$LOGDIR"X = "X" ]; then + LOGDIR=/var/log/snort +fi + +# These are used by the 'stats' option +if [ "$SYSLOG"X = "X" ]; then + SYSLOG=/var/log/messages +fi + +if [ "$SECS"X = "X" ]; then + SECS=5 +fi + +if [ ! "$BPFFILE"X = "X" ]; then + BPFFILE="-F $BPFFILE" +fi + +###################################### +# Now to the real heart of the matter: + +# See how we were called. +case "$1" in + start) + echo -n "Starting snort: " + cd $LOGDIR + if [ "$INTERFACE" = "-i ALL" ]; then + for i in `cat /proc/net/dev|grep eth|awk -F ":" '{ print $1; }'` + do + mkdir -p "$LOGDIR/$i" + chown -R $USER:$GROUP $LOGDIR + daemon /usr/sbin/snort $ALERTMODE $BINARY_LOG $NO_PACKET_LOG $DUMP_APP -D $PRINT_INTERFACE -i $i -u $USER -g $GROUP $CONF -l $LOGDIR/$i $PASS_FIRST $BPFFILE $BPF + done + else + # check if more than one interface is given + if [ `echo $INTERFACE|wc -w` -gt 2 ]; then + for i in `echo $INTERFACE | sed s/"-i "//` + do + mkdir -p "$LOGDIR/$i" + chown -R $USER:$GROUP $LOGDIR + daemon /usr/sbin/snort $ALERTMODE $BINARY_LOG $NO_PACKET_LOG $DUMP_APP -D $PRINT_INTERFACE -i $i -u $USER -g $GROUP $CONF -l $LOGDIR/$i $PASS_FIRST $BPFFILE $BPF + done + else + # Run with a single interface (default) + daemon /usr/sbin/snort $ALERTMODE $BINARY_LOG $NO_PACKET_LOG $DUMP_APP -D $PRINT_INTERFACE $INTERFACE -u $USER -g $GROUP $CONF -l $LOGDIR $PASS_FIRST $BPFFILE $BPF + fi + fi + touch /var/lock/subsys/snort + echo + ;; + stop) + echo -n "Stopping snort: " + killproc snort + rm -f /var/lock/subsys/snort + echo + ;; + reload) + echo "Sorry, not implemented yet" + ;; + restart) + $0 stop + $0 start + ;; + condrestart) + [ -e /var/lock/subsys/snort ] && $0 restart + ;; + status) + status snort + ;; + stats) + TC=125 # Trailing context to grep + SNORTNAME='snort' # Process name to look for + + if [ ! -x "/sbin/pidof" ]; then + echo "/sbin/pidof not present, sorry, I cannot go on like this!" + exit 1 + fi + + #Grab Snort's PID + PID=`pidof -o $$ -o $PPID -o %PPID -x ${SNORTNAME}` + + if [ ! -n "$PID" ]; then # if we got no PID then: + echo "No PID found: ${SNORTNAME} must not running." + exit 2 + fi + + echo "" + echo "*******" + echo "WARNING: This feature is EXPERIMENTAL - please report errors!" + echo "*******" + echo "" + echo "You can also run: $0 stats [long | opt]" + echo "" + echo "Dumping ${SNORTNAME}'s ($PID) statistics" + echo "please wait..." + + # Get the date and tell Snort to dump stats as close together in + # time as possible--not 100%, but it seems to work. + startdate=`date '+%b %e %H:%M:%S'` + + # This causes the stats to be dumped to syslog + kill -USR1 $PID + + # Sleep for $SECS secs to give syslog a chance to catch up + # May need to be adjusted for slow/busy systems + sleep $SECS + + if [ "$2" = "long" ]; then # Long format + egrep -B 3 -A $TC "^$startdate .* snort.*: ={79}" $SYSLOG | \ + grep snort.*: + elif [ "$2" = "opt" ]; then # OPTimize format + # Just show stuff useful for optimizing Snort + egrep -B 3 -A $TC "^$startdate .* snort.*: ={79}" $SYSLOG | \ + egrep "snort.*: Snort analyzed |snort.*: dropping|emory .aults:" + else # Default format + egrep -B 3 -A $TC "^$startdate .* snort.*: ={79}" $SYSLOG | \ + grep snort.*: | cut -d: -f4- + fi + ;; + *) + echo "Usage: $0 {start|stop|reload|restart|condrestart|status|stats (long|opt)}" + exit 2 +esac + +exit 0 Index: snort/doc/FAQ diff -u /dev/null snort/doc/FAQ:1.1.1.3 --- /dev/null Mon Jun 13 11:22:46 2005 +++ snort/doc/FAQ Sat Mar 12 01:51:37 2005 @@ -0,0 +1,3583 @@ + The Snort FAQ + + The Snort Core Team + +Suggestions for enhancements of this document are always welcome. Please email +them to erek@snort.org . If you have contributed to this document and don't +see your name listed, email us. Many people have contributed to this FAQ: + + + + Marty Roesch Fyodor Yarochkin Dragos Ruiu Jed Pickel + + Max Vision Michael Davis Joe McAlerney Joe Stewart + + Erek Adams Roman Danyliw Christopher Cramer Frank Knobbe + + Phil Wood Toby Kohlenberg Ramin Alidousti Jim Hankins + +Dennis Hollingworth Paul Howell Stef Mit Ofir Arkin + + Jason Haar Blake Frantz Lars Norman Søndergaard Brent Erickson + + Brian Caswell Scot Wiedenfeld Chris Green Jeff Wirth + + Edin Dizdarevic Detmar Liesen Don Ng Matt Kettler + + Joe Lyman Jim Burwell Jed Haile Andrew Hutchinson + + Jeff Nathan Alberto Gonzalez Jason Haar + + + +Dragos Ruiu: This version of this guide has been brought to you by the kind +generosity and sponsorship of Wiley and Sons publishers whose support let +myself, and other snort developers Jeff Nathan and Jed Haile take the time to +work on this document and other tutorials for Snort due out in our upcoming +book. (route++) + + +Contents + + * Contents + * 1 Background + + 1.1 How do you pronounce the names of some of these guys who work on + snort? + + 1.2 Is Fyodor Yarochkin the same Fyodor who wrote nmap? + + 1.3 Where do I get more help on snort? + + 1.4 Where can I get more reading and courses about IDS? + + 1.5 Does Snort handle IP defragmentation? + + 1.6 Does Snort perform TCP stream reassembly? + + 1.7 Does Snort perform stateful protocol analysis? + + 1.8 I'm on a switched network, can I still use Snort? + + 1.9 Is snort vulnerable to IDS noise generators like "Stick" and + "Snot"? + + 1.10 Can snort be evaded by the use of polymorphic mutators on + shellcode? + + 1.11 Does Snort log the full packets that it generates alerts? + * 2 Getting Started + + 2.1 Where do I find binary packages for BlueHat BSD-Linux-RT? + + 2.2 How do I run snort? + + 2.3 Where are my log files located? What are they named? + + 2.4 Why does snort complain about /var/log/snort? + + 2.5 Where's a good place to physically put a Snort sensor? + + 2.6 Libpcap complains about permissions problems, what's going on? + + 2.7 I've got RedHat and .... + + 2.8 Where do I get the latest version of libpcap? + + 2.9 Where do I get the latest version of Winpcap? + + 2.10 What version of Winpcap do I need? + + 2.11 Why does building snort complain about missing references? + + 2.12 Why does building snort fail with errors about yylex and lex_init? + + 2.13 I want to build a snort box. Will this + handle traffic? + + 2.14 What are CIDR netmasks? + + 2.15 What is the use of the "-r" switch to read tcpdump files? + * 3 Configuring Snort + + 3.1 How do I setup snort on a 'stealth' interface? + + 3.2 How do I setup a receive-only ethernet cable? + + 3.3 What are HOME_NET and EXTERNAL_NET? + + 3.4 My network spans multiple subnets. How do I define HOME_NET? + + 3.5 How do I set EXTERNAL_NET? + + 3.6 How can I run snort on multiple interfaces simultaneously. + + 3.7 My IP address is assigned dynamically to my interface, can I use + snort with it? + + 3.8 I have one network card and two aliases, how can I force snort to + "listen" on both addresses ? + + 3.9 How do I ignore traffic coming from a particular host or hosts? + + 3.10 How do I get Snort to log the packet payload as well as the + header? + + 3.11 Why are there no subdirectories under /var/log/snort for IP + addresses? + + 3.12 Why does the portscan plugin log "stealth" packets even though the + host is in the portscan-ignorehosts list? + + 3.13 What the heck is a ``Stealth scan''? + + 3.14 What the heck is a SYNFIN scan? + + 3.15 Which takes precedence, commandline or rule file ? + + 3.16 How does rule ordering work? + + 3.17 How do I configure stream4? + + 3.18 Where does one obtain new/modified rules? How do you merge them + in? + + 3.19 How do you get the latest snort via cvs? + + 3.20 How do I use a remote syslog machine? + + 3.21 How do I build this ACID thing? + * 4 Rules and Alerts + + 4.1 Errors loading rules files + + 4.2 Snort says "Rule IP addr ("1.1.1.1") didn't x-late, WTF?" + + 4.3 Snort is behind a firewall and awfully quiet... + + 4.4 Does snort see packets filtered by IPTables/IPChains/IPF/PF? + + 4.5 I'm getting large amounts of . What should I do? + Where can I go to find out more about it? + + 4.6 What about all these false alarms? + + 4.7 What are all these ICMP files in subdirectories under /var/log/ + snort? + + 4.8 Why does the program generate alerts on packets that have pass + rules? + + 4.9 What are all these "ICMP destination unreachable" alerts? + + 4.10 Why do many snort rules have the flags P (TCP PuSH) and A (TCP + ACK) set? + + 4.11 Snort says BACKDOOR SIGNATURE... does my machine have a Trojan? + + 4.12 What about "CGI Null Byte attacks"? + + 4.13 Why do certain alerts seem to have 'unknown' IPs in ACID? + + 4.14 Can priorities be assigned to Alerts using ACID? + + 4.15 What about 'SMB Name Wildcard' alerts? + + 4.16 What the heck is a SYNFIN scan? + + 4.17 I am getting too many "IIS Unicode attack detected" and/or "CGI + Null Byte attack detected" false positives. How can I turn this + detection off? + + 4.18 How do I test snort alerts and logging? + + 4.19 What is the difference between ``Alerting'' and ``Logging''? + + 4.20 Are rule keywords ORed or ANDed together? + + 4.21 Can snort trigger a rule by MAC addresses? + + 4.22 How can I deactivate a rule? + + 4.23 How can I define an address to be anything except some hosts? + + 4.24 After I add new rules or comment out rules how do I make snort + reload? + + 4.25 Where do the distance and within keywords work from to modify + content searches in rules ? + + 4.26 How can I specify a list of ports in a rule? + + 4.27 How can I protect web servers running on ports other than 80? + + 4.28 How do I turn off "spp:possible EVASIVE RST detection" alerts? + + 4.29 Is there a private SID number range so my rules don't conflict? + + 4.30 How long can Address Lists, Variables, or Rules be? + * 5 Getting Fancy + + 5.1 I hear people talking about ``Barnyard''. What's that? + + 5.2 How do I process those snort logs into reports? + + 5.3 How do I log to multiple databases or output plugins? + + 5.4 How can I test snort without having an ethernet card or a + connection to other computers? + + 5.5 How to start snort as a win32 service? + + 5.6 Is it possible with snort to add a ipfilter/ipfw rule to a + firewall? + + 5.7 What is the best way to use snort to block attack traffic? + + 5.8 Snort complains about the "react" keyword... + + 5.9 How do I get snort to e-mail me alerts? + + 5.10 How do I log a specific type of traffic and send alerts to syslog? + + 5.11 Is it possible to have snort call an external program when an + alert is raised? + + 5.12 How can I use snort to log http urls or smtp traffic ? + + 5.13 How can I move data from the snort db to snort_archive db like + ACID does? + + 5.14 What are some resources that I can use to understand more about + source addresses logged and where they are coming from? + + 5.15 How do I understand this traffic and do IDS alert analysis? + + 5.16 How can I examine logged packets in more detail? + * 6 Problems + + 6.1 I think I found a bug in snort. Now what? + + 6.2 SMB alerts aren't working, what's wrong? + + 6.3 Snort says "Garbage Packet with Null Pointer discarded!". Huh? + + 6.4 Snort says "Ran Out Of Space". Huh? + + 6.5 My ACID db connection times-out when performing long operations + (e.g. deleting a large number of alerts) + + 6.6 Why does ACID keep changing my sensor number and how do I keep it + consistent? + + 6.7 Why does snort report "Packet loss statistics are unavailable under + Linux"? + + 6.8 My /var/log/snort directory get very large..... + + 6.9 Why does the 'error deleting alert' message occur when attempting + to delete an alert with ACID? + + 6.10 ACID appears to be broken in Lynx + + 6.11 I am getting 'snort [pid] uses obsolete (PF_INET, SOCK_PACKET)' + warnings, what's wrong. + + 6.12 On HPUX I get device lan0 open: recv_ack: promisc_phys: Invalid + argument + + 6.13 I am getting snort dying with 'can not create file' error and I + have plenty of diskspace, what's wrong? + + 6.14 I am using Snort on Windows and receive an ``OpenPcap() error upon + startup: ERROR: OpenPcap() device open: Error opening adapter'' What's + wrong? + + 6.15 Snort is not logging to my database! + + 6.16 Portscans are not being logged to my database + + 6.17 Snort is not logging to syslog + + 6.18 I am still getting bombarded with spp_portscan messages even + though the IP that I am getting the portscan from is in my $DNS_SERVERS + var + + 6.19 Why chrooted snort die when I send it a SIGHUP? + + 6.20 My snort crashes, how do I restart it? + + 6.21 Why can't snort see one of the 10Mbps or 100Mbps traffic on my + autoswitch hub + + 6.22 Trying to install snort it says: "bad interpreter: No such file or + directory" + + 6.23 I'm not seeing any interfaces listed under Win32. + + 6.24 It's not working on Win32, how can I tell if my problem is snort + or WinPcap? + + 6.25 I just downloaded a new ruleset and now snort fails complaining + about the rules. + + 6.26 How do I speed up ACID and MySQL ? + + 6.27 Why am I seeing so many "SMTP RCPT TO overflow" alerts ? + + 6.28 I'm getting lots of *ICMP Ping Speedera*, is this bad? + + 6.29 Why are my unified alert times off by +/- N hours? + + 6.30 I try to start snort and it gives an error like "ERROR: Unable to + open rules file: /root/.snortrc or /root//root/.snortrc". What can I do + to fix this? + * 7 Development + + 7.1 How do you put snort in debug mode? + * 8 Miscellaneous + + 8.1 What's this about a snort drinking game? + +1 Background + +1.1 How do you pronounce the names of some of these guys who work on snort? + +For the record, 'Roesch' is pronounced like 'fresh' without the 'f'. +Additionally, 'Ruiu' is pronounced like 'screw you' without the 'sc' (think of +the sound your car makes when it doesn't start on a cold morning). Jed's last +name is like "pick-el", not "pickle". + +1.2 Is Fyodor Yarochkin the same Fyodor who wrote nmap? + +Nope. fyodor@insecure.org is the author of nmap, and he uses the same pseudonym +as other snort Fyodor's real surname. Yeah, messes up my mailbox too, but I +think it's too late to change either of them :-). + +1.3 Where do I get more help on snort? + +Check the website, http://www.snort.org/ . Other good resources are are +available in the source distribution, including the Snort Users Manual and the +USAGE file. There is also a excellent mailing list, snort-users. You can find +info on how to signup at http://www.snort.org/lists.html . You can also join # +snort on irc.freenode.het. + +1.4 Where can I get more reading and courses about IDS? + + All of the following offer courses on Intrusion Detection: + + * SANS - http://www.sans.org + * Usenix - http://www.usenix.org/event/ + * Networld/Interop - http://www.key3media.com/interop/ + * CanSecWest - http://www.cansecwest.com + +There are some books about Snort that are about to be published: + ++--------------------------------------------------------------------------------------------------------+ +| | | | | | +|----------------------------------+---------------------------+----------------+--------------+---------| +| Snort: The Complete Guide | Jeff Nathan, Dragos Ruiu, | Wiley&Sons | 0471455970 | 06/2003 | +|----------------------------------+---------------------------+----------------+--------------+---------| +| to Intrusion Detection | Jed Haile | | | | +|----------------------------------+---------------------------+----------------+--------------+---------| +| Intrusion Detection with Snort: | Rafeeq Rehman | Prentice Hall | I0131407333 | 05/2003 | +|----------------------------------+---------------------------+----------------+--------------+---------| +| Advanced IDS Techniques | | | | | +|----------------------------------+---------------------------+----------------+--------------+---------| +| Snort Intrusion Detection | Ryan Russell | Syngress Media | 1931836744 | 02/2003 | +|----------------------------------+---------------------------+----------------+--------------+---------| +| Snort Intrusion Detection | Jack Koziol | New Riders | 157870281X | 04/2003 | +|----------------------------------+---------------------------+----------------+--------------+---------| +| | | | | | ++--------------------------------------------------------------------------------------------------------+ + +Many good books on Intrusion detection are available. Included are just a few: + ++-------------------------------------------------------------------------------------+ +| | | | +|---------------------------------------------------+--------------------+------------| +| Network Intrusion Detection An Analyst's Handbook | Stephen Northcutt | 0735708681 | +|---------------------------------------------------+--------------------+------------| +| Intrusion Signatures and Analysis | Stephen Northcutt | 0735710635 | +|---------------------------------------------------+--------------------+------------| +| TCP/IP Illustrated, Volume 1 The Protocols | W. Richard Stevens | 0201633469 | +|---------------------------------------------------+--------------------+------------| +| Intrusion Detection | Rebecca G. Bace | 1578701856 | +|---------------------------------------------------+--------------------+------------| +| | | | ++-------------------------------------------------------------------------------------+ + +1.5 Does Snort handle IP defragmentation? + +Yes, use "preprocessor frag2" + +1.6 Does Snort perform TCP stream reassembly? + +Yes, check out the stream4 preprocessor (see FAQ 3.17) that does stateful +analysis session loggin, tcp reassembly and much much more. + +1.7 Does Snort perform stateful protocol analysis? + +Yes. (see FAQ 3.17) does this as well. + +1.8 I'm on a switched network, can I still use Snort? + +Short version: + +Being able to sniff on a switched network depends on what type of switch is +being used. If the switch can mirror traffic, then set the switch to mirror all +traffic to the snort machine's port. + +Extended version: + +There are several ways of deploying NIDS in switched environments which all +have their pros and cons. Which method applies to your needs depends on what +kind of segments you want to monitor and on your budget. Here are the most +common methods: + +1. Switch Mirror - if the switch can mirror traffic, then set the switch to + mirror all traffic to the snort machine's port. + + Advantages: + + - Simple method, works with most decent switches. + + Drawbacks: + + - if the switch is a fast ethernet switch, you can mirror 100Mbit/s + max. Since each switch port is capable of handling 100Mbit/s for each + direction, the bandwidth per port sums up to 200Mbit/s, so the switch + will not be able to mirror all packets at high network utilization. + + - some switches suffer from performance degradation through port + mirroring. + +2. Hub - inserting a hub in line, so you can simply tap all traffic. Works + fine for home networks, will lose data due to collisions at loads greater + than 50% - so a 10Mbps hub should be fine for T1/E1, DSL or cablemodem. If + you have a DS3 or greater, you should investigate taps. + + + Advantages: + + -Simple method + + -No impact on switch performance and no config changes + + -low cost + + Drawbacks: + + -loss of full-duplex capabilities + + -additional single point of failure + + - collision loss at above 50% load levels + +3. Network Taps - using network taps (e.g. Shomiti/Finisar^[*] and Netoptics^ + [*]). You can find some rather good information in the papers by Jeff + Nathan. You can find the papers at http://www.snort.org/docs/#deploy . + + Advantages: + + - no impact on switch performance and no special configuration + + - stealth, i.e. sending data back to the switch is disabled + + - no single point of failure, "fail-open" if the tap power fails + + Drawbacks: + + - the datastream is split into TX and RX, so you need two NICs + + - the two datastreams have to be recombined, i.e. merged, if you don't + want to lose the capability of doing stateful analysis. This can be + done by using channel bonding. Information can be found at http:// + sourceforge.net/projects/bonding . - cost + +4. Throw money at it - tapping all switch ports (using the forementioned + network taps) but only tapping all incoming packets (RX lines of the switch + ports), connecting those tap ports to a dedicated gigabit switch, which is + capable of mirroring up to ten RX taplines to one single dedicated gigabit + port, which is connected to a gigabit IDS machine. + + + Advantages: + + -maximum coverage (i.e. monitor all switchports) + + -no performance degradation or re-configuration of the switch + + Drawbacks: + + -mucho $$$ + +1.9 Is snort vulnerable to IDS noise generators like "Stick" and "Snot"? + +It is now possible to defeat these kinds of noise generators with the (see FAQ +3.17) preprocessor. Even without the stream4 preprocessor enabled, snort will +weather the alert storm without falling over or losing a lot of alerts due to +its highly optimized nature. Using tools that generate huge amounts of alerts +will warn a good analyst that someone is trying to sneak by their defenses. + +1.10 Can snort be evaded by the use of polymorphic mutators on shellcode? + +Yes, and this could defeat some of the NOP sled detection signatures but the +ordinary exploit rules should not be affected by this kind of obfuscation. The +fnord preprocessor attempts to detect mutated or obfuscated long strings of NOP +equivalent sleds. + +1.11 Does Snort log the full packets that it generates alerts? + +Yes, the packets should be in the directory that has the same IP address as the +source host of the packet which generated the alert. If you are using binary +logging, there will be a packet capture file (.pcap) in the logging directory +instead. + +2 Getting Started + +2.1 Where do I find binary packages for BlueHat BSD-Linux-RT? + +Repeat after me: + + wget http://www.snort.org/downloads/snort-stable.tgz + + tar zxvf snort-stable.tgz + + cd snort-stable + + ./configure + + make + + su + + make install + + mkdir /var/log/snort + + cd etc + + vi snort.conf + + snort -D -c snort.conf + + exit + +...and if you want to use our binary package uninstaller :-): + + cd snort-stable; make uninstall + +and if you must, you can find some binaries at http://www.snort.org/dl/binaries +/ . You can also find Snort in most BSD ports trees. + +2.2 How do I run snort? + +Run Snort in sniffer mode and make sure it can see the packets. + + snort -dv + +Then run it with the HOME_NET set appropriately for the network you're +defending in your rules file. A default rules file comes with the snort +distribution and is called "snort.conf" You can run this basic ruleset with the +following command line: + + snort -A full -c snort.conf + +If it's all set right, make sure the interface is in promiscuous mode by +running the command from another window: + + ifconfig -a + +The output from ifconfig should show if the interface is in promiscuous mode. +If it's not, there should be a way to set it manually. + +Note that the default output mode (-A full) of snort should not be used except +in very controlled environments. It is the slowest way to run snort and +presents several hard to recover from problems with inode creation on +filesystems. + +For people doing real IDS work, use something like (-A fast -b) to combine fast +alert mode with tcpdump binary log files or use the unified format coupled with +(see FAQ [*]). + +2.3 Where are my log files located? What are they named? + +The default location for logs is /var/log/snort. If snort is started with "-l +", then the logs will be located in the directory specified. + +In the past, running Snort in daemon mode (-D) produced a file named +"snort.alert". For consistency sake, this has been changed. Running Snort in +both standard or daemon modes (-D) will produce a file named "alert". + +Note the log file naming convention changed between 1.8 and 1.9. That funny +alphanumeric soup at the end of the new names is a UNIX timestamp. This helps +avoid file conflicts. + +2.4 Why does snort complain about /var/log/snort? + +It requires this directory to log alerts to it. Try running the command: + + mkdir -p /var/log/snort + +Make sure the logging directory is owned by the user snort is running as. + +2.5 Where's a good place to physically put a Snort sensor? + +This is going to be heavily influenced by your organizations policy, and what +you want to detect. One way of looking at it is determining if you want to +place it inside or outside your firewall. Placing an IDS outside of your +firewall will allow you monitor all attacks directed at your network, +regardless of whether or not they are stopped at the firewall. This almost +certainly means that the IDS will pick up on more events than an IDS inside the +firewall, and hence more logs will be generated. Place an IDS inside your +firewall if you are only interested in monitoring traffic that your firewall +let pass. If resources permit, it may be best to place one IDS outside and one +IDS inside of your firewall. This way you can watch for everything directed at +your network, and anything that made it's way in. + +ADDENDA AD NAUSEUM + +Note: So this one still gets a lot of traffic even though it's in the FAQ. Erek +Adams has noted this comprehensive and authoritative discussion of this +perpetual discussion item - mildly edited, also see faq question about switches +hubs and taps -dr + +If your router/switch can do port mirroring then just connecting a network IDS +to it would be fine. Else a hub could be another option. Most of network IDS +can have a NIC that acts as a passive sniffer anyway. + +As to where to place the sensor. I would go for both, one to monitor the +external, one for the internal. I work in a distributor for security products, +so over instrumentation is fun :) And in any case, if the traffic do not pass +by the Sensor it will not get monitored. So some people deploy IDS on their +internal segments too I believe. + +In ``front'' of the firewall(s): + +Pro: Higher state of alert you know what attacks you are facing. + +Con: Wall to Wall of data, boring? If your firewall has NAT turned on, tracking +the sources originating from your internal network is difficult. + +``Behind'' the firewall(s): + +Pro: Only what gets through the firewall gets monitored? Less load on the IDS +analyst. You get to see what hosts are sending traffic to the internet. + +Con: Less idea of the state of the environment, false sense of safety. + +Where should IDS be placed relative to firewalls? Explore the pros and cons off +placing IDS inside or outside firewall. What are the drawbacks of each? + + * MARCUS RANUM from NFR Security: "I'd put mine inside. Why should I care if + someone is attacking the outside of my firewall? I care only if they + succeed, which my IDS on the inside would ideally detect. Placing the IDS + on the outside is going to quickly lull the administrator into complacency. + I used to have a highly instrumented firewall that alerted me whenever + someone attacked it. Two weeks later I was deleting its alert messages + without reading them. Another important factor arguing for putting it + inside is that not all intrusions come from the outside or the firewall. An + IDS on the inside might detect new network links appearing, or attackers + that got in via another avenue such as a dial-in bank.'' + * CURRY from IBM: ``The IDS should be placed where it will be able to see as + much of the network traffic you're concerned about as possible. For + example, if you're concerned about attacks from the Internet, it makes the + most sense to put the IDS outside the firewall. the most sense to put the + IDS outside the firewall. This gives it an "unobstructed" view of + everything that's coming in. If you put the IDS inside the firewall, then + you're not seeing all the traffic the bad guys are sending at you, and this + may impact your ability to detect intrusions.'' + * SUTTERFIELD from Wheel Group: ``IDS ideally plays an important role both + inside and outside a firewall. Outside a firewall, IDS watches legitimate + traffic going to public machines such as e-mail and Web servers. More + importantly IDS outside a firewall will see traffic that would typically be + blocked by a firewall and would remain undetected by an internal system. + This is especially important in detecting network sweeping which can be a + first indication of attack. External systems will also give you the benefit + of monitoring those services that firewalls determine are legitimate. + Putting an IDS inside the firewall offers the added benefit of being able + to watch traffic internal to the protected network. This adds an important + element of protection against insider threats. The major drawback of IDS + inside a firewall is that it cannot see a good deal of important traffic + coming from untrusted networks and may fail to alert on obvious signals of + an impending attack.'' + * CHRIS KLAUS from ISS: ``Outside the firewall is almost always a good + idea-it protects the DMZ devices from attack and dedicates an additional + processor to protecting the internal network. Just inside the firewall is + also useful-it detects attempts to exploit the tunnels that exist through + the firewall and provides an excellent source of data for how well your + firewall is working. Throughout your intranet may be the best place for IDS + deployment, however. Everyone agrees that attacks aren't the only things + we're worried about-there's internal mischief, fraud, espionage, theft, and + general network misuse. Intrusion detection systems are just as effective + inside the network as outside, especially if they're unobtrusive and easy + to deploy.'' + * GENE SPAFFORD: ``The IDS must be inside any firewalls to be able to detect + insider abuse and certain kinds of attacks through the firewall. IDS + outside the firewall may be useful if you want to monitor attacks on the + firewall, and to sample traffic that the firewall doesn't let through. + However, a true IDS system is likely to be wasted there unless you have + some follow-through on what you see.'' + * Bottom Line: + + DRAGOS RUIU: ``just pick a spot you're likely to look at the logs for :-)'' + +2.6 Libpcap complains about permissions problems, what's going on? + +You are not running snort as root or your kernel is not configured correctly. + +2.7 I've got RedHat and .... + +Check your version of libpcap. If it's not >= 0.5, then you should update. + +2.8 Where do I get the latest version of libpcap? + +You can find the most current version at: + + http://www.tcpdump.org/ + +You might also want to have a look at Phil Wood's patches to libpcap for Linux. + + http://public.lanl.gov/cpw/ + +2.9 Where do I get the latest version of Winpcap? + +http://winpcap.polito.it/ + +2.10 What version of Winpcap do I need? + +It depends. If you only have one processor, you can use the most current +version (3.x). If you have a SMP box, you'll have to use either an older +version (< 2.3) or the 3.x version plus a patch from http://www.ntop.org/ +winpcap.html . + +2.11 Why does building snort complain about missing references? + +You must configure libpcap with the -install-incl option. (On RedHat, install +the libpcap-devel rpm.) + +2.12 Why does building snort fail with errors about yylex and lex_init? + +You need the lex and yacc tools or their gnu equivalents flex and bison +installed. + +2.13 I want to build a snort box. Will this handle + traffic? + +That depends. Lower the number of rules is a standard performance increase. +Disable rules that you don't need or care about. There have been many +discussions on 'tweaking performance' with lots of 'I handle XX mb with a ___ +machine setup.' being said. Look at some of the discussions on the snort-users +mailing lists. + +Here is an oft quoted bit on the subject from Marty: + +"Hardware/OS recommendations" + +Ok, here are the guidelines and some parameters. Intrusion detection is turning +into one of the most high performance production computing fields that is in +wide deployment today. If you think about the requirements of a NIDS sensor and +the constraints that they are required to operate within, you'll probably start +to realize that it's not too hard to find the performance wall with a NIDS +these days. + +The things a NIDS needs are: + +1. MIPS (Fast CPU) +2. RAM (More is *always* better) +3. I/O (Wide, fast busses and high performance NIC) +4. AODS (Acres Of Disk Space) + +A NIDS also needs to be pretty quick internally at doing its job. Snort's seen +better days in that regard (when 1.5 came out the architecture was a lot +cleaner) but it's still considered to be one of the performance leaders +available. + +As for OS selection, use what you like. When we implement Data Acquisition +Plugin's in Snort 2.0 this may become more of a factor, but for now I'm hearing +about a lot of people seeing alot of success using Snort on Solaris, Linux, +*BSD and Windows 2000. Personally, I develop Snort on FreeBSD and Sourcefire +uses OpenBSD for our sensor appliance OS, but I've been hearing some good +things about the RedHat Turbo Packet interface (which would require mods for +Snort to use, not to mention my general objection to RedHat's breaking stuff +all the time). (ed note: take a drink, see FAQ 7.2 -dr) + +2.14 What are CIDR netmasks? + +(Excerpt from url: http://public.pacbell.net/dedicated/cidr.html ) CIDR is a +new addressing scheme for the Internet which allows for more i efficient +allocation of IP addresses than the old Class A, B, and C address scheme. + +CIDR Block Equivalent Class C IP Addresses Usable Addresses Subnet Mask + + /32 1/256th of a Class C 1 1 255.255.255.255 + + /30 1/64th of a Class C 4 2 255.255.255.252 + + /29 1/32nd of a Class C 8 6 255.255.255.248 + + /28 1/16th of a Class C 16 14 255.255.255.240 + + /27 1/8th of a Class C 32 30 255.255.255.224 + + /26 1/4th of a Class C 64 62 255.255.255.192 + + /25 1/2 of a Class C 128 126 255.255.255.128 + + /24 1 Class C 256 254 255.255.255.0 + + /23 2 Class C 512 510 255.255.254.0 + + /22 4 Class C 1,024 1022 255.255.252.0 + + /21 8 Class C 2,048 2046 255.255.248.0 + + /20 16 Class C 4,096 4094 255.255.240.0 + + /19 32 Class C 8,192 8190 255.255.224.0 + + /18 64 Class C 16,384 16,382 255.255.192.0 + + /17 128 Class C 32,768 32,766 255.255.128.0 + + /16 256 Class C 65,536 65,534 255.255.0.0 + + /15 512 Class C 131,072 131,070 255.254.0.0 + + /14 1,024 Class C 262,144 262,142 255.252.0.0 + + /13 2,048 Class C 524,288 524,286 255.248.0.0 + +For more detailed technical information on CIDR, check out the following RFCs: + + * RFC 1517: Applicability Statement for the Implementation of CIDR + * RFC 1518: An Architecture for IP Address Allocation with CIDR + * RFC 1519: CIDR: An Address Assignment and Aggregation Strategy + * RFC 1520: Exchanging Routing Information Across Provider Boundaries in the + CIDR Environment + +RFCs are available at http://www.rfc-editor.org/rfcsearch.html + +2.15 What is the use of the "-r" switch to read tcpdump files? + +Used in conjunction with a snort rules file, the tcpdump data can be analyzed +for hostile content, port scans, or anything else Snort can be used to detect. +Snort can also display the packets in a decoded format, which many people find +is easier to read than native tcpdump output. + +3 Configuring Snort + +3.1 How do I setup snort on a 'stealth' interface? + + *BSD and Linux: + + ifconfig eth1 up + +Solaris: + + ifconfig eth1 plumb + + ifconfig eth1 up + +NT/W2K/XP: + +NOTE: You are at your own risk if you follow these instructions. Editing your +registry is DANGEROUS and should be done with extreme caution. Follow these +steps at your OWN risk. + +1. Get your device's hex value. ('snort -W' works for this) +2. open Regedt32 +3. Navigate out to: HKEY_LOCAL_MACHINE\( \backslash \)SYSTEM\( \backslash \) + CurrentControlSet\( \backslash \)Services\( \backslash \)Tcpip\( \backslash + \)Parameters\( \backslash \)Interfaces\( \backslash \) + {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} +4. Select the network card you wish to setup as the monitoring interface (this + will be the {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} value). +5. Set IPAddress:REG_MULTI_SZ: to null (Double click on the string, delete + data in the Multi-String Editor, then click OK) +6. Set SubnetMask:REG_MULTI_SZ: to null (Double click on the string, delete + data in the Multi-String Editor, then click OK) +7. Set DefaultGateway:REG_MULTI_SZ: to null (Double click on the string, + delete data in the Multi-String Editor, then click OK) +8. Close the Registry Editor, your changes will be saved automatically. +9. In a command prompt, run 'ipconfig' to verify the interface does not have + an IP bound to it. + +If you do not receive an IP address listing from the interface you modified, +you are good to go. To run snort with the specified interface, use the -i flag +such as 'snort -v -d -p -i1' + +3.2 How do I setup a receive-only ethernet cable? + +Use an ethernet tap, or build your own 'receive-only' ethernet cable. Anyway, +here is the cable I use: + + * []LAN Sniffer + + 1 ---\ /- 1 + + 2 --\ | \- 2 + + 3 --+-*--- 3 + + 4 - | - 4 + + 5 - | - 5 + + 6 --*---- 6 + + 7 - - 7 + + 8 - - 8 + +Basically, 1 and 2 on the sniffer side are connected, 3 and 6 straight through +to the LAN. 1 and 2 on the LAN side connect to 3 and 6 respectively. This fakes +a link on both ends but only allows traffic from the LAN to the sniffer. It +also causes the 'incoming' traffic to be sent back to the LAN, so this cable +only works well on a hub. You can use it on a switch but you will get ...err... +interesting results. Since the switch receives the packets back in on the port +it sent them out, the MAC table gets confused and after a short while devices +start to drop off the switch. Works like a charm on a hub though. + +Another method which uses a capacitor and should work on 100mbs links: + + http://www.geocities.com/samngms/sniffing_cable + +And another: + + The UTP Y-Cable specified by Joe Lyman: + +A less noisy option: it involves a couple of cat 5 cables and a single speed +hub. The idea is to use the rcv cables for the wire going to the sniffer box +and use the xmit cables from another hub port. This will give you a link light +and allow your sniffer to rcv only. Cannot xmit because the xmit cables are not +connected. This has been successfully used on netgear single speed hubs. It +wont work on dual speed hubs due to the negotiation of speed. + +Pin outs. They are reversed in the picture in order to prevent lines from +crossing, and I only included the pins used. + + * []HUB PORT 1 HUB PORT 2 + + ----- ----- + + x x r r r r x x + + 6 3 2 1 1 2 3 6 + + | | | | | | + + | | | ----------- | + + | | ------------- + + | | + + | | + + | | + + | | + + 6 3 2 1 + + r r x x + + ---- + + SNIFFER + + x = xmit + + r = rcv + +You could make it a single cable by adding a battery to simulate the voltage +from the xmit cables on the nic, but batteries die. + +It's not recommended to cut the transmit side, shunt it to ground (pin 2). Some +OS's will disable the interface if PIN 1 does not indicate a completed circuit. + +3.3 What are HOME_NET and EXTERNAL_NET? + +HOME_NET and EXTERNAL_NET are standard variable names that all of the Snort.Org +rules use. HOME_NET refers to the network(s) that you want to protect, where +EXTERNAL_NET is the network(s) that you think attacks would come from. + +3.4 My network spans multiple subnets. How do I define HOME_NET? + +Snort 1.7 supports IP lists. You can assign a number of addresses to a single +variable. For example: + + var HOME_NET [10.1.1.0/24,192.168.1.0/24] + +Note: Not all preprocessors support IP lists at this time. Unless otherwise +stated, assume that any preprocessor using an IP list variable will use the +first value as the HOME_NET. The portscan preprocessor is an example. To catch +all detectable portscans, pass 0.0.0.0/0 in as the first parameter. + + preprocessor portscan: 0.0.0.0/0 5 3 portscan.log + +Use the portscan-ignorehosts preprocessor to fine tune and ignore traffic from +noisy, trusted machines. + +3.5 How do I set EXTERNAL_NET? + +Many people set EXTERNAL_NET to ``any''. + + var EXTERNAL_NET any + +By setting it to ``any'' Snort will alert you on any traffic matching a rule +coming into or leaving your network. + +To cut down on the work that Snort has to do, many people set it to ``not +HOME_NET''. + + var EXTERNAL_NET !$HOME_NET + +This tells Snort to define EXTERNAL_NET as everything except HOME_NET. For most +people this is the best thing to set it to. + +3.6 How can I run snort on multiple interfaces simultaneously. + +LINUX: If you aren't running snort on linux 2.1.x/2.2.x kernel (with LPF +available) the only way is to run multiple instances of snort, one instance per +interface (with the -i option specifying the interface). However for linux +2.1.x/2.2.x and higher you can use libpcap library with S. Krahmer's patch +which allows you to specify 'any' as interface name. In this case snort will be +able to process traffic coming to all interfaces. + +*BSD: Use the ``bridge'' interface to combine your nics into a logical +interface (bridge0). + +3.7 My IP address is assigned dynamically to my interface, can I use snort with +it? + +Yes. With snort 1.7 and later, _ADDRESS variable is available. The +value of this variable will be always set to IP address/Netmask of the +interface which you run snort at. if interface goes down and up again (and an +IP address is reassigned) you will have to restart Snort. For earlier versions +of snort numerous scripts to achieve the same result are available. + +3.8 I have one network card and two aliases, how can I force snort to "listen" +on both addresses ? + +Since version 1.7, you can specify an IP list like this: + + var HOME_NET [ 192.168.10.0/24, 10.1.1.1/16 ] + +3.9 How do I ignore traffic coming from a particular host or hosts? + +There are two basic ways to ignore traffic from a host: + + * Pass Rules + * BPF Filters + +Details: + +1. Pass Rules: + + Advantages: + + Gives you rule based control over the packets. + + Puts all your changes into 'one place'-snort.conf. + + Disadvantages: + + Reverses the Rule order, can cause some headaches in tracking down + problems. + + One poorly written pass rule can 'blind' your whole network. + + The more specific the pass rule is, the more CPU snort needs to process + it which may be important on loaded nets. + + Example: + + For example to ignore ALL ICMP traffic from host using a pass + rule: + + pass icmp any -> $HOME_NET any + +2. BPF Filters: + + + Advantages: + + Drops the packet at the BPF interface, which saves on processing. + + Speeds up Snort since it 'never sees' those packets. + + Disadvantages: + + Poorly constructed filters can 'blind-side' you. + + Example: + + To ignore all traffic from 192.168.0.1: + + snort not host 192.168.0.1 + + To ignore all ICMP ECHO-REQUESTS (pings) and ICMP-ECHO REPLY's (ping + reply) from host : + + snort ``not ( (icmp[0] = 8 or icmp[0] = 0) and host + )'' + +3.10 How do I get Snort to log the packet payload as well as the header? + +Use the "-d" command line option to log packet payload, or use the ``-b'' +option to log the full binary packet. + +3.11 Why are there no subdirectories under /var/log/snort for IP addresses? + +It depends on how your Snort configuration logs. If it logs in binary format, +you'll have to process the binary log in order to get cleartext. You also might +have ``-A '' on the command line. Command line options always take +override the .conf file. + +3.12 Why does the portscan plugin log "stealth" packets even though the host is +in the portscan-ignorehosts list? + +These types of TCP packets are inherently suspicious, no matter where they are +coming from. The portscan detector was built with the assumption that stealth +packets should be reported, even from hosts which are not monitored for +portscanning. An option to ignore "stealth" packets may be added in the future. + +3.13 What the heck is a ``Stealth scan''? + +A Stealth scan can refer to more than one type of scan. + + * Half-Open or SYN scan-Instead of completing the full TCP + three-way-handshake a full connection is not made. A SYN packet is sent to + the system and if a SYN/ACK packet is received it is assumed that the port + on the system is active. In that case a RST/ACK will be sent which will + determined the listening state the system is in. If a RST/ACK packet is + received, it is assumed that the port on the system is not active. + * FIN scan-According to RFC 793 a system should send back an RST for all TCP + ports closed when they receive a FIN packet for a specific port. + * XMAS tree scan-According to RFC 793 a system should send back an RST for + all TCP ports closed when they receive a FIN/URG/PUSH packet for a specific + port. + * NULL scan-According to RFC 793 a system should send back an RST for all TCP + ports closed when they receive a packet without any specified IP flags for + a specific port. + * Slow scan-Any of the above scans could be used as a slow scan. A slow scan + is when the attacker sends packets at a _very_ slow rate. Sometimes these + scans can be conducted over hours, days, or weeks. The idea is since they + are so slow, the victim's security measures won't ``notice'' the scan. + +3.14 What the heck is a SYNFIN scan? + +SYNFIN scans got their name because there are both the SYN and FIN flags set. + +3.15 Which takes precedence, commandline or rule file ? + +The command line always gets precedence over the rules file. If people want to +try stuff out quickly without having to manually edit the rules file, they +should be able to override many things from the command line. + +3.16 How does rule ordering work? + +FOR 2.0 =>: + +Please see the documents on v2.0 at: +myquotehtmladdnormallinkhttp://www.snort.org/docs/#devel http://www.snort.org/ +docs/#devel + +FOR <= 1.9.X: Marty has answered this many times on the snort-users mailing +list. Here is an excerpt from a post on Thu, 22 Feb 2001 00:31:53 -0500, titled +"Re: [Snort-users] order of evaluation of rules" + +Currently, the data structures that store Snort rule data are the RuleTreeNodes +(RTN) and the OptTreeNodes (OTN). These data structs are stored in a two +dimensional linked list structure with the RTNs forming the top row of the +"Array" and the OTNs forming the columns under the RTNs. Here's an ASCII +illustration from the infamous "lisapaper": + + * []RTN RTN RTN + + ------- ------- --- + + | Chain Header | | Chain Header | | Chai + + | | | | | + + | Src IP | | Src IP | | Src + + | Dst IP |--->| Dst IP |--->| Dst + + | Src Port | | Src Port | | Src + + | Dst Port | | Dst Port | | Dst + + | | | | | + + ------- ------- --- + + | | + + | | + + | | + + OTN \|/ OTN \|/ + + ----V--- ----V---- + + | Chain Option | | Chain Option | + + | | | : | + + | Content | : + + | TCP Flags | : + + | ICMP Data | + + | Payload Size | + + | etc. | + + | | + + -------- + + | + + | + + | + + OTN \|/ + + ----V--- + + | Chain Option | + + | | + + | Content | + + | TCP Flags | + + | ICMP data | + + | Payload Size | + + | etc. | + + | | + + ------- + + | + + | + +Rules with similar rule headers (i.e. all the CGI rules, the old stealth port +scan detection rules, most of the rules that focus on any single service, etc) +are grouped under a single RTN for the sake of efficiency and the applicable +OTNs are hung below them. For instance, if you have three rules like this: + + alert tcp any any -> $HOME 80 (content: "foo"; msg: "foo";) + alert tcp any any -> $HOME 80 (content: "bar"; msg: "bar";) + alert tcp any any -> $HOME 80 (content: "baz"; msg: "baz";) + +They all get grouped under the same RTN and the OTNs are "hung" beneath them +like this: + + * [] RTN RTN + + ---------- ---------- + + | SIP: any | | SIP: any | + + | SP: any |---->| SP: any | + + | DIP: $HOME | | DIP: $HOME | + + | DP: 80 | | DP: 1-1024 | + + ---------- ---------- + + | | + + | | + + OTN \|/ \|/ + + -----v----- -----v----- + + | content: foo | | flags: S | + + | msg: foo | | msg: example | + + ---------- ---------- + + | + + | + + OTN \|/ + + -----v----- + + | flags: S | + + | msg: Port 80 SYN! | + + ---------- + + | + + | + + OTN \|/ + + -----v----- + + | content: baz | + + | msg: baz | + + ---------- + +This is an efficient way to do things because we only need to check the data in +the RTN once with this method. There is actually another dimension to this +array: the function pointer list. Each node in the "array" has a linked list of +function pointers attached to it. The functions in this list are the tests that +need to be done to determine whether the data in the current packet matches the +current rule node's information. Having this function pointer list gives us +great efficiency and flexibility: we don't need to perform tests for things the +current rule doesn't contain (e.g. "any" ports/IPs, packet content on +non-content rules, etc). It also allows us to analyze the packet with any +function without having to make major modifications to the whole program (which +was the case in versions prior to version 1.5). + +There are a couple of implications of this architecture. For the sake of this +discussion on rules ordering, the one we're interested in is that rule order is +tricky to figure out. For instance + + alert tcp any any -> $HOME 80 (content: "foo"; msg: "foo";) + alert tcp any any -> $HOME 1:1024 (flags: S; msg: "example";) + alert tcp any any -> $HOME 80 (flags: S; msg: "Port 80 SYN!";) + alert tcp any any -> $HOME 80 (content: "baz"; msg: "baz";) + +gets built like this: + + * []\begin{verbatim} + + RTN RTN + ---------- ---------- + + | SIP: any | | SIP: any | + + | SP: any |---->| SP: any | + + | DIP: \$HOME | | DIP: \$HOME | + + | DP: 80 | | DP: 1-1024 | + + ---------- ---------- + + | | + + | | + + OTN \|/ \|/ + + -----v----- -----v----- + + | content: foo | | flags: S | + + | msg: foo | | msg: example | + + ---------- ---------- + + | + + | + + OTN \|/ + + -----v----- + + | flags: S | + + | msg: Port 80 SYN! | + + ---------- + + | + + | + + OTN \|/ + + -----v----- + + | content: baz | + + | msg: baz | + + ---------- + +Note that all three of the port 80 rules will be checked before the "1:1024" +rule due to the order in which the applicable RTN has been created. This is +because the rules parser builds the first chain header for port 80 traffic and +sticks it on the rules list, then on the next rule it sees that a new chain +header is required, so it gets built and put in place. In this case you would +intuitively expect to get the "example" message and never see the "Port 80 SYN! +", but the opposite is true. + +3.17 How do I configure stream4? + + Stream4 is an entirely new preprocessor that performs two functions: + + * Stateful inspection of TCP sessions + * TCP stream reassembly + +Marty implemented stream4 out of the desire to have more robust stream +reassembly capabilities and the desire to defeat the latest "stateless attacks" +that have been coming out against Snort (c.f. stick and snot). Stream4 is +written with the intent to let Snort be able to handle performing stream +reassembly for "enterprise class" users, people who need to track and +reassemble more than 256 streams simultaneously. Marty optimized the code +fairly extensively to be robust, stable, and fast. The testing and calculations +I've performed lead me to be fairly confident that stream4 can provide full +stream reassembly for several thousand simultaneous connections and stateful +inspection for upwards of 64,000 simultaneous sessions. + +Stream4 is a large and complex piece of code (almost 2000 lines) and there are +a lot of options associated with its runtime configuration, so I'll go over +them here. + + preprocessor stream4: [noinspect], [keepstats], [timeout ], + [memcap] + +stream4_reassemble defaults: + + Reassemble client: ACTIVE + Reassemble server: INACTIVE + Reassemble ports: 21 23 25 53 80 143 110 111 513 + Reassembly alerts: ACTIVE + +There is a new command line switch that is used in concert with the stream4 +code, "-z". If the -z switch is specified, Snort will only alert (for TCP +traffic) on streams that have been established via a three way handshake or +streams where cooperative bidirectional activity has been observed (i.e. where +some traffic went one way and something other than a RST or FIN was seen going +back to the originator). With "-z" turned on, Snort completely ignores +TCP-based stick/snot "attacks". + +3.18 Where does one obtain new/modified rules? How do you merge them in? + +New rules can be downloaded via CVS or alternatively may be found at http:// +www.snort.org . There is a mailing list dedicated to snort rules, called +snort-sigs hosted at Sourceforge. There are some scripts/programs to help you +with rule management: + + * oinkmaster: It is a simple Perl script to update the ruleset for you. + + http://www.algonet.se/~nitzer/oinkmaster/ + + * IDS Policy Manager: It is a win32 application that updates the ruleset + using a gui then upload your rulesets via scp. + + http://www.activeworx.com/idspm + + * snortpp: a program to merge multiple files into one master file sorted by + SID. + + http://dragos.com/snortpp.tgz + +There is also this script that might be useful: + + * []#!/bin/sh + + ########################################################################### + #### + + # + + # Das Skript zum Herunterladen und installieren neuer IDS-Signaturen. + + # + + ########################################################################### + #### + + MAILTO="admin@mydomain.de" + + MACHINE="machine1" + + #set -x + + SIGS_URL1="http://www.snort.org/dl/signatures/snortrules-stable.tar.gz" + + MD5_URL1="http://www.snort.org/dl/signatures/snortrules-stable.tar.gz.md5" + + WGET="/usr/bin/wget" + + #WGET_PARAMS="-N" + + WGET_PARAMS="-t 3 -T 5 -N -a /etc/snort/snort.log -P /etc/snort" + + # Wget parameters: + + # + + # -t : Retries (here 3) + + # -N : Get the file only if newer + + # -a : Append the log messages to the specified file + + # -P : Save the file to the specified directory + + # -T : Timeout + + ECHO="/bin/echo" + + TAR="/bin/tar" + + KILL="/bin/kill" + + PIDOF="/sbin/pidof" + + SNORT="/usr/local/bin/snort" + + SNORTUSER="snort" + + SNORTGROUP="snort" + + KILLSIG="SIGUSR1" + + SERVICE="/sbin/service" + + # Where is the Snort configuration dir: + + RULESPATH="/etc/snort/snortrules" + + SNORTCFGPATH="/etc/snort" + + MD5SUM="/usr/bin/md5sum" + + MD5SUM_PARAMS="" + + # The list of sensor interfacec divided by blanks + + IFACES="eth0" + + ########################################################################### + #### + + # F U N C T I O N S + + # + + ########################################################################### + #### + + ########################################################################### + #### + + # + Die Funktion, die Snort fuer alle def. Interfaces auf dem System startet + # + + # + + # + + # + Um sie zu erweitern muss man zwei Dinge tun: + # + + # + 1. Die Parameterliste von Interfaces erweitern + # + + # 2. Das Konfigurationsfile unter /etc/snort/ + snort.conf_ethX anlegen # + + # + + # + + ########################################################################### + #### + + restartsnort() { + + # Restarting Snort for all interfaces + + for i in $IFACES; do + + "$ECHO" "Setting up Snort for interface "$i"" + + $ECHO "Restarting Snort..." + + #/usr/bin/killall snort + + if [ -f /var/run/snort_"$i".pid ] + + then + + PID=$("$PIDOF" "$SNORT") + + if [ -z "$PID" ] + + then + + "$SERVICE" snort restart + + else + + #`cat /var/run/snort_"$i".pid` + + "$ECHO" "Restarting Snort running with PID "$PID" and reloading the rules..." + + "$KILL" -s "$KILLSIG" "$PID" + + fi + + else + + "$ECHO" "No PID file for interface "$i" found under /var/ + run" + + fi + + "$ECHO" "Starting Snort" + + "$SNORT" -a -b -c "$SNORTCFGPATH""/snort.conf_""$i" -I -D -v + + -i $i -u "$SNORTUSER" -g "$SNORTGROUP" + + PID=`cat /var/run/snort_"$i".pid` + + "$ECHO" "Snort running now with PID "$PID"" + + done + + } + + ########################################################################### + #### + + # + Die Funktion zum ueberpruefen, ob und wie Snort auf dem System laeuft + # + + ########################################################################### + #### + + checksnort() { + + SNORTS=$("$PIDOF" "$SNORT" | wc -w | awk '{print $1}') + + SNORT_PIDS=$(/usr/bin/find /var/run -name snort\_eth[0-9]\.pid -ls | + + wc -l | awk '{print $1}') + + "$ECHO" "Snort instances counted: $SNORTS" + + "$ECHO" "Snort PID files found: $SNORT_PIDS" + + # 1. Fall: Snort laeuft nicht oder PID-File nicht da: + + if [ "$SNORTS" = "0" -o "$SNORT_PIDS" = "0" ] + + then + + "$ECHO" "Snort seems to be down or no PID file there..." + + "$ECHO" "Restarting Snort for all Interfaces..." + + "$SERVICE" snort restart + + fi + + # 2. Fall: Anzahl der Instanzen ungleich der Anzahl der PID-Files + + if [ "$SNORTS" -gt "$SNORT_PIDS" ] + + then + + "$ECHO" "More Snort instances than found PID files..." + + "$ECHO" "Something is wrong outthere..." + + "$ECHO" "Stopping all Snort processes..." + + # /usr/bin/killall -9 snort + + "$SERVICE" snort stop + + "$ECHO" "Hold on... Restarting Snort now..." + + "$SERVICE" snort restart + + fi + + + + # + 3. Fall: Anzahl der Instanzen stimmt mit der Anzahl der PID-files ueberein + + + + } + + ########################################################################### + #### + + ########################################################################### + #### + + getrules() { + + # Get the rules, since we know that they are newer... + + $WGET $WGET_PARAMS $SIGS_URL1 + + $WGET $WGET_PARAMS $MD5_URL1 + + "$ECHO" "Readout the checksum..." + + # MD5-Summe auslesen + + if [ -f /etc/snort/snortrules-stable.tar.gz.md5 ] + + then + + MD5SUM1=`grep MD5 \ + + /etc/snort/snortrules-stable.tar.gz.md5|awk + + '{print $4}'` + + else + + "$ECHO" "Error! No MD5-file found" + + exit 1 + + fi + + "$ECHO" "Generating our own checksum..." + + # MD5-Summe bilden + + if [ -f /etc/snort/snortrules-stable.tar.gz ] + + then + + MD5SUM2=`md5sum /etc/snort/snortrules-stable.tar.gz|awk '{print $1}'` + + else + + "$ECHO" "Error! No rules file found" + + exit 1 + + fi + + if [ "$MD5SUM1" = "$MD5SUM2" ] + + then + + "$ECHO" "The MD5-Checksum fits!" + + "$ECHO" "$MD5SUM1" + + "$ECHO" "$MD5SUM2" + + "$ECHO" "$MD5SUM1" >> /etc/snort/snort.log + + "$ECHO" "$MD5SUM2" >> /etc/snort/snort.log + + "$ECHO" "Proceeding..." + + # /bin/sleep 1 + + else + + "$ECHO" "Error! Wrong checksum! Aborting!" + + "$ECHO" "Install rules manually!" + + "$ECHO" "$MD5SUM1" >> /etc/snort/snort.log + + "$ECHO" "$MD5SUM2" >> /etc/snort/snort.log + + exit 1 + + fi + + # Extract the new rules + + if [ -f "/etc/snort/snortrules-stable.tar.gz" ] + + then + + "$ECHO" "Extracting Snort rules..." + + "$TAR" -xzvf /etc/snort/snortrules-stable.tar.gz -C /etc/snort + + else + + "$ECHO" "Lost the file! Something is wrong!" + + "$ECHO" "Aborting!!" + + exit 1 + + fi + + # Deleting old rules + + # Existiert das Verzeichnis ueberhaupt? + + if [ -d "$RULESPATH" ] + + then + + # /bin/rm "$RULESPATH"/*.rules + + /bin/mv -f /etc/snort/rules/*.rules "$RULESPATH" + + /bin/cp -f /etc/snort/rules/classification.config "$SNORTCFGPATH" + + else + + "$ECHO" "Missing rules-directory!" + + "$ECHO" "Aborting!" + + exit 1 + + fi + + + + # Cleaning up... + + /bin/rm -rf /etc/snort/rules + + # Give everything to root + + /bin/chown root:root ${RULESPATH}/* + + } + + ########################################################################### + #### + + # + M A I N + # + + ########################################################################### + #### + + # Error handling first + + FCHK=$(/usr/bin/wget -spider -N -t 3 -T 5 "$SIGS_URL1" -P /etc/snort 2>&1) + + ERR_MSG=$("$ECHO" "$FCHK" | egrep -oi "failed error") + + # Log the error message explicitly + + "$ECHO" "$FCHK" >> /etc/snort/snort.log + + # If there is a word "failed" or "error" we break.. + + if [ "$("$ECHO" "$FCHK"| grep -i "failed")" ] || \ + + [ "$("$ECHO" "$FCHK"| grep -i "error")" ] + + then + + "$ECHO" "Error getting the files. The server seems to be not available." + + "$ECHO" "Error message:" + + "$ECHO" "$FCHK" + + "$ECHO" "Aborting!" + + exit 0 + + fi + + + + "$ECHO" "Checking/getting files..." + + # First extract the wget message + + FCHK=$(/usr/bin/wget -spider -N -t 3 -T 5 "$SIGS_URL1" \ + + -P /etc/snort 2>&1 | grep "not retrieving") + + /bin/date >> /etc/snort/snort.log + + "$ECHO" "Wget-output:" + + "$ECHO" $FCHK + + # Logging what we've done and when + + "$ECHO" "$FCHK" >> /etc/snort/snort.log + + if [ -z "$FCHK" ] + + then + + "$ECHO" "The files on the server seem to be newer." + + "$ECHO" "We will get them now..." + + getrules + + # Reload rules + + "$SERVICE" snort reload + + # restartsnort + + else + + # + "$ECHO" "The signature files on the server are older or not newer." + + "$ECHO" "Doing nothing for now..." + + "$ECHO" "Checking if Snort is running...." + + checksnort + + exit 0 + + fi + + # Send Email + + "$ECHO" -e "`ls -lA "$RULESPATH"`\n\nSnort running with PID $("$PIDOF"\ + + "$SNORT")" | mail -s "Reloaded Snort signatures on $MACHINE"\ + + "$MAILTO" + + ########################################################################### + #### + + ########################################################################### + #### + + exit 0 + + #EOF + +3.19 How do you get the latest snort via cvs? + + The Snort project's SourceForge CVS repository can be checked out through +anonymous (pserver) CVS with the following instruction set. The module you wish +to check out must be specified as the modulename. When prompted for a password +for anonymous, simply press the Enter key. + + cvs -d:pserver:anonymous@cvs.snort.sourceforge.net:/cvsroot/snort login + + cvs -z3 -d:pserver:anonymous@cvs.snort.sourceforge.net:/cvsroot/snort co + snort + +Updates from within the module's directory do not need the -d parameter. + +You will need to issue the command "sh ./autojunk.sh" before starting +./configure. + +3.20 How do I use a remote syslog machine? + +Add the syslog switch, -s, and put this statement syslog.conf + + auth.alert @managmentserverIP + +Look at your snort.conf file for more info on the facility and Priority +settings. + +Make sure you have syslogd on management server configured to allow syslog over +UDP. Under RedHat, you can do this by editing /etc/sysconfig/syslog and adding +the following line: + + SYSLOGD_OPTIONS="-r -m 0" + +This will start syslogd with the mark interval set to 0 (turning it off) and +set it to receive network connections. + +Then restart syslog. ``man syslogd'' for more info. You might also want to +investigate syslog-ng^[*]. + +Example invocation of snort: + + /usr/local/bin/snort -c /etc/snort/snort.conf -I -A full -s 192.168.0.2:514 + -i rl0 + +Note for Win32 users: + +Frank Knobbe wrote a patch for Snort to allow you to use '-s ' on the +command line under Windows without nullifying the snort.conf. In other words, +Snort still uses all settings from snort.conf but in addition uses the host +from '-s' to send syslog alerts to. You can find the patch at + + http://www.snort.org/dl/contrib/patches/win32syslog/ + +3.21 How do I build this ACID thing? + +Read carefully through all the docs for each package. Getting ACID to work is a +lot of work, since it depends on many packages. You need a working Apache, a +working PHP, a working GD (and the many libraries GD depends on), the ADODB +package, and Phplot. This is a lot of stuff to configure. + +A typical sequence to get this all working on Solaris 8: Use some binary +packages from a trusted Sun freeware site (sunfreeware.com). The most problems +were with PHP and the GD library. GD itself needs a bunch of packages and +libraries to work also. It needs the libpng stuff, the libjpeg stuff (if you +want jpeg), etc, etc. Read through the readme for GD. So you either need to get +these and compile them also, or get some binary packages. PHP is the most +difficult thing to get compiled correctly. The PHP package needs to be compiled +with lots of "-with" flags for GD to work properly, otherwise it gets lots of +run-time unresolved reference errors. Just using a "with" for GD isn't +sufficient. You also need to "with" each library which GD uses also, or PHP +can't find the functions it needs. Here's the "configure" line you can use to +get PHP working: + + ./configure --with-mysql --with-apxs=/usr/apache/bin/apxs --with-gd + --enable-sockets --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/ + lib --with-zlib-dir=/usr/local/lib --with-xpm-dir=/usr/local/lib + + These 'with' statements basically have the effect of the Makefile including -L +and -R statements for each library so that both the compile and run time +linkers can find all the functions needed to find in the Apache module +environment. Apache doesn't seem to consult the LD_LIBRARY_PATH when running a +module (or PHP doesn't, or there's some config item in the Apache conf files, +but you can just use the "withs"). + +Basically, you need to work from the bottom up. So you need to obtain/compile +any libraries that GD needs and install them, and any libraries/packages those +packages need. Then once you get GD compiled properly and installed, compile +PHP. Then make a PHP script that calls phpinfo() (this is referenced in the +ACID install) and carefully examine the page produced. Once satisfied PHP is +working, then the 'foundation' is ready for the other stuff. Install PHplot and +run a few of the tests. If they succeed, then install ADODB and ACID, tweak the +config files, and it should all work. (heh, heh) + +Also make sure you read the ACID FAQ on the web site. There's some stuff not in +the ACID install guide that should probably be there. Namely the fact that the +PHP "register_globals" option must be turned on in the php.ini file (it's off +in the default PHP configurations). + +ACID FAQ: http://www.andrew.cmu.edu/~rdanyliw/snort/acid_faq.html + +4 Rules and Alerts + +4.1 Errors loading rules files + +Some common ones: + + * ERROR telnet.rules:YYY => Port value missing in rule! + * ERROR telnet.rules:YYY => Bad port number: "(msg:"blah" + * ERROR telnet.rules:YYY => Couldn't resolve hostname blah + +What's going on? + +``telnet.rules'' is the file where the syntax error occurred, and ``YYY'' is +the line number it occurred on. There are a couple of possibilities: + +1. The rule is missing a port value, has an invalid port number, or a bad + hostname - in which case the ruleset author/maintainer should be notified. +2. More often, the rule is just fine, but a variable in it was not declared. + Open the rules file, look at the rule on the line number provided, and + confirm that the variables it uses have been declared. You can read more + about variables from + + http://www.snort.org/docs/writing_rules/chap2.html#tth_sEc2.1.2 + +4.2 Snort says "Rule IP addr ("1.1.1.1") didn't x-late, WTF?" + +Get rid of the quotes around the IP address and try again. + +4.3 Snort is behind a firewall and awfully quiet... + +Your firewall rules will also block traffic to the snort processes. + +Note: This does not apply if Snort is installed _on_ the firewall box. + +4.4 Does snort see packets filtered by IPTables/IPChains/IPF/PF? + +Snort operates using libpcap. In general it sees everything the network adapter +driver sees before the network stack munges it. Linux IPTables, Linux IPChains, +BSD PF and IPF and other packet filters do not prevent snort from seeing a +packet that is present on the network wire. Even if an inbound packet is denied +by the packet filter Snort will still see and analyze the packet if it is +listening to that interface. Snort/pcap sees whatever comes out of or goes into +the network adapter. + +Note however that Snort is affected to the extent that the stream of data on +the network wire is affected. Thus Snort will not see outbound packets which +were denied while being sent since they will never reach the network adapter. + +Under OpenBSD you can snort just the PF rejects by using the /dev/pflogN +interface. + +4.5 I'm getting large amounts of . What should I do? Where +can I go to find out more about it? + +Some rules are more prone to producing false positives than others. This often +varies between networks. You first need to determine if it is indeed a false +positive. Some rules are referenced with ID numbers. The following are some +common identification systems, and where to go to find more information about a +particular alert. + ++---------------------------------------------------------------------------------------+ +| System | Example | URL | +|---------+---------------+-------------------------------------------------------------| +| IDS | IDS182 | http://www.whitehats.com/IDS/182 | +|---------+---------------+-------------------------------------------------------------| +| CVE | CVE-2000-0138 | http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2000-0138 | +|---------+---------------+-------------------------------------------------------------| +| Bugtraq | BugtraqID 1 | http://www.securityfocus.com/vdb/bottom.html?vid=1 | +|---------+---------------+-------------------------------------------------------------| +| McAfee | Mcafee 10225 | http://vil.nai.com/vil/dispVirus.asp?virus_k=10225 | +|---------+---------------+-------------------------------------------------------------| +| Nessus | Nessus 11073 | http://cgi.nessus.org/plugins/dump.php3?id=11073 | ++---------------------------------------------------------------------------------------+ + +It may be necessary to examine the packet payload to determine if the alert is +a false positive. The packet payload is logged using the -d option. If you +determine the alerts are false positives, you may want to write pass rules for +machines that are producing a large number of them. If the rule is producing an +unmanageable amount of false positives from a number of different machines, you +could pass on the rule for all traffic. This should be used as a last resort. + +4.6 What about all these false alarms? + +Most think that a pile of false positives is infinitely preferable. Then people +can turn off what they don't want. The reverse, having a small rule set, can +lure people into complacency thinking that Snort is doing "its thing" and there +is nothing to worry about. + +4.7 What are all these ICMP files in subdirectories under /var/log/snort? + +Most of them are likely destination unreachable and port unreachables that were +detected by snort when a communications session attempt fails. + +4.8 Why does the program generate alerts on packets that have pass rules? + +The default order that the rules are applied in is alerts first, then pass +rules, then log rules. This ordering ensures that you don't write 50 great +alert rules and then disable them all accidently with an errant pass rule. If +you really want to change this order so that the pass rules are applied first, +use the "-o" command line switch, or the ``order'' config directive. + +One other thing to keep in mind is that the alert might be generated from a +preprocessor. If that is the case, then no pass rule will help you minimize the +false positives. You will need to use a BPF filter. + +4.9 What are all these "ICMP destination unreachable" alerts? + +ICMP is the acronym for Internet Control Message Protocol. They are failed +connections. ICMP unreach packet carries first 64 bits(8bytes) or more of the +original datagram and the original IP header. + +The ICMP Destination Unreachable (message type 3) is sent back to the +originator when an IP packet could not be delivered to the destination address. +The ICMP Code indicates why the packet could not be delivered. The original +codes are: + + * 0 - net unreachable + * 1 - host unreachable + * 2 - protocol unreachable + * 3 - port unreachable + * 4 - fragmentation needed and DF bit set + * 5 - source route failed + +As far as why... "it all depends..." + +ICMP Unreachable Error Messages are divided into two groups: + +1. ICMP Unreachable Error Messages issued by routers (all 16 of them) +2. ICMP Unreachable Error Messages issued by a Host (only 2) + +What are the only 2 issued by a host? + + * ICMP Port Unreachable - the destination port on the targeted host is closed + (a.k.a. not in a listening state). + * ICMP Protocol Unreachable - the protocol we were trying to use is not being + used on the targeted host. + +Both ICMP Type field and Code field indicates why the packets could not be +delivered. Some snort ICMP alerts" are informational like the ICMP alerts found +in icmp-info.rules. At this time there are no references or even classtypes +associated with these rules. + +Other rules are more likely to be associated with untoward activity. For +example, in icmp.rules you will find: + + alert icmp $EXTERNAL_NET any -> $HOME_NET any (msg:"ICMP ISS Pinger"; + content:"|495353504e475251|";itype:8;depth:32; reference:arachnids,158; + classtype:attempted-recon; sid:465; rev:1;) + +which has a reference where the importance might be determined by checking out +the arachnids reference. The classtype may indicate more or less the relative +importance of the event. + +When a destination UDP port is closed on the targeted host, a.k.a. not in a +listening state, the targeted host will issue an ICMP Port Unreachable error +message back to the offending packets source IP address, given in the query. +Some programs use these messages, like traceroute with *nix based machines. +Windows based machines (tracert) will default to ICMP Echo requests... + +For further information about this see + + * IP - ftp://ftp.isi.edu/in-notes/rfc791.txt + * ICMP - ftp://ftp.isi.edu/in-notes/rfc792.txt + * TCP - ftp://ftp.isi.edu/in-notes/rfc793.txt + * UDP - ftp://ftp.isi.edu/in-notes/rfc768.txt + +and + + http://www.iana.org/assignments/icmp-parameters + +Actually, putting this URL somewhere handy is a good idea: + + http://www.iana.org/ + +There is also a good ICMP paper available at: + + http://www.sys-security.com/ + +4.10 Why do many snort rules have the flags P (TCP PuSH) and A (TCP ACK) set? + +One of the reasons it alerts on a PA flags is to minimize the false positive. +You will only get an alert upon successful connections. If you want to see all +the attempts, you either have to modify the signatures, add you own signatures +or use your firewall logs to see if an attempt to specific a port occurred. + +4.11 Snort says BACKDOOR SIGNATURE... does my machine have a Trojan? + +If you are dumping the data part of the packet, review it. These rules are +known to have high false rates as most of them are just based on numeric port +numbers. + +4.12 What about "CGI Null Byte attacks"? + +It's a part of the http preprocessor. Basically, if the http decoding routine +finds a %00 in an http request, it will alert with this message. Sometimes you +may see false positives with sites that use cookies with urlencoded binary +data, or if you're scanning port 443 and picking up SSLencrypted traffic . If +you're logging alerted packets you can check the actual string that caused the +alert. Also, the unicode alert is subject to the same false positives with +cookies and SSL. Having the packet dumps is the only way to tell for sure if +you have a real attack on your hands, but this is true for any content-based +alert. + +4.13 Why do certain alerts seem to have 'unknown' IPs in ACID? + +The Snort database plug-in only logs packet information into the database when +an alert is triggered by a rule (signature). Therefore, since alerts generated +by pre-preprocessors such as portscan and mini-fragment have no corresponding +rules, no packet information is logged beyond an entry indicating their +occupance. As a consequence, ACID cannot display any packet-level (e.g. IP +address) information for these alerts. For these particular alerts, certain +statistics may show zero unique IP addresses, list the IP address as 'unknown', +and will not list any packet information when decoding the alert. + +4.14 Can priorities be assigned to Alerts using ACID? + +The quick answer to this question is no. ACID is at the mercy of the underlying +database, since Snort doesn't assign priorities, ACID does not have priorities. +Nevertheless, there are some work-arounds: + + * It is possible to enforce priorities of sort at the database level by + writing alerts of different severity to separate databases. For example, + critical alerts such as buffer overflows can be written to one database, + while scan alerts can be written to another. Then load two different + versions of ACID, each pointing to a different instance of the database. + * With manual intervention Alert Groups (AG) can be used to assign priority. + Essentially, this strategy entails creating an AG for each severity level + and manually moving the alerts as they arrive into the appropriate group. + +4.15 What about 'SMB Name Wildcard' alerts? + +Whitehats IDS177 http://dev.whitehats.com/cgi/test/new.pl/Show?_id= +netbios-name-query specifies traffic coming from outside of your local network. +Allowing netbios traffic over public networks is usually very insecure. + +If the rule you are using also refers to ingres traffic only, then it would +explain why you don't see a lot of false positives. For anyone reading that +does see a lot of false positives - if you change your rule to reflect the +source address as being !$HOME (or whatever variable you use to represent your +internal network), then you should see most of the false positives go away. + +The value of this check is that a default administrative share C$ ADMIN$ or +some such has been accessed. This shouldn't happen in normal use - when people +want to share files they should be implicitly defining the shares and ACL. + +4.16 What the heck is a SYNFIN scan? + +SYNFIN scans got their name because there are both the SYN and FIN flags set. + +4.17 I am getting too many "IIS Unicode attack detected" and/or "CGI Null Byte +attack detected" false positives. How can I turn this detection off? + +These messages are produced by the http_decode preprocessor. If you wish to +turn these checks off, add -unicode or -cginull to your http_decode +preprocessor line respectively. + + preprocessor http_decode: 80 8080 -unicode -cginull + +Your own internal users normal surfing can trigger these alerts in the +preprocessor. Netscape in particular has been known to trigger them. + +Instead of disabling them,try a BPF filter to ignore your outbound http traffic +such as: + + snort -d -A fast -c snort.conf not (src net xxx.xxx and dst port 80) + +This has worked very well for us over a period of 5-6 months and Snort is still +very able to decode actual and dangerous cgi null and unicode attacks on our +public web servers. + +4.18 How do I test snort alerts and logging? + +Try a rule that will fire off all the time like: + + alert tcp any any -> any any (msg:"TCP traffic";) + +Also take a look at sneeze at http://snort.sourceforge.net/sneeze-1.0.tar +Sneeze is a false positive generator that reads snort signatures and generates +packets that will trigger the rules. + +4.19 What is the difference between ``Alerting'' and ``Logging''? + + There are two primary output facilities in Snort, logging and alerting. The +alerting facility exists to let you know that something interesting has +happened. The logging facility exists to log full packet information to the +output format (pcap, ascii, database, etc). + +The "alert" action in Snort is hard coded to do two things when an event is +detected by Snort, write an event to the alert facility and log as much as +possible/desired to the output facility. The "log" action merely logs the +current packet to the logging facility without generating an alert. This is +done so you can log interesting things (telnet sessions, whatever) without +having to generate an alert on every packet. + +The database plugin is something of an anomaly because it doesn't separate the +two functionalities very much. The "log" option attaches the log facility and +the "alert" option attaches it to the alert facility. What this means in +practical terms is that if the db plugin is in alert mode, it will only receive +output from alert rules, whereas if it's in "log" mode it will receive output +from both log and alert rules. + +4.20 Are rule keywords ORed or ANDed together? + +From Section 2.1 of the Snort Manual: + + All of the elements in that make up a rule must be true for the indicated + rule action to be taken. When taken together, the elements can be + considered to form a logical AND statement. At the same time, the various + rules in a Snort rules library file can be considered to form a large + logical OR statement. + +4.21 Can snort trigger a rule by MAC addresses? + +Not exactly. Snort logs MAC addresses and other L2 info within the packets. The +arpwatch pre-processor can watch for games with MAC address changes. But there +is no facility for triggering Rules form the L2 information. The content search +keywords and depth and offset begin from the L3 payload, though we haven't +tried playing with really big offsets yet :-). + +4.22 How can I deactivate a rule? + +Rules can be called from an included file in snort.conf, which tells Snort to +follow the path to the rules file specified, and load it at initialization. +Rules can also be included in snort.conf directly. If you want to deactivate a +single rule within any list of rules, you can use one of these techniques: + +1. Delete the rule and re-initialize Snort +2. Place a # in front of the rule, commenting it out, and re-initialize Snort +3. Write a pass rule with the same properties in local.rules (or wherever you + prefer), and re-initialize Snort with the -o option. + +4.23 How can I define an address to be anything except some hosts? + +Use the ! operator. E.g.: + + var EXTERNAL_NET !$HOME_NET + +Note that the negation operator does not work inside a list so the following +will NOT work: + + var EXTERNAL_NET [!192.168.40.0/24,!10.14.0.0/16] + +but this will work: + + var EXTERNAL_NET ![192.168.40.0/24,10.14.0.0/16] + +4.24 After I add new rules or comment out rules how do I make snort reload? + +Usually a kill -HUP will work just fine. But if you are running inside of a +chroot setup, this will not work as expected (see FAQ 6.19). If you're running +like inside of a chroot jail, your best bet would be to kill and restart the +snort process instead. + +4.25 Where do the distance and within keywords work from to modify content +searches in rules ? + +The "distance" keyword gives you a relative offset from the end of the last +match, so it basically acts as a wildcarding mechanism. You can also use the +new "within" keyword to limit how deep into the packet from the end of the +distance it'll search before it stops. + +4.26 How can I specify a list of ports in a rule? + +You can't yet. You can specify a range of ports between X and Y With the +notation X:Y. See the users manual^[*] for more info on port ranges. + +4.27 How can I protect web servers running on ports other than 80? + +It is possible... It's a kludge, but it can work. Since the newer rules use +$HTTP_PORTS variable, you simply reset it and re-run the rules for the other +ports. + +For example: + + var HTTP_PORTS 80 + + include web.rules + + var HTTP_PORTS 8080 + + include web.rules + +4.28 How do I turn off "spp:possible EVASIVE RST detection" alerts? + +You want to pass the ``disable_evasion_alerts'' argument to stream4 in +snort.conf. + +4.29 Is there a private SID number range so my rules don't conflict? + +Yes. Private SID starts at 1000000. + +4.30 How long can Address Lists, Variables, or Rules be? + +The snort parser has an 8K limit on variables and rules *after* expansion. In +practice this is not a major limitation. :-) + +5 Getting Fancy + +5.1 I hear people talking about ``Barnyard''. What's that? + + Barnyard is a output system for Snort. Snort creates a special binary output +format called ``unified''. Barnyard reads this file, and then resends the data +to a database backend. Unlike the database output plugin, Barnyard is aware of +a failure to send the alert to the database, and it stops sending alerts. It is +also aware when the database can accept connections again and will start +sending the alerts again. + +5.2 How do I process those snort logs into reports? + +1. Barnyard 5.1can be used to process unified output files into a number of + formats including output to a database for further analysis. +2. SnortSnarf, a tool for producing HTML out of snort alerts for navigating + through these alerts. + + http://www.silicondefense.com/snortsnarf/ + +3. If you want to set up logging to a database you could try ACID Some + documentation describing the current ACID functionality: + + http://www.cert.org/kb/acid/ + +4. You can manipulate the unified output files directly without a separate + database and browse/correlate them with Cerebus: + + http://dragos.com/cerebus/ + +5. For GUI front ends with simple log browsing look at: + + + HenWen (OSX) + + http://homepage.mac.com/nickzman + + http://home.attbi.com/~rickzman/software/HenWen1.0.sit.bin + + + IDS Center (Win32) + + http://www.packx.net/ + + + Puresecure (UNIX and Win32)-Formerly known as demarc. + + http://www.demarc.com/downloads/puresecure/ + + + SnortCenter (UNIX and Win32) + + http://users.pandora.be/larc/ + + + IDS Policy Manager (Win32) + + http://www.activeworx.com/IDSPM/ + +5.3 How do I log to multiple databases or output plugins? + +Feed the unified output files through barnyard twice to separate databases, +or... + +You can build redundancy by using multiple output plugins. Here are some +examples. + +Multiple instantiations of the database plugin: + + output log_database: mysql, dbname=snort host=localhost user=xyz + output log_database: mysql, dbname=snort host=remote.loghost.com user=xyz + +Remote database and local tcpdump: + + output log_database: mysql, dbname=snort host=remote.loghost.com user=xyz + output log_tcpdump: /var/log/snort.tcpdump + +Then you can replay the tcpdump file through snort to recreate the database. +CAVEAT: just playing back the log packets might not trigger some of the state +dependent pre-processors. + +5.4 How can I test snort without having an ethernet card or a connection to +other computers? + +You have to use routing between two dummy devices: + + modprobe -a dummy # (The dummy device has to be built by the kernel) + + ifconfig dummy0 192.168.0.1 + + ifconfig dummy0:0 192.168.0.2 + + telnet 192.168.0.3 12345 + +It's important that the second IP is on the same interface and not e.g. dummy1 +or dummy2 and that the IP you try to access is not one of those you put on the +interfaces. Use snort's ability to hear in promiscuous mode on an IP address +range. (HOME_NET=192.168.0.0/16) + +5.5 How to start snort as a win32 service? + +1. Use must use complete paths for everything. This means EVERYTHING. Command + line, configuration files, everything. Examples: All include statements + must be full paths. + + WRONG: include scan-lib + + CORRECT: include C:\( \backslash \)snort\( \backslash \)scan-lib + + All Command line options must be full paths. + + WRONG: snort.exe -l ./log + + CORRECT: snort.exe -l C:\( \backslash \)snort\( \backslash \)log + +2. YOU MUST ALWAYS HAVE A LOGGING DIRECTORY SET VIA THE COMMAND LINE (-l + switch). If you do not set a logging directory the service will not start + and, on NT/Win2k, your bootup will hang for about 4 minutes. +3. Make sure that snort runs correctly from the command line, without yet + worrying about any service related issues. Test that all of your desired + command line parameters are causing snort to function as you expect, such + as correctly generating logging and alert output. If you can't get this + part to work, then you don't have much hope of snort miraculously starting + to work as a service. +4. Once you have step (3) running correctly, modify the command line + parameters you used in step (3) to include the additional parameters "/ + SERVICE /INSTALL". For example, if your command line in step (3) was + + snort -i1 -lC:\( \backslash \)snort\( \backslash \)log -cC:\( \ + backslash \)snort\( \backslash \)snort.conf + + then you should change it to be + + snort /SERVICE /INSTALL -i1 -lC:\( \backslash \)snort\( \backslash \) + log -cC:\( \backslash \)snort\( \backslash \)snort.conf + + Verify that the command line parameters were received correctly by running + the command 'snort /SERVICE /SHOW'. +5. Start the service by running the command + + net start snortsvc + + Note that versions 1.9 (build 228), 2.0 (build 50), or any versions newer + than these, will add entries to the Win32 event Log if there is ever a + problem starting the service. + Stop the service by running the command + + net stop snortsvc + +6. The service can be uninstalled by running the command + + snort /SERVICE /UNINSTALL + +5.6 Is it possible with snort to add a ipfilter/ipfw rule to a firewall? + +Yes, with additional software in the contrib directory. But this can be +dangerous and is not recommended unless you know what you're doing. + + * SnortSam + + http://www.snortsam.net + + * You also might wat to look at inline-snort at: + + http://www.snort.org/dl/contrib/patches/snort-inline + + * Guardian is a perl script which uses snort to detect attacks, and then uses + IPchains to deny any further attacks. The Guardian webpage can be found at: + http://www.chaotic.org/~astevens/Guardian/index.html or you can use the + mirror, http://www.cyberwizards.com/~midnite/Guardian/index.html + +But one caveat... running external binaries can also be a performance limiter +and your should read the caution below... + +CHRISTOPHER CRAMER wrote: + + I'm sure this has been mentioned before in similar discussions, but this + feels like a _really_ bad idea. What if the bad guys realize what is going + on and make use of your blocking method as a DoS attack. All one would have + to do start sending a series of triggering packets with spoofed IP + addresses. + + Since I am no longer interested in breaking into your site, but rather + making your life hell, I don't worry about the resulting data getting back + to me. All I have to do is start proceeding up a list of IP addresses that + I think you should no longer be able to talk to. When you come in the next + morning, you find that you can no longer access the world. + + Just my $0.02. + +Danger Will Robinson: Conventional wisdom says that auto-blocking is inherently +dangerous. + +However, for those that like to live at the bleeding edge of tech (and the +separate process scanning logs and processing firewall commands sounds like a +good way to do this...): + +Please remember to include an exclusion list and put on them important sites +such as root servers, other important dns servers (yours, and important sites +for your users), and in general any host you don't want to receive phone calls +about being DoSed when they are spoofed - usually inconveniently like that +first time you actually manage to get on vacation.... (i.e. imagine "Crisis: +the CEO can't reach his favorite redlite.org game.... you have to fly back from +the Carribean asap....") + +5.7 What is the best way to use snort to block attack traffic? + +snort-inline > hogwash >> SnortSAM|Guardian >> flexresp + +5.8 Snort complains about the "react" keyword... + +Rerun configure with the -enable-flexresp option and rebuild/reinstall. + +5.9 How do I get snort to e-mail me alerts? + +You can't. Such a process would slow Snort down too much to make it of any use. +Instead, log to syslog and use swatch or logcheck to parse over the plaintext +logfiles. + +With the logsurfer docs, this might get you on the road to doing something with +snort & logsurfer: + + http://www.obfuscation.org/emf/logsurfer/snort.txt + +JASON HAAR provided an example Swatch (3.1beta) config that emails alerts: + + http://www.theadamsfamily.net/~erek/snort/snort-swatch.conf.txt + +Here are some docs on swatch: + + * http://www.oit.ucsb.edu/~eta/swatch/ + * http://www.stanford.edu/~atkins/swatch + * http://rr.sans.org/sysadmin/swatch.php + * http://www.enteract.com/~lspitz/swatch.html + * http://www.cert.org/security-improvement/implementations/i042.01.html + +IDS Center (see FAQ 5) on Win32 will also mail alerts. + +5.10 How do I log a specific type of traffic and send alerts to syslog? + +An example addition to snort.conf: + + ruletype redalert { + + type alert + + output alert_syslog: LOG_LOCAL2 + + output database: alert, postgresql, user=user dbname=snort password=pwd + + } + +Go into your local.rules and make sure you have something like: + + redalert tcp any any -> any any (msg:"REDRUM REDRUM"; + content:"redalerttest") + +Then just do a telnet and type 'redalerttest'. Presto, alerts to both. + +5.11 Is it possible to have snort call an external program when an alert is +raised? + +Calling another program from within your main IDS loop is generally a bad idea. +Having your IDS block while waiting for of dubious reliability and +origin nevermind timing while the packets are piling up is inviting packet +loss. Especially with the already oh-so-consistent "Gee I think I'll go away +for a minute" rock steady even cpu slicing Windows gives you (that's sarcasm, +sorry). Go with the second approach.... process invocation is expensive on +Windows. + +You want to keep that IDS task humming and munching packets as efficiently as +possible with as few interruptions as possible, IMHO, and not be invoking the +penalty of process invocation.... particularly on Windows where process +invocation is much much heavier task than *nix. + +Even in a secondary process... You'll probably find something that stays +"awake" all the time will work out much more nicely than something that gets +"woken up" on a per alert basis for the aforementioned reasons. + +As a better alternative go check out swatch or logwatch. Also for those new to +UNIX, logging alerts to syslog and then using "tail -f /var/log/messages" might +be what you are looking for. + +5.12 How can I use snort to log http urls or smtp traffic ? + +It can be done with snort, but you might find it faster to use mailsnarf and +urlsnarf from Dug Song's dsniff package. Dsniff is available from + + http://www.monkey.org/~dsong/dsniff/ + +You can get a win32 port of dsniff at + + http://www.datanerds.net/~mike/dsniff.html + +5.13 How can I move data from the snort db to snort_archive db like ACID does? + +Use the perl script snort_archdb.pl found in the contrib dir of the snort +distribution (snort_archdb-90a.tar.gz). + +5.14 What are some resources that I can use to understand more about source +addresses logged and where they are coming from? + + * http://www.arin.org/ + * http://www.caida.org/tools/utilities/netgeo/ + * http://netgeo.caida.org/perl/netgeo.cgi + * http://standards.ieee.org/regauth/oui/oui.txt + * http://www.codito.de/manufactor_hash + * http://coffer.com/mac_find/ + * http://www.idefense.com/Intell/CI022702.html + * http://www.idefense.com/excelfiles/All.zip + +also try "dig". + +5.15 How do I understand this traffic and do IDS alert analysis? + +1. You'll need to understand some basics of IP, TCP, and UDP. Things like + destination addresses, source addresses, common ports, what TCP SYN, FIN + and RST mean, etc. The same kind of basic knowledge of the internet you + need to successfully configure a multi-interface router applies here, + although you don't need to know router syntax. Some useful online + references: + + A truly basic "intro to TCP/IP" http://pclt.cis.yale.edu/pclt/COMM/ + TCPIP.HTM + + A reasonable looking TCP/IP FAQ: http://www.itprc.com/tcpipfaq/ + default.htm + + A basics of firewalls, DMZ's, etc. http://www.ibiblio.org/pub/Linux/ + docs/HOWTO/other-formats/html_single/Firewall-HOWTO.html +2. You'll need to understand some basics of how network attacks work. I'd + recommend skimming over "Smashing the Stack for fun and profit" by Aleph + one. A deep understanding isn't necessary, but a casual read of this will + give you some helpful basics in understanding the kinds of things that + happen in an attack, and give you a better understanding of what to look + for. + + http://www.insecure.org/stf/smashstack.txt + +3. A good guide on securing systems is helpful, something like this one: + + http://www.openna.com/products/books/sol/solus.php + + http://www.seifried.org/lasg/ + +4. You'll need to understand the basics of internet servers, ie: what DNS, + HTTP, FTP, SMTP, etc. are for. Most of that should be covered in the + various other references made here. +5. An excellent reference on "oddball" traffic patterns commonly seen at + network borders, also very helpful: + + http://www.robertgraham.com/pubs/firewall-seen.html + +6. Also take a look at the ``Recommended Reading'' section (see FAQ 1.4) + +5.16 How can I examine logged packets in more detail? + +If you are using unified logging, you can use Barnyard (see FAQ 5.1) + +or the unified log to pcap converter written by Dragos: + + http://dragos.com/logtopcap.c + +You can then get additional decoding of the packet contents by analyzing these +pcap files with either: + + * Tcpdump - http://www.tcpdump.org + * Ethereal - http://www.ethereal.com + +6 Problems + +6.1 I think I found a bug in snort. Now what? + +Get some more diagnostic information and post it to "snort-users" at http:// +lists.sourceforge.net/lists/listinfo/snort-users To get diagnostic information +compile snort as either: + + * []make clean; make CFLAGS=-ggdb + +or + + * []make clean; make "CFLAGS=-ggdb -DDEBUG" + +trace coredump as: + + * []gdb /path/to/snort /path/to/snort/core + + gdb> where + + gdb> bt + + gdb> print \$varname, varname, \$\$varname etc.. + +or if corefile isn't generated snort should be started as + + * []gdb snort + + gdb> run snort\_args\_go\_here + +Then when it crashes: + + * []gdb> where + + gdb> bt + + gdb> print \$varname, varname, \$\$varname etc.. + +6.2 SMB alerts aren't working, what's wrong? + +The SMB alerting output plugin was removed in Snort 2.1 due to security issues. + +6.3 Snort says "Garbage Packet with Null Pointer discarded!". Huh? + +This was an internal diagnostic message triggered by an old bug in early +versions of the defragmentation preprocessor. Upgrade to to the latest version +of snort. + +6.4 Snort says "Ran Out Of Space". Huh? + +This is an internal diagnostic message when the defragmentation preprocessor +runs into its 32MB hard allocation space limit. Tell Dragos about it + + +6.5 My ACID db connection times-out when performing long operations (e.g. +deleting a large number of alerts) + +PHP has an internal variable set to limit the length an script can execute. It +is used to prevent poorly written code from executing indefinitely. In order to +modify the time-out value, examine the 'max_execution_time' variable found in +the 'php.ini' configuration file. + +6.6 Why does ACID keep changing my sensor number and how do I keep it +consistent? + +From the code in op_acid_db.c: + + * []/* if sensor id == + 0, then we attempt attempt to determine it dynamically */ if(data-> + sensor_id == 0) + + { + + data->sensor_id = AcidDbGetSensorId(data); + + } + +And AcidDbGetSensorId does the following: + + * []"SELECT sid FROM sensor WHERE hostname='%s' AND interface='%s' " + + "AND filter='%s' AND detail='%u' AND encoding='0'", pv.hostname, + + pv.interface, pv.filter, op_data->detail) + +If it gets a sensor back, it uses that sensor_id, if not, it inserts the new +sensor. So from the code, to keep it consistent, don't change the hostname / +interface / filter and detail. + +6.7 Why does snort report "Packet loss statistics are unavailable under Linux"? + +The Linux IP stack doesn't report lost packet stats. This also has been +recently fixed with the 2.4+ kernel in the new version of libpcap... upgrade +kernels and libpcap and it should now work. + +6.8 My /var/log/snort directory get very large..... + +Try this script to archive the files. + + * []#!/bin/sh + + # + + # Logfile rotation script for snort writen by jameso@elwood.net. + + # + + # This script is pretty basic. We start out by setting some vars. + + # Its job is tho rotate the days logfiles, e-mail you with what + + # it logged, keep one weeks worth of uncompressed logs, and also + + # keep compressed tgz files of all the logs. It is made to be run + + # at midnight everynight. This script expects you to have a base + + # dir that you keep all of your logs, rule sets etc in. You can + + # see what sub dirs it expects from looking at the var settings + + # below. + + # + + # Things to note in this script is that we run this script at 12 + + # every night, so we want to set the dirdate var the day the script + + # runs minus a day so we label the files with the correct day. We + + # Then create a dir for the days logs, move the log files into + + # todays dir. As soon as that is done restart snort so we don't miss + + # anything. Then delete any logs that are uncompressed and over a + + # week old. Then compress out todays logs and archive them away, and + + # end up by mailling out the logs to you. + + # + + # Define where you have the base of your snort install + + snortbase=/usr/snort + + # Define other vars + + # logdir - Where the logs are kept + + # oldlogs - Where you want the archived .tgz logs kept + + # + weeklogs - This is where you want to keep a weeks worth of log files uncompres + + sed + + # dirdate - Todays Date in Month - Day - Year format + + # olddirdate - Todays date in the same format as dirdate, minus a week + + logdir=$snortbase/log + + oldlogs=$snortbase/oldlogs + + weeklogs=$snortbase/weeklogs + + # When I first wrote this script, I only ran it on BSD systems. That was a + + # + mistake, as BSD systems have a date command that apperently lets you walk the + + # + date back pretty easily. Well, some systems don't have this feature, so I had + + # + to change the way that dates are done in here. I left in the old way, because + + + + # + it is cleaner, and I added in a new way that should be portable. If anyone + + # has any problems, just let me know and I will try to fix it. + + # + + # + You have to change the system var to either bsd or other. Set it to bsd if + + # your system supports the "-v" flag. If you are not sure, set it to other. + + system=bsd + + if [ $system = bsd ] + + then + + dirdate=`date -v -1d "+%m-%d-%y"` + + olddirdate=`date -v -8d "+%m-%d-%y"` + + elif [ $system = other ] + + month=`date "+%m"` + + yesterday=`expr \`date "+%d"\` - 1` + + eightday=`expr \`date "+%d"\` - 8` + + year=`date "+%y"` + + dirdate=$month-$yesterday-$year + + olddirdate=$month-$eightday-$year + + fi + + # Create the Dir for todays logs. + + if [ ! -d $weeklogs/$dirdate ] + + then + + mkdir $weeklogs/$dirdate + + fi + + # Move the log files into todays log dir. This is done with + + # a for loop right now, because I am afriad that if alot is + + # logged there may be to many items to move with a "mv *" + + # type command. There may a better way to do this, but I don't + + # know it yet. + + for logitem in `ls $logdir` ; do + + mv $logdir/$logitem $weeklogs/$dirdate + + done + + # Kill and restart snort now that the log files are moved. + + kill `cat /var/run/snort_fxp0.pid` + + # Restart snort in the correct way for you + + /usr/local/bin/snort -i fxp0 -d -D -h homeiprange/28 -l /usr/snort/log \ + + -c /usr/snort/etc/08292k.rules > /dev/null 2>&1 + + # Delete any uncompressed log files that over a week old. + + if [ -d $weeklogs/$olddirdate ] + + then + + rm -r $weeklogs/$olddirdate + + fi + + # Compress and save the log files to save for as long as you want. + + # This is done in a sub-shell because we change dirs, and I don't want + + # to do that within the shell that the script runs in. + + (cd $weeklogs; tar zcvf $oldlogs/$dirdate.tgz $dirdate > /dev/null 2>&1) + + # Mail out the log files for today. + + cat $weeklogs/$dirdate/snort.alert | mail -s "Snort logs" you@domain.com + + cat $weeklogs/$dirdate/snort_portscan.log | + mail -s "Snort portscan logs" you@do + + main.com + +6.9 Why does the 'error deleting alert' message occur when attempting to delete +an alert with ACID? + +Most likely the DB user configure in ACID does not have sufficient privileges. +In addition to those privileges granted to log the alerts into the database +(INSERT, SELECT), DELETE is also required. + +This permission related issue can be confirmed by manually inserting a row into +the database, then trying to delete it. + +1. login to MySQL with the same credentials (i.e. username, password) as you + use in ACID + + mysql -u -p + +2. insert a test row into the event table + + mysql> INSERT INTO event (sid, cid, signature, timestamp) VALUES + (1,1000000, "test", "0"); + + (this assumes that you don't already have a row with an event ID=1000000. + If you do just choose another event id #) + +3. now delete this newly inserted row: + + mysql> DELETE FROM event WHERE sid=1 AND cid=10000000; + + If you where not able to delete, this confirms that this is a permission + problem. Re-login to mysql as root, and issue a GRANT command (giving the + DELETE permission) to the ACID DB user. + + GRANT DELETE on snort.* to acid@localhost + + (this assumes that my alert database is 'snort', username is 'acid', and + logging from the 'localhost') + +6.10 ACID appears to be broken in Lynx + +This is a known issue. Lynx mangles some of the form arguments appended to the +URL. It's resolution is being investigated, but use Netscape, Opera, or IE in +the mean time. + +6.11 I am getting 'snort [pid] uses obsolete (PF_INET, SOCK_PACKET)' warnings, +what's wrong. + +You use older libpcap version with recent linux kernel. There should be no +problem with it as long as your kernel supports SOCK_PACKET socket type. To get +rid off the warning message however, you'll have to upgrade to some recent +version of libpcap. (a copy from www.tcpdump.org is recommended). + +6.12 On HPUX I get device lan0 open: recv_ack: promisc_phys: Invalid argument + +It's because there's another program running using the DLPI service. The HP-UX +implementation doesn't allow more than one libpcap program at a time to run, +unlike Linux. (from snort.c) + +6.13 I am getting snort dying with 'can not create file' error and I have +plenty of diskspace, what's wrong? + +You may run out of free inodes, which basically also means you can not create +more files on the partition. The obvious solution is to rm some ;-) + +6.14 I am using Snort on Windows and receive an ``OpenPcap() error upon +startup: ERROR: OpenPcap() device open: Error opening adapter'' What's wrong? + +Either winpcap is not installed, or you are using an incompatible version. Try +upgrading to the latest version (2.3 as of 01/17/03). It is available from +http://netgroup-serv.polito.it/winpcap/ It might also be an issue with SMP +machines see FAQ Q:### + +6.15 Snort is not logging to my database! + +There are a number of problems that may be causing snort to fail to log to a +database. You should check these: + +1. You did not set up the database plugin in your configuration file. +2. You are using an older database schema, and should update it by running the + create scripts from the /contrib directory of the source tarball. +3. You are using a command line option that overrides what you have in your + configuration file. This is most often -A or -s. NOTE: If you wish to log + to syslog as well, specify so in your configuration file rather then the + command line. +4. There is a problem with your database configuration itself. Make sure the + user you specify has the correct permissions, or that the database is even + up and running. + +6.16 Portscans are not being logged to my database + +You need to change the output facility to 'alert' rather then 'log'. The +portscan preprocessor calls output plugins registered as 'alert' plugins rather +then 'log'. + + output database: alert, mysql, user=snort dbname=snort host=localhost + +6.17 Snort is not logging to syslog + +There are a number of problems that may be causing snort to fail to log to +syslog. You should check these: + + * You are using a command line option that overrides what you have in your + configuration file. This is most often -A. + * It may be logging to the wrong place. Make sure syslog is configured + correctly. + +6.18 I am still getting bombarded with spp_portscan messages even though the IP +that I am getting the portscan from is in my $DNS_SERVERS var + +Try adding /32 netmasks to those addresses: + + var DNS_SERVERS [xxx.xx.0.3/32,xxx.xxx.0.2/32] + +And make sure the $DNS_SERVERS variable is on the portscan-ignorehosts line: + + preprocessor portscan-ignorehosts: $DNS_SERVERS + +6.19 Why chrooted snort die when I send it a SIGHUP? + + It's a known problem with permissions. Workaround, restart snort instead. + +But the longer answer is this: Due to the way the execv(2) call works, it +"Restarts" snort from scratch. This has the odd side effect of making HUPS to a +chrooted snort become recursive. For example, chroot to /snort. It now sees / +snort as / . Now HUP snort. Snort now expects to have /snort/snort as /. In +other words, you have to re-create your directories for your jail inside it. 4 +HUPS and you will be in /snort/snort/snort/snort. + +6.20 My snort crashes, how do I restart it? + +Try one of these two shell scripts or daemontools (refer to website to +daemontools) + + * []#!/bin/sh + + #snorthup: Snort Restarter and Crash Logger + + #(dr@kyx..net with help from kmaxwell@superpages.com) + + $conf = "snort.conf" + + for $IFACE in fxp0 fxp1 + + do + + if [ -f /var/run/snort_$IFACE.pid ]; then + + if ! ps -p `cat /var/run/snort_$IFACE.pid` > /dev/null ; then + + /usr/bin/logger -p user.notice snorthup: removing bogus pidfile + + /usr/bin/ + logger -p user.notice snorthup: restarting absentee snort o + + n $IFACE with conf file $i + + rm -f /var/run/snort_$IFACE.pid + + /usr/local/bin/snort -D -c $conf -i $IFACE + + fi; + + else + + /usr/bin/ + logger -p user.notice snorthup: restarting snort on $IFACE with + + conf file $conf + + /usr/local/bin/snort -D -c $conf -i $IFACE + + fi + + done + +Another version: + + * []#!/bin/ksh + + # snortstartd: Snort (Re)Starter + + # Dom De Vitto (dom@devitto..com) + + # (original idea by dr@kyx..net & kmaxwell@superpages.com) + + # + + # Note: You'd better get CONF and INTERFACES right or + + # this script will just keep trying to start snort. + + # Path to echo, sed, test, ps, grep, logger, rm, and sleep. + + PATH=$PATH:/usr/bin:/usr/local/bin ; export PATH + + # Point this to your conf file: + + CONF="/usr/local/share/examples/snort/snort.conf" + + # Which interfaces should Snort run on, e.g.: + + INTERFACES="hme0 hme1" + + # Wait this many seconds between checks: + + CHECKEVERY=5 + + # Full path to Snort: + + SNORTBINARY=/usr/local/bin/snort + + while :; do + + for INT in $INTERFACES + + do + + GREPSTRING="`echo $SNORTBINARY -N -D -c $CONF -i $INT|sed + + 's?\/?\\\/?g'`" + + PSCMDLINES=`(ps augxww 2>/dev/null||ps -ef 2>/dev/null) | grep + + "$GREPSTRING"|wc -l` + + if [ $PSCMDLINES = 0 ]; then + + logger -p user.notice -t "$0" "Starting Snort on $INT." + + $SNORTBINARY -N -D -c $CONF -i $INT 2>&1 > /dev/null + + fi + + done + + sleep $CHECKEVERY + + done + +6.21 Why can't snort see one of the 10Mbps or 100Mbps traffic on my autoswitch +hub + +Basically it's a function of the design and all autoswitching hubs will behave +in this way. It's the result of just not being able to stuff all the 100 Mbps +traffic into the 10Mbps CSMA/CD. One solution I use to the problem is these new +cheapie four port switches... put all the 10Mbps on it's own hub/switch/ +whatever and then route that to the 100Mbps hub I use for monitoring but put a +cheapie switch in between that works as an adapter basically mediating the 10 +up to 100 and vice versa. + +The bad thing about hubs that don't have this "feature", is that in order to +support 10bt devices, they throttle the entire hub speed down to 10bt if there +is one or more 10bt only devices hooked up to it. I have seen this behavior +(and did the bandwidth tests to prove it) on old 3com office connect 10/100 +hubs (newer ones do the 2 hubs with a switch thing.) So, the point of what I am +saying is, since these old hubs have no switching capabilities, and they don't +know which port the traffic is supposed to go to (no switch=no arp table), they +have to throttle bandwidth. + +None of the hubs and switches have any significant amount of storage on the +ethernet chip sets, and therefore any non-layer-three box that has 100 -> 10 +capability can only handle small amounts of traffic before the chip set drops +incoming packets on the floor. Guess one might call that throttled bandwidth, +but at the expense of retransmission timeouts and retransmissions at the end +nodes. + +If the box has a backplane, multiple cards and some network management +functions, there is a higher probability the manufacturer has some additional +buffering going on to keep dropped packets from happening on at least small +bursts of traffic. + +In the most generic of terms, if a box supports 100 "full-duplex", then its a +switch (regardless of what the manufacturer calls it). If it supports 100 -> +10, there is 50-50 chance the box has some MAC address awareness. If a box only +supports 10 -> 10 or 100 -> 100, there is a high probability it is not MAC +address aware and therefor functions like a hub. + +Many hubs have different back planes, ie one for 10 one for 100. + +From a definition standpoint, a hub segment whether it be 10 or 100 is a single +broadcast/collision domain. You will not see ANY traffic between segments +without a bridge or layer3 route function between them. + +In a switched environment, typically each port is a separate collision domain +but one big broadcast domain. VLANs can be created in some to separate into +separate broadcast domains and some have built in layer 3 functionality which +basically connects a router into the backplane so that it can route between +vlans at wire speed. + +Think of a switch as a bridge with many ports. (that's what it is). Some +switches support port mirroring or span ports. When you want to "sniff" frames +in a switched environment (beyond just broadcast/multicast traffic) you need to +be able to "see" the unicast traffic (telnet,http for example). You set up a +port to mirror traffic from the ports that have the devices your interested in +to the port you have your analysis device plugged into. Without doing so, you +don't see the unicast conversations because the traffic is getting "switched" +across the backplane so pc on port 1 talks to server on port 2 and no other +ports get this traffic. If server on port 2 broadcasts or multicasts, the +information is flooded out all ports. (multicast can be controlled on some +switches so only those ports that have listening stations get the traffic. Not +all switches have these capabilities. + +An excellent book on the topic is Interconnections by Radia Perlman. (Bridges +and Routers). + +Additional caveat: if you deal with full duplex on a switched port, only a tap +would save you - users have successfully used Shomiti's ones on 100MB FD ports, +and used two Snort instances, capturing traffic on both directions. Port +mirroring didn't work in that case ... + +6.22 Trying to install snort it says: "bad interpreter: No such file or +directory" + +Usually this error comes from editing files on Windows machines. Often it shows +up on the ./configure step. The configure script should be looking for the /bin +/sh shell as its interpreter. If /bin/sh doesn't exist then you'll get this +error. Check that whatever comes after the #! on the first line of configure is +actually there. + +If the file has been edited on a Windows machine it can sometimes Add CR/LF +(VM) characters on the end of each line, so #!/bin/sh becomes #!/bin/shVM and +as the ctrl-v/ctrl-m characters are special, and hidden by default on most +editors, it can create a really hard to find problem. To remove the extra CR +characters that UNIXish machines don't like, simply use the dos2unix command: + + * []dos2unix + +If your OS doesn't have dos2unix, then you can use: + + * []cat | tr -d ``\r'' > + +6.23 I'm not seeing any interfaces listed under Win32. + +The reason you're seeing nothing in the interface list is a WinPcap problem. In +previous versions of WinPcap there is a 1K buffer, which overflows if you have +many interfaces (ie. 10+). This has been replaced with an 8K buffer in more +recent versions of WinPcap. The current snort distribution should already be +linking against the newer WinPcap libraries, which should resolve this problem. +Try obtaining a more recent build of snort. + +6.24 It's not working on Win32, how can I tell if my problem is snort or +WinPcap? + +See if WinDump will work with WinPcap. This should help you isolate which +component is being bogus. + +6.25 I just downloaded a new ruleset and now snort fails complaining about the +rules. + +First, make sure you downloaded the right ruleset for your version of snort. +Snort.org generally hosts a ruleset for the released version of snort, as well +as rules for the development branch and sometimes copies for older versions of +snort. This is generally the case for "unknown keyword in rule" type errors. + +If you have the rules that are correct for your version of snort be aware that +the snort rules tarball contains a snort.conf file. From time to time the +snort.conf included with the rules gets changed as new .rules files are added, +and new variables are added to support a better ruleset. When downloading new +rulesets you should always give the included snort.conf a quick look-over to +see if new includes or vars have been added, or at least be aware you should +consult it if things do not work as expected. This is generally the case if you +get messages indicating that something is undefined in a rule. + +6.26 How do I speed up ACID and MySQL ? + +(ACID FAQ B-10) + +MySQL optimizations Two things for you to check from the ACID faq: + + http://www.andrew.cmu.edu/~rdanyliw/snort/acid_faq.html + + * Compact the tables + + After numerous delete operations, "holes" will occur in the native files + used to store the tables decreasing the speed of the all queries. The + following shell script will examine all the MySQL tables and compact them. + + []for table in `echo show tables|mysql snort|tail +2` + + do + + echo optimize table $table|mysql snort + + done + * Creating indexes + + Some of the required indexes are not created in initial MySQL creation + script. The following indexes can be added to significantly improve + performance: + + tcphdr.tcp_sport + + tcphdr.tcp_dport + + acid_ag_alert.ag_sid + acid_ag_alert.ag_cid + + MySQL can be fast - you just need to have the proper indexing set up. If + you need a good MySQL reference, pick up a copy of Paul DuBois' book, which + is currently the bible for MySQL. O'Reilly also recently released a + reference by Monty and the MySQL AB team. + + The way to check if the indices are already there are with the SHOW INDEX + command. For instance, to check the tcphdr table, you would run: + + []mysql> show index from tcphdr; + + +----+------+------+-------+-------+------+-------+-----+----+-----+ + + | Table | Non_unique | Key_name | Seq_in_index | Column_name | + Collation | Cardinality | Sub_part | Packed | Comment | + + +----+------+------+-------+-------+------+-------+-----+----+-----+ + + | tcphdr | 0 | PRIMARY | 1 | sid | + A | NULL | NULL | NULL | | + + | tcphdr | 0 | PRIMARY | 2 | cid | + A | 2543146 | NULL | NULL | | + + | tcphdr | 1 | tcp_sport | 1 | tcp_sport | + A | NULL | NULL | NULL | | + + | tcphdr | 1 | tcp_dport | 1 | tcp_dport | + A | NULL | NULL | NULL | | + + | tcphdr | 1 | tcp_flags | 1 | tcp_flags | + A | NULL | NULL | NULL | | + + +----+------+------+-------+-------+------+-------+-----+----+-----+ + + 5 rows in set (0.00 sec) + You can see that in this case, the tcphdr.tcp_sport index is in line 3, and + the tcphdr.tcp_dport is in line 4. + + If you need to create the index, you can run: + + []CREATE INDEX idx_tcp_sport ON tcphdr(tcp_sport); + To create a compound index, you would do this: + + []CREATE INDEX idx_cpd_sid_cid ON acid_ag_alert(ag_sid,ag_cid); + If you want to take a closer look at the table structures, you can use the + DESCRIBE command, and pass it the table name: + + [] mysql> DESCRIBE tcphdr; + + +------+-----------+---+---+-----+----+ + + | Field | Type | Null | Key | Default | + Extra | + + +------+-----------+---+---+-----+----+ + + | sid | int(10) unsigned | | PRI | 0 | + | + + | cid | int(10) unsigned | | PRI | 0 | + | + + | tcp_sport | smallint(5) unsigned | | MUL | 0 | + | + + | tcp_dport | smallint(5) unsigned | | MUL | 0 | + | + + | tcp_seq | int(10) unsigned | YES | | NULL | + | + + | tcp_ack | int(10) unsigned | YES | | NULL | + | + + | tcp_off | tinyint(3) unsigned | YES | | NULL | + | + + | tcp_res | tinyint(3) unsigned | YES | | NULL | + | + + | tcp_flags | tinyint(3) unsigned | | MUL | 0 | + | + + | tcp_win | smallint(5) unsigned | YES | | NULL | + | + + | tcp_csum | smallint(5) unsigned | YES | | NULL | + | + + | tcp_urp | smallint(5) unsigned | YES | | NULL | + | + + +------+-----------+---+---+-----+----+ + + 12 rows in set (0.02 sec) + +6.27 Why am I seeing so many "SMTP RCPT TO overflow" alerts ? + +That rule looks for a TCP frame going to your SMTP server which contains more +than 800 bytes of data. Any email can easily set that off if pipelining is +used. SMTP command pipelining allows several command lines lines to be sent as +a single packet without waiting for an OK response. Any good high-volume +mailserver will try to pipeline where possible, resulting in a single TCP frame +containing a series of command lines, each of which is not very long, but in +aggregate easily exceed the 800 byte threshold, particularly if there is a +large recipient list. + +For more info on pipelining: + + http://www.faqs.org/rfcs/rfc1854.html + +If your mailservers are not vulnerable to these overflows you can disable this +rule and regain some peace... + +6.28 I'm getting lots of *ICMP Ping Speedera*, is this bad? + +Quite ordinary. Windows update uses speedera based DNS, among other things. Of +course, if the speedera traffic is coming from a Dialup account (as there have +been reports of) it's likely a hacker tool. ;-) + +6.29 Why are my unified alert times off by +/- N hours? + +Unified log and alert files are stored in UTC. + +6.30 I try to start snort and it gives an error like "ERROR: Unable to open +rules file: /root/.snortrc or /root//root/.snortrc". What can I do to fix this? + +When Snort starts it looks at the command line and checks for "-c /some/path/ +snort.conf". If thats not there, then it will look for the one of the following +files: + + * /etc/snort.conf + * ./snort.conf + * $HOMEDIR/snort.conf + * $HOMEDIR/.snortrc + * ./.snortrc + +Make sure your .conf is in one of those locations and then snort will be able +to find it or use the -c parameter to tell snort the full pathname to the +snort.conf. + + snort -c /usr/local/etc/snort.conf + +7 Development + +7.1 How do you put snort in debug mode? + +In the 1.9 or greater, + +1. ./configure -enable-debug +2. Look up the section of snort you'd like to debug ( look at src/debug.h ) + and add up the constants. For example if you want to debug Portscan2, + + #define DEBUG_PORTSCAN2 0x00080000 /* 524288 / (+ conv2 ) 589824 */ + + To debug both just portscan2, + + export SNORT_DEBUG=524288 + + To debug both portscan2 and conversation: + + export SNORT_DEBUG=589824 + +3. Run snort as normal. You will need to redirect output to a file to cope + with the large amounts of debug output. + +8 Miscellaneous + +8.1 What's this about a snort drinking game? + +:-) Check it out for yourself: + + http://www.theadamsfamily.net/~erek/snort/drinking_game.txt + +About this document ... + +The Snort FAQ + +This document was generated using the LaTeX2HTML translator Version 97.1 +(release) (July 13th, 1997) + +Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning +Unit, University of Leeds. + +The command line arguments were: +latex2html -no_subdir -split 0 -show_section_numbers /tmp/lyx_tmpdir5901fp5901/ +lyx_tmpbuf5901EF5901/faq.tex. + +The translation was initiated by Erek Adams on 4/9/2003 +------------------------------------------------------------------------------- + +Footnotes + +...Shomiti/Finisar + http://www.shomiti.com + +...Netoptics + http://www.netoptics.com/ + +...syslog-ng + http://www.balabit.hu/en/downloads/syslog-ng/ + +...manual + http://www.snort.org/docs/writing_rules/chap2.html#tth_sEc2.2.4 + +------------------------------------------------------------------------------- +next up previous + +Erek Adams +4/9/2003 Index: snort/doc/Makefile.am diff -u snort/doc/Makefile.am:1.1.1.10 snort/doc/Makefile.am:1.6.2.6 --- snort/doc/Makefile.am:1.1.1.10 Sun Apr 24 22:07:01 2005 +++ snort/doc/Makefile.am Fri Jun 10 19:11:01 2005 @@ -22,7 +22,9 @@ README.INLINE \ README.sfportscan \ snort_schema_v106.pdf \ -README.wireless PROBLEMS RULES.todo WISHLIST faq.pdf faq.tex +README.wireless PROBLEMS RULES.todo WISHLIST faq.pdf faq.tex \ +README.wifi_statetable \ +README.snort-wireless DISTCLEANFILES= snort_manual.log snort_manual.toc snort_manual.aux faq.pdf faq.tex snort_manual.pdf Index: snort/doc/README.asn1 diff -u snort/doc/README.asn1:1.1.1.2 snort/doc/README.asn1:1.1.1.2.4.1 --- snort/doc/README.asn1:1.1.1.2 Sun Apr 24 22:07:03 2005 +++ snort/doc/README.asn1 Sat May 14 02:22:34 2005 @@ -68,92 +68,3 @@ alert tcp any any -> any 80 (msg:"ASN1 Relative Foo"; content:"foo"; \ asn1: bitstring_overflow, print, relative_offset, 0;) - - -Background on ASN.1 -------------------- - -The following comments were compiled by Chris Reid circa Feb 2003. - -ASN.1 - Abstract Syntax Notation number One - -* * * * * * - -An interesting site about ASN.1 (and its primary author Professor John -Larmouth) can be found here: http://www.oss.com/asn1/larmouth.html -including an electronic copy of Professor Larmouth's book titled -"ASN.1 Complete". - -* * * * * * - -The following descriptions are copied from the website: -"http://asn1.elibel.tm.fr/". I have no affiliation with this website, -but reference it here because they provide a large amount of useful -information about ASN.1. - -"Abstract Syntax Notation number One (ASN.1) is an international standard - that aims at specifying data used in communication protocols. It is a - powerful and complex language: its features are designed to describe - accurately and efficiently communications between homogeneous or - heterogeneous systems." - -"ASN.1 is a formal notation used for describing data transmitted by - telecommunications protocols, regardless of language implementation and - physical representation of these data, whatever the application, whether - complex or very simple. - - "------------------------------------------- - Abstract Syntax Notation number One - is a standard that defines a formalism - for the specification of abstract data types. - ------------------------------------------- - -"The notation provides a certain number of pre-defined basic types such as: - - integers (INTEGER), - - booleans (BOOLEAN), - - character strings (IA5String, UniversalString...), - - bit strings (BIT STRING), - - etc., - -"and makes it possible to define constructed types such as: - - structures (SEQUENCE), - - lists (SEQUENCE OF), - - choice between types (CHOICE), - - etc. " - -* * * * * * - -My own notes about ASN.1, as understood from skimming through Section 3 -("Encodings") of the book "ASN.1 Complete"... - - - Data in ASN.1 is represented by groupings composed of T-L-V (Type, - Length, and Value) - - - Datatypes are identified by the bottom six bits of a single byte. - Datatypes values 0 through 30 are represented in a single byte. - Value "31" (0x1f) is an escape marker to indicate the datatype - value continues in the following bytes -- as long as successive - bytes have the high bit set. - - - The length of a given datatype can be represented in any of three - ways: Short Length, Long Length, and Indefinite Length. - - - Short Lengths are stored in one byte, and can indicate data lengths - of up to 127 bytes. Note that Short Lengths are identified by an - upper bit of zero. - - - Long Lengths are stored in multiple bytes. The first byte indicates - how many bytes are required to contain the Long Length, and the - successive bytes contain the value of the Long Length. Note that - the first byte of Long Lengths are identified by an upper bit of one, - and that only the bottom seven bits of the first byte are used to - represent how many bytes are required to contain the Long Length. - Also, note that the maximum allowed value of the bottom seven bits - is 126 (0x7e), and that 127 (0x7f) is reserved for future use. - - - Indefinite Lengths are conceptually like BLOB data. The upper bit of - the first byte is set to one, and the bottom seven bits are zero. The - data value follows immediately, and continues until two zero-bytes - are encountered. - - Index: snort/doc/README.snort-wireless diff -u /dev/null snort/doc/README.snort-wireless:1.1 --- /dev/null Mon Jun 13 11:22:46 2005 +++ snort/doc/README.snort-wireless Thu Mar 10 17:34:35 2005 @@ -0,0 +1,74 @@ +Snort-Wireless +============== + +Copyright (c) 2003 Andrew Lockhart + +Any feedback, bug reports, feature requests, etc. are welcome at +andrew@snort-wireless.org. If you'd like to help in any way, feel free to +contact me. I'll try to respond ASAP. + +"wifi" Protocol Rules +===================== +Snort at present does not contain direct support for rule based detection of +anything below the IP layer. It is possible in Snort 2.0.x to match byte +patterns in a packet, but it is not very straightforward and is very +time-consuming to write detection rules this way. + +Rules for detecting particular 802.11 frames are specified +using the following syntax: + + wifi -> () + +The 802.11 plugins are in src/detection-plugins and their filenames begin +with sp_wifi_. Each plugin should have documentation for it in the comments +at the top of its source file. Additionally, rules/wifi.rules contains example +rules for every plugin contained in the distribution. + +-Bugs- +* Only the alert and log actions have been tested +* Only the first matching rule triggers an alert +* Alerts logged to a database do not show up in ACID - this is because they + lack in IP header + +RogueAP Preprocessor +The RogueAP preprocessor detects both rogue APs and AdHoc networks. To +configure it, you'll need to first specify your APs BSSIDs and channels that +they operate on in your snort.conf file using the ACCESS_POINTS and CHANNELS +variables. + +# Single AP +var ACCESS_POINTS XX:XX:XX:XX:XX:XX +# Multiple APs +var ACCESS_POINTS [XX:XX:XX:XX:XX:XX, YY:YY:YY:YY:YY:YY, ....] +# Single channel +var CHANNELS X +# Multiple channels +var CHANNELS [X, Y, ...] + +The preprocessor is activated by specifying the following in your snort.conf: + +preprocessor rogue_ap: $ACCESS_POINTS, $CHANNELS, scan_flag [0 | 1], \ + scan_timeout [num], expire_timeout [num] + + +* scan_flag - toggles scanning of multiple channels *NOT IMPLEMENTED* +* scan_timeout - time in seconds between channel scans *NOT IMPLEMENTED* +* expire_timeout - time in seconds before a BSSID is removed from the rogue + list + +AntiStumbler Preprocessor + +The AntiStumbler preprocessor attempts to detect Netstumbler like traffic. It +does this by keeping track of probe request frames sent with NULL SSID fields. +The preprocessor is activated by specifying the following in your snort.conf: + +preprocessor antistumbler: probe_reqs [num], probe_period [num], \ + expire_timeout [num] + + +* probe_reqs - number of probe requests that triggers an alert +* probe_period - time period in seconds that NULL SSID probe request count is + maintained +* expire_timeout - time in seconds before a STA is removed from the stumbler + list + Index: snort/doc/README.wifi_statetable diff -u /dev/null snort/doc/README.wifi_statetable:1.1.2.1 --- /dev/null Mon Jun 13 11:22:46 2005 +++ snort/doc/README.wifi_statetable Sat Apr 23 02:19:32 2005 @@ -0,0 +1,93 @@ +Enabled with --enable-wireless configure option. + +Snort-Wifi_StateTable +===================== + +Copyright (c) 2004 Sebastien Gracia + +Any feedback, bug reports, feature requests, etc. are welcome at +sgracia@wanadoo.fr. If you'd like to help in any way, feel free to +contact me. I'll try to respond ASAP. + +I would like to thank Michel Weinachter and Olivier Grumelard. + +This patch is a snort-2.1.1 patch and includes Andrew Lockhart works +(). + +"wifi_statetable" +================= +Basically, Wifi_StateTable (WST) should be considered as a stateful table used +by dedicated wireless preprocessors which purpose is to detect some wireless +specific attack. +The index of this table will be "MAC address hash" based. +Anytime a packet would filled some WST preprocessors alert criterions (depending +on preprocessor arguments inside snort.conf), some data will be inserted or +updated inside WST. +Whenever alert_threshold are reached, corresponding alert will be sended. +At the moment, two preprocessors use WST: + - deauthflood, + - authflood. + +DeauthFlood +--------------------------------------------- +DeauthFlood detects wireless station flooded with deauth frames. + +Arguments: + +deauth_threshold [num] => number of deauth frames during time delta it takes + to trigger an alert +expire_timeout [num] => time period used to keep count of deauth frames +target_limit [num] => maximum number of station inserted inside deauthstation + mempool +prune_period [num] => number of seconds to wait for removing some decayed + deauthstations from mempool + +AuthFlood +--------------------------------------------- +AuthFlood detects wireless access point flooded with auth frames. + +Arguments: + +auth_threshold [num] => number of auth frames during time delta it takes + to trigger an alert +expire_timeout [num] => time period used to keep count of auth frames +target_limit [num] => maximum number of access point inserted inside authAP mempool +prune_period [num] => number of seconds to wait for removing some decayed + flooded AP from mempool + +MacSpoof +--------------------------------------------- +MacSpoof detects wireless MAC addresses involved in some MAC spoofed traffic. + +Arguments: + +MACSPOOF_MASKED_ADDR => list of MAC addresses excluded from wireless MAC spoofing + [var] detection process +tolerate_gap [num] => tolerate missing frames between two consecutives frames issued + from same MAC address +threshold [num] => number of abnormal sequence number gaps during time delta to + trigger an alert +expire_timeout [num} => time period used to keep count of abnormal seq number gap +spoofed_target_limit => maximum number of MAC addresses inserted inside MAC spoofed + [num] addresses mempool +prune_period [num] => number of seconds to wait for looking after some decayed + MAC addresses inside mempool + +*Because of some particuliar firmware or some electro_magnetic conditions, this + preprocessors won't fit to all wireless features inside network. + Those would generate too much false positive alert. + Therefore, I suggest macspoof preprocessos users to run snort a first time + in order to identify those particuliar features and thereafter to insert + them inside MaskedMACaddrlist. + +*Whenever an alert si raised, it doesn't mean anytime that concerned MAC address + is spoofed. Furthermore, It means that this MAC adress is involved in some MAC + spoofed traffic (either MAC spoofed or MAC spoofing address). + +*whenever "end abnormal sequence number gap" is logged, it doesn't exactly mean that + MAC spoofing ended. For example, it would occured if a spoofer succeed to divert + a user from network while keeping using his MAC address. In such a case, neither + abnormal sequence number gap would be detected nor alert would be sended + while MAC spoofing still occur. + + Index: snort/doc/snort_schema_v106.pdf Index: snort/doc/signatures/119-1.txt diff -u snort/doc/signatures/119-1.txt:1.1.1.2 snort/doc/signatures/119-1.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-1.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-1.txt Sat May 14 02:22:35 2005 @@ -59,5 +59,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-10.txt diff -u snort/doc/signatures/119-10.txt:1.1.1.2 snort/doc/signatures/119-10.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-10.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-10.txt Sat May 14 02:22:35 2005 @@ -59,5 +59,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-11.txt diff -u snort/doc/signatures/119-11.txt:1.1.1.2 snort/doc/signatures/119-11.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-11.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-11.txt Sat May 14 02:22:35 2005 @@ -58,5 +58,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-12.txt diff -u snort/doc/signatures/119-12.txt:1.1.1.2 snort/doc/signatures/119-12.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-12.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-12.txt Sat May 14 02:22:35 2005 @@ -57,5 +57,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-13.txt diff -u snort/doc/signatures/119-13.txt:1.1.1.2 snort/doc/signatures/119-13.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-13.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-13.txt Sat May 14 02:22:35 2005 @@ -58,5 +58,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-14.txt diff -u snort/doc/signatures/119-14.txt:1.1.1.2 snort/doc/signatures/119-14.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-14.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-14.txt Sat May 14 02:22:35 2005 @@ -59,5 +59,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-15.txt diff -u snort/doc/signatures/119-15.txt:1.1.1.2 snort/doc/signatures/119-15.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-15.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-15.txt Sat May 14 02:22:35 2005 @@ -60,5 +60,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-16.txt diff -u snort/doc/signatures/119-16.txt:1.1.1.2 snort/doc/signatures/119-16.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-16.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-16.txt Sat May 14 02:22:35 2005 @@ -57,5 +57,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-17.txt diff -u snort/doc/signatures/119-17.txt:1.1.1.2 snort/doc/signatures/119-17.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-17.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-17.txt Sat May 14 02:22:35 2005 @@ -60,5 +60,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-18.txt diff -u snort/doc/signatures/119-18.txt:1.1.1.2 snort/doc/signatures/119-18.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-18.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-18.txt Sat May 14 02:22:35 2005 @@ -58,5 +58,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-2.txt diff -u snort/doc/signatures/119-2.txt:1.1.1.2 snort/doc/signatures/119-2.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-2.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-2.txt Sat May 14 02:22:35 2005 @@ -66,5 +66,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-3.txt diff -u snort/doc/signatures/119-3.txt:1.1.1.2 snort/doc/signatures/119-3.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-3.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-3.txt Sat May 14 02:22:35 2005 @@ -66,5 +66,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-4.txt diff -u snort/doc/signatures/119-4.txt:1.1.1.2 snort/doc/signatures/119-4.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-4.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-4.txt Sat May 14 02:22:35 2005 @@ -65,5 +65,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-5.txt diff -u snort/doc/signatures/119-5.txt:1.1.1.2 snort/doc/signatures/119-5.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-5.txt:1.1.1.2 Sun Apr 24 22:07:40 2005 +++ snort/doc/signatures/119-5.txt Sat May 14 02:22:35 2005 @@ -57,5 +57,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-6.txt diff -u snort/doc/signatures/119-6.txt:1.1.1.2 snort/doc/signatures/119-6.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-6.txt:1.1.1.2 Sun Apr 24 22:07:41 2005 +++ snort/doc/signatures/119-6.txt Sat May 14 02:22:35 2005 @@ -57,5 +57,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-7.txt diff -u snort/doc/signatures/119-7.txt:1.1.1.2 snort/doc/signatures/119-7.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-7.txt:1.1.1.2 Sun Apr 24 22:07:41 2005 +++ snort/doc/signatures/119-7.txt Sat May 14 02:22:35 2005 @@ -60,5 +60,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-8.txt diff -u snort/doc/signatures/119-8.txt:1.1.1.2 snort/doc/signatures/119-8.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-8.txt:1.1.1.2 Sun Apr 24 22:07:41 2005 +++ snort/doc/signatures/119-8.txt Sat May 14 02:22:35 2005 @@ -62,5 +62,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/119-9.txt diff -u snort/doc/signatures/119-9.txt:1.1.1.2 snort/doc/signatures/119-9.txt:1.1.1.2.4.1 --- snort/doc/signatures/119-9.txt:1.1.1.2 Sun Apr 24 22:07:41 2005 +++ snort/doc/signatures/119-9.txt Sat May 14 02:22:35 2005 @@ -62,5 +62,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/120-1.txt diff -u snort/doc/signatures/120-1.txt:1.1.1.2 snort/doc/signatures/120-1.txt:1.1.1.2.4.1 --- snort/doc/signatures/120-1.txt:1.1.1.2 Sun Apr 24 22:07:41 2005 +++ snort/doc/signatures/120-1.txt Sat May 14 02:22:35 2005 @@ -61,5 +61,3 @@ HTTP IDS Evasions Revisited - Daniel Roelker http://docs.idsresearch.org/http_ids_evasions.pdf - --- Index: snort/doc/signatures/2321.txt diff -u snort/doc/signatures/2321.txt:1.1.1.2 snort/doc/signatures/2321.txt:1.1.1.2.4.1 --- snort/doc/signatures/2321.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2321.txt Thu May 5 01:12:28 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2322.txt diff -u snort/doc/signatures/2322.txt:1.1.1.2 snort/doc/signatures/2322.txt:1.1.1.2.4.1 --- snort/doc/signatures/2322.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2322.txt Thu May 5 01:12:28 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2323.txt diff -u snort/doc/signatures/2323.txt:1.1.1.2 snort/doc/signatures/2323.txt:1.1.1.2.4.1 --- snort/doc/signatures/2323.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2323.txt Thu May 5 01:12:28 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2324.txt diff -u snort/doc/signatures/2324.txt:1.1.1.2 snort/doc/signatures/2324.txt:1.1.1.2.4.1 --- snort/doc/signatures/2324.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2324.txt Thu May 5 01:12:28 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2325.txt diff -u snort/doc/signatures/2325.txt:1.1.1.2 snort/doc/signatures/2325.txt:1.1.1.2.4.1 --- snort/doc/signatures/2325.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2325.txt Thu May 5 01:12:28 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2326.txt diff -u snort/doc/signatures/2326.txt:1.1.1.2 snort/doc/signatures/2326.txt:1.1.1.2.4.1 --- snort/doc/signatures/2326.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2326.txt Thu May 5 01:12:28 2005 @@ -70,5 +70,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2327.txt diff -u snort/doc/signatures/2327.txt:1.1.1.2 snort/doc/signatures/2327.txt:1.1.1.2.4.1 --- snort/doc/signatures/2327.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2327.txt Thu May 5 01:12:28 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2328.txt diff -u snort/doc/signatures/2328.txt:1.1.1.2 snort/doc/signatures/2328.txt:1.1.1.2.4.1 --- snort/doc/signatures/2328.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2328.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2330.txt diff -u snort/doc/signatures/2330.txt:1.1.1.3 snort/doc/signatures/2330.txt:1.1.1.3.2.1 --- snort/doc/signatures/2330.txt:1.1.1.3 Sun Apr 24 23:51:39 2005 +++ snort/doc/signatures/2330.txt Thu May 5 01:12:28 2005 @@ -2,7 +2,6 @@ -- Sid: -2330 -- Summary: @@ -61,5 +60,3 @@ Bugtraq http://www.securityfocus.com/bid/8861 - --- Index: snort/doc/signatures/2331.txt diff -u snort/doc/signatures/2331.txt:1.1.1.2 snort/doc/signatures/2331.txt:1.1.1.2.4.1 --- snort/doc/signatures/2331.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2331.txt Thu May 5 01:12:28 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2332.txt diff -u snort/doc/signatures/2332.txt:1.1.1.2 snort/doc/signatures/2332.txt:1.1.1.2.4.1 --- snort/doc/signatures/2332.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2332.txt Thu May 5 01:12:28 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2333.txt diff -u snort/doc/signatures/2333.txt:1.1.1.2 snort/doc/signatures/2333.txt:1.1.1.2.4.1 --- snort/doc/signatures/2333.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2333.txt Thu May 5 01:12:28 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2334.txt diff -u snort/doc/signatures/2334.txt:1.1.1.2 snort/doc/signatures/2334.txt:1.1.1.2.4.1 --- snort/doc/signatures/2334.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2334.txt Thu May 5 01:12:28 2005 @@ -52,5 +52,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2335.txt diff -u snort/doc/signatures/2335.txt:1.1.1.2 snort/doc/signatures/2335.txt:1.1.1.2.4.1 --- snort/doc/signatures/2335.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2335.txt Thu May 5 01:12:28 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2336.txt diff -u snort/doc/signatures/2336.txt:1.1.1.2 snort/doc/signatures/2336.txt:1.1.1.2.4.1 --- snort/doc/signatures/2336.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2336.txt Thu May 5 01:12:28 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2337.txt diff -u snort/doc/signatures/2337.txt:1.1.1.2 snort/doc/signatures/2337.txt:1.1.1.2.4.1 --- snort/doc/signatures/2337.txt:1.1.1.2 Sun Apr 24 22:08:47 2005 +++ snort/doc/signatures/2337.txt Thu May 5 01:12:28 2005 @@ -62,5 +62,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2338.txt diff -u snort/doc/signatures/2338.txt:1.1.1.2 snort/doc/signatures/2338.txt:1.1.1.2.4.1 --- snort/doc/signatures/2338.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2338.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2339.txt diff -u snort/doc/signatures/2339.txt:1.1.1.2 snort/doc/signatures/2339.txt:1.1.1.2.4.1 --- snort/doc/signatures/2339.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2339.txt Thu May 5 01:12:28 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2340.txt diff -u snort/doc/signatures/2340.txt:1.1.1.2 snort/doc/signatures/2340.txt:1.1.1.2.4.1 --- snort/doc/signatures/2340.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2340.txt Thu May 5 01:12:28 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2341.txt diff -u snort/doc/signatures/2341.txt:1.1.1.2 snort/doc/signatures/2341.txt:1.1.1.2.4.1 --- snort/doc/signatures/2341.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2341.txt Thu May 5 01:12:28 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2342.txt diff -u snort/doc/signatures/2342.txt:1.1.1.2 snort/doc/signatures/2342.txt:1.1.1.2.4.1 --- snort/doc/signatures/2342.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2342.txt Thu May 5 01:12:28 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2343.txt diff -u snort/doc/signatures/2343.txt:1.1.1.2 snort/doc/signatures/2343.txt:1.1.1.2.4.1 --- snort/doc/signatures/2343.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2343.txt Thu May 5 01:12:28 2005 @@ -69,5 +69,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2344.txt diff -u snort/doc/signatures/2344.txt:1.1.1.2 snort/doc/signatures/2344.txt:1.1.1.2.4.1 --- snort/doc/signatures/2344.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2344.txt Thu May 5 01:12:28 2005 @@ -55,5 +55,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2345.txt diff -u snort/doc/signatures/2345.txt:1.1.1.2 snort/doc/signatures/2345.txt:1.1.1.2.4.1 --- snort/doc/signatures/2345.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2345.txt Thu May 5 01:12:28 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2346.txt diff -u snort/doc/signatures/2346.txt:1.1.1.2 snort/doc/signatures/2346.txt:1.1.1.2.4.1 --- snort/doc/signatures/2346.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2346.txt Thu May 5 01:12:28 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2347.txt diff -u snort/doc/signatures/2347.txt:1.1.1.2 snort/doc/signatures/2347.txt:1.1.1.2.4.1 --- snort/doc/signatures/2347.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2347.txt Thu May 5 01:12:28 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2348.txt diff -u snort/doc/signatures/2348.txt:1.1.1.2 snort/doc/signatures/2348.txt:1.1.1.2.4.1 --- snort/doc/signatures/2348.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2348.txt Thu May 5 01:12:28 2005 @@ -49,5 +49,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2349.txt diff -u snort/doc/signatures/2349.txt:1.1.1.2 snort/doc/signatures/2349.txt:1.1.1.2.4.1 --- snort/doc/signatures/2349.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2349.txt Thu May 5 01:12:28 2005 @@ -51,5 +51,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2352.txt diff -u snort/doc/signatures/2352.txt:1.1.1.2 snort/doc/signatures/2352.txt:1.1.1.2.4.1 --- snort/doc/signatures/2352.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2352.txt Thu May 5 01:12:28 2005 @@ -83,5 +83,3 @@ Symantec: http://securityresponse.symantec.com/avcenter/venc/data/w32.blaster.worm.html - --- Index: snort/doc/signatures/2353.txt diff -u snort/doc/signatures/2353.txt:1.1.1.2 snort/doc/signatures/2353.txt:1.1.1.2.4.1 --- snort/doc/signatures/2353.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2353.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2354.txt diff -u snort/doc/signatures/2354.txt:1.1.1.2 snort/doc/signatures/2354.txt:1.1.1.2.4.1 --- snort/doc/signatures/2354.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2354.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2355.txt diff -u snort/doc/signatures/2355.txt:1.1.1.2 snort/doc/signatures/2355.txt:1.1.1.2.4.1 --- snort/doc/signatures/2355.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2355.txt Thu May 5 01:12:28 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2356.txt diff -u snort/doc/signatures/2356.txt:1.1.1.2 snort/doc/signatures/2356.txt:1.1.1.2.4.1 --- snort/doc/signatures/2356.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2356.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2357.txt diff -u snort/doc/signatures/2357.txt:1.1.1.2 snort/doc/signatures/2357.txt:1.1.1.2.4.1 --- snort/doc/signatures/2357.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2357.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2358.txt diff -u snort/doc/signatures/2358.txt:1.1.1.2 snort/doc/signatures/2358.txt:1.1.1.2.4.1 --- snort/doc/signatures/2358.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2358.txt Thu May 5 01:12:28 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2359.txt diff -u snort/doc/signatures/2359.txt:1.1.1.2 snort/doc/signatures/2359.txt:1.1.1.2.4.1 --- snort/doc/signatures/2359.txt:1.1.1.2 Sun Apr 24 22:08:48 2005 +++ snort/doc/signatures/2359.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2360.txt diff -u snort/doc/signatures/2360.txt:1.1.1.2 snort/doc/signatures/2360.txt:1.1.1.2.4.1 --- snort/doc/signatures/2360.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2360.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2361.txt diff -u snort/doc/signatures/2361.txt:1.1.1.2 snort/doc/signatures/2361.txt:1.1.1.2.4.1 --- snort/doc/signatures/2361.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2361.txt Thu May 5 01:12:28 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2362.txt diff -u snort/doc/signatures/2362.txt:1.1.1.2 snort/doc/signatures/2362.txt:1.1.1.2.4.1 --- snort/doc/signatures/2362.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2362.txt Thu May 5 01:12:28 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2363.txt diff -u snort/doc/signatures/2363.txt:1.1.1.2 snort/doc/signatures/2363.txt:1.1.1.2.4.1 --- snort/doc/signatures/2363.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2363.txt Thu May 5 01:12:28 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2364.txt diff -u snort/doc/signatures/2364.txt:1.1.1.2 snort/doc/signatures/2364.txt:1.1.1.2.4.1 --- snort/doc/signatures/2364.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2364.txt Thu May 5 01:12:28 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2365.txt diff -u snort/doc/signatures/2365.txt:1.1.1.2 snort/doc/signatures/2365.txt:1.1.1.2.4.1 --- snort/doc/signatures/2365.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2365.txt Thu May 5 01:12:28 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2366.txt diff -u snort/doc/signatures/2366.txt:1.1.1.2 snort/doc/signatures/2366.txt:1.1.1.2.4.1 --- snort/doc/signatures/2366.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2366.txt Thu May 5 01:12:28 2005 @@ -55,5 +55,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2367.txt diff -u snort/doc/signatures/2367.txt:1.1.1.2 snort/doc/signatures/2367.txt:1.1.1.2.4.1 --- snort/doc/signatures/2367.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2367.txt Thu May 5 01:12:28 2005 @@ -55,8 +55,3 @@ -- Additional References: - -CERT: -http://www.cert.org/advisories/CA-2003-07.html - --- Index: snort/doc/signatures/2368.txt diff -u snort/doc/signatures/2368.txt:1.1.1.2 snort/doc/signatures/2368.txt:1.1.1.2.4.1 --- snort/doc/signatures/2368.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2368.txt Thu May 5 01:12:28 2005 @@ -55,5 +55,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2369.txt diff -u snort/doc/signatures/2369.txt:1.1.1.2 snort/doc/signatures/2369.txt:1.1.1.2.4.1 --- snort/doc/signatures/2369.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2369.txt Thu May 5 01:12:28 2005 @@ -53,5 +53,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2370.txt diff -u snort/doc/signatures/2370.txt:1.1.1.2 snort/doc/signatures/2370.txt:1.1.1.2.4.1 --- snort/doc/signatures/2370.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2370.txt Thu May 5 01:12:28 2005 @@ -53,5 +53,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2371.txt diff -u snort/doc/signatures/2371.txt:1.1.1.2 snort/doc/signatures/2371.txt:1.1.1.2.4.1 --- snort/doc/signatures/2371.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2371.txt Thu May 5 01:12:28 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2372.txt diff -u snort/doc/signatures/2372.txt:1.1.1.2 snort/doc/signatures/2372.txt:1.1.1.2.4.1 --- snort/doc/signatures/2372.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2372.txt Thu May 5 01:12:28 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2373.txt diff -u snort/doc/signatures/2373.txt:1.1.1.2 snort/doc/signatures/2373.txt:1.1.1.2.4.1 --- snort/doc/signatures/2373.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2373.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2374.txt diff -u snort/doc/signatures/2374.txt:1.1.1.2 snort/doc/signatures/2374.txt:1.1.1.2.4.1 --- snort/doc/signatures/2374.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2374.txt Thu May 5 01:12:28 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2375.txt diff -u snort/doc/signatures/2375.txt:1.1.1.2 snort/doc/signatures/2375.txt:1.1.1.2.4.1 --- snort/doc/signatures/2375.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2375.txt Thu May 5 01:12:28 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2376.txt diff -u snort/doc/signatures/2376.txt:1.1.1.2 snort/doc/signatures/2376.txt:1.1.1.2.4.1 --- snort/doc/signatures/2376.txt:1.1.1.2 Sun Apr 24 22:08:49 2005 +++ snort/doc/signatures/2376.txt Thu May 5 01:12:28 2005 @@ -60,5 +60,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2377.txt diff -u snort/doc/signatures/2377.txt:1.1.1.2 snort/doc/signatures/2377.txt:1.1.1.2.4.1 --- snort/doc/signatures/2377.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2377.txt Thu May 5 01:12:28 2005 @@ -60,5 +60,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2378.txt diff -u snort/doc/signatures/2378.txt:1.1.1.2 snort/doc/signatures/2378.txt:1.1.1.2.4.1 --- snort/doc/signatures/2378.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2378.txt Thu May 5 01:12:28 2005 @@ -60,5 +60,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2379.txt diff -u snort/doc/signatures/2379.txt:1.1.1.2 snort/doc/signatures/2379.txt:1.1.1.2.4.1 --- snort/doc/signatures/2379.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2379.txt Thu May 5 01:12:28 2005 @@ -60,5 +60,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2380.txt diff -u snort/doc/signatures/2380.txt:1.1.1.2 snort/doc/signatures/2380.txt:1.1.1.2.4.1 --- snort/doc/signatures/2380.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2380.txt Thu May 5 01:12:28 2005 @@ -60,5 +60,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2381.txt diff -u snort/doc/signatures/2381.txt:1.1.1.2 snort/doc/signatures/2381.txt:1.1.1.2.4.1 --- snort/doc/signatures/2381.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2381.txt Thu May 5 01:12:28 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2382.txt diff -u snort/doc/signatures/2382.txt:1.1.1.2 snort/doc/signatures/2382.txt:1.1.1.2.4.1 --- snort/doc/signatures/2382.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2382.txt Thu May 5 01:12:28 2005 @@ -66,5 +66,3 @@ Microsoft http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms04-007.asp - --- Index: snort/doc/signatures/2383.txt diff -u snort/doc/signatures/2383.txt:1.1.1.2 snort/doc/signatures/2383.txt:1.1.1.2.4.1 --- snort/doc/signatures/2383.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2383.txt Thu May 5 01:12:28 2005 @@ -66,5 +66,3 @@ Microsoft http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms04-007.asp - --- Index: snort/doc/signatures/2384.txt diff -u snort/doc/signatures/2384.txt:1.1.1.2 snort/doc/signatures/2384.txt:1.1.1.2.4.1 --- snort/doc/signatures/2384.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2384.txt Thu May 5 01:12:28 2005 @@ -66,5 +66,3 @@ Microsoft http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms04-007.asp - --- Index: snort/doc/signatures/2385.txt diff -u snort/doc/signatures/2385.txt:1.1.1.2 snort/doc/signatures/2385.txt:1.1.1.2.4.1 --- snort/doc/signatures/2385.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2385.txt Thu May 5 01:12:28 2005 @@ -66,5 +66,3 @@ Microsoft http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms04-007.asp - --- Index: snort/doc/signatures/2386.txt diff -u snort/doc/signatures/2386.txt:1.1.1.2 snort/doc/signatures/2386.txt:1.1.1.2.4.1 --- snort/doc/signatures/2386.txt:1.1.1.2 Sun Apr 24 22:08:50 2005 +++ snort/doc/signatures/2386.txt Thu May 5 01:12:28 2005 @@ -70,5 +70,3 @@ Microsoft http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms04-007.asp - --- Index: snort/doc/signatures/2387.txt diff -u snort/doc/signatures/2387.txt:1.1.1.2 snort/doc/signatures/2387.txt:1.1.1.2.4.1 --- snort/doc/signatures/2387.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2387.txt Thu May 5 01:12:28 2005 @@ -58,5 +58,3 @@ CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0422 - --- Index: snort/doc/signatures/2388.txt diff -u snort/doc/signatures/2388.txt:1.1.1.2 snort/doc/signatures/2388.txt:1.1.1.2.4.1 --- snort/doc/signatures/2388.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2388.txt Sat May 14 02:22:36 2005 @@ -68,5 +68,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2389.txt diff -u snort/doc/signatures/2389.txt:1.1.1.2 snort/doc/signatures/2389.txt:1.1.1.2.4.1 --- snort/doc/signatures/2389.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2389.txt Thu May 5 01:12:28 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2390.txt diff -u snort/doc/signatures/2390.txt:1.1.1.2 snort/doc/signatures/2390.txt:1.1.1.2.4.1 --- snort/doc/signatures/2390.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2390.txt Thu May 5 01:12:28 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2391.txt diff -u snort/doc/signatures/2391.txt:1.1.1.2 snort/doc/signatures/2391.txt:1.1.1.2.4.1 --- snort/doc/signatures/2391.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2391.txt Thu May 5 01:12:28 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2392.txt diff -u snort/doc/signatures/2392.txt:1.1.1.2 snort/doc/signatures/2392.txt:1.1.1.2.4.1 --- snort/doc/signatures/2392.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2392.txt Thu May 5 01:12:28 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2393.txt diff -u snort/doc/signatures/2393.txt:1.1.1.2 snort/doc/signatures/2393.txt:1.1.1.2.4.1 --- snort/doc/signatures/2393.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2393.txt Thu May 5 01:12:28 2005 @@ -53,5 +53,3 @@ nessus: http://cgi.nessus.org/plugins/dump.php3?id=12032 - --- Index: snort/doc/signatures/2394.txt diff -u snort/doc/signatures/2394.txt:1.1.1.2 snort/doc/signatures/2394.txt:1.1.1.2.4.1 --- snort/doc/signatures/2394.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2394.txt Thu May 5 01:12:28 2005 @@ -53,5 +53,3 @@ bugtraq http://www.securityfocus.com/bid/8014 - --- Index: snort/doc/signatures/2395.txt diff -u snort/doc/signatures/2395.txt:1.1.1.2 snort/doc/signatures/2395.txt:1.1.1.2.4.1 --- snort/doc/signatures/2395.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2395.txt Thu May 5 01:12:29 2005 @@ -62,5 +62,3 @@ CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0624 - --- Index: snort/doc/signatures/2396.txt diff -u snort/doc/signatures/2396.txt:1.1.1.2 snort/doc/signatures/2396.txt:1.1.1.2.4.1 --- snort/doc/signatures/2396.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2396.txt Thu May 5 01:12:29 2005 @@ -50,5 +50,3 @@ bugtraq http://www.securityfocus.com/bid/8095 - --- Index: snort/doc/signatures/2397.txt diff -u snort/doc/signatures/2397.txt:1.1.1.2 snort/doc/signatures/2397.txt:1.1.1.2.4.1 --- snort/doc/signatures/2397.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2397.txt Thu May 5 01:12:29 2005 @@ -50,5 +50,3 @@ bugtraq http://www.securityfocus.com/bid/8095 - --- Index: snort/doc/signatures/2398.txt diff -u snort/doc/signatures/2398.txt:1.1.1.2 snort/doc/signatures/2398.txt:1.1.1.2.4.1 --- snort/doc/signatures/2398.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2398.txt Thu May 5 01:12:29 2005 @@ -55,5 +55,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2399.txt diff -u snort/doc/signatures/2399.txt:1.1.1.2 snort/doc/signatures/2399.txt:1.1.1.2.4.1 --- snort/doc/signatures/2399.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2399.txt Thu May 5 01:12:29 2005 @@ -55,5 +55,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2400.txt diff -u snort/doc/signatures/2400.txt:1.1.1.2 snort/doc/signatures/2400.txt:1.1.1.2.4.1 --- snort/doc/signatures/2400.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2400.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2401.txt diff -u snort/doc/signatures/2401.txt:1.1.1.2 snort/doc/signatures/2401.txt:1.1.1.2.4.1 --- snort/doc/signatures/2401.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2401.txt Thu May 5 01:12:29 2005 @@ -84,5 +84,3 @@ Bugtraq http://www.securityfocus.com/bid/9752 - --- Index: snort/doc/signatures/2402.txt diff -u snort/doc/signatures/2402.txt:1.1.1.2 snort/doc/signatures/2402.txt:1.1.1.2.4.1 --- snort/doc/signatures/2402.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2402.txt Thu May 5 01:12:29 2005 @@ -84,5 +84,3 @@ Bugtraq http://www.securityfocus.com/bid/9752 - --- Index: snort/doc/signatures/2403.txt diff -u snort/doc/signatures/2403.txt:1.1.1.2 snort/doc/signatures/2403.txt:1.1.1.2.4.1 --- snort/doc/signatures/2403.txt:1.1.1.2 Sun Apr 24 22:08:51 2005 +++ snort/doc/signatures/2403.txt Thu May 5 01:12:29 2005 @@ -84,5 +84,3 @@ Bugtraq http://www.securityfocus.com/bid/9752 - --- Index: snort/doc/signatures/2404.txt diff -u snort/doc/signatures/2404.txt:1.1.1.3 snort/doc/signatures/2404.txt:1.1.1.3.4.2 --- snort/doc/signatures/2404.txt:1.1.1.3 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2404.txt Thu Jun 2 23:56:05 2005 @@ -88,5 +88,3 @@ Bugtraq http://www.securityfocus.com/bid/9752 - --- Index: snort/doc/signatures/2405.txt diff -u snort/doc/signatures/2405.txt:1.1.1.2 snort/doc/signatures/2405.txt:1.1.1.2.4.1 --- snort/doc/signatures/2405.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2405.txt Sat May 14 02:22:36 2005 @@ -68,5 +68,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2406.txt diff -u snort/doc/signatures/2406.txt:1.1.1.2 snort/doc/signatures/2406.txt:1.1.1.2.4.1 --- snort/doc/signatures/2406.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2406.txt Sat May 14 02:22:36 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2407.txt diff -u snort/doc/signatures/2407.txt:1.1.1.2 snort/doc/signatures/2407.txt:1.1.1.2.4.1 --- snort/doc/signatures/2407.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2407.txt Sat May 14 02:22:36 2005 @@ -70,5 +70,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2408.txt diff -u snort/doc/signatures/2408.txt:1.1.1.2 snort/doc/signatures/2408.txt:1.1.1.2.4.1 --- snort/doc/signatures/2408.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2408.txt Sat May 14 02:22:36 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2409.txt diff -u snort/doc/signatures/2409.txt:1.1.1.2 snort/doc/signatures/2409.txt:1.1.1.2.4.1 --- snort/doc/signatures/2409.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2409.txt Thu May 5 01:12:29 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2410.txt diff -u snort/doc/signatures/2410.txt:1.1.1.2 snort/doc/signatures/2410.txt:1.1.1.2.4.1 --- snort/doc/signatures/2410.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2410.txt Sat May 14 02:22:36 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2411.txt diff -u snort/doc/signatures/2411.txt:1.1.1.2 snort/doc/signatures/2411.txt:1.1.1.2.4.1 --- snort/doc/signatures/2411.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2411.txt Thu May 5 01:12:29 2005 @@ -62,5 +62,3 @@ RealNetworks http://www.service.real.com/help/faq/security/rootexploit091103.html - --- Index: snort/doc/signatures/2412.txt diff -u snort/doc/signatures/2412.txt:1.1.1.2 snort/doc/signatures/2412.txt:1.1.1.2.4.1 --- snort/doc/signatures/2412.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2412.txt Thu May 5 01:12:29 2005 @@ -54,5 +54,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2413.txt diff -u snort/doc/signatures/2413.txt:1.1.1.2 snort/doc/signatures/2413.txt:1.1.1.2.4.1 --- snort/doc/signatures/2413.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2413.txt Thu May 5 01:12:29 2005 @@ -69,5 +69,3 @@ IANA: http://www.iana.org/assignments/isakmp-registry - --- Index: snort/doc/signatures/2414.txt diff -u snort/doc/signatures/2414.txt:1.1.1.2 snort/doc/signatures/2414.txt:1.1.1.2.4.1 --- snort/doc/signatures/2414.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2414.txt Thu May 5 01:12:29 2005 @@ -69,5 +69,3 @@ IANA: http://www.iana.org/assignments/isakmp-registry - --- Index: snort/doc/signatures/2415.txt diff -u snort/doc/signatures/2415.txt:1.1.1.2 snort/doc/signatures/2415.txt:1.1.1.2.4.1 --- snort/doc/signatures/2415.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2415.txt Thu May 5 01:12:29 2005 @@ -69,5 +69,3 @@ IANA: http://www.iana.org/assignments/isakmp-registry - --- Index: snort/doc/signatures/2416.txt diff -u snort/doc/signatures/2416.txt:1.1.1.2 snort/doc/signatures/2416.txt:1.1.1.2.4.1 --- snort/doc/signatures/2416.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2416.txt Thu May 5 01:12:29 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2417.txt diff -u snort/doc/signatures/2417.txt:1.1.1.2 snort/doc/signatures/2417.txt:1.1.1.2.4.1 --- snort/doc/signatures/2417.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2417.txt Thu May 5 01:12:29 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2418.txt diff -u snort/doc/signatures/2418.txt:1.1.1.2 snort/doc/signatures/2418.txt:1.1.1.2.4.1 --- snort/doc/signatures/2418.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2418.txt Thu May 5 01:12:29 2005 @@ -50,5 +50,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2419.txt diff -u snort/doc/signatures/2419.txt:1.1.1.2 snort/doc/signatures/2419.txt:1.1.1.2.4.1 --- snort/doc/signatures/2419.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2419.txt Thu May 5 01:12:29 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2420.txt diff -u snort/doc/signatures/2420.txt:1.1.1.2 snort/doc/signatures/2420.txt:1.1.1.2.4.1 --- snort/doc/signatures/2420.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2420.txt Thu May 5 01:12:29 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2421.txt diff -u snort/doc/signatures/2421.txt:1.1.1.2 snort/doc/signatures/2421.txt:1.1.1.2.4.1 --- snort/doc/signatures/2421.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2421.txt Thu May 5 01:12:29 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2422.txt diff -u snort/doc/signatures/2422.txt:1.1.1.2 snort/doc/signatures/2422.txt:1.1.1.2.4.1 --- snort/doc/signatures/2422.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2422.txt Thu May 5 01:12:29 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2423.txt diff -u snort/doc/signatures/2423.txt:1.1.1.2 snort/doc/signatures/2423.txt:1.1.1.2.4.1 --- snort/doc/signatures/2423.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2423.txt Thu May 5 01:12:29 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2424.txt diff -u snort/doc/signatures/2424.txt:1.1.1.2 snort/doc/signatures/2424.txt:1.1.1.2.4.1 --- snort/doc/signatures/2424.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2424.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2425.txt diff -u snort/doc/signatures/2425.txt:1.1.1.2 snort/doc/signatures/2425.txt:1.1.1.2.4.1 --- snort/doc/signatures/2425.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2425.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2426.txt diff -u snort/doc/signatures/2426.txt:1.1.1.2 snort/doc/signatures/2426.txt:1.1.1.2.4.1 --- snort/doc/signatures/2426.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2426.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2427.txt diff -u snort/doc/signatures/2427.txt:1.1.1.2 snort/doc/signatures/2427.txt:1.1.1.2.4.1 --- snort/doc/signatures/2427.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2427.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2428.txt diff -u snort/doc/signatures/2428.txt:1.1.1.2 snort/doc/signatures/2428.txt:1.1.1.2.4.1 --- snort/doc/signatures/2428.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2428.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2429.txt diff -u snort/doc/signatures/2429.txt:1.1.1.2 snort/doc/signatures/2429.txt:1.1.1.2.4.1 --- snort/doc/signatures/2429.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2429.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2430.txt diff -u snort/doc/signatures/2430.txt:1.1.1.2 snort/doc/signatures/2430.txt:1.1.1.2.4.1 --- snort/doc/signatures/2430.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2430.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2431.txt diff -u snort/doc/signatures/2431.txt:1.1.1.2 snort/doc/signatures/2431.txt:1.1.1.2.4.1 --- snort/doc/signatures/2431.txt:1.1.1.2 Sun Apr 24 22:08:52 2005 +++ snort/doc/signatures/2431.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2432.txt diff -u snort/doc/signatures/2432.txt:1.1.1.2 snort/doc/signatures/2432.txt:1.1.1.2.4.1 --- snort/doc/signatures/2432.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2432.txt Thu May 5 01:12:29 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2433.txt diff -u snort/doc/signatures/2433.txt:1.1.1.2 snort/doc/signatures/2433.txt:1.1.1.2.4.1 --- snort/doc/signatures/2433.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2433.txt Thu May 5 01:12:29 2005 @@ -75,5 +75,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2434.txt diff -u snort/doc/signatures/2434.txt:1.1.1.2 snort/doc/signatures/2434.txt:1.1.1.2.4.1 --- snort/doc/signatures/2434.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2434.txt Thu May 5 01:12:29 2005 @@ -75,5 +75,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2435.txt diff -u snort/doc/signatures/2435.txt:1.1.1.2 snort/doc/signatures/2435.txt:1.1.1.2.4.1 --- snort/doc/signatures/2435.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2435.txt Thu May 5 01:12:29 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2436.txt diff -u snort/doc/signatures/2436.txt:1.1.1.2 snort/doc/signatures/2436.txt:1.1.1.2.4.1 --- snort/doc/signatures/2436.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2436.txt Thu May 5 01:12:29 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2437.txt diff -u snort/doc/signatures/2437.txt:1.1.1.2 snort/doc/signatures/2437.txt:1.1.1.2.4.1 --- snort/doc/signatures/2437.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2437.txt Sat May 14 02:22:36 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2438.txt diff -u snort/doc/signatures/2438.txt:1.1.1.2 snort/doc/signatures/2438.txt:1.1.1.2.4.1 --- snort/doc/signatures/2438.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2438.txt Thu May 5 01:12:29 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2439.txt diff -u snort/doc/signatures/2439.txt:1.1.1.2 snort/doc/signatures/2439.txt:1.1.1.2.4.1 --- snort/doc/signatures/2439.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2439.txt Thu May 5 01:12:29 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2440.txt diff -u snort/doc/signatures/2440.txt:1.1.1.2 snort/doc/signatures/2440.txt:1.1.1.2.4.1 --- snort/doc/signatures/2440.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2440.txt Thu May 5 01:12:29 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2441.txt diff -u snort/doc/signatures/2441.txt:1.1.1.2 snort/doc/signatures/2441.txt:1.1.1.2.4.1 --- snort/doc/signatures/2441.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2441.txt Thu May 5 01:12:29 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2442.txt diff -u snort/doc/signatures/2442.txt:1.1.1.2 snort/doc/signatures/2442.txt:1.1.1.2.4.1 --- snort/doc/signatures/2442.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2442.txt Thu May 5 01:12:29 2005 @@ -58,5 +58,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2443.txt diff -u snort/doc/signatures/2443.txt:1.1.1.2 snort/doc/signatures/2443.txt:1.1.1.2.4.1 --- snort/doc/signatures/2443.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2443.txt Thu May 5 01:12:29 2005 @@ -78,5 +78,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2444.txt diff -u snort/doc/signatures/2444.txt:1.1.1.2 snort/doc/signatures/2444.txt:1.1.1.2.4.1 --- snort/doc/signatures/2444.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2444.txt Thu May 5 01:12:29 2005 @@ -78,5 +78,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2445.txt diff -u snort/doc/signatures/2445.txt:1.1.1.2 snort/doc/signatures/2445.txt:1.1.1.2.4.1 --- snort/doc/signatures/2445.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2445.txt Thu May 5 01:12:29 2005 @@ -78,5 +78,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2446.txt diff -u snort/doc/signatures/2446.txt:1.1.1.2 snort/doc/signatures/2446.txt:1.1.1.2.4.1 --- snort/doc/signatures/2446.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2446.txt Thu May 5 01:12:29 2005 @@ -78,5 +78,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2447.txt diff -u snort/doc/signatures/2447.txt:1.1.1.2 snort/doc/signatures/2447.txt:1.1.1.2.4.1 --- snort/doc/signatures/2447.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2447.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2448.txt diff -u snort/doc/signatures/2448.txt:1.1.1.2 snort/doc/signatures/2448.txt:1.1.1.2.4.1 --- snort/doc/signatures/2448.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2448.txt Thu May 5 01:12:29 2005 @@ -55,5 +55,3 @@ -- Additional References - --- Index: snort/doc/signatures/2449.txt diff -u snort/doc/signatures/2449.txt:1.1.1.2 snort/doc/signatures/2449.txt:1.1.1.2.4.1 --- snort/doc/signatures/2449.txt:1.1.1.2 Sun Apr 24 22:08:53 2005 +++ snort/doc/signatures/2449.txt Thu May 5 01:12:29 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2450.txt diff -u snort/doc/signatures/2450.txt:1.1.1.3 snort/doc/signatures/2450.txt:1.1.1.3.4.2 --- snort/doc/signatures/2450.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2450.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2451.txt diff -u snort/doc/signatures/2451.txt:1.1.1.3 snort/doc/signatures/2451.txt:1.1.1.3.4.2 --- snort/doc/signatures/2451.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2451.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2452.txt diff -u snort/doc/signatures/2452.txt:1.1.1.3 snort/doc/signatures/2452.txt:1.1.1.3.4.2 --- snort/doc/signatures/2452.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2452.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2453.txt diff -u snort/doc/signatures/2453.txt:1.1.1.3 snort/doc/signatures/2453.txt:1.1.1.3.4.2 --- snort/doc/signatures/2453.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2453.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2454.txt diff -u snort/doc/signatures/2454.txt:1.1.1.3 snort/doc/signatures/2454.txt:1.1.1.3.4.2 --- snort/doc/signatures/2454.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2454.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2455.txt diff -u snort/doc/signatures/2455.txt:1.1.1.3 snort/doc/signatures/2455.txt:1.1.1.3.4.2 --- snort/doc/signatures/2455.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2455.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2456.txt diff -u snort/doc/signatures/2456.txt:1.1.1.3 snort/doc/signatures/2456.txt:1.1.1.3.4.2 --- snort/doc/signatures/2456.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2456.txt Thu Jun 2 23:56:05 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2457.txt diff -u snort/doc/signatures/2457.txt:1.1.1.3 snort/doc/signatures/2457.txt:1.1.1.3.4.2 --- snort/doc/signatures/2457.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2457.txt Thu Jun 2 23:56:05 2005 @@ -44,5 +44,3 @@ Contributors: Sourcefire Research Team Judy Novak - --- Index: snort/doc/signatures/2458.txt diff -u snort/doc/signatures/2458.txt:1.1.1.3 snort/doc/signatures/2458.txt:1.1.1.3.4.2 --- snort/doc/signatures/2458.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2458.txt Thu Jun 2 23:56:06 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2459.txt diff -u snort/doc/signatures/2459.txt:1.1.1.3 snort/doc/signatures/2459.txt:1.1.1.3.4.2 --- snort/doc/signatures/2459.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2459.txt Thu Jun 2 23:56:06 2005 @@ -48,5 +48,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2460.txt diff -u snort/doc/signatures/2460.txt:1.1.1.3 snort/doc/signatures/2460.txt:1.1.1.3.4.2 --- snort/doc/signatures/2460.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2460.txt Thu Jun 2 23:56:06 2005 @@ -57,5 +57,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2461.txt diff -u snort/doc/signatures/2461.txt:1.1.1.3 snort/doc/signatures/2461.txt:1.1.1.3.4.2 --- snort/doc/signatures/2461.txt:1.1.1.3 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2461.txt Thu Jun 2 23:56:06 2005 @@ -57,5 +57,3 @@ Additional References: Yahoo Protocol http://www.cse.iitb.ac.in/~varunk/YahooProtocol.htm - --- Index: snort/doc/signatures/2462.txt diff -u snort/doc/signatures/2462.txt:1.1.1.2 snort/doc/signatures/2462.txt:1.1.1.2.4.1 --- snort/doc/signatures/2462.txt:1.1.1.2 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2462.txt Thu May 5 01:12:29 2005 @@ -67,5 +67,3 @@ Bugtraq: http://www.securityfocus.com/bid/9952: - --- Index: snort/doc/signatures/2463.txt diff -u snort/doc/signatures/2463.txt:1.1.1.2 snort/doc/signatures/2463.txt:1.1.1.2.4.1 --- snort/doc/signatures/2463.txt:1.1.1.2 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2463.txt Thu May 5 01:12:29 2005 @@ -66,5 +66,3 @@ Bugtraq: http://www.securityfocus.com/bid/9952: - --- Index: snort/doc/signatures/2464.txt diff -u snort/doc/signatures/2464.txt:1.1.1.2 snort/doc/signatures/2464.txt:1.1.1.2.4.1 --- snort/doc/signatures/2464.txt:1.1.1.2 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2464.txt Thu May 5 01:12:29 2005 @@ -66,5 +66,3 @@ Bugtraq: http://www.securityfocus.com/bid/9952 - --- Index: snort/doc/signatures/2465.txt diff -u snort/doc/signatures/2465.txt:1.1.1.2 snort/doc/signatures/2465.txt:1.1.1.2.4.1 --- snort/doc/signatures/2465.txt:1.1.1.2 Sun Apr 24 22:08:54 2005 +++ snort/doc/signatures/2465.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2466.txt diff -u snort/doc/signatures/2466.txt:1.1.1.2 snort/doc/signatures/2466.txt:1.1.1.2.4.1 --- snort/doc/signatures/2466.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2466.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2467.txt diff -u snort/doc/signatures/2467.txt:1.1.1.2 snort/doc/signatures/2467.txt:1.1.1.2.4.1 --- snort/doc/signatures/2467.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2467.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2468.txt diff -u snort/doc/signatures/2468.txt:1.1.1.2 snort/doc/signatures/2468.txt:1.1.1.2.4.1 --- snort/doc/signatures/2468.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2468.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2469.txt diff -u snort/doc/signatures/2469.txt:1.1.1.2 snort/doc/signatures/2469.txt:1.1.1.2.4.1 --- snort/doc/signatures/2469.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2469.txt Thu May 5 01:12:29 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2470.txt diff -u snort/doc/signatures/2470.txt:1.1.1.2 snort/doc/signatures/2470.txt:1.1.1.2.4.1 --- snort/doc/signatures/2470.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2470.txt Thu May 5 01:12:29 2005 @@ -60,5 +60,3 @@ Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;100517 - --- Index: snort/doc/signatures/2471.txt diff -u snort/doc/signatures/2471.txt:1.1.1.2 snort/doc/signatures/2471.txt:1.1.1.2.4.1 --- snort/doc/signatures/2471.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2471.txt Thu May 5 01:12:29 2005 @@ -60,5 +60,3 @@ Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;100517 - --- Index: snort/doc/signatures/2472.txt diff -u snort/doc/signatures/2472.txt:1.1.1.2 snort/doc/signatures/2472.txt:1.1.1.2.4.1 --- snort/doc/signatures/2472.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2472.txt Thu May 5 01:12:29 2005 @@ -60,5 +60,3 @@ Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;100517 - --- Index: snort/doc/signatures/2473.txt diff -u snort/doc/signatures/2473.txt:1.1.1.2 snort/doc/signatures/2473.txt:1.1.1.2.4.1 --- snort/doc/signatures/2473.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2473.txt Thu May 5 01:12:29 2005 @@ -60,5 +60,3 @@ Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;100517 - --- Index: snort/doc/signatures/2474.txt diff -u snort/doc/signatures/2474.txt:1.1.1.2 snort/doc/signatures/2474.txt:1.1.1.2.4.1 --- snort/doc/signatures/2474.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2474.txt Thu May 5 01:12:29 2005 @@ -60,5 +60,3 @@ Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;100517 - --- Index: snort/doc/signatures/2475.txt diff -u snort/doc/signatures/2475.txt:1.1.1.2 snort/doc/signatures/2475.txt:1.1.1.2.4.1 --- snort/doc/signatures/2475.txt:1.1.1.2 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2475.txt Thu May 5 01:12:29 2005 @@ -60,5 +60,3 @@ Microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;100517 - --- Index: snort/doc/signatures/2476.txt diff -u snort/doc/signatures/2476.txt:1.1.1.3 snort/doc/signatures/2476.txt:1.1.1.3.4.2 --- snort/doc/signatures/2476.txt:1.1.1.3 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2476.txt Thu Jun 2 23:56:06 2005 @@ -58,5 +58,3 @@ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-1999-0562 Winreg http://www.rutherfurd.net/python/winreg/ - --- Index: snort/doc/signatures/2477.txt diff -u snort/doc/signatures/2477.txt:1.1.1.3 snort/doc/signatures/2477.txt:1.1.1.3.4.2 --- snort/doc/signatures/2477.txt:1.1.1.3 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2477.txt Thu Jun 2 23:56:06 2005 @@ -58,5 +58,3 @@ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-1999-0562 Winreg http://www.rutherfurd.net/python/winreg/ - --- Index: snort/doc/signatures/2478.txt diff -u snort/doc/signatures/2478.txt:1.1.1.3 snort/doc/signatures/2478.txt:1.1.1.3.4.2 --- snort/doc/signatures/2478.txt:1.1.1.3 Sun Apr 24 22:08:55 2005 +++ snort/doc/signatures/2478.txt Thu Jun 2 23:56:06 2005 @@ -58,5 +58,3 @@ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-1999-0562 Winreg http://www.rutherfurd.net/python/winreg/ - --- Index: snort/doc/signatures/2479.txt diff -u snort/doc/signatures/2479.txt:1.1.1.3 snort/doc/signatures/2479.txt:1.1.1.3.4.2 --- snort/doc/signatures/2479.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2479.txt Thu Jun 2 23:56:06 2005 @@ -58,5 +58,3 @@ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-1999-0562 Winreg http://www.rutherfurd.net/python/winreg/ - --- Index: snort/doc/signatures/2480.txt diff -u snort/doc/signatures/2480.txt:1.1.1.2 snort/doc/signatures/2480.txt:1.1.1.2.4.1 --- snort/doc/signatures/2480.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2480.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2481.txt diff -u snort/doc/signatures/2481.txt:1.1.1.2 snort/doc/signatures/2481.txt:1.1.1.2.4.1 --- snort/doc/signatures/2481.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2481.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2482.txt diff -u snort/doc/signatures/2482.txt:1.1.1.2 snort/doc/signatures/2482.txt:1.1.1.2.4.1 --- snort/doc/signatures/2482.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2482.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2483.txt diff -u snort/doc/signatures/2483.txt:1.1.1.2 snort/doc/signatures/2483.txt:1.1.1.2.4.1 --- snort/doc/signatures/2483.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2483.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2484.txt diff -u snort/doc/signatures/2484.txt:1.1.1.2 snort/doc/signatures/2484.txt:1.1.1.2.4.1 --- snort/doc/signatures/2484.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2484.txt Thu May 5 01:12:30 2005 @@ -53,5 +53,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2485.txt diff -u snort/doc/signatures/2485.txt:1.1.1.3 snort/doc/signatures/2485.txt:1.1.1.3.4.2 --- snort/doc/signatures/2485.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2485.txt Thu Jun 2 23:56:06 2005 @@ -63,5 +63,3 @@ Bugtraq: http://security.focus.com/bid/9916 - --- Index: snort/doc/signatures/2486.txt diff -u snort/doc/signatures/2486.txt:1.1.1.2 snort/doc/signatures/2486.txt:1.1.1.2.4.1 --- snort/doc/signatures/2486.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2486.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ Bugtraq: http://www.securityfocus.com/bid/10004 - --- Index: snort/doc/signatures/2487.txt diff -u snort/doc/signatures/2487.txt:1.1.1.3 snort/doc/signatures/2487.txt:1.1.1.3.4.2 --- snort/doc/signatures/2487.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2487.txt Thu Jun 2 23:56:06 2005 @@ -59,5 +59,3 @@ Bugtraq: http://securityfocus.com/bid/9758 - --- Index: snort/doc/signatures/2488.txt diff -u snort/doc/signatures/2488.txt:1.1.1.3 snort/doc/signatures/2488.txt:1.1.1.3.4.2 --- snort/doc/signatures/2488.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2488.txt Thu Jun 2 23:56:06 2005 @@ -59,5 +59,3 @@ Bugtraq: http://securityfocus.com/bid/9758 - --- Index: snort/doc/signatures/2489.txt diff -u snort/doc/signatures/2489.txt:1.1.1.3 snort/doc/signatures/2489.txt:1.1.1.3.4.2 --- snort/doc/signatures/2489.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2489.txt Thu Jun 2 23:56:06 2005 @@ -58,5 +58,3 @@ Bugtraq: http://www.securityfocus.com/bid/9978 - --- Index: snort/doc/signatures/2490.txt diff -u snort/doc/signatures/2490.txt:1.1.1.3 snort/doc/signatures/2490.txt:1.1.1.3.4.2 --- snort/doc/signatures/2490.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2490.txt Thu Jun 2 23:56:06 2005 @@ -57,5 +57,3 @@ Bugtraq: http://www.securityfocus.com/bid/9978 - --- Index: snort/doc/signatures/2491.txt diff -u snort/doc/signatures/2491.txt:1.1.1.2 snort/doc/signatures/2491.txt:1.1.1.2.4.1 --- snort/doc/signatures/2491.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2491.txt Thu May 5 01:12:30 2005 @@ -89,5 +89,3 @@ Symantec: http://securityresponse.symantec.com/avcenter/venc/data/w32.blaster.worm.html - --- Index: snort/doc/signatures/2492.txt diff -u snort/doc/signatures/2492.txt:1.1.1.2 snort/doc/signatures/2492.txt:1.1.1.2.4.1 --- snort/doc/signatures/2492.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2492.txt Thu May 5 01:12:30 2005 @@ -89,5 +89,3 @@ Symantec: http://securityresponse.symantec.com/avcenter/venc/data/w32.blaster.worm.html - --- Index: snort/doc/signatures/2493.txt diff -u snort/doc/signatures/2493.txt:1.1.1.2 snort/doc/signatures/2493.txt:1.1.1.2.4.1 --- snort/doc/signatures/2493.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2493.txt Thu May 5 01:12:30 2005 @@ -89,5 +89,3 @@ Symantec: http://securityresponse.symantec.com/avcenter/venc/data/w32.blaster.worm.html - --- Index: snort/doc/signatures/2494.txt diff -u snort/doc/signatures/2494.txt:1.1.1.3 snort/doc/signatures/2494.txt:1.1.1.3.4.2 --- snort/doc/signatures/2494.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2494.txt Thu Jun 2 23:56:06 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2495.txt diff -u snort/doc/signatures/2495.txt:1.1.1.3 snort/doc/signatures/2495.txt:1.1.1.3.4.2 --- snort/doc/signatures/2495.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2495.txt Thu Jun 2 23:56:06 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2496.txt diff -u snort/doc/signatures/2496.txt:1.1.1.3 snort/doc/signatures/2496.txt:1.1.1.3.4.2 --- snort/doc/signatures/2496.txt:1.1.1.3 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2496.txt Thu Jun 2 23:56:06 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2497.txt diff -u snort/doc/signatures/2497.txt:1.1.1.2 snort/doc/signatures/2497.txt:1.1.1.2.4.1 --- snort/doc/signatures/2497.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2497.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2498.txt diff -u snort/doc/signatures/2498.txt:1.1.1.2 snort/doc/signatures/2498.txt:1.1.1.2.4.1 --- snort/doc/signatures/2498.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2498.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2499.txt diff -u snort/doc/signatures/2499.txt:1.1.1.2 snort/doc/signatures/2499.txt:1.1.1.2.4.1 --- snort/doc/signatures/2499.txt:1.1.1.2 Sun Apr 24 22:08:56 2005 +++ snort/doc/signatures/2499.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2500.txt diff -u snort/doc/signatures/2500.txt:1.1.1.2 snort/doc/signatures/2500.txt:1.1.1.2.4.1 --- snort/doc/signatures/2500.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2500.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2501.txt diff -u snort/doc/signatures/2501.txt:1.1.1.2 snort/doc/signatures/2501.txt:1.1.1.2.4.1 --- snort/doc/signatures/2501.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2501.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2502.txt diff -u snort/doc/signatures/2502.txt:1.1.1.2 snort/doc/signatures/2502.txt:1.1.1.2.4.1 --- snort/doc/signatures/2502.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2502.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2503.txt diff -u snort/doc/signatures/2503.txt:1.1.1.2 snort/doc/signatures/2503.txt:1.1.1.2.4.1 --- snort/doc/signatures/2503.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2503.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2504.txt diff -u snort/doc/signatures/2504.txt:1.1.1.2 snort/doc/signatures/2504.txt:1.1.1.2.4.1 --- snort/doc/signatures/2504.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2504.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2505.txt diff -u snort/doc/signatures/2505.txt:1.1.1.2 snort/doc/signatures/2505.txt:1.1.1.2.4.1 --- snort/doc/signatures/2505.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2505.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2506.txt diff -u snort/doc/signatures/2506.txt:1.1.1.2 snort/doc/signatures/2506.txt:1.1.1.2.4.1 --- snort/doc/signatures/2506.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2506.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2507.txt diff -u snort/doc/signatures/2507.txt:1.1.1.2 snort/doc/signatures/2507.txt:1.1.1.2.4.1 --- snort/doc/signatures/2507.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2507.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2508.txt diff -u snort/doc/signatures/2508.txt:1.1.1.2 snort/doc/signatures/2508.txt:1.1.1.2.4.1 --- snort/doc/signatures/2508.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2508.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2509.txt diff -u snort/doc/signatures/2509.txt:1.1.1.2 snort/doc/signatures/2509.txt:1.1.1.2.4.1 --- snort/doc/signatures/2509.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2509.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2510.txt diff -u snort/doc/signatures/2510.txt:1.1.1.2 snort/doc/signatures/2510.txt:1.1.1.2.4.1 --- snort/doc/signatures/2510.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2510.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2511.txt diff -u snort/doc/signatures/2511.txt:1.1.1.2 snort/doc/signatures/2511.txt:1.1.1.2.4.1 --- snort/doc/signatures/2511.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2511.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2512.txt diff -u snort/doc/signatures/2512.txt:1.1.1.2 snort/doc/signatures/2512.txt:1.1.1.2.4.1 --- snort/doc/signatures/2512.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2512.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2513.txt diff -u snort/doc/signatures/2513.txt:1.1.1.2 snort/doc/signatures/2513.txt:1.1.1.2.4.1 --- snort/doc/signatures/2513.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2513.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2514.txt diff -u snort/doc/signatures/2514.txt:1.1.1.2 snort/doc/signatures/2514.txt:1.1.1.2.4.1 --- snort/doc/signatures/2514.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2514.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2515.txt diff -u snort/doc/signatures/2515.txt:1.1.1.2 snort/doc/signatures/2515.txt:1.1.1.2.4.1 --- snort/doc/signatures/2515.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2515.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2516.txt diff -u snort/doc/signatures/2516.txt:1.1.1.2 snort/doc/signatures/2516.txt:1.1.1.2.4.1 --- snort/doc/signatures/2516.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2516.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2517.txt diff -u snort/doc/signatures/2517.txt:1.1.1.2 snort/doc/signatures/2517.txt:1.1.1.2.4.1 --- snort/doc/signatures/2517.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2517.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2518.txt diff -u snort/doc/signatures/2518.txt:1.1.1.2 snort/doc/signatures/2518.txt:1.1.1.2.4.1 --- snort/doc/signatures/2518.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2518.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2519.txt diff -u snort/doc/signatures/2519.txt:1.1.1.2 snort/doc/signatures/2519.txt:1.1.1.2.4.1 --- snort/doc/signatures/2519.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2519.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2520.txt diff -u snort/doc/signatures/2520.txt:1.1.1.2 snort/doc/signatures/2520.txt:1.1.1.2.4.1 --- snort/doc/signatures/2520.txt:1.1.1.2 Sun Apr 24 22:08:57 2005 +++ snort/doc/signatures/2520.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2521.txt diff -u snort/doc/signatures/2521.txt:1.1.1.2 snort/doc/signatures/2521.txt:1.1.1.2.4.1 --- snort/doc/signatures/2521.txt:1.1.1.2 Sun Apr 24 22:08:58 2005 +++ snort/doc/signatures/2521.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2522.txt diff -u snort/doc/signatures/2522.txt:1.1.1.2 snort/doc/signatures/2522.txt:1.1.1.2.4.1 --- snort/doc/signatures/2522.txt:1.1.1.2 Sun Apr 24 22:08:58 2005 +++ snort/doc/signatures/2522.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2523.txt diff -u snort/doc/signatures/2523.txt:1.1.1.2 snort/doc/signatures/2523.txt:1.1.1.2.4.1 --- snort/doc/signatures/2523.txt:1.1.1.2 Sun Apr 24 22:08:58 2005 +++ snort/doc/signatures/2523.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2524.txt diff -u snort/doc/signatures/2524.txt:1.1.1.2 snort/doc/signatures/2524.txt:1.1.1.2.4.1 --- snort/doc/signatures/2524.txt:1.1.1.2 Sun Apr 24 22:08:58 2005 +++ snort/doc/signatures/2524.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2525.txt diff -u snort/doc/signatures/2525.txt:1.1.1.2 snort/doc/signatures/2525.txt:1.1.1.2.4.1 --- snort/doc/signatures/2525.txt:1.1.1.2 Sun Apr 24 22:08:58 2005 +++ snort/doc/signatures/2525.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2526.txt diff -u snort/doc/signatures/2526.txt:1.1.1.2 snort/doc/signatures/2526.txt:1.1.1.2.4.1 --- snort/doc/signatures/2526.txt:1.1.1.2 Sun Apr 24 22:08:58 2005 +++ snort/doc/signatures/2526.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2527.txt diff -u snort/doc/signatures/2527.txt:1.1.1.2 snort/doc/signatures/2527.txt:1.1.1.2.4.1 --- snort/doc/signatures/2527.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2527.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2528.txt diff -u snort/doc/signatures/2528.txt:1.1.1.2 snort/doc/signatures/2528.txt:1.1.1.2.4.1 --- snort/doc/signatures/2528.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2528.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2529.txt diff -u snort/doc/signatures/2529.txt:1.1.1.2 snort/doc/signatures/2529.txt:1.1.1.2.4.1 --- snort/doc/signatures/2529.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2529.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2530.txt diff -u snort/doc/signatures/2530.txt:1.1.1.2 snort/doc/signatures/2530.txt:1.1.1.2.4.1 --- snort/doc/signatures/2530.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2530.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2531.txt diff -u snort/doc/signatures/2531.txt:1.1.1.2 snort/doc/signatures/2531.txt:1.1.1.2.4.1 --- snort/doc/signatures/2531.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2531.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2532.txt diff -u snort/doc/signatures/2532.txt:1.1.1.2 snort/doc/signatures/2532.txt:1.1.1.2.4.1 --- snort/doc/signatures/2532.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2532.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2533.txt diff -u snort/doc/signatures/2533.txt:1.1.1.2 snort/doc/signatures/2533.txt:1.1.1.2.4.1 --- snort/doc/signatures/2533.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2533.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2534.txt diff -u snort/doc/signatures/2534.txt:1.1.1.2 snort/doc/signatures/2534.txt:1.1.1.2.4.1 --- snort/doc/signatures/2534.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2534.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2535.txt diff -u snort/doc/signatures/2535.txt:1.1.1.2 snort/doc/signatures/2535.txt:1.1.1.2.4.1 --- snort/doc/signatures/2535.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2535.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-Cert: -http://www.kb.cert.org/vuls/id/150236 - --- Index: snort/doc/signatures/2536.txt diff -u snort/doc/signatures/2536.txt:1.1.1.2 snort/doc/signatures/2536.txt:1.1.1.2.4.1 --- snort/doc/signatures/2536.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2536.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-Cert: -http://www.kb.cert.org/vuls/id/150236 - --- Index: snort/doc/signatures/2537.txt diff -u snort/doc/signatures/2537.txt:1.1.1.2 snort/doc/signatures/2537.txt:1.1.1.2.4.1 --- snort/doc/signatures/2537.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2537.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-Cert: -http://www.kb.cert.org/vuls/id/150236 - --- Index: snort/doc/signatures/2538.txt diff -u snort/doc/signatures/2538.txt:1.1.1.2 snort/doc/signatures/2538.txt:1.1.1.2.4.1 --- snort/doc/signatures/2538.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2538.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-CERT: -http://www.us-cert.gov/cas/techalerts/TA04-104A.html - --- Index: snort/doc/signatures/2539.txt diff -u snort/doc/signatures/2539.txt:1.1.1.2 snort/doc/signatures/2539.txt:1.1.1.2.4.1 --- snort/doc/signatures/2539.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2539.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-CERT: -http://www.us-cert.gov/cas/techalerts/TA04-104A.html - --- Index: snort/doc/signatures/2540.txt diff -u snort/doc/signatures/2540.txt:1.1.1.2 snort/doc/signatures/2540.txt:1.1.1.2.4.1 --- snort/doc/signatures/2540.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2540.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-CERT: -http://www.us-cert.gov/cas/techalerts/TA04-104A.html - --- Index: snort/doc/signatures/2541.txt diff -u snort/doc/signatures/2541.txt:1.1.1.2 snort/doc/signatures/2541.txt:1.1.1.2.4.1 --- snort/doc/signatures/2541.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2541.txt Thu May 5 01:12:30 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2542.txt diff -u snort/doc/signatures/2542.txt:1.1.1.2 snort/doc/signatures/2542.txt:1.1.1.2.4.1 --- snort/doc/signatures/2542.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2542.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-CERT: -http://www.us-cert.gov/cas/techalerts/TA04-104A.html - --- Index: snort/doc/signatures/2543.txt diff -u snort/doc/signatures/2543.txt:1.1.1.2 snort/doc/signatures/2543.txt:1.1.1.2.4.1 --- snort/doc/signatures/2543.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2543.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-CERT: -http://www.us-cert.gov/cas/techalerts/TA04-104A.html - --- Index: snort/doc/signatures/2544.txt diff -u snort/doc/signatures/2544.txt:1.1.1.2 snort/doc/signatures/2544.txt:1.1.1.2.4.1 --- snort/doc/signatures/2544.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2544.txt Thu May 5 01:12:30 2005 @@ -57,8 +57,3 @@ -- Additional References: - -US-CERT: -http://www.us-cert.gov/cas/techalerts/TA04-104A.html - --- Index: snort/doc/signatures/2545.txt diff -u snort/doc/signatures/2545.txt:1.1.1.2 snort/doc/signatures/2545.txt:1.1.1.2.4.1 --- snort/doc/signatures/2545.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2545.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2546.txt diff -u snort/doc/signatures/2546.txt:1.1.1.2 snort/doc/signatures/2546.txt:1.1.1.2.4.1 --- snort/doc/signatures/2546.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2546.txt Thu May 5 01:12:30 2005 @@ -56,5 +56,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2547.txt diff -u snort/doc/signatures/2547.txt:1.1.1.2 snort/doc/signatures/2547.txt:1.1.1.2.4.1 --- snort/doc/signatures/2547.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2547.txt Thu May 5 01:12:30 2005 @@ -64,5 +64,3 @@ Bugtraq: http://www.securityfocus.com/bid/9971 - --- Index: snort/doc/signatures/2548.txt diff -u snort/doc/signatures/2548.txt:1.1.1.2 snort/doc/signatures/2548.txt:1.1.1.2.4.1 --- snort/doc/signatures/2548.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2548.txt Thu May 5 01:12:30 2005 @@ -63,5 +63,3 @@ Bugtraq: http://www.securityfocus.com/bid/9972 - --- Index: snort/doc/signatures/2549.txt diff -u snort/doc/signatures/2549.txt:1.1.1.3 snort/doc/signatures/2549.txt:1.1.1.3.4.2 --- snort/doc/signatures/2549.txt:1.1.1.3 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2549.txt Thu Jun 2 23:56:06 2005 @@ -61,5 +61,3 @@ Bugtraq: http://www.securityfocus.com/bid/9973 - --- Index: snort/doc/signatures/2550.txt diff -u snort/doc/signatures/2550.txt:1.1.1.2 snort/doc/signatures/2550.txt:1.1.1.2.4.1 --- snort/doc/signatures/2550.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2550.txt Thu May 5 01:12:30 2005 @@ -59,5 +59,3 @@ Other: http://www.nextgenss.com/advisories/winampheap.txt - --- Index: snort/doc/signatures/2551.txt diff -u snort/doc/signatures/2551.txt:1.1.1.2 snort/doc/signatures/2551.txt:1.1.1.2.4.1 --- snort/doc/signatures/2551.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2551.txt Thu May 5 01:12:30 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2552.txt diff -u snort/doc/signatures/2552.txt:1.1.1.2 snort/doc/signatures/2552.txt:1.1.1.2.4.1 --- snort/doc/signatures/2552.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2552.txt Thu May 5 01:12:30 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2553.txt diff -u snort/doc/signatures/2553.txt:1.1.1.2 snort/doc/signatures/2553.txt:1.1.1.2.4.1 --- snort/doc/signatures/2553.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2553.txt Thu May 5 01:12:30 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2554.txt diff -u snort/doc/signatures/2554.txt:1.1.1.2 snort/doc/signatures/2554.txt:1.1.1.2.4.1 --- snort/doc/signatures/2554.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2554.txt Thu May 5 01:12:30 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2555.txt diff -u snort/doc/signatures/2555.txt:1.1.1.2 snort/doc/signatures/2555.txt:1.1.1.2.4.1 --- snort/doc/signatures/2555.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2555.txt Thu May 5 01:12:30 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2556.txt diff -u snort/doc/signatures/2556.txt:1.1.1.2 snort/doc/signatures/2556.txt:1.1.1.2.4.1 --- snort/doc/signatures/2556.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2556.txt Thu May 5 01:12:31 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2557.txt diff -u snort/doc/signatures/2557.txt:1.1.1.2 snort/doc/signatures/2557.txt:1.1.1.2.4.1 --- snort/doc/signatures/2557.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2557.txt Thu May 5 01:12:31 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2558.txt diff -u snort/doc/signatures/2558.txt:1.1.1.2 snort/doc/signatures/2558.txt:1.1.1.2.4.1 --- snort/doc/signatures/2558.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2558.txt Thu May 5 01:12:31 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2559.txt diff -u snort/doc/signatures/2559.txt:1.1.1.2 snort/doc/signatures/2559.txt:1.1.1.2.4.1 --- snort/doc/signatures/2559.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2559.txt Thu May 5 01:12:31 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2560.txt diff -u snort/doc/signatures/2560.txt:1.1.1.2 snort/doc/signatures/2560.txt:1.1.1.2.4.1 --- snort/doc/signatures/2560.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2560.txt Thu May 5 01:12:31 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2561.txt diff -u snort/doc/signatures/2561.txt:1.1.1.2 snort/doc/signatures/2561.txt:1.1.1.2.4.1 --- snort/doc/signatures/2561.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2561.txt Thu May 5 01:12:31 2005 @@ -63,5 +63,3 @@ Bugtraq: http://www.securityfocus.com/bid/10247 - --- Index: snort/doc/signatures/2562.txt diff -u snort/doc/signatures/2562.txt:1.1.1.2 snort/doc/signatures/2562.txt:1.1.1.2.4.1 --- snort/doc/signatures/2562.txt:1.1.1.2 Sun Apr 24 22:08:59 2005 +++ snort/doc/signatures/2562.txt Thu May 5 01:12:31 2005 @@ -68,5 +68,3 @@ Bugtraq: http://www.securityfocus.com/bid/10200 - --- Index: snort/doc/signatures/2563.txt diff -u snort/doc/signatures/2563.txt:1.1.1.2 snort/doc/signatures/2563.txt:1.1.1.2.4.1 --- snort/doc/signatures/2563.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2563.txt Thu May 5 01:12:31 2005 @@ -71,5 +71,3 @@ Misc: http://www.eeye.com/html/Research/Advisories/AD20040512C.html - --- Index: snort/doc/signatures/2564.txt diff -u snort/doc/signatures/2564.txt:1.1.1.2 snort/doc/signatures/2564.txt:1.1.1.2.4.1 --- snort/doc/signatures/2564.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2564.txt Thu May 5 01:12:31 2005 @@ -71,5 +71,3 @@ Misc: http://www.eeye.com/html/Research/Advisories/AD20040512A.html - --- Index: snort/doc/signatures/2565.txt diff -u snort/doc/signatures/2565.txt:1.1.1.2 snort/doc/signatures/2565.txt:1.1.1.2.4.1 --- snort/doc/signatures/2565.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2565.txt Sat May 14 02:22:36 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2566.txt diff -u snort/doc/signatures/2566.txt:1.1.1.2 snort/doc/signatures/2566.txt:1.1.1.2.4.1 --- snort/doc/signatures/2566.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2566.txt Sat May 14 02:22:36 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2567.txt diff -u snort/doc/signatures/2567.txt:1.1.1.2 snort/doc/signatures/2567.txt:1.1.1.2.4.1 --- snort/doc/signatures/2567.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2567.txt Sat May 14 02:22:36 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2568.txt diff -u snort/doc/signatures/2568.txt:1.1.1.2 snort/doc/signatures/2568.txt:1.1.1.2.4.1 --- snort/doc/signatures/2568.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2568.txt Sat May 14 02:22:36 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2569.txt diff -u snort/doc/signatures/2569.txt:1.1.1.2 snort/doc/signatures/2569.txt:1.1.1.2.4.1 --- snort/doc/signatures/2569.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2569.txt Sat May 14 02:22:36 2005 @@ -67,5 +67,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2570.txt diff -u snort/doc/signatures/2570.txt:1.1.1.2 snort/doc/signatures/2570.txt:1.1.1.2.4.1 --- snort/doc/signatures/2570.txt:1.1.1.2 Sun Apr 24 22:09:00 2005 +++ snort/doc/signatures/2570.txt Sat May 14 02:22:36 2005 @@ -71,5 +71,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2571.txt diff -u snort/doc/signatures/2571.txt:1.1.1.2 snort/doc/signatures/2571.txt:1.1.1.2.4.1 --- snort/doc/signatures/2571.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2571.txt Sat May 14 02:22:36 2005 @@ -74,5 +74,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2572.txt diff -u snort/doc/signatures/2572.txt:1.1.1.2 snort/doc/signatures/2572.txt:1.1.1.2.4.1 --- snort/doc/signatures/2572.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2572.txt Sat May 14 02:22:36 2005 @@ -74,5 +74,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2573.txt diff -u snort/doc/signatures/2573.txt:1.1.1.2 snort/doc/signatures/2573.txt:1.1.1.2.4.1 --- snort/doc/signatures/2573.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2573.txt Sat May 14 02:22:36 2005 @@ -74,5 +74,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2574.txt diff -u snort/doc/signatures/2574.txt:1.1.1.2 snort/doc/signatures/2574.txt:1.1.1.2.4.1 --- snort/doc/signatures/2574.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2574.txt Sat May 14 02:22:36 2005 @@ -64,5 +64,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2575.txt diff -u snort/doc/signatures/2575.txt:1.1.1.2 snort/doc/signatures/2575.txt:1.1.1.2.4.1 --- snort/doc/signatures/2575.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2575.txt Sat May 14 02:22:36 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2576.txt diff -u snort/doc/signatures/2576.txt:1.1.1.2 snort/doc/signatures/2576.txt:1.1.1.2.4.1 --- snort/doc/signatures/2576.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2576.txt Sat May 14 02:22:37 2005 @@ -68,5 +68,3 @@ Application Security Inc. https://www.appsecinc.com/Policy/PolicyCheck93.html - --- Index: snort/doc/signatures/2577.txt diff -u snort/doc/signatures/2577.txt:1.1.1.2 snort/doc/signatures/2577.txt:1.1.1.2.4.1 --- snort/doc/signatures/2577.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2577.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2578.txt diff -u snort/doc/signatures/2578.txt:1.1.1.2 snort/doc/signatures/2578.txt:1.1.1.2.4.1 --- snort/doc/signatures/2578.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2578.txt Sat May 14 02:22:37 2005 @@ -61,5 +61,3 @@ Other: http://web.mit.edu/kerberos/advisories/MITKRB5-SA-2004-001-an_to_ln.txt - --- Index: snort/doc/signatures/2579.txt diff -u snort/doc/signatures/2579.txt:1.1.1.2 snort/doc/signatures/2579.txt:1.1.1.2.4.1 --- snort/doc/signatures/2579.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2579.txt Sat May 14 02:22:37 2005 @@ -61,5 +61,3 @@ Other: http://web.mit.edu/kerberos/advisories/MITKRB5-SA-2004-001-an_to_ln.txt - --- Index: snort/doc/signatures/2580.txt diff -u snort/doc/signatures/2580.txt:1.1.1.2 snort/doc/signatures/2580.txt:1.1.1.2.4.1 --- snort/doc/signatures/2580.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2580.txt Sat May 14 02:22:37 2005 @@ -63,5 +63,3 @@ Other: http://www.guninski.com/modproxy1.html - --- Index: snort/doc/signatures/2581.txt diff -u snort/doc/signatures/2581.txt:1.1.1.2 snort/doc/signatures/2581.txt:1.1.1.2.4.1 --- snort/doc/signatures/2581.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2581.txt Sat May 14 02:22:37 2005 @@ -73,5 +73,3 @@ Other: http://www.microsoft.com/security/bulletins/200406_crystal.mspx - --- Index: snort/doc/signatures/2582.txt diff -u snort/doc/signatures/2582.txt:1.1.1.2 snort/doc/signatures/2582.txt:1.1.1.2.4.1 --- snort/doc/signatures/2582.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2582.txt Sat May 14 02:22:37 2005 @@ -73,5 +73,3 @@ Other: http://www.microsoft.com/security/bulletins/200406_crystal.mspx - --- Index: snort/doc/signatures/2583.txt diff -u snort/doc/signatures/2583.txt:1.1.1.2 snort/doc/signatures/2583.txt:1.1.1.2.4.1 --- snort/doc/signatures/2583.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2583.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Bugtraq: http://www.securityfocus.com/bid/10499 - --- Index: snort/doc/signatures/2584.txt diff -u snort/doc/signatures/2584.txt:1.1.1.2 snort/doc/signatures/2584.txt:1.1.1.2.4.1 --- snort/doc/signatures/2584.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2584.txt Sat May 14 02:22:37 2005 @@ -60,5 +60,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2585.txt diff -u snort/doc/signatures/2585.txt:1.1.1.2 snort/doc/signatures/2585.txt:1.1.1.2.4.1 --- snort/doc/signatures/2585.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2585.txt Sat May 14 02:22:37 2005 @@ -65,5 +65,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2586.txt diff -u snort/doc/signatures/2586.txt:1.1.1.2 snort/doc/signatures/2586.txt:1.1.1.2.4.1 --- snort/doc/signatures/2586.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2586.txt Sat May 14 02:22:37 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2587.txt diff -u snort/doc/signatures/2587.txt:1.1.1.2 snort/doc/signatures/2587.txt:1.1.1.2.4.1 --- snort/doc/signatures/2587.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2587.txt Sat May 14 02:22:37 2005 @@ -57,5 +57,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2588.txt diff -u snort/doc/signatures/2588.txt:1.1.1.2 snort/doc/signatures/2588.txt:1.1.1.2.4.1 --- snort/doc/signatures/2588.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2588.txt Sat May 14 02:22:37 2005 @@ -61,5 +61,3 @@ -- Additional References: - --- Index: snort/doc/signatures/2589.txt diff -u snort/doc/signatures/2589.txt:1.1.1.2 snort/doc/signatures/2589.txt:1.1.1.2.4.1 --- snort/doc/signatures/2589.txt:1.1.1.2 Sun Apr 24 22:09:01 2005 +++ snort/doc/signatures/2589.txt Sat May 14 02:22:37 2005 @@ -89,5 +89,3 @@ Other: http://www.microsoft.com/technet/security/bulletin/ms04-024.mspx - --- Index: snort/doc/signatures/2590.txt diff -u snort/doc/signatures/2590.txt:1.1.1.2 snort/doc/signatures/2590.txt:1.1.1.2.4.1 --- snort/doc/signatures/2590.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2590.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2591.txt diff -u snort/doc/signatures/2591.txt:1.1.1.2 snort/doc/signatures/2591.txt:1.1.1.2.4.1 --- snort/doc/signatures/2591.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2591.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2592.txt diff -u snort/doc/signatures/2592.txt:1.1.1.2 snort/doc/signatures/2592.txt:1.1.1.2.4.1 --- snort/doc/signatures/2592.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2592.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2593.txt diff -u snort/doc/signatures/2593.txt:1.1.1.2 snort/doc/signatures/2593.txt:1.1.1.2.4.1 --- snort/doc/signatures/2593.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2593.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2594.txt diff -u snort/doc/signatures/2594.txt:1.1.1.2 snort/doc/signatures/2594.txt:1.1.1.2.4.1 --- snort/doc/signatures/2594.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2594.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2595.txt diff -u snort/doc/signatures/2595.txt:1.1.1.2 snort/doc/signatures/2595.txt:1.1.1.2.4.1 --- snort/doc/signatures/2595.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2595.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2596.txt diff -u snort/doc/signatures/2596.txt:1.1.1.2 snort/doc/signatures/2596.txt:1.1.1.2.4.1 --- snort/doc/signatures/2596.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2596.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Other: http://www.guninski.com/exim1.html - --- Index: snort/doc/signatures/2597.txt diff -u snort/doc/signatures/2597.txt:1.1.1.2 snort/doc/signatures/2597.txt:1.1.1.2.4.1 --- snort/doc/signatures/2597.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2597.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Bugtraq: http://www.securityfocus.com/bid/10780 - --- Index: snort/doc/signatures/2598.txt diff -u snort/doc/signatures/2598.txt:1.1.1.2 snort/doc/signatures/2598.txt:1.1.1.2.4.1 --- snort/doc/signatures/2598.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2598.txt Sat May 14 02:22:37 2005 @@ -64,5 +64,3 @@ Bugtraq: http://www.securityfocus.com/bid/10780 - --- Index: snort/doc/signatures/2599.txt diff -u snort/doc/signatures/2599.txt:1.1.1.2 snort/doc/signatures/2599.txt:1.1.1.2.4.1 --- snort/doc/signatures/2599.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2599.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck633.html - --- Index: snort/doc/signatures/2600.txt diff -u snort/doc/signatures/2600.txt:1.1.1.2 snort/doc/signatures/2600.txt:1.1.1.2.4.1 --- snort/doc/signatures/2600.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2600.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck633.html - --- Index: snort/doc/signatures/2601.txt diff -u snort/doc/signatures/2601.txt:1.1.1.2 snort/doc/signatures/2601.txt:1.1.1.2.4.1 --- snort/doc/signatures/2601.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2601.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck87.html - --- Index: snort/doc/signatures/2602.txt diff -u snort/doc/signatures/2602.txt:1.1.1.2 snort/doc/signatures/2602.txt:1.1.1.2.4.1 --- snort/doc/signatures/2602.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2602.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck87.html - --- Index: snort/doc/signatures/2603.txt diff -u snort/doc/signatures/2603.txt:1.1.1.2 snort/doc/signatures/2603.txt:1.1.1.2.4.1 --- snort/doc/signatures/2603.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2603.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck633.html - --- Index: snort/doc/signatures/2604.txt diff -u snort/doc/signatures/2604.txt:1.1.1.2 snort/doc/signatures/2604.txt:1.1.1.2.4.1 --- snort/doc/signatures/2604.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2604.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck633.html - --- Index: snort/doc/signatures/2605.txt diff -u snort/doc/signatures/2605.txt:1.1.1.2 snort/doc/signatures/2605.txt:1.1.1.2.4.1 --- snort/doc/signatures/2605.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2605.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck91.html - --- Index: snort/doc/signatures/2606.txt diff -u snort/doc/signatures/2606.txt:1.1.1.2 snort/doc/signatures/2606.txt:1.1.1.2.4.1 --- snort/doc/signatures/2606.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2606.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck634.html - --- Index: snort/doc/signatures/2607.txt diff -u snort/doc/signatures/2607.txt:1.1.1.2 snort/doc/signatures/2607.txt:1.1.1.2.4.1 --- snort/doc/signatures/2607.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2607.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck634.html - --- Index: snort/doc/signatures/2608.txt diff -u snort/doc/signatures/2608.txt:1.1.1.2 snort/doc/signatures/2608.txt:1.1.1.2.4.1 --- snort/doc/signatures/2608.txt:1.1.1.2 Sun Apr 24 22:09:02 2005 +++ snort/doc/signatures/2608.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2609.txt diff -u snort/doc/signatures/2609.txt:1.1.1.2 snort/doc/signatures/2609.txt:1.1.1.2.4.1 --- snort/doc/signatures/2609.txt:1.1.1.2 Sun Apr 24 22:09:03 2005 +++ snort/doc/signatures/2609.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck633.html - --- Index: snort/doc/signatures/2610.txt diff -u snort/doc/signatures/2610.txt:1.1.1.2 snort/doc/signatures/2610.txt:1.1.1.2.4.1 --- snort/doc/signatures/2610.txt:1.1.1.2 Sun Apr 24 22:09:03 2005 +++ snort/doc/signatures/2610.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck633.html - --- Index: snort/doc/signatures/2611.txt diff -u snort/doc/signatures/2611.txt:1.1.1.2 snort/doc/signatures/2611.txt:1.1.1.2.4.1 --- snort/doc/signatures/2611.txt:1.1.1.2 Sun Apr 24 22:09:03 2005 +++ snort/doc/signatures/2611.txt Sat May 14 02:22:37 2005 @@ -71,5 +71,3 @@ Other: http://archives.neohapsis.com/archives/bugtraq/2003-04/0360.html - --- Index: snort/doc/signatures/2612.txt diff -u snort/doc/signatures/2612.txt:1.1.1.2 snort/doc/signatures/2612.txt:1.1.1.2.4.1 --- snort/doc/signatures/2612.txt:1.1.1.2 Sun Apr 24 22:09:03 2005 +++ snort/doc/signatures/2612.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2613.txt diff -u snort/doc/signatures/2613.txt:1.1.1.2 snort/doc/signatures/2613.txt:1.1.1.2.4.1 --- snort/doc/signatures/2613.txt:1.1.1.2 Sun Apr 24 22:09:03 2005 +++ snort/doc/signatures/2613.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2614.txt diff -u snort/doc/signatures/2614.txt:1.1.1.2 snort/doc/signatures/2614.txt:1.1.1.2.4.1 --- snort/doc/signatures/2614.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2614.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.nextgenss.com/advisories/ora_time_zone.txt - --- Index: snort/doc/signatures/2615.txt diff -u snort/doc/signatures/2615.txt:1.1.1.2 snort/doc/signatures/2615.txt:1.1.1.2.4.1 --- snort/doc/signatures/2615.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2615.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2616.txt diff -u snort/doc/signatures/2616.txt:1.1.1.2 snort/doc/signatures/2616.txt:1.1.1.2.4.1 --- snort/doc/signatures/2616.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2616.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2617.txt diff -u snort/doc/signatures/2617.txt:1.1.1.2 snort/doc/signatures/2617.txt:1.1.1.2.4.1 --- snort/doc/signatures/2617.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2617.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck632.html - --- Index: snort/doc/signatures/2618.txt diff -u snort/doc/signatures/2618.txt:1.1.1.2 snort/doc/signatures/2618.txt:1.1.1.2.4.1 --- snort/doc/signatures/2618.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2618.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck632.html - --- Index: snort/doc/signatures/2619.txt diff -u snort/doc/signatures/2619.txt:1.1.1.2 snort/doc/signatures/2619.txt:1.1.1.2.4.1 --- snort/doc/signatures/2619.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2619.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck634.html - --- Index: snort/doc/signatures/2620.txt diff -u snort/doc/signatures/2620.txt:1.1.1.2 snort/doc/signatures/2620.txt:1.1.1.2.4.1 --- snort/doc/signatures/2620.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2620.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck634.html - --- Index: snort/doc/signatures/2621.txt diff -u snort/doc/signatures/2621.txt:1.1.1.2 snort/doc/signatures/2621.txt:1.1.1.2.4.1 --- snort/doc/signatures/2621.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2621.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2622.txt diff -u snort/doc/signatures/2622.txt:1.1.1.2 snort/doc/signatures/2622.txt:1.1.1.2.4.1 --- snort/doc/signatures/2622.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2622.txt Sat May 14 02:22:37 2005 @@ -68,5 +68,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2623.txt diff -u snort/doc/signatures/2623.txt:1.1.1.2 snort/doc/signatures/2623.txt:1.1.1.2.4.1 --- snort/doc/signatures/2623.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2623.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2624.txt diff -u snort/doc/signatures/2624.txt:1.1.1.2 snort/doc/signatures/2624.txt:1.1.1.2.4.1 --- snort/doc/signatures/2624.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2624.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck94.html - --- Index: snort/doc/signatures/2625.txt diff -u snort/doc/signatures/2625.txt:1.1.1.2 snort/doc/signatures/2625.txt:1.1.1.2.4.1 --- snort/doc/signatures/2625.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2625.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck94.html - --- Index: snort/doc/signatures/2626.txt diff -u snort/doc/signatures/2626.txt:1.1.1.2 snort/doc/signatures/2626.txt:1.1.1.2.4.1 --- snort/doc/signatures/2626.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2626.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck91.html Action: - --- Index: snort/doc/signatures/2627.txt diff -u snort/doc/signatures/2627.txt:1.1.1.2 snort/doc/signatures/2627.txt:1.1.1.2.4.1 --- snort/doc/signatures/2627.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2627.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck90.html - --- Index: snort/doc/signatures/2628.txt diff -u snort/doc/signatures/2628.txt:1.1.1.2 snort/doc/signatures/2628.txt:1.1.1.2.4.1 --- snort/doc/signatures/2628.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2628.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck90.html - --- Index: snort/doc/signatures/2629.txt diff -u snort/doc/signatures/2629.txt:1.1.1.2 snort/doc/signatures/2629.txt:1.1.1.2.4.1 --- snort/doc/signatures/2629.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2629.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck94.html - --- Index: snort/doc/signatures/2630.txt diff -u snort/doc/signatures/2630.txt:1.1.1.2 snort/doc/signatures/2630.txt:1.1.1.2.4.1 --- snort/doc/signatures/2630.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2630.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck94.html - --- Index: snort/doc/signatures/2631.txt diff -u snort/doc/signatures/2631.txt:1.1.1.2 snort/doc/signatures/2631.txt:1.1.1.2.4.1 --- snort/doc/signatures/2631.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2631.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck90.html - --- Index: snort/doc/signatures/2632.txt diff -u snort/doc/signatures/2632.txt:1.1.1.2 snort/doc/signatures/2632.txt:1.1.1.2.4.1 --- snort/doc/signatures/2632.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2632.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck90.html - --- Index: snort/doc/signatures/2633.txt diff -u snort/doc/signatures/2633.txt:1.1.1.2 snort/doc/signatures/2633.txt:1.1.1.2.4.1 --- snort/doc/signatures/2633.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2633.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2634.txt diff -u snort/doc/signatures/2634.txt:1.1.1.2 snort/doc/signatures/2634.txt:1.1.1.2.4.1 --- snort/doc/signatures/2634.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2634.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck97.html - --- Index: snort/doc/signatures/2635.txt diff -u snort/doc/signatures/2635.txt:1.1.1.2 snort/doc/signatures/2635.txt:1.1.1.2.4.1 --- snort/doc/signatures/2635.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2635.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck632.html - --- Index: snort/doc/signatures/2636.txt diff -u snort/doc/signatures/2636.txt:1.1.1.2 snort/doc/signatures/2636.txt:1.1.1.2.4.1 --- snort/doc/signatures/2636.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2636.txt Sat May 14 02:22:37 2005 @@ -70,5 +70,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck632.html - --- Index: snort/doc/signatures/2637.txt diff -u snort/doc/signatures/2637.txt:1.1.1.2 snort/doc/signatures/2637.txt:1.1.1.2.4.1 --- snort/doc/signatures/2637.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2637.txt Sat May 14 02:22:37 2005 @@ -68,5 +68,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck630.html - --- Index: snort/doc/signatures/2638.txt diff -u snort/doc/signatures/2638.txt:1.1.1.2 snort/doc/signatures/2638.txt:1.1.1.2.4.1 --- snort/doc/signatures/2638.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2638.txt Sat May 14 02:22:37 2005 @@ -68,5 +68,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck630.html - --- Index: snort/doc/signatures/2639.txt diff -u snort/doc/signatures/2639.txt:1.1.1.2 snort/doc/signatures/2639.txt:1.1.1.2.4.1 --- snort/doc/signatures/2639.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2639.txt Sat May 14 02:22:37 2005 @@ -47,8 +47,7 @@ False Positives: None known. --- -False Negatives: +--False Negatives: None known. -- @@ -69,5 +68,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck90.html - --- Index: snort/doc/signatures/2640.txt diff -u snort/doc/signatures/2640.txt:1.1.1.2 snort/doc/signatures/2640.txt:1.1.1.2.4.1 --- snort/doc/signatures/2640.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2640.txt Sat May 14 02:22:37 2005 @@ -47,8 +47,7 @@ False Positives: None known. --- -False Negatives: +--False Negatives: None known. -- @@ -69,5 +68,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck90.html - --- Index: snort/doc/signatures/2641.txt diff -u snort/doc/signatures/2641.txt:1.1.1.2 snort/doc/signatures/2641.txt:1.1.1.2.4.1 --- snort/doc/signatures/2641.txt:1.1.1.2 Sun Apr 24 22:09:04 2005 +++ snort/doc/signatures/2641.txt Sat May 14 02:22:37 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck629.html - --- Index: snort/doc/signatures/2642.txt diff -u snort/doc/signatures/2642.txt:1.1.1.2 snort/doc/signatures/2642.txt:1.1.1.2.4.1 --- snort/doc/signatures/2642.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2642.txt Sat May 14 02:22:38 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck629.html - --- Index: snort/doc/signatures/2643.txt diff -u snort/doc/signatures/2643.txt:1.1.1.2 snort/doc/signatures/2643.txt:1.1.1.2.4.1 --- snort/doc/signatures/2643.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2643.txt Sat May 14 02:22:38 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck96.html - --- Index: snort/doc/signatures/2644.txt diff -u snort/doc/signatures/2644.txt:1.1.1.2 snort/doc/signatures/2644.txt:1.1.1.2.4.1 --- snort/doc/signatures/2644.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2644.txt Sat May 14 02:22:38 2005 @@ -67,5 +67,3 @@ Other: http://www.nextgenss.com/advisories/ora_from_tz.txt - --- Index: snort/doc/signatures/2645.txt diff -u snort/doc/signatures/2645.txt:1.1.1.2 snort/doc/signatures/2645.txt:1.1.1.2.4.1 --- snort/doc/signatures/2645.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2645.txt Sat May 14 02:22:38 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck630.html - --- Index: snort/doc/signatures/2646.txt diff -u snort/doc/signatures/2646.txt:1.1.1.2 snort/doc/signatures/2646.txt:1.1.1.2.4.1 --- snort/doc/signatures/2646.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2646.txt Sat May 14 02:22:38 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck630.html - --- Index: snort/doc/signatures/2647.txt diff -u snort/doc/signatures/2647.txt:1.1.1.2 snort/doc/signatures/2647.txt:1.1.1.2.4.1 --- snort/doc/signatures/2647.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2647.txt Sat May 14 02:22:38 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck631.html - --- Index: snort/doc/signatures/2648.txt diff -u snort/doc/signatures/2648.txt:1.1.1.2 snort/doc/signatures/2648.txt:1.1.1.2.4.1 --- snort/doc/signatures/2648.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2648.txt Sat May 14 02:22:38 2005 @@ -69,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck631.html - --- Index: snort/doc/signatures/2649.txt diff -u snort/doc/signatures/2649.txt:1.1.1.2 snort/doc/signatures/2649.txt:1.1.1.2.4.1 --- snort/doc/signatures/2649.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2649.txt Sat May 14 02:22:38 2005 @@ -64,5 +64,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck52.html - --- Index: snort/doc/signatures/2650.txt diff -u snort/doc/signatures/2650.txt:1.1.1.2 snort/doc/signatures/2650.txt:1.1.1.2.4.1 --- snort/doc/signatures/2650.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2650.txt Sat May 14 02:22:38 2005 @@ -65,5 +65,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck62.html - --- Index: snort/doc/signatures/2651.txt diff -u snort/doc/signatures/2651.txt:1.1.1.2 snort/doc/signatures/2651.txt:1.1.1.2.4.1 --- snort/doc/signatures/2651.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2651.txt Sat May 14 02:22:38 2005 @@ -74,5 +74,3 @@ Other: http://www.nextgenss.com/advisories/ora_numtodsinterval.txt http://www.nextgenss.com/advisories/ora_numtoyminterval.txt - --- Index: snort/doc/signatures/2652.txt diff -u snort/doc/signatures/2652.txt:1.1.1.2 snort/doc/signatures/2652.txt:1.1.1.2.4.1 --- snort/doc/signatures/2652.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2652.txt Sat May 14 02:22:38 2005 @@ -48,8 +48,7 @@ False Positives: None known. --- -False Negatives: +--False Negatives: None known. -- @@ -70,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck632.html - --- Index: snort/doc/signatures/2653.txt diff -u snort/doc/signatures/2653.txt:1.1.1.2 snort/doc/signatures/2653.txt:1.1.1.2.4.1 --- snort/doc/signatures/2653.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2653.txt Sat May 14 02:22:38 2005 @@ -48,8 +48,7 @@ False Positives: None known. --- -False Negatives: +--False Negatives: None known. -- @@ -70,5 +69,3 @@ Other: http://www.appsecinc.com/Policy/PolicyCheck632.html - --- Index: snort/doc/signatures/2654.txt diff -u snort/doc/signatures/2654.txt:1.1.1.2 snort/doc/signatures/2654.txt:1.1.1.2.4.1 --- snort/doc/signatures/2654.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2654.txt Sat May 14 02:22:38 2005 @@ -62,4 +62,5 @@ -- Additional References: --- +Bugtraq: +http://www.securityfocus.com/bid/7193 Index: snort/doc/signatures/2655.txt diff -u snort/doc/signatures/2655.txt:1.1.1.2 snort/doc/signatures/2655.txt:1.1.1.2.4.1 --- snort/doc/signatures/2655.txt:1.1.1.2 Sun Apr 24 22:09:05 2005 +++ snort/doc/signatures/2655.txt Sat May 14 02:22:38 2005 @@ -66,5 +66,3 @@ Hewlett-Packard: http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=PSD_HPSBPI01026 - --- Index: snort/doc/signatures/3006.txt diff -u snort/doc/signatures/3006.txt:1.1.1.2 snort/doc/signatures/3006.txt:1.1.1.2.2.1 --- snort/doc/signatures/3006.txt:1.1.1.2 Sun Apr 24 23:52:18 2005 +++ snort/doc/signatures/3006.txt Fri Jun 10 19:11:20 2005 @@ -53,7 +53,7 @@ -- Contributors: Sourcefire Vulnerability Research Team -Matt Watchinski +Brian Caswell Nigel Houghton -- Index: snort/doc/signatures/3011.txt diff -u snort/doc/signatures/3011.txt:1.1.1.2 snort/doc/signatures/3011.txt:1.1.1.2.2.1 --- snort/doc/signatures/3011.txt:1.1.1.2 Sun Apr 24 23:52:18 2005 +++ snort/doc/signatures/3011.txt Fri Jun 10 19:11:21 2005 @@ -11,40 +11,35 @@ -- Impact: If successful, the attacker would gain unauthorized access to the system, -to upload and execute file on the target system. The attacker can use -this function to upload additional backdoors to the victim's system and -execute them. + to upload and execute file on the target system. The attacker can use this function to upload additional backdoors to the victim's system and execute them. -- Detailed Information: -When executed, RUX the Tick opens up its assigned port (default is -22222) for communication with the attacker. RUX the Tick has three -functions: Get Windows Directory, Get System Directory, and Upload And -Execute File. Get Windows Directory and Get System Directory are used -for reconnaissance. Upload And Execute File is mainly used to upload and -run other backdoors onto the victim's computer. +When executed, RUX the Tick opens up its assigned port (default is 22222) for communication with the attacker. +RUX the Tick has three functions: Get Windows Directory, Get System Directory, and Upload And Execute File. +Get Windows Directory and Get System Directory are used for reconnaissance. Upload And Execute File is mainly used to +upload and run other backdoors onto the victim's computer. -- Affected Systems: - Windows 95/98/ME/NT/2000 +Windows 95/98/ME/NT/2000 -- + Attack Scenarios: -The victim must first install the server. Be wary of suspicious files -because they often can be backdoors in disguise. Once the victim -mistakenly installs the server program, the attacker usually will employ -an IP scanner program to find the IP addresses of victims that have -installed the program. Then the attacker enters the IP address, port -number (which is assigned to the server program by the attacker: -default is 22222), and presses the connect button and he has access to -the computer. +The victim must first install the server. Be wary of suspicious files because they often can be backdoors in disguise. +Once the victim mistakenly installs the server program, the attacker usually will employ an IP scanner program +to find the IP addresses of victims that have installed the program. Then the attacker enters the IP address, port number (which +is assigned to the server program by the attacker: default is 22222), and presses the connect button and he has access to your computer. -- Ease of Attack: -Simple. +Easy. Simply a matter of pressing the connect button once the victim has installed the server. + -- + False Positives: None known @@ -53,21 +48,22 @@ None known -- + Corrective Action: Using Windows Task Manager, kill these processes: ruxserver.exe and server.exe. Use Windows Explorer to find ruxserver.exe and delete the file. -Keep anti-virus programs updated with the latest definitions. +Keep your anti-virus programs updated with the latest definitions. + -- Contributors: +Original Rule Writer: Ricky Macatee Sourcefire Research Team -Ricky Macatee -- Additional References: - -PestPatrol: http://www.pestpatrol.com/PestInfo/R/RUX.ASP + -- Index: snort/doc/signatures/3012.txt diff -u snort/doc/signatures/3012.txt:1.1.1.2 snort/doc/signatures/3012.txt:1.1.1.2.2.1 --- snort/doc/signatures/3012.txt:1.1.1.2 Sun Apr 24 23:52:18 2005 +++ snort/doc/signatures/3012.txt Fri Jun 10 19:11:21 2005 @@ -5,48 +5,41 @@ 3012 -- Summary: -This event is generated when an attacker attempts to remotely upload and -execute a file with the RUX the Tick trojan. +This event is generated when an attacker attempts to remotely upload and execute a file with the RUX the Tick trojan. -- + Impact: -If successful, the attacker would gain unauthorized access to an -affected system, enabling him to upload and execute file on the machine. -The attacker can use this function to upload additional backdoors to the -victim's sytem and execute them. +If successful, the attacker would gain unauthorized access to your system, enabling him to upload and execute file on your +computer. The attacker can use this function to upload additional backdoors to the victim's sytem and execute them. -- Detailed Information: -When executed, RUX the Tick opens up its assigned port (default is -22222) for communication with the attacker. RUX the Tick has three -functions: Get Windows Directory, Get System Directory, and Upload And -Execute File. - -Get Windows Directory and Get System Directory are used for -reconnaissance. Upload And Execute File is mainly used to upload and run -other backdoors onto the victim's computer. +When executed, RUX the Tick opens up its assigned port (default is 22222) for communication with the attacker. +RUX the Tick has three functions: Get Windows Directory, Get System Directory, and Upload And Execute File. +Get Windows Directory and Get System Directory are used for reconnaissance. Upload And Execute File is mainly used to +upload and run other backdoors onto the victim's computer. -- Affected Systems: - Windows 95/98/ME/NT/2000 +Windows 95/98/ME/NT/2000 -- + Attack Scenarios: -The victim must first install the server. Be wary of suspicious files -because they often can be backdoors in disguise. Once the victim -mistakenly installs the server program, the attacker usually will employ -an IP scanner program to find the IP addresses of victims that have -installed the program. Then the attacker enters the IP address, port -number (which is assigned to the server program by the attacker: -default is 22222), and presses the connect button and he has access to -the computer. +The victim must first install the server. Be wary of suspicious files because they often can be backdoors in disguise. +Once the victim mistakenly installs the server program, the attacker usually will employ an IP scanner program +to find the IP addresses of victims that have installed the program. Then the attacker enters the IP address, port number (which +is assigned to the server program by the attacker: default is 22222), and presses the connect button and he has access to your computer. -- + Ease of Attack: -Simple. +Easy. Simply a matter of pressing the connect button once the victim has installed the server. -- + False Positives: None known @@ -57,23 +50,20 @@ -- Corrective Action: -Using Windows Task Manager, kill these processes: ruxserver.exe and server.exe +Using Windows Task Manager, kill these processes: ruxserver.exe and server.exe. Use Windows Explorer to find ruxserver.exe and delete the file. -This program may hide itself in the process list and can use different -names and can exist in many locations on an infected machine. +Keep your anti-virus programs updated with the latest definitions. -Keep anti-virus programs updated with the latest definitions. -- Contributors: +Original Rule Writer: Ricky Macatee Sourcefire Research Team -Ricky Macatee -- Additional References: - -PestPatrol: http://www.pestpatrol.com/PestInfo/R/RUX.ASP + -- Index: snort/doc/signatures/3013.txt diff -u snort/doc/signatures/3013.txt:1.1.1.2 snort/doc/signatures/3013.txt:1.1.1.2.2.1 --- snort/doc/signatures/3013.txt:1.1.1.2 Sun Apr 24 23:52:18 2005 +++ snort/doc/signatures/3013.txt Fri Jun 10 19:11:21 2005 @@ -5,20 +5,18 @@ 3013 -- Summary: -This event is generated when an attacker attempts to connect to the -victim using the Asylum 0.1 trojan. +This event is generated when the attacker attempts to connect to the victim using the Asylum 0.1 trojan. -- + Impact: -If successful, the attacker would gain unauthorized access to the -system, enabling him to upload and execute files on the computer and -reboot it at will, resulting in a full compromise of the victim's computer. +If successful, the attacker would gain unauthorized access to your system, enabling him to upload and execute files on your +computer and reboot it at will, resulting in a full compromise of the victim's computer. -- Detailed Information: -When executed, Asylum 0.1 opens up its assigned port (default is 23432) -for communication with the attacker. Asylum 0.1 has four functions: -Upload File, Open File, Reboot Computer, and Remove Server. +When executed, Asylum 0.1 opens up its assigned port (default is 23432) for communication with the attacker. +Asylum 0.1 has four functions: Upload File, Open File, Reboot Computer, and Remove Server. Upload File: Look for traffic on port 23432 containing UPL followed by a file location. Open File: Look for traffic on port 23432 containing RUN followed by a file location. @@ -30,21 +28,21 @@ Windows 95/98/ME/NT/2000 -- + Attack Scenarios: -The victim must first install the server. Be wary of suspicious files -because they often can be backdoors in disguise. Once the victim -mistakenly installs the server program, the attacker usually will employ -an IP scanner program to find the IP addresses of victims that have -installed the program. Then the attacker enters the IP address, port -number (which is assigned to the server program by the attacker: -default is 23432), and presses the connect button and he has access to -the computer. +The victim must first install the server. Be wary of suspicious files because they often can be backdoors in disguise. +Once the victim mistakenly installs the server program, the attacker usually will employ an IP scanner program +to find the IP addresses of victims that have installed the program. Then the attacker enters the IP address, port number (which +is assigned to the server program by the attacker: default is 23432), and presses the connect button and he has access to your computer. -- + Ease of Attack: -Simple. +Easy. Simply a matter of pressing the connect button once the victim has installed the server. + -- + False Positives: None known @@ -53,8 +51,8 @@ None known -- -Corrective Action: +Corrective Action: Delete the System Administration key (if found) in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run or HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices or @@ -66,20 +64,17 @@ Find and delete the Asylum 0.1 trojan server file, usually called wincmp32.exe. -Keep anti-virus programs updated with the latest definitions. +Keep your anti-virus programs updated with the latest definitions. -- Contributors: +Original Rule Writer: Ricky Macatee Sourcefire Research Team -Ricky Macatee -- Additional References: - -PestPatrol: http://www.pestpatrol.com/PestInfo/A/Asylum.asp - -Dark-E: http://www.dark-e.com/archive/trojans/asylum/01/index.shtml + -- Index: snort/doc/signatures/3014.txt diff -u snort/doc/signatures/3014.txt:1.1.1.2 snort/doc/signatures/3014.txt:1.1.1.2.2.1 --- snort/doc/signatures/3014.txt:1.1.1.2 Sun Apr 24 23:52:18 2005 +++ snort/doc/signatures/3014.txt Fri Jun 10 19:11:21 2005 @@ -3,13 +3,12 @@ -- Sid: 3014 - -- Summary: -This event is generated when a victim host attempts to send a connection -confirmation to an attacker using the Asylum 0.1 trojan. +This event is generated when the victim attempts to send a connection confirmation to the attacker using the Asylum 0.1 trojan. -- + Impact: If successful, the attacker would gain unauthorized access to your system, enabling him to upload and execute files on your computer and reboot it at will, resulting in a full compromise of the victim's computer. Index: snort/doc/signatures/3017.txt diff -u snort/doc/signatures/3017.txt:1.1.1.2 snort/doc/signatures/3017.txt:1.1.1.2.2.1 --- snort/doc/signatures/3017.txt:1.1.1.2 Sun Apr 24 23:52:18 2005 +++ snort/doc/signatures/3017.txt Fri Jun 10 19:11:21 2005 @@ -10,23 +10,13 @@ -- Impact: -Client-supplied data is written to client-specified locations in memory, -allowing for arbitrary code execution. Since WINS servers run with -administrative privileges, this allows an attacker to gain -administrative access remotely without any prior authentication. +Client-supplied data is written to client-specified locations in memory, allowing for arbitrary code execution. Since WINS servers run with administrative privileges, this allows an attacker to gain administrative access remotely without any prior authentication. -- Detailed Information: -Vulnerable WINS servers write client-supplied data to a client-supplied -memory address. This allows clients to supply arbitrary code for -execution with administrative privileges. This attack does not require authentication. - -In order to reduce false positives, the rule looks for requests that are -greater than 204 bytes. As the maximum length of a hostname is 192 -bytes, and a standard request has 12 bytes of headers, no standard -request should exceed this length. Additionally, this rule checks to see -if particular flags that are required to exploit this vulnerability are -set in the client request. +Vulnerable WINS servers write client-supplied data to a client-supplied memory address. This allows clients to supply arbitrary code for execution with administrative privileges. This attack does not require authentication. + +In order to reduce false positives, the rule looks for requests that are greater than 204 bytes. As the maximum length of a hostname is 192 bytes, and a standard request has 12 bytes of headers, no standard request should exceed this length. Additionally, this rule checks to see if particular flags that are required to exploit this vulnerability are set in the client request. -- Affected Systems: @@ -34,9 +24,7 @@ -- Attack Scenarios: -Since WINS clients are programmed to not exceed the maximum length for a -request, an attacker would need to use a script which generated -malformed WINS requests. +Since WINS clients are programmed to not exceed the maximum length for a request, an attacker would need to use a script which generated malformed WINS requests. -- Ease of Attack: @@ -44,8 +32,7 @@ -- False Positives: -This rule will generate false positives when replication occurs. -Additionally, there may be unknown scenarios which generate false positives. +This rule will generate false positives when replication occurs. Additionally, there may be unknown scenarios which generate false positives. -- False Negatives: Index: snort/etc/snort.conf diff -u snort/etc/snort.conf:1.1.1.9 snort/etc/snort.conf:1.5.2.7 --- snort/etc/snort.conf:1.1.1.9 Mon Apr 25 03:25:02 2005 +++ snort/etc/snort.conf Mon Jun 13 00:18:32 2005 @@ -46,6 +46,34 @@ # Set up the external network addresses as well. A good start may be "any" var EXTERNAL_NET any +# Configure your wireless AP lists. This allows snort to look for attacks +# against your wireless network, such as rogue access points or adhoc wireless +# networks. Also specify what channels your access points are setup on. +# +# Ex: +# +# var ACCESS_POINTS XX:XX:XX:XX:XX:XX +# var CHANNELS X +# OR +# +# var ACCESS_POINTS [XX:XX:XX:XX:XX:XX, YY:YY:YY:YY:YY:YY, ....] +# var CHANNELS [X, Y, ....] + var ACCESS_POINTS FF:FF:FF:FF:FF:FF + var CHANNELS 11 + +# Configure masked MAC addresses. This disabled any MAC spoofing wireless +# detection for concerned MAC addresses in order to avoid too much false positive +# alert. +# +# Ex: +# +# var MACSPOOF_MASKED_ADDR none +# OR +# var MACSPOOF_MASKED_ADDR XX:XX:XX:XX:XX:XX +# OR +# var MACSPOOF_MASKED_ADDR [XX:XX:XX:XX:XX:XX,YY:YY:YY:YY:YY:YY,....] + var MACSPOOF_MASKED_ADDR none + # Configure your server lists. This allows snort to only look for attacks to # systems that have a service up. Why look for HTTP attacks if you are not # running a web server? This allows quick filtering based on IP addresses @@ -478,6 +506,7 @@ #preprocessor arpspoof #preprocessor arpspoof_detect_host: 192.168.40.1 f0:0f:00:f0:0f:00 + # Performance Statistics # ---------------------- # Documentation for this is provided in the Snort Manual. You should read it. @@ -501,7 +530,90 @@ preprocessor xlink2state: ports { 25 691 } -#################################################################### +# RogueAP +#--------------------------------------------- +# Require --enable-wireless configure option +# RogueAP detects rogue APs and AdHoc networks +# +# Arguments: +# +# scan_flag [0 | 1] => toggles scanning of multiple channels *NOT IMPLEMENTED* +# scan_timeout [num] => time in seconds between channel scans *NOT IMPLEMENTED* +# expire_timeout [num] => time in seconds before a BSSID is removed from the rogue list +# + +#preprocessor rogue_ap: $ACCESS_POINTS, $CHANNELS, scan_flag 1, scan_timeout 1800, expire_timeout 3600 + +# AntiStumbler +#--------------------------------------------- +# Require --enable-wireless configure option +# AntiStumbler detects possible Netstumbler activity +# +# Arguments: +# +# probe_reqs [num] => number of probe requests that triggers an alert +# probe_period [num] => time period in seconds that NULL SSID probe requests are counted +# expire_timeout [num] => time in seconds before a STA is removed from the stumbler list +# + +#preprocessor antistumbler: probe_reqs 90, probe_period 30, expire_timeout 3600 + +# DeauthFlood +#--------------------------------------------- +# Require --enable-wireless configure option +# DeauthFlood detects wireless station flooded with deauth frames. +# +# Arguments: +# +# deauth_threshold [num] => number of deauth frames during time delta it takes +# to trigger an alert +# expire_timeout [num] => time period used to keep count of deauth frames +# target_limit [num] => maximum number of station inserted inside deauthstation +# mempool +# prune_period [num] => number of seconds to wait for removing some decayed +# deauthstations from mempool +# + +#preprocessor deauth_flood: deauth_threshold 20, expire_timeout 60, target_limit 100, prune_period 30 + +# AuthFlood +#--------------------------------------------- +# Require --enable-wireless configure option +# AuthFlood detects wireless access point flooded with auth frames. +# +# Arguments: +# +# auth_threshold [num] => number of auth frames during time delta it takes +# to trigger an alert +# expire_timeout [num] => time period used to keep count of auth frames +# target_limit [num] => maximum number of access point inserted inside authAP mempool +# prune_period [num] => number of seconds to wait for removing some decayed +# flooded AP from mempool +# + +#preprocessor auth_flood: auth_threshold 100, expire_timeout 60, target_limit 10, prune_period 30 + +# MacSpoof +#--------------------------------------------- +# Require --enable-wireless configure option +# MacSpoof detects wireless MAC addresses involved in some MAC spoofed traffic. +# +# Arguments: +# +# MACSPOOF_MASKED_ADDR => list of MAC addresses excluded from wireless MAC spoofing +# [var detection process +# tolerate_gap [num] => tolerate missing frames between two consecutives frames issued +# from same MAC address +# threshold [num] => number of abnormal sequence number gaps during time delta to +# trigger an alert +# expire_timeout [num} => time period used to keep count of abnormal seq number gap +# spoofed_target_limit => maximum number of MAC addresses inserted inside MAC spoofed +# [num] addresses mempool +# prune_period [num] => number of seconds to wait for looking after some decayed +# MAC addresses inside mempool + +#preprocessor macspoof: $MACSPOOF_MASKED_ADDR, tolerate_gap 5, threshold 10, expire_timeout 120, spoofed_addr_limit 100, prune_period 30 + # Step #3: Configure output plugins # # Uncomment and configure the output plugins you decide to use. General @@ -705,6 +817,7 @@ # include $RULE_PATH/multimedia.rules # include $RULE_PATH/p2p.rules include $RULE_PATH/experimental.rules +#include $RULE_PATH/wifi.rules # Include any thresholding or suppression commands. See threshold.conf in the # /etc directory for details. Commands don't necessarily need to be Index: snort/rpm/snort.org.spec diff -u snort/rpm/snort.org.spec:1.1.1.4 snort/rpm/snort.org.spec:1.1.1.4.2.1 --- snort/rpm/snort.org.spec:1.1.1.4 Mon Apr 25 03:25:06 2005 +++ snort/rpm/snort.org.spec Fri Jun 10 19:11:29 2005 @@ -1,4 +1,4 @@ -# $Id: snort.org.spec,v 1.1.2.8 2005/04/22 19:03:56 jhewlett Exp $ +# $Id: snort.org.spec,v 1.1.2.5 2005/01/13 20:36:20 jhewlett Exp $ # Snort.org's SPEC file for Snort ################################################################ @@ -82,7 +82,7 @@ Summary: An open source Network Intrusion Detection System (NIDS) Name: snort -Version: 2.3.3 +Version: 2.3.0 Release: %{release} Epoch: 0 License: GPL Index: snort/rules/Makefile.am diff -u snort/rules/Makefile.am:1.1.1.3 snort/rules/Makefile.am:1.3.2.2 --- snort/rules/Makefile.am:1.1.1.3 Thu Mar 10 13:13:45 2005 +++ snort/rules/Makefile.am Wed May 4 23:13:26 2005 @@ -9,4 +9,5 @@ porn.rules rpc.rules rservices.rules scan.rules shellcode.rules smtp.rules \ snmp.rules sql.rules telnet.rules tftp.rules virus.rules web-attacks.rules \ web-cgi.rules web-client.rules web-coldfusion.rules web-frontpage.rules \ -web-iis.rules web-misc.rules web-php.rules x11.rules pop2.rules +web-iis.rules web-misc.rules web-php.rules x11.rules pop2.rules \ +wifi.rules Index: snort/rules/wifi.rules diff -u /dev/null snort/rules/wifi.rules:1.7 --- /dev/null Mon Jun 13 11:23:03 2005 +++ snort/rules/wifi.rules Fri Mar 11 10:54:28 2005 @@ -0,0 +1,74 @@ +# these are just for testing right now + +# *NOTE* MAC addresses can be substituted for "any" + + +# Frame types +# ! may proceed any type argument to perform a logical NOT operation + +alert wifi any -> any (msg:"Mangement Frame"; type:TYPE_MANAGEMENT;) +alert wifi any -> any (msg:"Control Frame"; type:TYPE_CONTROL;) +alert wifi any -> any (msg:"Data Frame"; type:TYPE_DATA;) + + +# Frame subtypes (These implicitly check the frame's type) +# ! may proceed any stype argument to perform a logical NOT operation + +#alert wifi any -> any (msg:"Association Request"; stype:STYPE_ASSOCREQ;) +#alert wifi any -> any (msg:"Association Response"; stype:STYPE_ASSOCRESP;) +#alert wifi any -> any (msg:"Reassociation Request"; stype:STYPE_REASSOC_REQ;) +#alert wifi any -> any (msg:"Reassociation Response"; stype:STYPE_REASSOC_RESP;) +#alert wifi any -> any (msg:"Probe Request"; stype:STYPE_PROBEREQ;) +#alert wifi any -> any (msg:"Probe Response"; stype:STYPE_PROBERESP;) +#alert wifi any -> any (msg:"Beacon"; stype:STYPE_BEACON;) +#alert wifi any -> any (msg:"ATIM"; stype:STYPE_ATIM;) +#alert wifi any -> any (msg:"Disassociation"; stype:STYPE_DISASSOC;) +#alert wifi any -> any (msg:"Authentication"; stype:STYPE_AUTH;) +#alert wifi any -> any (msg:"Deauthentication"; stype:STYPE_DEAUTH;) + +#alert wifi any -> any (msg:"Power-Save Poll"; stype:STYPE_PSPOLL;) +#alert wifi any -> any (msg:"RTS"; stype:STYPE_RTS;) +#alert wifi any -> any (msg:"CTS"; stype:STYPE_CTS;) +#alert wifi any -> any (msg:"Ack"; stype:STYPE_ACK;) +#alert wifi any -> any (msg:"CF-End"; stype:STYPE_CFEND;) +#alert wifi any -> any (msg:"CF-End+CF-Ack"; stype:STYPE_CFEND_CFACK;) + +#alert wifi any -> any (msg:"Data"; stype:STYPE_DATA;) +#alert wifi any -> any (msg:"CF-Ack"; stype:STYPE_CFACK;) +#alert wifi any -> any (msg:"CF-Poll"; stype:STYPE_CFPOLL;) +#alert wifi any -> any (msg:"CF-Ack+CF-Poll"; stype:STYPE_CFACK_CFPOLL;) +#alert wifi any -> any (msg:"NULL Function"; stype:STYPE_NULLFUNC;) +#alert wifi any -> any (msg:"CF-Ack+NULL Function"; stype:STYPE_CFACK_NULLFUNC;) +#alert wifi any -> any (msg:"CF-Poll+NULL Function"; stype:STYPE_CFPOLL_NULLFUNC;) +#alert wifi any -> any (msg:"CF-Ack+CF-Poll-NULL Function"; stype:STYPE_CFACK_CFPOLL_NULLFUNC;) + +# Check for a match of the entire frame control field against a hex or decimal value +# ! may proceed the argument to perform a logical NOT operation +#alert wifi any -> any (msg:"WEP encrypted Data frame with from_ds set"; frame_control:0x4208;) +#alert wifi any -> any (msg:"WEP encrypted Data frame with from_ds set"; frame_control:16904;) + + +# Frame control flags +# ON, OFF, TRUE, or FALSE may be used. '!' may proceed any of these. + +#alert wifi any -> any (msg:"from_ds flag set"; from_ds:TRUE;) +#alert wifi any -> any (msg:"to_ds flag set"; to_ds:ON;) +#alert wifi any -> any (msg:"more_frags flag set"; more_frags:!FALSE;) +#alert wifi any -> any (msg:"retry flag set"; retry:!OFF;) +#alert wifi any -> any (msg:"pwr_mgmt flag not set"; pwr_mgmt:FALSE;) +#alert wifi any -> any (msg:"more_data flag not set"; more_data:OFF;) +#alert wifi any -> any (msg:"wep flag set"; wep:TRUE;) +#alert wifi any -> any (msg:"order flag set"; order:TRUE;) + + +# These plugins will detect on frames that contain the respective field +# '!' may proceed any of these plugin arguments to perform a logical NOT operation + +#alert wifi any -> any (msg:"Duration/ID is 0xFF"; duration_id:0xFF;) +#alert wifi any -> any (msg:"BSSID is not 00\:DE\:AD\:C0\:DE\:00"; bssid:!0x00DEADC0DE00;) +#alert wifi any -> any (msg:"Sequence Number is 2345"; seq_num:2345;) +#alert wifi any -> any (msg:"Sequence Number is 0xFF"; seq_num:0x00FF;) +#alert wifi any -> any (msg:"Fragment Number is 12"; frag_num:12;) +#alert wifi any -> any (msg:"Fragment Number is 15"; frag_num:0xF;) +#alert wifi any -> any (msg:"Address 4 Field is D1\:ED\:1E\:D1\:ED\:1E"; addr4:0xD1ED1ED1ED1E;) +#alert wifi any -> any (msg:"SSID is linksys"; ssid:linksys;) Index: snort/src/Makefile.am diff -u snort/src/Makefile.am:1.1.1.9 snort/src/Makefile.am:1.1.1.6.2.4 --- snort/src/Makefile.am:1.1.1.9 Sun Apr 24 22:11:05 2005 +++ snort/src/Makefile.am Fri Jun 10 19:11:30 2005 @@ -45,7 +45,8 @@ smalloc.h \ snort_packet_header.h \ event_queue.c event_queue.h \ -inline.c inline.h +inline.c inline.h \ +wifi_statetable.c wifi_statetable.h snort_LDADD = output-plugins/libspo.a \ detection-plugins/libspd.a \ Index: snort/src/debug.h diff -u snort/src/debug.h:1.1.1.3 snort/src/debug.h:1.1.1.2.2.2 --- snort/src/debug.h:1.1.1.3 Sun Apr 24 00:24:52 2005 +++ snort/src/debug.h Sat May 14 02:22:40 2005 @@ -49,6 +49,12 @@ #define DEBUG_HTTPINSPECT 0x00400000 /* 4194304 */ #define DEBUG_STREAM_STATE 0x00800000 /* 8388608 */ #define DEBUG_ASN1 0x01000000 /* 16777216 */ +#ifdef WIRELESS +#define DEBUG_WIFI_STATETABLE 0x00800000 /* 8388608 */ +#define DEBUG_DEAUTHFLOOD 0x01000000 /* 16777216 */ +#define DEBUG_AUTHFLOOD 0x02000000 /* 23554432 */ +#define DEBUG_MACSPOOF 0x04000000 /* 67108864 */ +#endif /* WIRELESS */ #ifdef DEBUG Index: snort/src/decode.c diff -u snort/src/decode.c:1.1.1.8 snort/src/decode.c:1.8.2.5 --- snort/src/decode.c:1.1.1.8 Sun Apr 24 22:10:55 2005 +++ snort/src/decode.c Fri Jun 10 19:11:30 2005 @@ -148,6 +148,285 @@ } +#ifdef WIRELESS +/* + * Function: DecodeWifiHdr(Packet *, char *, struct pcap_pkthdr *, u_int8_t *) + * + * Purpose: Decodes unencapsulated portion of 802.11 frame headers + * + * Arguments: p => pointer to the decoded packet struct + * user => Utility pointer (unused) + * pkthdr => ptr to the packet header + * pkt => pointer to the real live packet data + * + * Returns: void function + */ +void DecodeWifiHdr(Packet *p, struct pcap_pkthdr * pkthdr, u_int8_t *pkt){ + +#warning "Update DecodeWifiHdr()" + + Event event; + u_int32_t pkt_len; /* suprisingly, the length of the packet */ + u_int32_t cap_len; /* caplen value */ + + /* set the lengths we need */ + pkt_len = pkthdr->len; /* total packet length */ + cap_len = pkthdr->caplen; /* captured packet length */ + + if(snaplen < pkthdr->len) + pkt_len = cap_len; + + /* lay the wireless structure over the packet data */ + p->wifih = (WifiHdr *) pkt; + + DEBUG_WRAP(DebugMessage(DEBUG_DECODE, "%X %X\n", *p->wifih->addr1, + *p->wifih->addr2);); + + /* determine frame type */ + switch(p->wifih->frame_control & 0x00ff) + { + /* management frames */ + case WLAN_TYPE_MGMT_ASREQ: + case WLAN_TYPE_MGMT_ASRES: + case WLAN_TYPE_MGMT_REREQ: + case WLAN_TYPE_MGMT_RERES: + case WLAN_TYPE_MGMT_PRREQ: + case WLAN_TYPE_MGMT_PRRES: + case WLAN_TYPE_MGMT_BEACON: + case WLAN_TYPE_MGMT_ATIM: + case WLAN_TYPE_MGMT_DIS: + case WLAN_TYPE_MGMT_AUTH: + case WLAN_TYPE_MGMT_DEAUTH: + pc.wifi_mgmt++; + break; + + /* Control frames */ + case WLAN_TYPE_CONT_PS: + case WLAN_TYPE_CONT_RTS: + case WLAN_TYPE_CONT_CTS: + case WLAN_TYPE_CONT_ACK: + case WLAN_TYPE_CONT_CFE: + case WLAN_TYPE_CONT_CFACK: + pc.wifi_control++; + break; + /* Data packets without data */ + case WLAN_TYPE_DATA_NULL: + case WLAN_TYPE_DATA_CFACK: + case WLAN_TYPE_DATA_CFPL: + case WLAN_TYPE_DATA_ACKPL: + + pc.wifi_data++; + break; + case WLAN_TYPE_DATA_DTCFACK: + case WLAN_TYPE_DATA_DTCFPL: + case WLAN_TYPE_DATA_DTACKPL: + case WLAN_TYPE_DATA_DATA: + pc.wifi_data++; + + if(cap_len < IEEE802_11_DATA_HDR_LEN + sizeof(EthLlc)) + { + if(pv.verbose_flag) + { + ErrorMessage("Not enough data for EthLlc header\n"); + } + + if((runMode == MODE_IDS) && pv.decoder_flags.decode_alerts) + { + SetEvent(&event, GENERATOR_SNORT_DECODE, + DECODE_BAD_80211_ETHLLC, 1, DECODE_CLASS, 5, 0); + CallAlertFuncs(p, DECODE_BAD_80211_ETHLLC_STR, NULL, &event); + CallLogFuncs(p, DECODE_BAD_80211_ETHLLC_STR, NULL, &event); + } + + return; + } + + p->ehllc = (EthLlc *) (pkt + IEEE802_11_DATA_HDR_LEN); + +#ifdef DEBUG + PrintNetData(stdout,(u_int8_t *) p->ehllc, sizeof(EthLlc)); + ClearDumpBuf(); + + printf("LLC Header:\n"); + printf(" DSAP: 0x%X\n", p->ehllc->dsap); + printf(" SSAP: 0x%X\n", p->ehllc->ssap); +#endif + + if(p->ehllc->dsap == ETH_DSAP_IP && p->ehllc->ssap == ETH_SSAP_IP) + { + if(cap_len < IEEE802_11_DATA_HDR_LEN + + sizeof(EthLlc) + sizeof(EthLlcOther)) + { + if(pv.verbose_flag) + { + ErrorMessage("Not enough data for EthLlcOther header\n"); + } + + if((runMode == MODE_IDS) && pv.decoder_flags.decode_alerts) + { + SetEvent(&event, GENERATOR_SNORT_DECODE, + DECODE_BAD_80211_ETHLLC, 1, DECODE_CLASS, 5, 0); + CallAlertFuncs(p, DECODE_BAD_80211_ETHLLC_STR, NULL, &event); + CallLogFuncs(p, DECODE_BAD_80211_ETHLLC_STR, NULL, &event); + } + + return; + } + + p->ehllcother = (EthLlcOther *) (pkt + IEEE802_11_DATA_HDR_LEN + sizeof(EthLlc)); +#ifdef DEBUG + PrintNetData(stdout,(u_int8_t *) p->ehllcother, sizeof(EthLlcOther)); + ClearDumpBuf(); + printf("LLC Other Header:\n"); + printf(" CTRL: 0x%X\n", p->ehllcother->ctrl); + printf(" ORG: 0x%02X%02X%02X\n", p->ehllcother->org_code[0], + p->ehllcother->org_code[1], p->ehllcother->org_code[2]); + printf(" PROTO: 0x%04X\n", ntohs(p->ehllcother->proto_id)); +#endif + + switch(ntohs(p->ehllcother->proto_id)) + { + case ETHERNET_TYPE_IP: + DecodeIP(p->pkt + IEEE802_11_DATA_HDR_LEN + sizeof(EthLlc) + + sizeof(EthLlcOther), + pkt_len - IEEE802_11_DATA_HDR_LEN - sizeof(EthLlc) - + sizeof(EthLlcOther), p); + return; + + case ETHERNET_TYPE_ARP: + case ETHERNET_TYPE_REVARP: + DecodeARP(p->pkt + IEEE802_11_DATA_HDR_LEN + sizeof(EthLlc) + + sizeof(EthLlcOther), + pkt_len - IEEE802_11_DATA_HDR_LEN - sizeof(EthLlc) - + sizeof(EthLlcOther), p); + return; + case ETHERNET_TYPE_EAPOL: + DecodeEapol(p->pkt + IEEE802_11_DATA_HDR_LEN + sizeof(EthLlc) + + sizeof(EthLlcOther), + pkt_len - IEEE802_11_DATA_HDR_LEN - sizeof(EthLlc) - + sizeof(EthLlcOther), p); + return; + case ETHERNET_TYPE_8021Q: + DecodeVlan(p->pkt + IEEE802_11_DATA_HDR_LEN , + cap_len - IEEE802_11_DATA_HDR_LEN , p); + return; + + default: + pc.other++; + return; + } + } + break; + default: + pc.other++; + break; + } + + return; +} + + +/* + * Function: DecodeIEEE80211Pkt(Packet *, char *, struct pcap_pkthdr*, + * u_int8_t*) + * + * Purpose: Decode those fun loving (unencapsulated) wireless LAN packets, one at a time! + * + * Arguments: p => pointer to the decoded packet struct + * user => Utility pointer (unused) + * pkthdr => ptr to the packet header + * pkt => pointer to the real live packet data + * + * Returns: void function + */ +void DecodeIEEE80211Pkt(Packet * p, struct pcap_pkthdr * pkthdr, + u_int8_t * pkt) +{ + u_int32_t pkt_len; /* suprisingly, the length of the packet */ + u_int32_t cap_len; /* caplen value */ + + bzero((char *) p, sizeof(Packet)); + + p->pkth = pkthdr; + p->pkt = pkt; + + /* set the lengths we need */ + pkt_len = pkthdr->len; /* total packet length */ + cap_len = pkthdr->caplen; /* captured packet length */ + + if(snaplen < pkt_len) + pkt_len = cap_len; + + DEBUG_WRAP(DebugMessage(DEBUG_DECODE, "Packet!\n");); + DEBUG_WRAP(DebugMessage(DEBUG_DECODE, "caplen: %lu pktlen: %lu\n", + (unsigned long)cap_len, (unsigned long)pkt_len);); + + /* do a little validation */ + if(p->pkth->caplen < MINIMAL_IEEE80211_HEADER_LEN) + { + if(pv.verbose_flag) + { + ErrorMessage("Captured data length < IEEE 802.11 header length! (%d bytes)\n", p->pkth->caplen); + } + return; + } + + /* decode the actual 802.11 frame */ + DecodeWifiHdr(p, pkthdr, pkt); +} + + +/* + * Function: DecodePrismHdr(Packet *, char *, struct pcap_pkthdr *, u_int8_t *) + * + * Purpose: Decode PRISM header encapsulated 802.11 frames. + * + * Arguments: p => pointer to the decoded packet struct + * user => Utility pointer (unused) + * pkthdr => ptr to the packet header + * pkt => pointer to the real live packet data + * + * Returns: void function + */ +void DecodePrismHdr(Packet *p, struct pcap_pkthdr *pkthdr, u_int8_t *pkt){ + + u_int32_t pkt_len; /* suprisingly, the length of the packet */ + u_int32_t cap_len; /* caplen value */ + + bzero((char *) p, sizeof(Packet)); + + p->pkth = pkthdr; + p->pkt = pkt; + + /* set the lengths we need */ + pkt_len = pkthdr->len; /* total packet length */ + cap_len = pkthdr->caplen; /* captured packet length */ + + + if(snaplen < pkt_len) + pkt_len = cap_len; + + DEBUG_WRAP(DebugMessage(DEBUG_DECODE, "Packet!\n");); + DEBUG_WRAP(DebugMessage(DEBUG_DECODE, "caplen: %lu pktlen: %lu\n", + (unsigned long)cap_len, (unsigned long)pkt_len);); + + /* do a little validation */ + if(p->pkth->caplen < (sizeof(PrismHdr) + MINIMAL_IEEE80211_HEADER_LEN)) + { + if(pv.verbose_flag) + { + ErrorMessage("Captured data length < IEEE 802.11 header length! (%d bytes)\n", p->pkth->caplen); + } + return; + } + + /* lay the prism structure over the packet data */ + p->prismh = (PrismHdr *)pkt; + + /* decode the encapsulated 802.11 frame */ + DecodeWifiHdr(p, pkthdr, pkt + sizeof(PrismHdr)); +} +#else /* * Function: DecodeIEEE80211Pkt(Packet *, char *, struct pcap_pkthdr*, * u_int8_t*) @@ -349,6 +628,7 @@ return; } +#endif /* WIRELESS */ void DecodeVlan(u_int8_t * pkt, const u_int32_t len, Packet * p) @@ -3421,7 +3701,7 @@ &p->ip_options[opt_count], &byte_skip); } - if(code < 0) + if(runMode == MODE_IDS && code < 0) { if(runMode == MODE_IDS) { Index: snort/src/decode.h diff -u snort/src/decode.h:1.1.1.8 snort/src/decode.h:1.9.2.3 --- snort/src/decode.h:1.1.1.8 Sun Apr 24 22:10:56 2005 +++ snort/src/decode.h Fri Jun 10 19:11:30 2005 @@ -776,16 +776,90 @@ */ typedef struct _WifiHdr { +#ifdef WIRELESS + union{ +#endif /* WIRELESS */ u_int16_t frame_control; +#ifdef WIRELESS + struct { + u_int16_t version:2; + u_int16_t type:2; + u_int16_t stype:4; + u_int16_t to_ds:1; + u_int16_t from_ds:1; + u_int16_t more_frags:1; + u_int16_t retry:1; + u_int16_t pwr_mgmt:1; + u_int16_t more_data:1; + u_int16_t wep:1; + u_int16_t order:1; + }; + }; +#endif /* WIRELESS */ u_int16_t duration_id; u_int8_t addr1[6]; u_int8_t addr2[6]; u_int8_t addr3[6]; +#ifdef WIRELESS + union { u_int16_t seq_control; + struct { + u_int16_t fragnum:4; + u_int16_t seqnum:12; + }; + }; +#endif /* WIRELESS */ u_int8_t addr4[6]; } WifiHdr; +#ifdef WIRELESS +/* + * PRISM Header (Sometimes encapsulates IEEE 802.11 Headers) + * + * (Somewhat borrowed from Tim Newsham's PRISM decoder for ethereal) + */ + +typedef struct _prism_val { + u_int32_t did; + u_int16_t status; + u_int16_t len; + u_int32_t data; +} prism_val; + +typedef struct _PrismHdr { + + u_int32_t msg_code; + u_int32_t msg_len; + char dev_name[16]; + prism_val host_time; + prism_val mac_time; + prism_val channel; + prism_val rssi; + prism_val sq; + prism_val signal; + prism_val noise; + prism_val rate; + prism_val is_tx; + prism_val frame_len; + +} PrismHdr; + + +/* + * WifiStateTable Index + * + */ + +typedef struct _WSTIdx { + + // u_int8_t *cache_addr[2]; + int32_t cache_addr[2]; + +} WSTIdx; +#endif /* WIRELESS */ + + /* Can't add any fields not in the real header here because of how the decoder uses structure overlaying */ #ifdef _MSC_VER @@ -1070,7 +1144,10 @@ EthLlcOther *ehllcother; WifiHdr *wifih; /* wireless LAN header */ - +#ifdef WIRELESS + PrismHdr *prismh; /* PRISM header */ + WSTIdx wstidx; +#endif /* WIRELESS */ EtherARP *ah; EtherEapol *eplh; /* 802.1x EAPOL header */ @@ -1167,6 +1244,9 @@ void DecodeLinuxSLLPkt(Packet *, struct pcap_pkthdr *, u_int8_t *); void DecodeEthPkt(Packet *, struct pcap_pkthdr *, u_int8_t *); void DecodeIEEE80211Pkt(Packet *, struct pcap_pkthdr *, u_int8_t *); +#ifdef WIRELESS +void DecodePrismHdr(Packet *, struct pcap_pkthdr *, u_int8_t *); +#endif /* WIRELESS */ void DecodeVlan(u_int8_t *, const u_int32_t, Packet *); void DecodePppPkt(Packet *, struct pcap_pkthdr *, u_int8_t *); void DecodePppSerialPkt(Packet *, struct pcap_pkthdr *, u_int8_t *); Index: snort/src/detect.c diff -u snort/src/detect.c:1.1.1.8 snort/src/detect.c:1.6.2.4 --- snort/src/detect.c:1.1.1.8 Sun Apr 24 22:10:58 2005 +++ snort/src/detect.c Fri Jun 10 19:11:30 2005 @@ -364,6 +364,21 @@ */ event->ref_time.tv_sec = p->pkth->ts.tv_sec; event->ref_time.tv_usec = p->pkth->ts.tv_usec; + + /* + * Perform Thresholding Tests + */ + if(p->iph) + { + if( !sfthreshold_test( event->sig_generator, + event->sig_id, + p->iph->ip_src.s_addr, + p->iph->ip_dst.s_addr, + event->ref_time.tv_sec ) ) + { + return; /* Don't log it ! */ + } + } } /* set the event number */ @@ -438,8 +453,13 @@ rule = RuleLists; +#ifdef WIRELESS + if(p && p->iph == NULL && p->wifih == NULL) + return 0; +#else if(p && p->iph == NULL) - return 0; + return 0; +#endif /* WIRELESS */ /* ** This is where we short circuit so @@ -634,6 +654,9 @@ { RuleTreeNode *rtn_idx; IpAddrSet *idx; /* indexing pointer */ +#ifdef WIRELESS + MacAddrSet *idx2; +#endif /* WIRELESS */ int i; #ifdef DEBUG OptTreeNode *otn_idx; @@ -644,104 +667,176 @@ DEBUG_WRAP(DebugMessage(DEBUG_RULES, "%s %s\n", rulename, listname);); rtn_idx = rtn_head; - + if(rtn_idx == NULL) - DEBUG_WRAP(DebugMessage(DEBUG_RULES, " Empty!\n\n");); - + DEBUG_WRAP(DebugMessage(DEBUG_RULES, " Empty!\n\n");); + /* walk thru the RTN list */ while(rtn_idx != NULL) - { - DEBUG_WRAP( - DebugMessage(DEBUG_RULES, "Rule type: %d\n", rtn_idx->type); - DebugMessage(DEBUG_RULES, "SRC IP List:\n"); - ); - idx = rtn_idx->sip; - i = 0; - while(idx != NULL) - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, - "[%d] 0x%.8lX / 0x%.8lX", - i++, (u_long) idx->ip_addr, - (u_long) idx->netmask);); - - if(idx->addr_flags & EXCEPT_IP) - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, - " (EXCEPTION_FLAG Active)\n");); - } - else - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, "\n");); - } - idx = idx->next; - } - - DEBUG_WRAP(DebugMessage(DEBUG_RULES, "DST IP List:\n");); - idx = rtn_idx->dip; - i = 0; - - while(idx != NULL) - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, - "[%d] 0x%.8lX / 0x%.8lX", - i++,(u_long) idx->ip_addr, - (u_long) idx->netmask);); - if(idx->addr_flags & EXCEPT_IP) - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, - " (EXCEPTION_FLAG Active)\n");); - } - else - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, "\n");); - } - - idx = idx->next; - } + { +#ifdef WIRELESS + if(rtn_idx->is_wifi){ + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "Rule type: %d\n", rtn_idx->type); + DebugMessage(DEBUG_RULES, "SRC MAC List:\n");); + + idx2 = rtn_idx->smac; + i = 0; + while(idx2 != NULL) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "[%d] %.2X:%.2X:%.2X:%.2X:%.2X:%.2X ", i++, + idx2->mac_addr[0], idx2->mac_addr[1], idx2->mac_addr[2], + idx2->mac_addr[3], idx2->mac_addr[4], idx2->mac_addr[5])); + + if(idx2->addr_flags & EXCEPT_MAC) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + " (EXCEPTION_FLAG Active)\n");); + } + else + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "\n");); + } + idx2 = idx2->next; + } + + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "DST MAC List:\n");); + + idx2 = rtn_idx->dmac; + i = 0; + while(idx2 != NULL) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "[%d] %.2X:%.2X:%.2X:%.2X:%.2X:%.2X ", i++, + idx2->mac_addr[0], idx2->mac_addr[1], idx2->mac_addr[2], + idx2->mac_addr[3], idx2->mac_addr[4], idx2->mac_addr[5])); + + if(idx2->addr_flags & EXCEPT_MAC) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + " (EXCEPTION_FLAG Active)\n");); + } + else + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "\n");); + } + idx2 = idx2->next; + } + } + else{ +#endif /* WIRELESS */ + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "Rule type: %d\n", rtn_idx->type); + DebugMessage(DEBUG_RULES, "SRC IP List:\n");); + idx = rtn_idx->sip; + i = 0; + while(idx != NULL) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + "[%d] 0x%.8lX / 0x%.8lX", + i++, (u_long) idx->ip_addr, + (u_long) idx->netmask);); + + if(idx->addr_flags & EXCEPT_IP) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + " (EXCEPTION_FLAG Active)\n");); + } + else + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "\n");); + } + idx = idx->next; + } + + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "DST IP List:\n");); + idx = rtn_idx->dip; + i = 0; + + while(idx != NULL) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + "[%d] 0x%.8lX / 0x%.8lX", + i++,(u_long) idx->ip_addr, + (u_long) idx->netmask);); + if(idx->addr_flags & EXCEPT_IP) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + " (EXCEPTION_FLAG Active)\n");); + } + else + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "\n");); + } + + idx = idx->next; + } +#ifdef WIRELESS + } +#endif /* WIRELESS */ #ifdef DEBUG - DebugMessage(DEBUG_RULES, "SRC PORT: %d - %d \n", rtn_idx->lsp, - rtn_idx->hsp); - DebugMessage(DEBUG_RULES, "DST PORT: %d - %d \n", rtn_idx->ldp, - rtn_idx->hdp); - DebugMessage(DEBUG_RULES, "Flags: "); - - if(rtn_idx->flags & EXCEPT_SRC_IP) - DebugMessage(DEBUG_RULES, "EXCEPT_SRC_IP "); - if(rtn_idx->flags & EXCEPT_DST_IP) - DebugMessage(DEBUG_RULES, "EXCEPT_DST_IP "); - if(rtn_idx->flags & ANY_SRC_PORT) - DebugMessage(DEBUG_RULES, "ANY_SRC_PORT "); - if(rtn_idx->flags & ANY_DST_PORT) - DebugMessage(DEBUG_RULES, "ANY_DST_PORT "); - if(rtn_idx->flags & EXCEPT_SRC_PORT) - DebugMessage(DEBUG_RULES, "EXCEPT_SRC_PORT "); - if(rtn_idx->flags & EXCEPT_DST_PORT) - DebugMessage(DEBUG_RULES, "EXCEPT_DST_PORT "); - DebugMessage(DEBUG_RULES, "\n"); - - otn_idx = rtn_idx->down; - - DEBUG_WRAP( - /* print the RTN header number */ - DebugMessage(DEBUG_RULES, - "Head: %d (type: %d)\n", - rtn_idx->head_node_number, otn_idx->type); - DebugMessage(DEBUG_RULES, " |\n"); - DebugMessage(DEBUG_RULES, " ->"); - ); - - /* walk thru the OTN chain */ - while(otn_idx != NULL) - { - DEBUG_WRAP(DebugMessage(DEBUG_RULES, - " %d", otn_idx->chain_node_number);); - otn_idx = otn_idx->next; - } - - DEBUG_WRAP(DebugMessage(DEBUG_RULES, "|=-\n");); +#ifdef WIRELESS + if(rtn_idx->is_wifi){ + DebugMessage(DEBUG_RULES, "FLags: "); + if(rtn_idx->flags & EXCEPT_SRC_MAC) + DebugMessage(DEBUG_RULES, "EXCEPT_SRC_MAC "); + if(rtn_idx->flags & EXCEPT_DST_MAC) + DebugMessage(DEBUG_RULES, "EXCEPT_DST_MAC "); + if(rtn_idx->flags & EXCEPT_BSSID_MAC) + DebugMessage(DEBUG_RULES, "EXCEPT_BSSID_MAC "); + if(rtn_idx->flags & ANY_SRC_MAC) + DebugMessage(DEBUG_RULES, "ANY_SRC_MAC "); + if(rtn_idx->flags & ANY_DST_MAC) + DebugMessage(DEBUG_RULES, "ANY_DST_MAC "); + if(rtn_idx->flags & ANY_BSSID_MAC) + DebugMessage(DEBUG_RULES, "ANY_BSSID_MAC "); + DebugMessage(DEBUG_RULES, "\n"); + } + else{ +#endif /* WIRELESS */ + DebugMessage(DEBUG_RULES, "SRC PORT: %d - %d \n", rtn_idx->lsp, + rtn_idx->hsp); + DebugMessage(DEBUG_RULES, "DST PORT: %d - %d \n", rtn_idx->ldp, + rtn_idx->hdp); + DebugMessage(DEBUG_RULES, "Flags: "); + + if(rtn_idx->flags & EXCEPT_SRC_IP) + DebugMessage(DEBUG_RULES, "EXCEPT_SRC_IP "); + if(rtn_idx->flags & EXCEPT_DST_IP) + DebugMessage(DEBUG_RULES, "EXCEPT_DST_IP "); + if(rtn_idx->flags & ANY_SRC_PORT) + DebugMessage(DEBUG_RULES, "ANY_SRC_PORT "); + if(rtn_idx->flags & ANY_DST_PORT) + DebugMessage(DEBUG_RULES, "ANY_DST_PORT "); + if(rtn_idx->flags & EXCEPT_SRC_PORT) + DebugMessage(DEBUG_RULES, "EXCEPT_SRC_PORT "); + if(rtn_idx->flags & EXCEPT_DST_PORT) + DebugMessage(DEBUG_RULES, "EXCEPT_DST_PORT "); + DebugMessage(DEBUG_RULES, "\n"); + +#ifdef WIRELESS + } +#endif /* WIRELESS */ + otn_idx = rtn_idx->down; + + DEBUG_WRAP( + /* print the RTN header number */ + DebugMessage(DEBUG_RULES, + "Head: %d (type: %d)\n", + rtn_idx->head_node_number, otn_idx->type); + DebugMessage(DEBUG_RULES, " |\n"); + DebugMessage(DEBUG_RULES, " ->"); + ); + + /* walk thru the OTN chain */ + while(otn_idx != NULL) + { + DEBUG_WRAP(DebugMessage(DEBUG_RULES, + " %d", otn_idx->chain_node_number);); + otn_idx = otn_idx->next; + } + + DEBUG_WRAP(DebugMessage(DEBUG_RULES, "|=-\n");); #endif - rtn_idx = rtn_idx->right; - } + rtn_idx = rtn_idx->right; + } } @@ -888,6 +983,135 @@ return 1; } + +#ifdef WIRELESS +int CheckSrcMAC(Packet *p, struct _RuleTreeNode *rtn_idx, RuleFpList *fp_list){ + + MacAddrSet *idx; + + DEBUG_WRAP(DebugMessage(DEBUG_DETECT,"CheckSrcMACEqual: ");); + +#warning "Make sure frames src and dest addresses correspond correctly" + + if(!(rtn_idx->flags & EXCEPT_SRC_MAC)){ + /* do the check */ + for(idx = rtn_idx->smac; idx != NULL; idx=idx->next) + { + +/* if( ((idx->ip_addr == (p->iph->ip_src.s_addr & idx->netmask)) */ +/* ^ (idx->addr_flags & EXCEPT_IP)) ) */ + if(!memcmp(idx->mac_addr, p->wifih->addr2, 6) ^ (idx->addr_flags & EXCEPT_MAC)) + { +#ifdef DEBUG + if(idx->addr_flags & EXCEPT_MAC) { + DebugMessage(DEBUG_DETECT, " SMAC exception match\n"); + } + else + { + DebugMessage(DEBUG_DETECT, " SMAC match\n"); + } + +/* DebugMessage(DEBUG_DETECT, "Rule: 0x%X Packet: 0x%X\n", */ +/* idx->ip_addr, (p->iph->ip_src.s_addr & idx->netmask)); */ +#endif /* DEBUG */ + + /* the packet matches this test, proceed to the next test */ + return fp_list->next->RuleHeadFunc(p, rtn_idx, fp_list->next); + } + } + } + else + { + /* global exception flag is up, we can't match on *any* + * of the source addresses + */ + DEBUG_WRAP(DebugMessage(DEBUG_DETECT," global exception flag, \n");); + + /* do the check */ + for(idx=rtn_idx->smac; idx != NULL; idx=idx->next) + { + if(!memcmp(idx->mac_addr, p->wifih->addr2, 6) ^ (idx->addr_flags & EXCEPT_MAC)) + { + DEBUG_WRAP(DebugMessage(DEBUG_DETECT,"address matched, failing on SMAC\n");); + /* got address match on globally negated rule, fail */ + return 0; + } + } + DEBUG_WRAP(DebugMessage(DEBUG_DETECT,"no matches on SMAC, passed\n");); + + return fp_list->next->RuleHeadFunc(p, rtn_idx, fp_list->next); + } + + DEBUG_WRAP(DebugMessage(DEBUG_DETECT," Mismatch on SMAC\n");); + + /* return 0 on a failed test */ + return 0; +} + + +int CheckDstMAC(Packet *p, struct _RuleTreeNode *rtn_idx, RuleFpList *fp_list){ + MacAddrSet *idx; /* ip address indexer */ + + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, "CheckDstMACEqual: ");) + + /* check for global exception flag */ + if(!(rtn_idx->flags & EXCEPT_DST_MAC)) + { + /* do the check */ + for(idx=rtn_idx->dmac; idx != NULL; idx=idx->next) + { + /* if( ((idx->ip_addr == (p->iph->ip_dst.s_addr & idx->netmask)) */ +/* ^ (idx->addr_flags & EXCEPT_IP)) ) */ + if(!memcmp(idx->mac_addr, p->wifih->addr1, 6) ^ (idx->addr_flags & EXCEPT_MAC)) + { +#ifdef DEBUG + if(idx->addr_flags & EXCEPT_MAC) + { + DebugMessage(DEBUG_DETECT, " DMAC exception match\n"); + } + else + { + DebugMessage(DEBUG_DETECT, " DMAC match\n"); + } + +/* DebugMessage(DEBUG_DETECT, "Rule: 0x%X Packet: 0x%X\n", */ +/* idx->ip_addr, (p->iph->ip_src.s_addr & idx->netmask)); */ +#endif /* DEBUG */ + /* the packet matches this test, proceed to the next test */ + return fp_list->next->RuleHeadFunc(p, rtn_idx, fp_list->next); + } + } + } + else + { + /* global exception flag is up, we can't match on *any* + * of the source addresses + */ + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, " global exception flag, \n");); + + /* do the check */ + for(idx=rtn_idx->dip; idx != NULL; idx=idx->next) + { +/* if( ((idx->ip_addr == (p->iph->ip_dst.s_addr & idx->netmask)) */ +/* ^ (idx->addr_flags & EXCEPT_IP)) ) */ + if(!memcmp(idx->mac_addr, p->wifih->addr1, 6) ^ (idx->addr_flags & EXCEPT_MAC)) + { + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, + "address matched, failing on DMAC\n");); + /* got address match on globally negated rule, fail */ + return 0; + } + } + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, "no matches on DMAC, passed\n");); + + return fp_list->next->RuleHeadFunc(p, rtn_idx, fp_list->next); + } + + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, " Mismatch on DMAC\n");); + /* return 0 on a failed test */ + return 0; +} +#endif /* WIRELESS */ /**************************************************************************** Index: snort/src/detect.h diff -u snort/src/detect.h:1.1.1.5 snort/src/detect.h:1.4.2.3 --- snort/src/detect.h:1.1.1.5 Sun Apr 24 22:10:58 2005 +++ snort/src/detect.h Fri Jun 10 19:11:30 2005 @@ -64,6 +64,10 @@ /* detection modules */ int CheckBidirectional(Packet *, struct _RuleTreeNode *, RuleFpList *); +#ifdef WIRELESS +int CheckSrcMAC(Packet *, struct _RuleTreeNode *, RuleFpList *); +int CheckDstMAC(Packet *, struct _RuleTreeNode *, RuleFpList *); +#endif /* WIRELESS */ int CheckSrcIP(Packet *, struct _RuleTreeNode *, RuleFpList *); int CheckDstIP(Packet *, struct _RuleTreeNode *, RuleFpList *); int CheckSrcIPNotEq(Packet *, struct _RuleTreeNode *, RuleFpList *); Index: snort/src/event_queue.c diff -u snort/src/event_queue.c:1.1.1.3 snort/src/event_queue.c:1.1.1.3.4.1 --- snort/src/event_queue.c:1.1.1.3 Sun Apr 24 22:10:58 2005 +++ snort/src/event_queue.c Thu May 5 01:12:32 2005 @@ -20,7 +20,6 @@ #include "sfeventq.h" #include "event_wrapper.h" #include "event_queue.h" -#include "sfthreshold.h" /* ** Set default values @@ -155,14 +154,12 @@ Packet *p; EventNode *en; OTNX *otnx; - SNORT_EVENTQ_USER *snort_user; - if(!event || !user) + if(!event) return 0; - en = (EventNode *)event; - snort_user = (SNORT_EVENTQ_USER *)user; - p = (Packet *)snort_user->pkt; + en = (EventNode *)event; + p = (Packet *)user; /* ** Log rule events differently because we have to. @@ -173,8 +170,6 @@ if(!otnx->rtn || !otnx->otn) return 0; - snort_user->rule_alert = 1; - fpLogEvent(otnx->rtn, otnx->otn, p); } else @@ -183,37 +178,12 @@ en->classification, en->priority, en->msg); } - sfthreshold_reset(); - return 0; } -/* -** NAME -** SnortEventqLog:: -*/ -/** -** We return whether we logged events or not. We've add a eventq user -** structure so we can track whether the events logged we're rule events -** or preprocessor/decoder events. The reason being that we don't want -** to flush a TCP stream for preprocessor/decoder events, and cause -** early flushing of the stream. -** -** @return 1 logged events -** @return 0 did not log events or logged only decoder/preprocessor events -*/ int SnortEventqLog(Packet *p) { - static SNORT_EVENTQ_USER user; - - user.rule_alert = 0x00; - user.pkt = (void *)p; - - if(sfeventq_action(LogSnortEvents, (void *)&user) > 0) - { - if(user.rule_alert) - return 1; - } + sfeventq_action(LogSnortEvents, (void *)p); return 0; } Index: snort/src/event_queue.h diff -u snort/src/event_queue.h:1.1.1.2 snort/src/event_queue.h:1.1.1.2.4.1 --- snort/src/event_queue.h:1.1.1.2 Sun Apr 24 22:10:58 2005 +++ snort/src/event_queue.h Thu May 5 01:12:32 2005 @@ -6,13 +6,6 @@ #define SNORT_EVENTQ_PRIORITY 1 #define SNORT_EVENTQ_CONTENT_LEN 2 -typedef struct s_SNORT_EVENTQ_USER -{ - char rule_alert; - void *pkt; - -} SNORT_EVENTQ_USER; - typedef struct s_SNORT_EVENT_QUEUE { int max_events; Index: snort/src/fpcreate.c diff -u snort/src/fpcreate.c:1.1.1.6 snort/src/fpcreate.c:1.5.2.4 --- snort/src/fpcreate.c:1.1.1.6 Sun Apr 24 00:25:00 2005 +++ snort/src/fpcreate.c Sat May 14 02:22:40 2005 @@ -70,7 +70,9 @@ static PORT_RULE_MAP *prmUdpRTNX = NULL; static PORT_RULE_MAP *prmIpRTNX = NULL; static PORT_RULE_MAP *prmIcmpRTNX= NULL; - +#ifdef WIRELESS +static PORT_RULE_MAP *prmWifiRTNX = NULL; +#endif /* WIRELESS */ static FPDETECT fpDetect; /* @@ -104,6 +106,12 @@ return prmFindRuleGroup( prmUdpRTNX, dport, sport, src, dst , gen); } +#ifdef WIRELESS +int prmFindRuleGroupWifi(PORT_GROUP **wifi_group, PORT_GROUP **gen){ + PORT_GROUP *src; + return prmFindRuleGroup(prmWifiRTNX, -1, -1, &src, wifi_group, gen); +} +#endif /* WIRELESS */ /* ** These Otnhas* functions check the otns for different contents. This @@ -692,6 +700,10 @@ RuleTreeNode *rtn; int sport; int dport; +#ifdef WIRELESS + u_int8_t *smac; + u_int8_t *dmac; +#endif /* WIRELESS */ OptTreeNode * otn; int iBiDirectional = 0; @@ -715,6 +727,12 @@ if(prmIcmpRTNX == NULL) return 1; +#ifdef WIRELESS + prmWifiRTNX = prmNewMap(); + if(prmWifiRTNX == NULL) + return 1; +#endif /* WIRELESS */ + for (rule=RuleLists; rule; rule=rule->next) { if(!rule->RuleList) @@ -1077,17 +1095,81 @@ } } } +#ifdef WIRELESS + if(rule->RuleList->WifiList){ /* treat a Wifi rule like an IP one without ports */ + + for(rtn = rule->RuleList->WifiList; rtn != NULL; rtn = rtn->right) + { + /* Walk OTN list -Add as Content, or NoContent */ + for( otn=rtn->down; otn; otn=otn->next ) + { + + otnx = malloc( sizeof(OTNX) ); + MEMASSERT(otnx,"otnx-WIFI"); + + otnx->otn = otn; + otnx->rtn = rtn; + +/* IpProto = */ +/* (IpProtoData *)otn->ds_list[PLUGIN_IP_PROTO_CHECK] ; */ + +/* if( IpProto ) */ +/* { */ +/* protocol = IpProto->protocol; */ +/* if( IpProto->comparison_flag == GREATER_THAN ) */ +/* protocol=-1; */ + +/* if( IpProto->comparison_flag == LESS_THAN ) */ +/* protocol=-1; */ + +/* if( IpProto->not_flag ) */ +/* protocol=-1; */ +/* } */ +/* else */ +/* { */ +/* protocol = -1; */ +/* } */ + + if( OtnHasContent( otn ) ) + { + if(fpDetect.debug) + { + printf("WIFI Content-Rule %s\n", otn->sigInfo.message); + } + prmAddRule(prmWifiRTNX, -1, -1, otnx); + + } + else + { + if(fpDetect.debug) + { + printf("WIFI NoContent-Rule %s\n", otn->sigInfo.message); + } + prmAddRuleNC(prmWifiRTNX, -1, -1, otnx); + + } + } + } + + } +#endif /* WIRELESS */ } prmCompileGroups(prmTcpRTNX); prmCompileGroups(prmUdpRTNX); prmCompileGroups(prmIcmpRTNX); prmCompileGroups(prmIpRTNX); +#ifdef WIRELESS + prmCompileGroups(prmWifiRTNX); +#endif /* WIRELESS */ BuildMultiPatternGroups(prmTcpRTNX); BuildMultiPatternGroups(prmUdpRTNX); BuildMultiPatternGroups(prmIcmpRTNX); BuildMultiPatternGroups(prmIpRTNX); +#ifdef WIRELESS + BuildMultiPatternGroups(prmWifiRTNX); +#endif /* WIRELESS */ if(fpDetect.debug) { @@ -1102,6 +1184,10 @@ printf("\n** IP Rule Group Stats -- "); prmShowStats(prmIpRTNX); +#ifdef WIRELESS + printf("\n** WIFI Rule Group Stats -- "); + prmShowStats(prmWifiRTNX); +#endif /* WIRELESS */ } return 0; @@ -1124,6 +1210,9 @@ printf("\n** UDP Event Stats -- "); prmShowEventStats(prmUdpRTNX); printf("\n** ICMP Event Stats -- "); prmShowEventStats(prmIcmpRTNX); printf("\n** IP Event Stats -- "); prmShowEventStats(prmIpRTNX); +#ifdef WIRELESS + printf("\n** WIFI Event Stats -- "); prmShowEventStats(prmWifiRTNX); +#endif /* WIRELESS */ return 0; } Index: snort/src/fpdetect.c diff -u snort/src/fpdetect.c:1.1.1.10 snort/src/fpdetect.c:1.8.2.4 --- snort/src/fpdetect.c:1.1.1.10 Sun Apr 24 22:11:01 2005 +++ snort/src/fpdetect.c Fri Jun 10 19:11:30 2005 @@ -135,6 +135,9 @@ static INLINE int fpEvalHeaderIcmp(Packet *p); static INLINE int fpEvalHeaderTcp(Packet *p); static INLINE int fpEvalHeaderUdp(Packet *p); +#ifdef WIRELESS +static INLINE int fpEvalHeaderWifi(Packet *p); +#endif /* WIRELESS */ static INLINE int fpEvalHeaderSW(PORT_GROUP *port_group, Packet *p, int check_ports); static int otnx_match (void* id, int index, void * data ); @@ -1359,6 +1362,32 @@ return fpFinalSelectEvent(&omd, p); } + +#ifdef WIRELESS +static INLINE int fpEvalHeaderWifi(Packet *p){ + + PORT_GROUP *gen, *wifi_group; + int retval; + + retval = prmFindRuleGroupWifi(&wifi_group, &gen); + + switch(retval) + { + case 4: + if(fpEvalHeader(gen, p, 0)) + { + return 1; + } + break; + default: + break; + } + + return 0; +} +#endif /* WIRELESS */ + + /* ** ** NAME @@ -1386,7 +1415,22 @@ */ int fpEvalPacket(Packet *p) { - int ip_proto = p->iph->ip_proto; +#ifndef WIRELESS + int ip_proto = p->iph->ip_proto; +#else + int ip_proto; + + /* check both the ip and wifi headers if they exist */ + + if(p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, + "Detecting on WifiList\n");); + fpEvalHeaderWifi(p); + } + + if(p->iph){ + ip_proto = p->iph->ip_proto; +#endif /* WIRELESS */ switch(ip_proto) { @@ -1434,5 +1478,9 @@ ** No Match on TCP/UDP, Do IP */ return fpEvalHeaderIp(p, ip_proto); +#ifdef WIRELESS + } + return 0; +#endif /* WIRELESS */ } Index: snort/src/generators.h diff -u snort/src/generators.h:1.1.1.5 snort/src/generators.h:1.3.2.5 --- snort/src/generators.h:1.1.1.5 Mon Apr 25 03:26:00 2005 +++ snort/src/generators.h Mon Jun 13 00:18:32 2005 @@ -243,6 +243,28 @@ #define GENERATOR_SMTP 124 +#ifdef WIRELESS + +#define GENERATOR_SPP_ROGUE_AP 200 +#define ROGUE_AP_DETECTED 1 + +#define GENERATOR_SPP_ANTISTUMBLER 201 +#define STUMBLER_DETECTED 1 + +#define GENERATOR_WIFI_STATETABLE 210 +#define RANDOM_MAC_ADDR_TRAFFIC 1 + +#define GENERATOR_SPP_DEAUTHFLOOD 211 +#define DEAUTHFLOOD_DETECTED 1 + +#define GENERATOR_SPP_AUTHFLOOD 212 +#define AUTHFLOOD_DETECTED 1 + +#define GENERATOR_SPP_MACSPOOF 213 +#define MACSPOOF_DETECTED 1 + +#endif /* WIRELESS */ + /* This is where all the alert messages will be archived for each internal alerts */ @@ -391,5 +413,16 @@ #define PSNG_ICMP_PORTSWEEP_FILTERED_STR "(portscan) ICMP Filtered Sweep" #define PSNG_OPEN_PORT_STR "(portscan) Open Port" + +#ifdef WIRELESS + +#define RANDOM_SRC_MAC "(wifi_state_table) detected 802.11 traffic with random SRC MAC addr." +#define RANDOM_DST_MAC "(wifi_state_table) detected 802.11 traffic with random DST MAC addr." + +#define DEAUTHFLOOD_PREFIX_STR "(spp_deauthflood) Deauthflood detected!" +#define AUTHFLOOD_PREFIX_STR "(spp_authflood) Authflood detected!" +#define MACSPOOF_PREFIX_STR "(spp_macspoof) Abnormal sequence number gap detected!" + +#endif /* WIRELESS */ #endif /* __GENERATORS_H__ */ Index: snort/src/log.c diff -u snort/src/log.c:1.1.1.5 snort/src/log.c:1.4.2.4 --- snort/src/log.c:1.1.1.5 Sun Apr 24 22:11:04 2005 +++ snort/src/log.c Fri Jun 10 19:11:30 2005 @@ -548,6 +548,16 @@ PrintWifiHeader(fp, p); break; #endif + +#ifdef WIRELESS +#ifdef DLT_PRISM_HEADER + case DLT_PRISM_HEADER: + if(p && p->wifih) + PrintWifiHeader(fp, p); + break; +#endif +#endif /* WIRELESS */ + case DLT_IEEE802: /* Token Ring */ if(p && p->trh) PrintTrHeader(fp, p); Index: snort/src/parser.c diff -u snort/src/parser.c:1.1.1.14 snort/src/parser.c:1.9.2.8 --- snort/src/parser.c:1.1.1.14 Mon Apr 25 03:26:08 2005 +++ snort/src/parser.c Mon Jun 13 00:18:32 2005 @@ -117,6 +117,9 @@ RuleTreeNode *GetDynamicRTN(int, RuleTreeNode *); OptTreeNode *GetDynamicOTN(int, RuleTreeNode *); void AddrToFunc(RuleTreeNode *, int); +#ifdef WIRELESS +void MacAddrToFunc(RuleTreeNode *, int); +#endif /* WIRELESS */ void PortToFunc(RuleTreeNode *, int, int, int); void SetupRTNFuncList(RuleTreeNode *); @@ -145,6 +148,9 @@ int continuation = 0; char *new_line = NULL; struct stat file_stat; /* for include path testing */ + int num_comments; + char *config_line; + char **comment_toks; if(inclevel == 0) { @@ -234,17 +240,32 @@ if((*index != '#') && (*index != 0x0a) && (*index != ';') && (index != NULL)) { + comment_toks = mSplit(index, "#", 2, &num_comments, 0); + /* If we got 1 or 2 values back... + * 1 implies no comments on the line + * 2 implies 1 comment at end of line + */ + if ((num_comments == 1) || (num_comments == 2)) + { + config_line = comment_toks[0]; + } + else + { + bzero((char *) buf, STD_BUF); + mSplitFree(&comment_toks, num_comments); + continue; + } if(continuation == 1) { - new_line = (char *) calloc((strlen(saved_line) + strlen(index) + new_line = (char *) calloc((strlen(saved_line) + strlen(config_line) +1), sizeof(char)); strncat(new_line, saved_line, strlen(saved_line)); - strncat(new_line, index, strlen(index)); + strncat(new_line, config_line, strlen(config_line)); free(saved_line); saved_line = NULL; - index = new_line; + config_line = new_line; - if(strlen(index) > PARSERULE_SIZE) + if(strlen(config_line) > PARSERULE_SIZE) { FatalError("Please don't try to overflow the parser, " "that's not very nice of you... (%d-byte " @@ -258,12 +279,12 @@ /* check for a '\' continuation character at the end of the line * if it's there we need to get the next line in the file */ - if(ContinuationCheck(index) == 0) + if(ContinuationCheck(config_line) == 0) { DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES, - "[*] Processing rule: %s\n", index);); + "[*] Processing rule: %s\n", config_line);); - ParseRule(thefp, index, inclevel); + ParseRule(thefp, config_line, inclevel); if(new_line != NULL) { @@ -275,13 +296,14 @@ else { /* save the current line */ - saved_line = strdup(index); + saved_line = strdup(config_line); /* set the flag to let us know the next line is * a continuation line */ continuation = 1; } + mSplitFree(&comment_toks, num_comments); } bzero((char *) buf, STD_BUF); @@ -295,11 +317,11 @@ if(inclevel == 0 && !pv.quiet_flag) { - LogMessage("%d Snort rules read...\n", rule_count); - LogMessage("%d Option Chains linked into %d Chain Headers\n", opt_count, + LogMessage("%d Snort rules read...\n", rule_count); + LogMessage("%d Option Chains linked into %d Chain Headers\n", opt_count, head_count); - LogMessage("%d Dynamic rules\n", dynamic_rules_present); - LogMessage("+++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"); + LogMessage("%d Dynamic rules\n", dynamic_rules_present); + LogMessage("+++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"); } fclose(thefp); @@ -421,6 +443,9 @@ while(rule != NULL) { +#ifdef WIRELESS + DumpChain(rule->RuleList->WifiList, rule->name, "WIFI Chains"); +#endif /* WIRELESS */ DumpChain(rule->RuleList->IpList, rule->name, "IP Chains"); DumpChain(rule->RuleList->TcpList, rule->name, "TCP Chains"); DumpChain(rule->RuleList->UdpList, rule->name, "UDP Chains"); @@ -445,6 +470,9 @@ while(rule != NULL) { +#ifdef WIRELESS + IntegrityCheck(rule->RuleList->WifiList, rule->name, "WIFI Chains"); +#endif /* WIRELESS */ IntegrityCheck(rule->RuleList->IpList, rule->name, "IP Chains"); IntegrityCheck(rule->RuleList->TcpList, rule->name, "TCP Chains"); IntegrityCheck(rule->RuleList->UdpList, rule->name, "UDP Chains"); @@ -690,6 +718,38 @@ } else {*/ + +#ifdef WIRELESS + if(protocol == DLT_IEEE802_11){ + proto_node.is_wifi = 1; + proto_node.sip = NULL; + proto_node.dip = NULL; + ProcessMAC(toks[2], &proto_node, SRC); /* get src mac */ + /* New in version 1.3: support for bidirectional rules */ + /* + * this checks the rule "direction" token and sets the bidirectional flag + * if the token = '<>' + */ + if(!strncmp("<>", toks[3], 2)) + { + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"Bidirectional rule!\n");); + proto_node.flags |= BIDIRECTIONAL; + } + + /* changed version 1.8.4 + * Die when someone has tried to define a rule character other than + -> or <> + */ + if(!strcmp("->", toks[3]) && !strcmp("<>", toks[3])) + { + FatalError("%s(%d): Illegal direction specifier: %s", toks[3]); + } + ProcessMAC(toks[4], &proto_node, DST); /* get dst mac */ + + } + else{ + proto_node.is_wifi = 0; +#endif /* WIRELESS */ ProcessIP(toks[2], &proto_node, SRC); /*}*/ @@ -766,6 +826,10 @@ if(proto_node.not_dp_flag) proto_node.flags |= EXCEPT_DST_PORT; +#ifdef WIRELESS + } +#endif /* WIRELESS */ + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"proto_node.flags = 0x%X\n", proto_node.flags);); DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"Processing Head Node....\n");); @@ -881,6 +945,12 @@ rtn_idx = list->IpList; break; +#ifdef WIRELESS + case DLT_IEEE802_11: + rtn_idx = list->WifiList; + break; +#endif /* WIRELESS */ + default: rtn_idx = NULL; break; @@ -926,6 +996,12 @@ rtn_tmp = list->IpList; break; +#ifdef WIRELESS + case DLT_IEEE802_11: + list->WifiList = (RuleTreeNode *) calloc(sizeof(RuleTreeNode), sizeof(char)); + rtn_tmp = list->WifiList; + break; +#endif /* WIRELESS */ } /* copy the prototype header data into the new node */ @@ -1198,8 +1274,16 @@ DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"CheckBidirectional->\n");); AddRuleFuncToList(CheckBidirectional, rtn); } +#ifdef WIRELESS else { + if(rtn->is_wifi){ + MacAddrToFunc(rtn, SRC); + MacAddrToFunc(rtn, DST); + + } +#endif /* WIRELESS */ + else{ /* Attach the proper port checking function to the function list */ /* * the in-line "if's" check to see if the "any" or "not" flags have @@ -1213,13 +1297,15 @@ PortToFunc(rtn, (rtn->flags & ANY_SRC_PORT ? 1 : 0), (rtn->flags & EXCEPT_SRC_PORT ? 1 : 0), SRC); - /* link in the proper IP address detection function */ + /* link in the proper IP address detection function */ AddrToFunc(rtn, SRC); /* last verse, same as the first (but for dest IP) ;) */ AddrToFunc(rtn, DST); +#ifdef WIRELESS + } +#endif /* WIRELESS */ } - DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"RuleListEnd\n");); /* tack the end (success) function to the list */ @@ -1275,6 +1361,35 @@ } +#ifdef WIRELESS +void MacAddrToFunc(RuleTreeNode *rtn, int mode){ + /* + * if IP and mask are both 0, this is a "any" IP and we don't need to + * check it + */ + switch(mode) + { + case SRC: + if((rtn->flags & ANY_SRC_MAC) == 0) + { + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"CheckSrcMAC -> ");); + AddRuleFuncToList(CheckSrcMAC, rtn); + } + + break; + + case DST: + if((rtn->flags & ANY_DST_MAC) == 0) + { + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"CheckDstMAC -> ");); + AddRuleFuncToList(CheckDstMAC, rtn); + } + + break; + } +} +#endif /* WIRELESS */ + /**************************************************************************** * @@ -1392,8 +1507,8 @@ while(pl_idx != NULL) { DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES, - "comparing: \"%s\" => \"%s\"\n", - funcname, pl_idx->entry.keyword);); + "comparing: \"%s\" => \"%s\"\n", + funcname, pl_idx->entry.keyword);); /* compare the keyword against the current list element's keyword */ if(!strcasecmp(funcname, pl_idx->entry.keyword)) { @@ -1408,6 +1523,9 @@ break; } + mSplitFree(&toks, num_arg_toks); + mSplitFree(&pp_head, num_head_toks); + if(!found) { FatalError(" unknown preprocessor \"%s\"\n", @@ -1821,7 +1939,7 @@ FatalError("\n%s(%d) => No argument passed to " "keyword \"%s\"\nMake sure you didn't forget a ':' " "or the argument to this keyword!\n", file_name, - file_line, opts[0]); + file_line, option_name); } } else if(!strcasecmp(option_name, "classtype")) @@ -2019,6 +2137,15 @@ if(!strcasecmp(proto_str, "arp")) return ETHERNET_TYPE_ARP; +#ifdef WIRELESS + if(!strcasecmp(proto_str, "wifi")){ +#ifdef DEBUG + fprintf(stderr, "WhichProto() returning: DLT_IEEE802_11\n"); +#endif + return DLT_IEEE802_11; +#warning "need to make a REAL protocol #define for wifi" + } +#endif /* WIRELESS */ /* * if we've gotten here, we have a protocol string we din't recognize and * should exit @@ -2216,6 +2343,216 @@ return NULL; } +#ifdef WIRELESS +MacAddrSet *AllocMacAddrNode(RuleTreeNode *rtn, int mode){ + MacAddrSet *idx; + + switch(mode) + { + case SRC: + if(rtn->smac == NULL){ + rtn->smac = (MacAddrSet *)calloc(sizeof(MacAddrSet), sizeof(char)); + if(rtn->smac == NULL){ + FatalError(" Unable to allocate node for MAC list\n"); + } + return rtn->smac; + } + else{ + idx = rtn->smac; + + while(idx->next != NULL){ + idx = idx->next; + } + + idx->next = (MacAddrSet *)calloc(sizeof(MacAddrSet), sizeof(char)); + if(idx->next == NULL){ + FatalError(" Unable to allocate node for MAC list\n"); + } + return idx->next; + } + break; + + case DST: + if(rtn->dmac == NULL){ + + rtn->dmac = (MacAddrSet *)calloc(sizeof(MacAddrSet), sizeof(char)); + if(rtn->dmac == NULL){ + FatalError(" Unable to allocate node for MAC list\n"); + } + return rtn->dmac; + } + else{ + idx = rtn->dmac; + + while(idx->next != NULL){ + idx = idx->next; + } + + idx->next = (MacAddrSet *)calloc(sizeof(MacAddrSet), sizeof(char)); + if(idx->next == NULL){ + FatalError(" Unable to allocate node for MAC list\n"); + } + return idx->next; + } + break; + } + return NULL; +} + + + + +int ProcessMAC(char *addr, RuleTreeNode *rtn, int mode){ + + char **toks = NULL; + int num_toks; + int i; + MacAddrSet *tmp_addr; + char *tmp; + char *enbracket; + + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"Got MAC address string: %s\n", + addr);); + + if(*addr == '!') + { + switch(mode) + { + case SRC: + rtn->flags |= EXCEPT_SRC_MAC; + break; + + case DST: + rtn->flags |= EXCEPT_DST_MAC; + break; + } + + addr++; + } + + if(*addr == '$') + { + if((tmp = VarGet(addr + 1)) == NULL) + { + FatalError("%s(%d) => Undefined variable %s\n", file_name, + file_line, addr); + } + } + else + { + tmp = addr; + } + + /* check to see if the first char is a + * bracket, which signifies a list + */ + if(*tmp == '[') + { + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"Found MAC list!\n");); + + /* *(tmp+strlen(tmp)) = ' ';*/ + enbracket = strrchr(tmp, (int)']'); /* null out the en-bracket */ + if(enbracket) *enbracket = '\x0'; + + toks = mSplit(tmp+1, ",", 128, &num_toks, 0); + + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"mSplit got %d tokens...\n", + num_toks);); + + for(i=0; i< num_toks; i++) + { + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES,"adding %s to MAC " + "address list\n", toks[i]);); + tmp = toks[i]; + while (isspace((int)*tmp)||*tmp=='[') tmp++; + enbracket = strrchr(tmp, (int)']'); /* null out the en-bracket */ + if(enbracket) *enbracket = '\x0'; + + if (strlen(tmp) == 0) + continue; + + tmp_addr = AllocMacAddrNode(rtn, mode); + if(ParseMAC(tmp, tmp_addr)) + { + switch(mode) + { + case SRC: + rtn->flags |= ANY_SRC_MAC; + break; + + case DST: + rtn->flags |= ANY_DST_MAC; + break; + } + } + } + + DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES, "Freeing %d tokens...\n", + num_toks);); + + for(i=0;iflags |= ANY_SRC_MAC; + break; + + case DST: + rtn->flags |= ANY_DST_MAC; + break; + } + } + } + + return 0; +} + + +int ParseMAC(char *paddr, MacAddrSet *address_data){ + int i = 0; + char *str, *next, *addr; + + addr = paddr; + if(*addr == '!'){ + address_data->addr_flags |= EXCEPT_MAC; + addr++; + } + + if(!strcasecmp(addr, "any")){ + memset(address_data, 0x00, sizeof(MacAddrSet)); + return 1; + } + + str = paddr; + next = str; + + while(*next){ + if((address_data->mac_addr[i] = strtol(str, &next, 16)) > 255){ + FatalError("%s(%d) => Unrecognized MAC address %s\n", file_name, file_line, addr); + } + if(str != next && i < 6){ + str = next + 1; + i++; + } + else + FatalError("%s(%d) => Unrecognized MAC address %s\n", file_name, file_line, addr); + } + return 0; +} +#endif /* WIRELESS */ + + /**************************************************************************** * * Function: ParsePort(char *, u_short *) @@ -2456,7 +2793,7 @@ otn_tmp->sigInfo.message = strdup(ptr); DEBUG_WRAP(DebugMessage(DEBUG_CONFIGRULES, "Rule message set to: %s\n", - otn_tmp->sigInfo.message);); + otn_tmp->sigInfo.message);); } else @@ -2636,6 +2973,11 @@ rtn->type = rule->type; rtn->sip = rule->sip; rtn->dip = rule->dip; +#ifdef WIRELESS + rtn->is_wifi = rule->is_wifi; + rtn->smac = rule->smac; + rtn->dmac = rule->dmac; +#endif /* WIRELESS */ rtn->hsp = rule->hsp; rtn->lsp = rule->lsp; rtn->hdp = rule->hdp; @@ -2778,14 +3120,14 @@ { if(strcasecmp(p->name, name) == 0) { - if (!(p->flags & VAR_STATIC)) + if (!(p->flags & VAR_STATIC)) { if( p->value ) free(p->value); p->value = strdup(value); } - return (p); + return (p); } p = p->next; @@ -3322,14 +3664,14 @@ void ProcessDetectionOptions( char ** args, int nargs ) { - int i; + int i; - for(i=0;i #include - +#ifdef WIRELESS +#include +#endif /* WIRELESS */ #include "plugbase.h" #include "spo_plugbase.h" @@ -62,6 +64,13 @@ #include "preprocessors/spp_flow.h" #include "preprocessors/spp_sfportscan.h" #include "preprocessors/spp_xlink2state.h" +#ifdef WIRELESS +#include "preprocessors/spp_rogue_ap.h" +#include "preprocessors/spp_antistumbler.h" +#include "preprocessors/spp_deauth_flood.h" +#include "preprocessors/spp_auth_flood.h" +#include "preprocessors/spp_macspoof.h" +#endif /* WIRELESS */ /* built-in detection plugins */ #include "detection-plugins/sp_pattern_match.h" @@ -95,6 +104,29 @@ #include "detection-plugins/sp_react.h" #include "detection-plugins/sp_respond.h" #endif +#ifdef WIRELESS +#include "detection-plugins/sp_wifi_type.h" +#include "detection-plugins/sp_wifi_stype.h" +#include "detection-plugins/sp_wifi_to_ds.h" +#include "detection-plugins/sp_wifi_from_ds.h" +#include "detection-plugins/sp_wifi_more_frags.h" +#include "detection-plugins/sp_wifi_retry.h" +#include "detection-plugins/sp_wifi_pwr_mgmt.h" +#include "detection-plugins/sp_wifi_more_data.h" +#include "detection-plugins/sp_wifi_wep.h" +#include "detection-plugins/sp_wifi_order.h" +#include "detection-plugins/sp_wifi_frame_control.h" +#include "detection-plugins/sp_wifi_duration_id.h" +#include "detection-plugins/sp_wifi_bssid.h" +#include "detection-plugins/sp_wifi_seqnum.h" +#include "detection-plugins/sp_wifi_fragnum.h" +#include "detection-plugins/sp_wifi_addr4.h" +#include "detection-plugins/sp_wifi_ssid.h" +#endif /* WIRELESS */ + + + + /* built-in output plugins */ @@ -161,6 +193,25 @@ SetupReact(); SetupRespond(); #endif +#ifdef WIRELESS + SetupWifiType(); + SetupWifiStype(); + SetupWifiToDs(); + SetupWifiFromDs(); + SetupWifiMoreFrags(); + SetupWifiRetry(); + SetupWifiPwrMgmt(); + SetupWifiMoreData(); + SetupWifiWep(); + SetupWifiOrder(); + SetupWifiFrameControl(); + SetupWifiDurationId(); + SetupWifiBssid(); + SetupWifiSeqNum(); + SetupWifiFragNum(); + SetupWifiAddr4(); + SetupWifiSsid(); +#endif /* WIRELESS */ } /**************************************************************************** @@ -412,6 +463,13 @@ SetupFlow(); SetupPsng(); SetupXLINK2STATE(); +#ifdef WIRELESS + SetupRogueAp(); + SetupAntiStumbler(); + SetupDeauthFlood(); + SetupAuthFlood(); + SetupMACSpoof(); +#endif /* WIRELESS */ } /**************************************************************************** @@ -843,6 +901,16 @@ /************************** Miscellaneous Functions **************************/ +#ifdef WIRELESS +int PacketIsWIFI(Packet *p) +{ + if(p->wifih != NULL) + return 1; + + return 0; +} +#endif /* WIRELESS */ + int PacketIsIP(Packet * p) { Index: snort/src/plugbase.h diff -u snort/src/plugbase.h:1.1.1.6 snort/src/plugbase.h:1.4.2.5 --- snort/src/plugbase.h:1.1.1.6 Sun Apr 24 22:11:13 2005 +++ snort/src/plugbase.h Fri Jun 10 19:11:30 2005 @@ -163,6 +163,9 @@ } PluginSignalFuncNode; +#ifdef WIRELESS +int PacketIsWIFI(Packet *); +#endif int PacketIsIP(Packet *); int PacketIsTCP(Packet *); int PacketIsUDP(Packet *); Index: snort/src/plugin_enum.h diff -u snort/src/plugin_enum.h:1.1.1.2 snort/src/plugin_enum.h:1.8.2.2 --- snort/src/plugin_enum.h:1.1.1.2 Thu Mar 10 13:13:47 2005 +++ snort/src/plugin_enum.h Wed May 4 23:13:27 2005 @@ -34,4 +34,23 @@ PLUGIN_TTL_CHECK, PLUGIN_BYTE_TEST, PLUGIN_PCRE, +#ifdef WIRELESS + PLUGIN_WIFI_TYPE_CHECK, + PLUGIN_WIFI_STYPE_CHECK, + PLUGIN_WIFI_TO_DS_CHECK, + PLUGIN_WIFI_FROM_DS_CHECK, + PLUGIN_WIFI_MORE_FRAGS_CHECK, + PLUGIN_WIFI_RETRY_CHECK, + PLUGIN_WIFI_PWR_MGMT_CHECK, + PLUGIN_WIFI_MORE_DATA_CHECK, + PLUGIN_WIFI_WEP_CHECK, + PLUGIN_WIFI_ORDER_CHECK, + PLUGIN_WIFI_FRAME_CONTROL_CHECK, + PLUGIN_WIFI_DURATION_ID_CHECK, + PLUGIN_WIFI_BSSID_CHECK, + PLUGIN_WIFI_SEQNUM_CHECK, + PLUGIN_WIFI_FRAGNUM_CHECK, + PLUGIN_WIFI_ADDR4_CHECK, + PLUGIN_WIFI_SSID_CHECK +#endif /* WIRELESS */ }; Index: snort/src/rules.h diff -u snort/src/rules.h:1.1.1.6 snort/src/rules.h:1.6.2.3 --- snort/src/rules.h:1.1.1.6 Sun Apr 24 22:11:14 2005 +++ snort/src/rules.h Fri Jun 10 19:11:30 2005 @@ -70,6 +70,17 @@ #define EXCEPT_IP 0x01 +#ifdef WIRELESS +#define EXCEPT_SRC_MAC 0x01 +#define EXCEPT_DST_MAC 0x02 +#define EXCEPT_BSSID_MAC 0x04 +#define ANY_SRC_MAC 0x08 +#define ANY_DST_MAC 0x10 +#define ANY_BSSID_MAC 0x20 + +#define EXCEPT_MAC 0x01 +#endif /* WIRELESS */ + #define R_FIN 0x01 #define R_SYN 0x02 #define R_RST 0x04 @@ -233,6 +244,18 @@ } IpAddrSet; #endif /* RELOCATED to parser/IpAddrSet.h */ + +#ifdef WIRELESS +/* #warning "Move _MacAddrSet to parser/MacAddrSet.h at some point" */ +typedef struct _MacAddrSet{ + u_int8_t mac_addr[6]; + u_int8_t addr_flags; + + struct _MacAddrSet *next; +} MacAddrSet; +#endif /* WIRELESS */ + + typedef struct _RuleTreeNode { RuleFpList *rule_func; /* match functions.. (Bidirectional etc.. ) */ @@ -240,6 +263,12 @@ int head_node_number; int type; +#ifdef WIRELESS + int is_wifi; + + MacAddrSet *smac; + MacAddrSet *dmac; +#endif /* WIRELESS */ IpAddrSet *sip; IpAddrSet *dip; @@ -278,6 +307,9 @@ RuleTreeNode *TcpList; RuleTreeNode *UdpList; RuleTreeNode *IcmpList; +#ifdef WIRELESS + RuleTreeNode *WifiList; +#endif /* WIRELESS */ struct _OutputFuncNode *LogList; struct _OutputFuncNode *AlertList; struct _RuleListNode *ruleListNode; Index: snort/src/snort.c diff -u snort/src/snort.c:1.1.1.9 snort/src/snort.c:1.6.2.4 --- snort/src/snort.c:1.1.1.9 Sun Apr 24 22:11:18 2005 +++ snort/src/snort.c Fri Jun 10 19:11:30 2005 @@ -76,6 +76,7 @@ #include "event_queue.h" #include "asn1.h" #include "inline.h" +#include "wifi_statetable.h" /* G L O B A L S ************************************************************/ extern OutputFuncNode *AlertList; @@ -549,7 +550,17 @@ printRuleOrder(); LogMessage("Log directory = %s\n", pv.log_dir); } - } + +#ifdef WIRELESS + /* Create WifiStateTable */ + if(!pv.quiet_flag) + { + LogMessage("\n+++++++++++++++++++++++++++++++++++++++++++++++++++\n"); + LogMessage("Allocating memory for WifistateTable...\n"); + } + WSTDoTable(); +#endif /* WIRELESS */ + } #ifndef WIN32 @@ -1504,6 +1515,21 @@ grinder = DecodeIEEE80211Pkt; break; #endif + +#ifdef WIRELESS +#ifdef DLT_PRISM_HEADER + case DLT_PRISM_HEADER: + if(!pv.readmode_flag){ + if(!pv.quiet_flag) + LogMessage("Decoding IEEE 802.11 with PRISM headers on interface %s\n", + PRINT_INTERFACE(pv.interface)); + } + + grinder = DecodePrismHdr; + break; +#endif +#endif /* WIRELESS */ + case 13: case DLT_IEEE802: /* Token Ring */ if(!pv.readmode_flag) Index: snort/src/wifi_statetable.c diff -u /dev/null snort/src/wifi_statetable.c:1.1.2.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/wifi_statetable.c Sat Apr 23 02:19:32 2005 @@ -0,0 +1,605 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2004 Sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_MAP_ANONYMOUS +#include +#endif + +#include "decode.h" +#include "util.h" +#include "debug.h" +#include "generators.h" +#include "log.h" +#include "plugbase.h" +#include "detect.h" +#include "snort.h" + +#ifndef __WIFI_STATETABLE_C__ +#define __WIFI_STATETABLE_C__ +#include "wifi_statetable.h" +#endif + +static u_int16_t current_size = WST_DATA_INITIAL_LENGTH; +/* Total size of data associated with a MAC address inside the WST + * (Wifi StateTable). Incremented during preprocessors initialization + * whenever a preprocessor request new data recording */ + +static u_int8_t *WST_ptr; /* pointer to the WST */ + +static u_int32_t rdm = 0; /* random value */ +/* MAC address and corresponding data will be inserted inside WST through + * a Hashing process (see WSTSearchAndInsert comments). rdm is used to avoid + * predictable Hash value */ + +static u_int32_t alert_time = 0; +/* time in second when the last "RANDOM_MAC_ADDR_TRAFFIC" alert was sended */ + +static u_int32_t timeout = 0; +/* Time validity of a MAC address and associated data recorded inside the + * WST. WSTSearchAndInsert function considers as decayed a MAC address and data + * with a timeval older than timeout. + * Update throught WSTUpdateTimeout. */ + +/* + * Function: u_int16_t WSTInit(u_int8_t size) + * + * Purpose: Called by WST's preprocessors. + * Updates current_size and returns data offset corresponding to + * calling preprocessor's needs. + * + * Arguments: size => data's size + * + * Returns: data's offset + */ +u_int16_t WSTInit(u_int8_t size) +{ + u_int16_t buffer_size; + + buffer_size = current_size; + current_size += size; + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "WSTInit function." + "current_size = %u, was just %u bytes increased\n", + current_size, size);); + + return(buffer_size); +} + + +/* + * Function: void WSTDoTable(void) + * + * Purpose: Creates WST called by SnortMain. + * + * Arguments: None + * + * Returns: void + */ +void WSTDoTable(void) +{ + static u_int32_t wst_total_size; /* total size in bytes of WST */ + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "Creating WST\n");); + + if(current_size == WST_DATA_INITIAL_LENGTH){ + if(!pv.quiet_flag){ + LogMessage("No memory allocated since no preprocessor requires it"); + LogMessage("\n+++++++++++++++++++++++++++++++++++++++++++++++++++\n"); + } + return; + } + + srand(time(0)); + rdm = rand(); /* allocating a radom value to rdm */ + + wst_total_size = current_size*WST_LENGTH; + +#ifdef HAVE_MAP_ANONYMOUS + WST_ptr = mmap(NULL, wst_total_size, PROT_READ | PROT_WRITE , + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (WST_ptr == MAP_FAILED){ + FatalError("WSTDoTable failed to map requested length into memory: %s\n", + strerror(errno)); + } +#else + WST_ptr = malloc(wst_total_size); + if (WST_ptr == NULL){ + FatalError("WSTDoTable failed to allocate requested memory: %s\n", + strerror(errno)); + } +#endif + if(!pv.quiet_flag){ + LogMessage("%u Kbyte allocated\n", (wst_total_size >> 10)); + LogMessage(" %s: %u\n", OPT_WST_LENGTH, WST_LENGTH); + LogMessage(" %s: %u\n", OPT_WST_TIMEOUT , timeout); + LogMessage(" %s: %u\n", OPT_MAX_HASH_RETRY, MAX_HASH_RETRY); + LogMessage(" %s: %u", OPT_WST_ALERT_PERIOD, WST_ALERT_PERIOD); + LogMessage("\n+++++++++++++++++++++++++++++++++++++++++++++++++++\n"); + } + memset(WST_ptr , 0, wst_total_size); + + srand(time(0)); + rdm = rand(); /* allocating a radom value to rdm */ + + AddFuncToCleanExitList(WSTCleanExitFunction, &wst_total_size); + AddFuncToRestartList(WSTRestartFunction, &wst_total_size); + + return; +} + +/* + * Function: void WSTUpdateTimeout(u_int32_t time) + * + * Purpose: Called by WST preprocessors. + * Whenever called, WSTmain checks whether or not needed timeout is superior or not + * to actual WST timeout. + * If not, updates it. + * + * Arguments: time => WST timeout length requested by calling preprocessor. + * + * Returns: void + */ +void WSTUpdateTimeout(u_int32_t time) +{ + if(time * 2 >= timeout){ + timeout = time * 2; + } + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, " WST timeout =%u\n", timeout);); + return; +} + + +/* + * Function: void WSTMain(Packet *p, wst_flag_type flag_addr) + * + * Purpose: Called by WST preprocessors. + * Whenever called, WSTmain checks whether or not a previous preprocessor + * already made a request for corresponding MAC address packet (src or dest). + * If not, fills up desired p->wstidx.cache_addr by calling WSTSearchAndUInsert + * function. + * + * Arguments: p => pointer to the current packet data struct + * + * flag_addr => either src or dst wst_flag_type depending on + * calling preprocessors needs. + * + * Returns: void + */ +void WSTMain(Packet *p, wst_flag_type flag_addr) +{ + u_int8_t *MACaddr_ptr; /* pointer to p->wifih corresponding to desired + MAC address */ + int8_t offset; + + /* checks whether or not p->wstidx.cache_addr[flag_addr] is already filled up. + * if not determine MACaddr_ptr and finally fills p->wstidx.cache_addr[flag_addr] up */ + + if(!p->wstidx.cache_addr[flag_addr]){ + offset = WSTDetermineMACAddrOffset(p, flag_addr); + if(offset == -1){ + p->wstidx.cache_addr[flag_addr] = WST_FAILED; + return; + } + else{ + MACaddr_ptr = ((u_int8_t*) p->wifih + offset); + + /* finally calls WSTSearchAndInsert function to determine + * p->wstidx.cache_addr[flag_addr] */ + + p->wstidx.cache_addr[flag_addr] = WSTSearchAndInsert(p, MACaddr_ptr, flag_addr); + } + } + return; +} + + +/* + * Function: int8_t WSTDetermineMACAddrOffset(Packet *p, wst_flag_type flag_addr) + * + * Purpose: Depending on both kind of frame type and needs + * (src or dst MAC address), determines needed offset inside p->wifih + * + * Arguments: p => pointer to the current packet data struct + * + * flag_addr => either src or dst wst_flag_type depending on + * calling preprocessors needs. + * + * Returns: needed offset inside p->wifih or -1 if failed + */ +int8_t WSTDetermineMACAddrOffset(Packet *p, wst_flag_type flag_addr) +{ + + switch(p->wifih->type){ + + case TYPE_MANAGEMENT: + if(flag_addr == WST_FLAG_SRCADDR){ + return(OFFSET_MANAGEMENT_SRCADDR); + } + else{ + return(OFFSET_MANAGEMENT_DESTADDR); + } + + case TYPE_CONTROL: + if(p->wifih->stype == STYPE_CTS || p->wifih->stype == STYPE_ACK){ + if(flag_addr == WST_FLAG_DESTADDR){ + return(OFFSET_CONTROL_DESTADDR); + } + else{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, + "received frame do not contain any source MAC address/invalid request\n");); + return -1; + } + } + else{ + if(flag_addr == WST_FLAG_SRCADDR){ + return(OFFSET_CONTROL_SRCADDR); + } + else{ + return(OFFSET_CONTROL_DESTADDR); + } + } + + case TYPE_DATA: + if(p->wifih->from_ds){ + if(p->wifih->to_ds){ /* from_ds == 1 && to_ds == 1 */ + if(flag_addr == WST_FLAG_SRCADDR){ + return(OFFSET_DATA_SRCADDR_FROM_TO); + } + else{ + return(OFFSET_DATA_DESTADDR_FROM_TO); + } + } + else{ + if(flag_addr == WST_FLAG_SRCADDR){ /* from_ds == 1 && to_ds == 0 */ + return(OFFSET_DATA_SRCADDR_FROM); + } + else{ + return(OFFSET_DATA_DESTADDR_FROM); + } + } + } + else{ + if(p->wifih->to_ds){ /* from_ds == 0 && to_ds == 1 */ + if(flag_addr == WST_FLAG_SRCADDR){ + return(OFFSET_DATA_SRCADDR_TO); + } + else{ + return(OFFSET_DATA_DESTADDR_TO); + } + } + else{ + if(flag_addr == WST_FLAG_SRCADDR){ /* from_ds == 0 && to_ds == 0 */ + return(OFFSET_DATA_SRCADDR_); + } + else{ + return(OFFSET_DATA_DESTADDR_); + } + } + } + + default: + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "received frame with unknown/invalid type\n");); + return -1; + } +} + + +/* + * Function: int32_t WSTSearchAndInsert(Packet *p, u_int8_t *MACaddr_ptr, + * wst_flag_type flag_addr) + * + * Purpose: Searches for the MAC address pointed by MACaddr_prt inside WST. + * In default, inserts it. + * If neither able to find nor insert it, sends an alert (traffic with random + * address detected). + * + * Arguments: p => pointer to the current packet data struct + * + * MACaddr_ptr => pointer to p->wifih corresponding to desired + * MAC address + * + * flag_addr => either src or dst wst_flag_type depending upon + * calling preprocessors needs. + * + * Returns: memory address corresponding to the place where MAC address and + * related data are recorded inside WST. + */ +int32_t WSTSearchAndInsert(Packet *p, u_int8_t *MACaddr_ptr, + wst_flag_type flag_addr) +{ + u_int32_t hash, x[2]; + u_int32_t wst_offset_line; /* offset line inside WST table */ + u_int8_t cpt=0; /* number of retry while trying to determine where MAC adrress and + * related data are recorded inside WST */ + struct timeval wst_tv, tv_diff; + Event event; + char outstring[255], tmp[255]; + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "WSTSearchAndInsert function processing " + "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x MAC address\n", + *((u_int8_t *)(MACaddr_ptr)), *((u_int8_t *)(MACaddr_ptr + 1)), + *((u_int8_t *)(MACaddr_ptr + 2)), *((u_int8_t *)(MACaddr_ptr + 3)), + *((u_int8_t *)(MACaddr_ptr + 4)), *((u_int8_t *)(MACaddr_ptr + 5)));); + + /* fill up x[0] and x[1]. x[0] contains the 4 first bytes of MAC address, x[1] + * the last 2. To avoid later predictable hash value x[0] is gonna be xored with a random + * value: rdm. */ + + x[1]=0; + memcpy(&x[0], MACaddr_ptr, SIZE_MAC_ADDR); + x[0] ^= rdm; + + /* It's time to determine where MAC adrress and related data are recorded + * inside WST */ + + do{ + + /* Determines Hash value */ + + hash = WSTMix32(x[0], x[1]); + hash %= WST_LENGTH; + + /* evaluates wst_offset_line */ + + wst_offset_line = hash * current_size; + + /* Checks if wst_offset_line is the offset line associated with needed MAC + * address (the one we are looking for) */ + + if(!memcmp(MACaddr_ptr, WST_ptr + wst_offset_line, SIZE_MAC_ADDR)){ + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "Find corresponding line offset" + " inside WST\n");); + + /* Updates timeval related with MAC address inside WST */ + + memcpy(WST_ptr + wst_offset_line + SIZE_MAC_ADDR, &p->pkth->ts, + sizeof(struct timeval)); + + /* returns memory address corresponding to MAC address and related data + we were looking for */ + + return((int32_t) (WST_ptr + wst_offset_line)); + } + + /* calculated wst_offset_line isn't the offset line associated with needed + * MAC address. Maybe MAC address associated with wst_offset_line should be + * considered as decayed because of an expired associated timeval? */ + + memcpy(&wst_tv , WST_ptr + wst_offset_line + SIZE_MAC_ADDR, + sizeof(struct timeval)); + tv_diff = WSTTimevalSubtract(p->pkth->ts, wst_tv); + if(tv_diff.tv_sec > timeout){ + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "Find a decayed MAC address" + " inside WST\n");); + + /* Overwrites decayed MAC address with the new one and updates timeval + * related with */ + + memcpy(WST_ptr + wst_offset_line, MACaddr_ptr, SIZE_MAC_ADDR); + memcpy(WST_ptr + wst_offset_line + SIZE_MAC_ADDR, &p->pkth->ts, + sizeof(struct timeval)); + + /* refreshes WST data */ + + bzero(WST_ptr + wst_offset_line + SIZE_MAC_ADDR + sizeof(struct timeval), + current_size - SIZE_MAC_ADDR - sizeof(struct timeval)); + + /* returns memory address corresponding to the place where MAC address + * and related data are now recorded inside WST */ + + return((int32_t) (WST_ptr + wst_offset_line)); + } + + /* Though MAC address pointed by wst_offset_line isn't the one + * we were looking for, associated timeval will be updated. + * Such refresh is made too avoid any subsequent loss of data due to both + * collision and unlucky timeval expiry situation. + * On the other hand, such refresh might involv some "dead wst_offset_line + * " offset. According to wireless network characteristics, it shouldn't + * have any real consequences. */ + + memcpy(WST_ptr + wst_offset_line + SIZE_MAC_ADDR, &p->pkth->ts, + sizeof(struct timeval)); + + /* Raising x[1] to calculate a new hash value and furthermore + a new wst_offset_line. */ + + x[1] += 1; + cpt++; + } while(cpt <= MAX_HASH_RETRY); + + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "WSTSearchAndInsert function failed" + " to insert MAC address inside WST\n");); + + /* Checks whether or not an alert has already been sended before WST_ALERT_PERIOD + * ended. */ + + if(alert_time + WST_ALERT_PERIOD > p->pkth->ts.tv_sec){ + return( WST_FAILED); + } + + /* an alert gonna be raised */ + + alert_time = p->pkth->ts.tv_sec; + + if(flag_addr == WST_FLAG_SRCADDR){ + snprintf(outstring, 255, RANDOM_SRC_MAC); + } + else{ + snprintf(outstring, 255, RANDOM_DST_MAC); + } + snprintf(tmp, 255, + "\nAddr src: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x" + " -> Addr dst: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x" + ",\nBssid: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x, TYPE: 0x%x, STYPE: 0x%x.", + p->wifih->addr2[0], p->wifih->addr2[1], p->wifih->addr2[2], + p->wifih->addr2[3], p->wifih->addr2[4], p->wifih->addr2[5], + p->wifih->addr1[0], p->wifih->addr1[1], p->wifih->addr1[2], + p->wifih->addr1[3], p->wifih->addr1[4], p->wifih->addr1[5], + p->wifih->addr3[0], p->wifih->addr3[1], p->wifih->addr3[2], + p->wifih->addr3[3], p->wifih->addr3[4], p->wifih->addr3[5], + p->wifih->type, p->wifih->stype); + strncat(outstring, tmp, 255); + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "%s\n", outstring);); + + SetEvent(&event, GENERATOR_WIFI_STATETABLE, RANDOM_MAC_ADDR_TRAFFIC, + 1, 0, 0, 0); + CallAlertFuncs(p, outstring, NULL, &event); /* send alert */ + + return(WST_FAILED); +} + + +/* + * Function: u_int32_t WSTMix32(u_int32_t x, u_int32_t y) + * + * Purpose: Calculate an hash value based on two u_int32_t. + * + * Arguments: x => first u_int32_t + * y => second u_int32_t + * + * Returns: hash value + */ +u_int32_t WSTMix32(u_int32_t x, u_int32_t y) +{ + u_int32_t db5=0xfb5cc520, w31_27; + + w31_27 = (y>>27); y<<=5; y+=((db5>>w31_27)^(db5<<(32-w31_27))); + w31_27 = (y>>27); y<<=5; y+=((db5>>w31_27)^(db5<<(32-w31_27))); + + w31_27 = (x>>27); x<<=5; x+=((db5>>w31_27)^(db5<<(32-w31_27))); + + x^=y; + + w31_27 = (x>>27); x<<=5; x+=((db5>>w31_27)^(db5<<(32-w31_27))); + w31_27 = (x>>27); x<<=5; x+=((db5>>w31_27)^(db5<<(32-w31_27))); + w31_27 = (x>>27); x<<=5; x+=((db5>>w31_27)^(db5<<(32-w31_27))); + w31_27 = (x>>27); x<<=5; x+=((db5>>w31_27)^(db5<<(32-w31_27))); + w31_27 = (x>>27); x<<=5; x+=((db5>>w31_27)^(db5<<(32-w31_27))); + + return(x); +} + + +/* + * Function: struct timeval WSTTimevalSubtract(struct timeval x, struct timeval y) + * + * Purpose: Subtract two `struct timeval. + * + * Arguments: x => first struct timeval value + * y => second struct timeval value + * + * Returns: result of subtract + */ +struct timeval WSTTimevalSubtract (struct timeval x, struct timeval y) +{ + struct timeval result; + + /* Perform the carry for the later subtraction by updating Y. */ + if (x.tv_usec < y.tv_usec){ + int nsec = (y.tv_usec - x.tv_usec) / 1000000 + 1; + y.tv_usec -= 1000000 * nsec; + y.tv_sec += nsec; + } + if (x.tv_usec - y.tv_usec > 1000000){ + int nsec = (x.tv_usec - y.tv_usec) / 1000000; + y.tv_usec += 1000000 * nsec; + y.tv_sec -= nsec; + } + + /* Compute the time remaining to wait. + `tv_usec' is certainly positive. */ + result.tv_sec = x.tv_sec - y.tv_sec; + result.tv_usec = x.tv_usec - y.tv_usec; + + return(result); +} + + +/* + * Function: void WSTCleanExitFunction(int, void *) + * + * Purpose: free wifi statetable while exiting snort + * + * Arguments: + * + * Returns: void + */ +void WSTCleanExitFunction(int signal, void *arg) +{ + u_int32_t *size = (u_int32_t *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "WSTCleanExitFunction\n");); + +#ifdef HAVE_MAP_ANONYMOUS + if(munmap(NULL, *size) == -1) + LogMessage("Munmap failure: %s\n", + strerror(errno)); +#else + free(WST_ptr); +#endif + return; +} + + +/* + * Function: void WSTRestartFunction(int, void *) + * + * Purpose: free wifi statetable while restarting snort + * + * Arguments: + * + * Returns: void + */ +void WSTRestartFunction(int signal, void *arg) +{ + u_int32_t *size = (u_int32_t *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_WIFI_STATETABLE, "WSTRestartFunction\n");); + +#ifdef HAVE_MAP_ANONYMOUS + if(munmap(NULL, *size) == -1) + LogMessage("Munmap failure: %s\n", + strerror(errno)); +#else + free(WST_ptr); +#endif + return; +} + +#endif /* WIRELESS */ Index: snort/src/wifi_statetable.h diff -u /dev/null snort/src/wifi_statetable.h:1.1.2.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/wifi_statetable.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,161 @@ +/* +** Copyright (C) 2004 Sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + + +#ifndef __WIFI_STATETABLE_H__ +#define __WIFI_STATETABLE_H__ + +#ifdef WIRELESS + +/* I N C L U D E S +*******************************************************************************/ + + +/* D E F I N E S +*******************************************************************************/ + +#define SIZE_MAC_ADDR (u_int32_t) 6 + +#define WST_DATA_INITIAL_LENGTH SIZE_MAC_ADDR + sizeof(struct timeval) +/* intitial size of data recorded inside the WST (Wifi StateTable), + * corresponding to the size of a MAC address and a struct timeval */ + + +#define WST_LENGTH (u_int32_t) 1 << 18 +/* Total lenght of the WST, corresponding to the maximum number of valid MAC + * address recorded inside. A valid MAC address means a MAC address with an + * associated timeval below WST_TIMEOUT */ + +#define MAX_HASH_RETRY (u_int8_t) 5 +/* Maximum number of retry for the WSTSearchAnsInsert function to insert or + * search for a MAC address inside the WST. Above this limit an alert will be + * send because someone around sending wifi frames with numerous random either + * source or destination MAC address */ + +#define WST_ALERT_PERIOD 120 +/* Number of second to wait for sending a new "RANDOM_MAC_ADDR-TRAFFIC" alert + * if such a situation is still occur */ + +#define WST_FAILED -1 +/* value return by WSTSearchAnsInsert function whenever MAX_HASH_RETRY is + * overruned or WSTMain received frame with unknow/invalid type */ + +#define OPT_WST_LENGTH "wst_length" +#define OPT_WST_TIMEOUT "wst_timeout" +#define OPT_MAX_HASH_RETRY "wst_max_hash_retry" +#define OPT_WST_ALERT_PERIOD "wst_alert_period" + +typedef enum { + /* 802.11 management frame address offset */ + OFFSET_MANAGEMENT_SRCADDR = 0x0a, + OFFSET_MANAGEMENT_DESTADDR = 0x04, + + /* 802.11 control frame address offset */ + OFFSET_CONTROL_SRCADDR = 0x0a, + OFFSET_CONTROL_DESTADDR = 0x04, + + /* 802.11 data frame address offset */ + OFFSET_DATA_SRCADDR_FROM_TO = 0x0a, + OFFSET_DATA_DESTADDR_FROM_TO = 0x10, + + OFFSET_DATA_SRCADDR_FROM = 0x10, + OFFSET_DATA_DESTADDR_FROM = 0x04, + + OFFSET_DATA_SRCADDR_TO = 0x0a, + OFFSET_DATA_DESTADDR_TO = 0x10, + + OFFSET_DATA_SRCADDR_ = 0x0a, + OFFSET_DATA_DESTADDR_ = 0x04 +} addr_offset_t; +/* Whenever called WSTSearchAndInsert function will record data associated on + * either source or destination MAC address, depending on calling + * preprocessor's needs. Thanks to addr_offset_t, WSTSearchAndInsert will look + * for the right offset for each packet */ + +typedef enum { + WST_FLAG_SRCADDR = 0x00, + WST_FLAG_DESTADDR = 0x01 +} wst_flag_type; + + +/* borrowed from airsnort */ +typedef enum { /* 802.11 frame types */ + TYPE_INVALID = -1, + TYPE_MANAGEMENT = 0x00, + TYPE_CONTROL = 0x01, + TYPE_DATA = 0x02 +} wifi_type_t; + + +typedef enum { /* 802.11 management frame subtypes */ + STYPE_ASSOCREQ = 0x00, /* Subtypes are already AND'ed with their */ + STYPE_ASSOCRESP = 0x01, /* corresponding Types to prevent false */ + STYPE_REASSOC_REQ = 0x02, /* positives and the need for checking the type */ + STYPE_REASSOC_RESP = 0x03, /* independently */ + STYPE_PROBEREQ = 0x04, + STYPE_PROBERESP = 0x05, + STYPE_BEACON = 0x08, + STYPE_ATIM = 0x09, + STYPE_DISASSOC = 0x0a, + STYPE_AUTH = 0x0b, + STYPE_DEAUTH = 0x0c, + STYPE_INVALID = 0x0d, + +/* 802.11 control frame subtypes */ + STYPE_PS = 0x0a, + STYPE_RTS = 0x0b, + STYPE_CTS = 0x0c, + STYPE_ACK = 0x0d, + STYPE_CFEND = 0x0e, + STYPE_CFEND_CFACK = 0x0f, + +/* 802.11 data frame subtypes */ + STYPE_DATA = 0x00, + STYPE_CFACK = 0x01, + STYPE_CFPOLL = 0x02, + STYPE_CFACK_CFPOLL = 0x03, + STYPE_NULLFUNC = 0x04, + STYPE_CFACK_NULLFUNC = 0x05, + STYPE_CFPOLL_NULLFUNC = 0x06, + STYPE_CFACK_CFPOLL_NULLFUNC = 0x07 +} wifi_stype_t; + + +/* P R O T O T Y P E S +*******************************************************************************/ + +u_int16_t WSTInit(u_int8_t); +void WSTDoTable(); +void WSTUpdateTimeout(u_int32_t); +void WSTMain(Packet *, wst_flag_type); +int8_t WSTDetermineMACAddrOffset(Packet *, wst_flag_type); +int32_t WSTSearchAndInsert(Packet *, u_int8_t *, wst_flag_type); +u_int32_t WSTMix32(u_int32_t, u_int32_t); +struct timeval WSTTimevalSubtract (struct timeval , struct timeval ); +void WSTCleanExitFunction(int, void *); +void WSTRestartFunction(int, void *); + +#endif /* WIRELESS */ + +#endif /* __WIFI_STATETABLE_H__ */ Index: snort/src/detection-plugins/Makefile.am diff -u snort/src/detection-plugins/Makefile.am:1.1.1.4 snort/src/detection-plugins/Makefile.am:1.10.2.2 --- snort/src/detection-plugins/Makefile.am:1.1.1.4 Sun Apr 24 00:25:25 2005 +++ snort/src/detection-plugins/Makefile.am Sat May 14 02:22:40 2005 @@ -16,6 +16,24 @@ sp_tcp_win_check.c sp_tcp_win_check.h sp_ttl_check.c sp_ttl_check.h \ sp_clientserver.c sp_clientserver.h sp_byte_check.c sp_byte_check.h \ sp_byte_jump.c sp_byte_jump.h sp_pcre.c sp_pcre.h sp_isdataat.c sp_isdataat.h \ -sp_flowbits.c sp_flowbits.h sp_asn1.c sp_asn1.h +sp_flowbits.c sp_flowbits.h sp_asn1.c sp_asn1.h \ +sp_wifi_type.c sp_wifi_type.h \ +sp_wifi_stype.c sp_wifi_stype.h \ +sp_wifi_to_ds.c sp_wifi_to_ds.h \ +sp_wifi_from_ds.c sp_wifi_from_ds.h \ +sp_wifi_more_frags.c sp_wifi_more_frags.h \ +sp_wifi_retry.c sp_wifi_retry.h \ +sp_wifi_pwr_mgmt.c sp_wifi_pwr_mgmt.h \ +sp_wifi_more_data.c sp_wifi_more_data.h \ +sp_wifi_wep.c sp_wifi_wep.h \ +sp_wifi_order.c sp_wifi_order.h \ +sp_wifi_frame_control.c sp_wifi_frame_control.h \ +sp_wifi_duration_id.c sp_wifi_duration_id.h \ +sp_wifi_bssid.c sp_wifi_bssid.h \ +sp_wifi_seqnum.c sp_wifi_seqnum.h \ +sp_wifi_fragnum.c sp_wifi_fragnum.h \ +sp_wifi_addr4.c sp_wifi_addr4.h \ +sp_wifi_ssid.c sp_wifi_ssid.h \ +wifi_datatypes.h INCLUDES = @INCLUDES@ Index: snort/src/detection-plugins/sp_asn1.c diff -u snort/src/detection-plugins/sp_asn1.c:1.1.1.2 snort/src/detection-plugins/sp_asn1.c:1.1.1.2.4.1 --- snort/src/detection-plugins/sp_asn1.c:1.1.1.2 Sun Apr 24 22:11:26 2005 +++ snort/src/detection-plugins/sp_asn1.c Sat May 14 02:22:40 2005 @@ -1,4 +1,4 @@ -/* $Id: sp_asn1.c,v 1.1.4.1 2004/11/17 15:54:23 jhewlett Exp $ */ +/* $Id: sp_asn1.c,v 1.1 2004/06/16 18:49:24 jhewlett Exp $ */ /** ** @file sp_asn1.c @@ -29,9 +29,6 @@ ** alert tcp any any -> any 162 (msg:"foo2"; \ ** asn1: bitstring_overflow, oversize_length 500, relative_offset 7;) ** -** -** Note that further general information about ASN.1 can be found in -** the file doc/README.asn1. */ #ifdef HAVE_CONFIG_H Index: snort/src/detection-plugins/sp_wifi_addr4.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_addr4.c:1.3.2.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_addr4.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,250 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_addr4.c,v 1.3.2.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_addr4 + * + * Purpose: + * + * Tests 802.11 frames 4th address field. + * + * Arguments: + * + * {{ '!' | {} } } + * + * Effect: + * + * Success on address field match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiAddr4Data +{ + u_int8_t addr4[6]; + u_int8_t not_flag; +} WifiAddr4Data; + +void WifiAddr4Init(char *, OptTreeNode *, int); +void WifiAddr4RuleParseFunction(char *, OptTreeNode *); +int WifiAddr4DetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiAddr4() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiAddr4() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("addr4", WifiAddr4Init); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiAddr4 Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiAddr4Init(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiAddr4Init(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_ADDR4_CHECK] = (WifiAddr4Data *) calloc(sizeof(WifiAddr4Data), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiAddr4RuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiAddr4DetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiAddr4RuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiAddr4RuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiAddr4Data *ds_ptr; /* data struct pointer */ + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_ADDR4_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + if(WifiAddr4ParseMAC(ds_ptr->addr4, data) < 0) + FatalError("%s (%d) => Error parsing MAC address \"%s\"\n", file_name, file_line, data); +} + + + +/* + * Function: WifiAddr4ParseMAC(u_int8_t *, char *) + * + * Purpose: Parses BSSIDs from a character string and stores them + * in a byte array. + * + * Arguments: bssid => pointer to byte array to store parsed BSSID in + * mac_str => character string containing BSSID + * + * Returns: 0 on success, -1 on error + * + */ + +int WifiAddr4ParseMAC(u_int8_t *bssid, char *mac_str){ + + u_int64_t mac; + + if(strlen(mac_str) != 14) + return -1; + + mac = strtoll(mac_str, NULL, 16); + if(mac < 0 || mac > 0xffffffffffff) + return -1; + + bssid[0] = mac >> 40 & 0x00ff; + bssid[1] = mac >> 32 & 0x00ff; + bssid[2] = mac >> 24 & 0x00ff; + bssid[3] = mac >> 16 & 0x00ff; + bssid[4] = mac >> 8 & 0x00ff; + bssid[5] = mac & 0x00ff; + + return 0; +} + + + +/**************************************************************************** + * + * Function: WifiAddr4DetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiAddr4DetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiAddr4Data *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_ADDR4_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + if(p->wifih->type != TYPE_DATA || p->wifih->to_ds != 1 || p->wifih->from_ds != 1){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Frame does not contain addr4 field\n");); + return 0; + } + + /* your detection function tests go here */ + if((plugin_data->not_flag && (memcmp(p->wifih->addr3, plugin_data->addr4, 6) != 0)) || + (!plugin_data->not_flag && (memcmp(p->wifih->addr3, plugin_data->addr4, 6) == 0))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ + Index: snort/src/detection-plugins/sp_wifi_addr4.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_addr4.h:1.1.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_addr4.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_addr4.h,v 1.1.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_ADDR4_H__ +#define __SP_WIFI_ADDR4_H__ + +#ifdef WIRELESS + +void SetupWifiAddr4(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_ADDR4_H__ */ Index: snort/src/detection-plugins/sp_wifi_bssid.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_bssid.c:1.6.2.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_bssid.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,291 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_bssid.c,v 1.6.2.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_bssid + * + * Purpose: + * + * Tests 802.11 frames BSSID. + * + * Arguments: + * + * {{ '!' | {} } } + * + * Effect: + * + * Success on BSSID match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiBssidData +{ + u_int8_t bssid[6]; + u_int8_t not_flag; +} WifiBssidData; + +void WifiBssidInit(char *, OptTreeNode *, int); +void WifiBssidRuleParseFunction(char *, OptTreeNode *); +int WifiBssidDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiBssid() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiBssid() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("bssid", WifiBssidInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiBssid Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiBssidInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiBssidInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_BSSID_CHECK] = (WifiBssidData *) calloc(sizeof(WifiBssidData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiBssidRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiBssidDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiBssidRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiBssidRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiBssidData *ds_ptr; /* data struct pointer */ + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_BSSID_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + if(WifiBssidParseBSSID(ds_ptr->bssid, data) < 0) + FatalError("%s (%d) => Error parsing BSSID \"%s\"\n", file_name, file_line, data); +} + + + +/* + * Function: WifiBssidParseBSSID(u_int8_t *, char *) + * + * Purpose: Parses BSSIDs from a character string and stores them + * in a byte array. + * + * Arguments: bssid => pointer to byte array to store parsed BSSID in + * mac_str => character string containing BSSID + * + * Returns: 0 on success, -1 on error + * + */ + +int WifiBssidParseBSSID(u_int8_t *bssid, char *mac_str){ + + u_int64_t mac; + + if(strlen(mac_str) != 14) + return -1; + + mac = strtoll(mac_str, NULL, 16); + if(mac < 0 || mac > 0xffffffffffff) + return -1; + + bssid[0] = mac >> 40 & 0x00ff; + bssid[1] = mac >> 32 & 0x00ff; + bssid[2] = mac >> 24 & 0x00ff; + bssid[3] = mac >> 16 & 0x00ff; + bssid[4] = mac >> 8 & 0x00ff; + bssid[5] = mac & 0x00ff; + + return 0; +} + + + +/**************************************************************************** + * + * Function: WifiBssidDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiBssidDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiBssidData *plugin_data; + u_int8_t *bssid; + plugin_data = otn->ds_list[PLUGIN_WIFI_BSSID_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + switch(p->wifih->type){ /* point bssid to the correct field in the frame */ + + case TYPE_MANAGEMENT: + bssid = p->wifih->addr3; + break; + + case TYPE_CONTROL: + if(p->wifih->stype == STYPE_RTS || p->wifih->stype == STYPE_CTS || p->wifih->stype == STYPE_ACK){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Received Control frame subtype that does not contain BSSID\n");); + return 0; + } + else if(p->wifih->stype == STYPE_PS) + bssid = p->wifih->addr1; + else if(p->wifih->stype == STYPE_CFEND) + bssid = p->wifih->addr2; + else if(p->wifih->stype == STYPE_CFEND_CFACK) + bssid = p->wifih->addr2; + else{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Received Control frame with unknown/invalid subtype\n");); + return 0; + } + break; + + case TYPE_DATA: + if(p->wifih->to_ds){ + if(p->wifih->from_ds){ /* to_ds == 1 && from_ds == 1 */ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Received Data frame subtype that does not contain BSSID\n");); + return 0; + } + else /* to_ds == 1 && from_ds == 0 */ + bssid = p->wifih->addr1; + } + else{ + if(p->wifih->from_ds) /* to_ds == 0 && from_ds == 1 */ + bssid = p->wifih->addr2; + else /* to_ds == 0 && from_ds == 0 */ + bssid = p->wifih->addr3; + } + break; + + default: + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Received frame with unknown/invalid type\n");); + return 0; + } + + + /* your detection function tests go here */ + if((plugin_data->not_flag && (memcmp(bssid, plugin_data->bssid, 6) != 0)) || + (!plugin_data->not_flag && (memcmp(bssid, plugin_data->bssid, 6) == 0))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_bssid.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_bssid.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_bssid.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_bssid.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_BSSID_H__ +#define __SP_WIFI_BSSID_H__ + +#ifdef WIRELESS + +void SetupWifiBssid(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_BSSID_H__ */ Index: snort/src/detection-plugins/sp_wifi_duration_id.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_duration_id.c:1.3.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_duration_id.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,224 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_duration_id.c,v 1.3.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_duration_id + * + * Purpose: + * + * Tests 802.11 frames duration_id field. + * + * Arguments: + * + * {{ '!' | {} } { 0 <= n <= 65535 } } + * + * Effect: + * + * Success on duration_id field match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiDurationIdData +{ + u_int16_t duration_id; + u_int8_t not_flag; +} WifiDurationIdData; + +void WifiDurationIdInit(char *, OptTreeNode *, int); +void WifiDurationIdRuleParseFunction(char *, OptTreeNode *); +int WifiDurationIdDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiDurationId() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiDurationId() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("duration_id", WifiDurationIdInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiDurationId Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiDurationIdInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiDurationIdInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_DURATION_ID_CHECK] = (WifiDurationIdData *) calloc(sizeof(WifiDurationIdData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiDurationIdRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiDurationIdDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiDurationIdRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiDurationIdRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiDurationIdData *ds_ptr; /* data struct pointer */ + unsigned long val = 1 << 16; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_DURATION_ID_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + if(*data){ + if(strncmp(data, "0x", 2) == 0) + val = strtoul(data, NULL, 16); /* use strtoul so people don't have to do + sign-extended 2's complement hex*/ + else + val = strtol(data, NULL, 10); + } + + if(val < 0 || val > 65535) + FatalError("%s(%d) => duration_id value out of range \"%s\"\n", + file_name, file_line, data); + + ds_ptr->duration_id = val; +} + + +/**************************************************************************** + * + * Function: WifiDurationIdDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiDurationIdDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiDurationIdData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_DURATION_ID_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + if(p->wifih->type == TYPE_CONTROL && p->wifih->stype == STYPE_PS){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "duration_id field not present\n");); + return 0; + } + + /* your detection function tests go here */ + if((plugin_data->not_flag && (p->wifih->duration_id != plugin_data->duration_id)) || + (!plugin_data->not_flag && (p->wifih->duration_id == plugin_data->duration_id))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_duration_id.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_duration_id.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_duration_id.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_duration_id.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_DURATION_ID_H__ +#define __SP_WIFI_DURATION_ID_H__ + +#ifdef WIRELESS + +void SetupWifiDurationId(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_DURATION_ID_H__ */ Index: snort/src/detection-plugins/sp_wifi_fragnum.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_fragnum.c:1.3.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_fragnum.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,226 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_fragnum.c,v 1.3.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_fragnum + * + * Purpose: + * + * Tests 802.11 frames fragnum control field. + * + * Arguments: + * + * {{ '!' | {} } { 0 <= n <= 15 } } + * + * n may be specified in either hex or decimal + * + * Effect: + * + * Success on fragnum control field match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiFragNumData +{ + u_int16_t fragnum; + u_int8_t not_flag; +} WifiFragNumData; + +void WifiFragNumInit(char *, OptTreeNode *, int); +void WifiFragNumRuleParseFunction(char *, OptTreeNode *); +int WifiFragNumDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiFragNum() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiFragNum() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("fragnum", WifiFragNumInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiFragNum Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiFragNumInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiFragNumInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_FRAGNUM_CHECK] = (WifiFragNumData *) calloc(sizeof(WifiFragNumData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiFragNumRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiFragNumDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiFragNumRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiFragNumRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiFragNumData *ds_ptr; /* data struct pointer */ + unsigned long val = 1 << 4; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_FRAGNUM_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + if(*data){ + if(strncmp(data, "0x", 2) == 0) + val = strtoul(data, NULL, 16); /* use strtoul so people don't have to do + sign-extended 2's complement hex*/ + else + val = strtol(data, NULL, 10); + } + + if(val < 0 || val > 15) + FatalError("%s(%d) => fragnum value out of range \"%s\"\n", + file_name, file_line, data); + + ds_ptr->fragnum = val; +} + + +/**************************************************************************** + * + * Function: WifiFragNumDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiFragNumDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiFragNumData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_FRAGNUM_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + if(p->wifih->type == TYPE_CONTROL){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Frame is TYPE_CONTROL\n");); + return 0; + } + + /* your detection function tests go here */ + if((plugin_data->not_flag && (p->wifih->fragnum != plugin_data->fragnum)) || + (!plugin_data->not_flag && (p->wifih->fragnum == plugin_data->fragnum))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_fragnum.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_fragnum.h:1.1.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_fragnum.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_fragnum.h,v 1.1.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_FRAGNUM_H__ +#define __SP_WIFI_FRAGNUM_H__ + +#ifdef WIRELESS + +void SetupWifiFragNum(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_FRAGNUM_H__ */ Index: snort/src/detection-plugins/sp_wifi_frame_control.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_frame_control.c:1.4.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_frame_control.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,219 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_frame_control.c,v 1.4.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_frame_control + * + * Purpose: + * + * Tests 802.11 frames frame_control field. + * + * Arguments: + * + * {{ '!' | {} } { 0 <= n <= 65535 } } + * + * n may be specified in either hex or decimal + * + * Effect: + * + * Success on frame_control field match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiFrameControlData +{ + u_int16_t frame_control; + u_int8_t not_flag; +} WifiFrameControlData; + +void WifiFrameControlInit(char *, OptTreeNode *, int); +void WifiFrameControlRuleParseFunction(char *, OptTreeNode *); +int WifiFrameControlDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiFrameControl() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiFrameControl() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("frame_control", WifiFrameControlInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiFrameControl Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiFrameControlInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiFrameControlInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_FRAME_CONTROL_CHECK] = (WifiFrameControlData *) calloc(sizeof(WifiFrameControlData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiFrameControlRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiFrameControlDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiFrameControlRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiFrameControlRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiFrameControlData *ds_ptr; /* data struct pointer */ + unsigned long val = 1 << 16; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_FRAME_CONTROL_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + if(*data) + if(strncmp(data, "0x", 2) == 0) + val = strtoul(data, NULL, 16); /* use strtoul so people don't have to do + sign-extended 2's complement hex*/ + else + val = strtol(data, NULL, 10); + + + if(val < 0 || val > 65535) + FatalError("%s(%d) => frame_control value out of range \"%s\"\n", + file_name, file_line, data); + + ds_ptr->frame_control = val; +} + + +/**************************************************************************** + * + * Function: WifiFrameControlDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiFrameControlDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiFrameControlData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_FRAME_CONTROL_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if((plugin_data->not_flag && (p->wifih->frame_control != plugin_data->frame_control)) || + (!plugin_data->not_flag && (p->wifih->frame_control == plugin_data->frame_control))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_frame_control.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_frame_control.h:1.1.6.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_frame_control.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_frame_control.h,v 1.1.6.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_FRAME_CONTROL_H__ +#define __SP_WIFI_FRAME_CONTROL_H__ + +#ifdef WIRELESS + +void SetupWifiFrameControl(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_FRAME_CONTROL_H__ */ Index: snort/src/detection-plugins/sp_wifi_from_ds.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_from_ds.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_from_ds.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_from_ds.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_from_ds + * + * Purpose: + * + * Tests 802.11 frames from_ds control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on from_ds match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiFromDsData +{ + int val; +} WifiFromDsData; + +void WifiFromDsInit(char *, OptTreeNode *, int); +void WifiFromDsRuleParseFunction(char *, OptTreeNode *); +int WifiFromDsDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiFromDs() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiFromDs() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("from_ds", WifiFromDsInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiFromDs Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiFromDsInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiFromDsInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_FROM_DS_CHECK] = (WifiFromDsData *) calloc(sizeof(WifiFromDsData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiFromDsRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiFromDsDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiFromDsRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiFromDsRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiFromDsData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_FROM_DS_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad from_ds flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiFromDsDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiFromDsDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiFromDsData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_FROM_DS_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->from_ds == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_from_ds.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_from_ds.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_from_ds.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_from_ds.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_FROM_DS_H__ +#define __SP_WIFI_FROM_DS_H__ + +#ifdef WIRELESS + +void SetupWifiFromDs(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_FROM_DS_H__ */ Index: snort/src/detection-plugins/sp_wifi_more_data.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_more_data.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:04 2005 +++ snort/src/detection-plugins/sp_wifi_more_data.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_more_data.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_more_data + * + * Purpose: + * + * Tests 802.11 frames more_data control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on more_data flag match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiMoreDataData +{ + int val; +} WifiMoreDataData; + +void WifiMoreDataInit(char *, OptTreeNode *, int); +void WifiMoreDataRuleParseFunction(char *, OptTreeNode *); +int WifiMoreDataDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiMoreData() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiMoreData() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("more_data", WifiMoreDataInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiMoreData Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiMoreDataInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiMoreDataInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_MORE_DATA_CHECK] = (WifiMoreDataData *) calloc(sizeof(WifiMoreDataData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiMoreDataRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiMoreDataDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiMoreDataRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiMoreDataRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiMoreDataData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_MORE_DATA_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad more_data flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiMoreDataDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiMoreDataDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiMoreDataData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_MORE_DATA_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->more_data == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_more_data.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_more_data.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_more_data.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_more_data.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_MORE_DATA_H__ +#define __SP_WIFI_MORE_DATA_H__ + +#ifdef WIRELESS + +void SetupWifiMoreData(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_MORE_DATA_H__ */ Index: snort/src/detection-plugins/sp_wifi_more_frags.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_more_frags.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_more_frags.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_more_frags.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_more_frags + * + * Purpose: + * + * Tests 802.11 frames more_frags control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on more_frags flag match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiMoreFragsData +{ + int val; +} WifiMoreFragsData; + +void WifiMoreFragsInit(char *, OptTreeNode *, int); +void WifiMoreFragsRuleParseFunction(char *, OptTreeNode *); +int WifiMoreFragsDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiMoreFrags() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiMoreFrags() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("more_frags", WifiMoreFragsInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiMoreFrags Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiMoreFragsInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiMoreFragsInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_MORE_FRAGS_CHECK] = (WifiMoreFragsData *) calloc(sizeof(WifiMoreFragsData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiMoreFragsRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiMoreFragsDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiMoreFragsRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiMoreFragsRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiMoreFragsData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_MORE_FRAGS_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad more_frags flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiMoreFragsDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiMoreFragsDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiMoreFragsData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_MORE_FRAGS_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->more_frags == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_more_frags.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_more_frags.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_more_frags.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_more_frags.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_MORE_FRAGS_H__ +#define __SP_WIFI_MORE_FRAGS_H__ + +#ifdef WIRELESS + +void SetupWifiMoreFrags(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_MORE_FRAGS_H__ */ Index: snort/src/detection-plugins/sp_wifi_order.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_order.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_order.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_order.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_order + * + * Purpose: + * + * Tests 802.11 frames order control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on order flag match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiOrderData +{ + int val; +} WifiOrderData; + +void WifiOrderInit(char *, OptTreeNode *, int); +void WifiOrderRuleParseFunction(char *, OptTreeNode *); +int WifiOrderDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiOrder() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiOrder() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("order", WifiOrderInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiOrder Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiOrderInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiOrderInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_ORDER_CHECK] = (WifiOrderData *) calloc(sizeof(WifiOrderData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiOrderRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiOrderDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiOrderRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiOrderRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiOrderData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_ORDER_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad order flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiOrderDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiOrderDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiOrderData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_ORDER_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->order == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_order.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_order.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_order.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_order.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_ORDER_H__ +#define __SP_WIFI_ORDER_H__ + +#ifdef WIRELESS + +void SetupWifiOrder(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_ORDER_H__ */ Index: snort/src/detection-plugins/sp_wifi_pwr_mgmt.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_pwr_mgmt.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_pwr_mgmt.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_pwr_mgmt.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_pwr_mgmt + * + * Purpose: + * + * Tests 802.11 frames pwr_mgmt control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on pwr_mgmt flag match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiPwrMgmtData +{ + int val; +} WifiPwrMgmtData; + +void WifiPwrMgmtInit(char *, OptTreeNode *, int); +void WifiPwrMgmtRuleParseFunction(char *, OptTreeNode *); +int WifiPwrMgmtDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiPwrMgmt() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiPwrMgmt() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("pwr_mgmt", WifiPwrMgmtInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiPwrMgmt Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiPwrMgmtInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiPwrMgmtInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_PWR_MGMT_CHECK] = (WifiPwrMgmtData *) calloc(sizeof(WifiPwrMgmtData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiPwrMgmtRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiPwrMgmtDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiPwrMgmtRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiPwrMgmtRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiPwrMgmtData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_PWR_MGMT_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad pwr_mgmt flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiPwrMgmtDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiPwrMgmtDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiPwrMgmtData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_PWR_MGMT_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->pwr_mgmt == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_pwr_mgmt.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_pwr_mgmt.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_pwr_mgmt.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,26 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_pwr_mgmt.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_PWR_MGMT_H__ +#define __SP_WIFI_PWR_MGMT_H__ + +void SetupWifiPwrMgmt(); + +#endif /* __SP_WIFI_PWR_MGMT_H__ */ Index: snort/src/detection-plugins/sp_wifi_retry.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_retry.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_retry.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_retry.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_retry + * + * Purpose: + * + * Tests 802.11 frames retry control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on retry flag match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiRetryData +{ + int val; +} WifiRetryData; + +void WifiRetryInit(char *, OptTreeNode *, int); +void WifiRetryRuleParseFunction(char *, OptTreeNode *); +int WifiRetryDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiRetry() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiRetry() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("retry", WifiRetryInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiRetry Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiRetryInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiRetryInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_RETRY_CHECK] = (WifiRetryData *) calloc(sizeof(WifiRetryData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiRetryRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiRetryDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiRetryRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiRetryRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiRetryData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_RETRY_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad retry flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiRetryDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiRetryDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiRetryData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_RETRY_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->retry == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_retry.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_retry.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_retry.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_retry.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_RETRY_H__ +#define __SP_WIFI_RETRY_H__ + +#ifdef WIRELESS + +void SetupWifiRetry(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_RETRY_H__ */ Index: snort/src/detection-plugins/sp_wifi_seqnum.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_seqnum.c:1.4.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_seqnum.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,226 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_seqnum.c,v 1.4.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_seqnum + * + * Purpose: + * + * Tests 802.11 frames seqnum control field. + * + * Arguments: + * + * {{ '!' | {} } { 0 <= n <= 4095 } } + * + * n may be specified in either hex or decimal + * + * Effect: + * + * Success on seqnum control field match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiSeqNumData +{ + u_int16_t seqnum; + u_int8_t not_flag; +} WifiSeqNumData; + +void WifiSeqNumInit(char *, OptTreeNode *, int); +void WifiSeqNumRuleParseFunction(char *, OptTreeNode *); +int WifiSeqNumDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiSeqNum() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiSeqNum() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("seqnum", WifiSeqNumInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiSeqNum Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiSeqNumInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiSeqNumInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_SEQNUM_CHECK] = (WifiSeqNumData *) calloc(sizeof(WifiSeqNumData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiSeqNumRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiSeqNumDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiSeqNumRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiSeqNumRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiSeqNumData *ds_ptr; /* data struct pointer */ + unsigned long val = 1 << 12; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_SEQNUM_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + if(*data){ + if(strncmp(data, "0x", 2) == 0) + val = strtoul(data, NULL, 16); /* use strtoul so people don't have to do + sign-extended 2's complement hex */ + else + val = strtol(data, NULL, 10); + } + + if(val < 0 || val > 4095) + FatalError("%s(%d) => seqnum value out of range \"%s\"\n", + file_name, file_line, data); + + ds_ptr->seqnum = val; +} + + +/**************************************************************************** + * + * Function: WifiSeqNumDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiSeqNumDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiSeqNumData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_SEQNUM_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + if(p->wifih->type == TYPE_CONTROL){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Frame is TYPE_CONTROL\n");); + return 0; + } + + /* your detection function tests go here */ + if((plugin_data->not_flag && (p->wifih->seqnum != plugin_data->seqnum)) || + (!plugin_data->not_flag && (p->wifih->seqnum == plugin_data->seqnum))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_seqnum.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_seqnum.h:1.1.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_seqnum.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_seqnum.h,v 1.1.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_SEQNUM_H__ +#define __SP_WIFI_SEQNUM_H__ + +#ifdef WIRELESS + +void SetupWifiSeqNum(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_SEQNUM_H__ */ Index: snort/src/detection-plugins/sp_wifi_ssid.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_ssid.c:1.3.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_ssid.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,258 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_ssid.c,v 1.3.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_ssid + * + * Purpose: + * + * Tests 802.11 frames SSID. + * + * Arguments: + * + * {{ '!' | {} } } + * + * Effect: + * + * Success on SSID match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiSsidData +{ + char *ssid; + u_int8_t ssid_len; + u_int8_t not_flag; +} WifiSsidData; + +void WifiSsidInit(char *, OptTreeNode *, int); +void WifiSsidRuleParseFunction(char *, OptTreeNode *); +int WifiSsidDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiSsid() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiSsid() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("ssid", WifiSsidInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiSsid Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiSsidInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiSsidInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_SSID_CHECK] = (WifiSsidData *) calloc(sizeof(WifiSsidData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiSsidRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiSsidDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiSsidRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiSsidRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiSsidData *ds_ptr; /* data struct pointer */ + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_SSID_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + /* set the final option arguments here */ + + ds_ptr->ssid = data; + if((ds_ptr->ssid_len = strlen(data)) > 32) + FatalError("%s (%d) => SSID exceeds maximum length \"%s\"\n", file_name, file_line, data); +} + + +/**************************************************************************** + * + * Function: WifiSsidDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiSsidDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiSsidData *plugin_data; + WifiElementID *ssid_id; + u_int8_t *ssid; + + plugin_data = otn->ds_list[PLUGIN_WIFI_SSID_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + + if(p->wifih->type != TYPE_MANAGEMENT){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Frame is not TYPE_MANAGEMENT\n");); + return 0; + } + + ssid_id = (u_int8_t *)p->wifih + _OFFSET_MANAGEMENT_BODY; + ssid = (u_int8_t *)p->wifih + _OFFSET_MANAGEMENT_BODY; + + switch(p->wifih->stype){ + case STYPE_BEACON: + ssid_id +=_OFFSET_BEACON_SSID_ID; + ssid +=_OFFSET_BEACON_SSID; + break; + case STYPE_ASSOCREQ: + ssid_id += _OFFSET_ASSOCREQ_SSID_ID; + ssid += _OFFSET_ASSOCREQ_SSID; + break; + + case STYPE_REASSOC_REQ: + ssid_id += _OFFSET_REASSOC_REQ_SSID_ID; + ssid += _OFFSET_REASSOC_REQ_SSID; + break; + + case STYPE_PROBEREQ: + ssid_id += _OFFSET_PROBEREQ_SSID_ID; + ssid += _OFFSET_PROBEREQ_SSID; + break; + + case STYPE_PROBERESP: + ssid_id += _OFFSET_PROBERESP_SSID_ID; + ssid += _OFFSET_PROBERESP_SSID; + break; + + case STYPE_ASSOCRESP: + case STYPE_REASSOC_RESP: + case STYPE_ATIM: + case STYPE_DISASSOC: + case STYPE_AUTH: + case STYPE_DEAUTH: + default: + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Management frame subtype does not contain SSID\n");); + return 0; + } + + /* your detection function tests go here */ + + if((plugin_data->not_flag && (memcmp(ssid, plugin_data->ssid, plugin_data->ssid_len) != 0)) || + (!plugin_data->not_flag && (memcmp(ssid, plugin_data->ssid, plugin_data->ssid_len) == 0))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_ssid.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_ssid.h:1.1.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_ssid.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_ssid.h,v 1.1.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_SSID_H__ +#define __SP_WIFI_SSID_H__ + +#ifdef WIRELESS + +void SetupWifiSsid(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_SSID_H__ */ Index: snort/src/detection-plugins/sp_wifi_stype.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_stype.c:1.5.2.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_stype.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,296 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +/* $Id: sp_wifi_stype.c,v 1.5.2.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_stype + * + * Purpose: + * + * Tests 802.11 frames for their frame subtype and implicitly tests the frame's type too + * so that using a symbollic name for the subtype works in the assumed manner. + * + * Arguments: + * + * {{ '!' | {} } { wifi_stype_t } + * + * Effect: + * + * Success on frame sub-type match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ +#define NUM_WIFI_STYPES 40 +char *_wifi_stype_strs[] = { + "STYPE_ASSOCREQ", /* 0x00 */ + "STYPE_ASSOCRESP", /* 0x01 */ + "STYPE_REASSOC_REQ", /* 0x02 */ + "STYPE_REASSOC_RESP", /* 0x03 */ + "STYPE_PROBEREQ", /* 0x04 */ + "STYPE_PROBERESP", /* 0x05 */ + "STYPE_INVALID", /* 0x06 */ + "STYPE_INVALID", /* 0x07 */ + "STYPE_BEACON", /* 0x08 */ + "STYPE_ATIM", /* 0x09 */ + "STYPE_DISASSOC", /* 0x0a */ + "STYPE_AUTH", /* 0x0b */ + "STYPE_DEAUTH", /* 0x0c */ + "STYPE_INVALID", /* 0x0d */ + "STYPE_INVALID", /* 0x0e */ + "STYPE_INVALID", /* 0x0f */ + "STYPE_INVALID", /* 0x10 */ + "STYPE_INVALID", /* 0x11 */ + "STYPE_INVALID", /* 0x12 */ + "STYPE_INVALID", /* 0x13 */ + "STYPE_INVALID", /* 0x14 */ + "STYPE_INVALID", /* 0x15 */ + "STYPE_INVALID", /* 0x16 */ + "STYPE_INVALID", /* 0x17 */ + "STYPE_INVALID", /* 0x18 */ + "STYPE_INVALID", /* 0x19 */ + "STYPE_PSPOLL", /* 0x1a */ + "STYPE_RTS", /* 0x1b */ + "STYPE_CTS", /* 0x1c */ + "STYPE_ACK", /* 0x1d */ + "STYPE_CFEND", /* 0x1e */ + "STYPE_CFEND_CFACK", /* 0x1f */ + "STYPE_DATA", /* 0x20 */ + "STYPE_CFACK", /* 0x21 */ + "STYPE_CFPOLL", /* 0x22 */ + "STYPE_CFACK_CFPOLL", /* 0x23 */ + "STYPE_NULLFUNC", /* 0x24 */ + "STYPE_CFACK_NULLFUNC", /* 0x25 */ + "STYPE_CFPOLL_NULLFUNC", /* 0x26 */ + "STYPE_CFACK_CFPOLL_NULLFUNC" /* 0x27 */ +}; + +typedef enum { /* 802.11 management frame subtypes */ + STYPE_INVALID = -1, + STYPE_ASSOCREQ = 0x00, /* Subtypes are already AND'ed with their corresponding Types */ + STYPE_ASSOCRESP = 0x01, /* to prevent false positives and the need for checking the type */ + STYPE_REASSOC_REQ = 0x02, /* independently */ + STYPE_REASSOC_RESP = 0x03, + STYPE_PROBEREQ = 0x04, + STYPE_PROBERESP = 0x05, + STYPE_BEACON = 0x08, + STYPE_ATIM = 0x09, + STYPE_DIASSOC = 0x0a, + STYPE_AUTH = 0x0b, + STYPE_DEAUTH = 0x0c, + +/* 802.11 control frame subtypes */ + STYPE_PSPOLL = 0x1a, + STYPE_RTS = 0x1b, + STYPE_CTS = 0x1c, + STYPE_ACK = 0x1d, + STYPE_CFEND = 0x1e, + STYPE_CFEND_CFACK = 0x1f, + +/* 802.11 data frame subtypes */ + STYPE_DATA = 0x20, + STYPE_CFACK = 0x21, + STYPE_CFPOLL = 0x22, + STYPE_CFACK_CFPOLL = 0x23, + STYPE_NULLFUNC = 0x24, + STYPE_CFACK_NULLFUNC = 0x25, + STYPE_CFPOLL_NULLFUNC = 0x26, + STYPE_CFACK_CFPOLL_NULLFUNC = 0x27 +} wifi_stype_t; + +typedef struct _WifiStypeData +{ + wifi_stype_t stype; + u_int8_t not_flag; + +} WifiStypeData; + +void WifiStypeInit(char *, OptTreeNode *, int); +void WifiStypeRuleParseFunction(char *, OptTreeNode *); +int WifiStypeDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiStype() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiStype() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("stype", WifiStypeInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiStype Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiStypeInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiStypeInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_STYPE_CHECK] = (WifiStypeData *) calloc(sizeof(WifiStypeData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiStypeRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiStypeDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiStypeRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiStypeRuleParseFunction(char *data, OptTreeNode *otn) +{ + int i; + WifiStypeData *ds_ptr; /* data struct pointer */ + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_STYPE_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int)*data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + ds_ptr->stype = STYPE_INVALID; + + /* set the final option arguments here */ + for(i = 0; i < NUM_WIFI_STYPES; i++) + if(strcmp(data, _wifi_stype_strs[i]) == 0 && + strcmp(data, "STYPE_INVALID") != 0){ + ds_ptr->stype = i; + break; + } + + if(ds_ptr->stype == STYPE_INVALID) + FatalError("%s(%d) => Bad frame sub-type \"%s\"\n", file_name, file_line, data); +} + + +/**************************************************************************** + * + * Function: WifiStypeDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiStypeDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + WifiStypeData *wtd; + u_int8_t stype; + wtd = otn->ds_list[PLUGIN_WIFI_STYPE_CHECK]; + + if(!p->wifih) + { + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not WIFI\n");); + return 0; + } + + stype = p->wifih->stype | (p->wifih->type << 4); + + if((wtd->not_flag && (stype != wtd->stype)) || + (!wtd->not_flag && (stype == wtd->stype))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"No match\n");); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_stype.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_stype.h:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_stype.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_stype.h,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_STYPE_H__ +#define __SP_WIFI_STYPE_H__ + +#ifdef WIRELESS + +void SetupWifiStype(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_STYPE_H__ */ Index: snort/src/detection-plugins/sp_wifi_to_ds.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_to_ds.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_to_ds.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_to_ds.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_to_ds + * + * Purpose: + * + * Tests 802.11 frames to_ds control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on to_ds match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiToDsData +{ + int val; +} WifiToDsData; + +void WifiToDsInit(char *, OptTreeNode *, int); +void WifiToDsRuleParseFunction(char *, OptTreeNode *); +int WifiToDsDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiToDs() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiToDs() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("to_ds", WifiToDsInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiToDs Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiToDsInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiToDsInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_TO_DS_CHECK] = (WifiToDsData *) calloc(sizeof(WifiToDsData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiToDsRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiToDsDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiToDsRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiToDsRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiToDsData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_TO_DS_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad to_ds flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiToDsDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiToDsDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiToDsData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_TO_DS_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->to_ds == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_to_ds.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_to_ds.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_to_ds.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_to_ds.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_TO_DS_H__ +#define __SP_WIFI_TO_DS_H__ + +#ifdef WIRELESS + +void SetupWifiToDs(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_TO_DS_H__ */ Index: snort/src/detection-plugins/sp_wifi_type.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_type.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_type.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,225 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + + +/* $Id: sp_wifi_type.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ +/* Snort Detection Plugin Source File WifiType */ + +/* sp_wifi_type + * + * Purpose: + * + * Tests 802.11 frames for their frame type. + * + * Arguments: + * + * {{ '!' | {} } { TYPE_MANAGEMENT | TYPE_CONTROL | TYPE_DATA } } + * + * Effect: + * + * Success on frame type match, failure otherwise. + * + */ + +#include +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + +#include "wifi_datatypes.h" + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +char *_wifi_type_strs[] = { + "TYPE_MANAGEMENT", + "TYPE_CONTROL", + "TYPE_DATA" +}; + +typedef struct _WifiTypeData +{ + wifi_type_t type; + u_int8_t not_flag; + +} WifiTypeData; + +void WifiTypeInit(char *, OptTreeNode *, int); +void WifiTypeRuleParseFunction(char *, OptTreeNode *); +int WifiTypeDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiType() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiType() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("type", WifiTypeInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiType Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiTypeInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiTypeInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_TYPE_CHECK] = (WifiTypeData *) calloc(sizeof(WifiTypeData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiTypeRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiTypeDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiTypeRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiTypeRuleParseFunction(char *data, OptTreeNode *otn) +{ + int i; + WifiTypeData *ds_ptr; /* data struct pointer */ + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_TYPE_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int)*data)) data++; + + if(*data == '!'){ + ds_ptr->not_flag = 1; + data++; + } + + ds_ptr->type = TYPE_INVALID; + + /* set the final option arguments here */ + for(i = 0; i < 3; i++) + if(strcmp(data, _wifi_type_strs[i]) == 0){ + ds_ptr->type = i; + break; + } + + if(ds_ptr->type == TYPE_INVALID) + FatalError("%s(%d) => Bad frame type \"%s\"\n", + file_name, file_line, data); +} + + +/**************************************************************************** + * + * Function: WifiTypeDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiTypeDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + WifiTypeData *wtd; + wtd = otn->ds_list[PLUGIN_WIFI_TYPE_CHECK]; + + if(!p->wifih) + { + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not WIFI\n");); + return 0; + } + + if((wtd->not_flag && (p->wifih->type != wtd->type)) || + (!wtd->not_flag && (p->wifih->type == wtd->type))) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"No match\n");); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_type.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_type.h:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_type.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_type.h,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_TYPE_H__ +#define __SP_WIFI_TYPE_H__ + +#ifdef WIRELESS + +void SetupWifiType(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_TYPE_H__ */ Index: snort/src/detection-plugins/sp_wifi_wep.c diff -u /dev/null snort/src/detection-plugins/sp_wifi_wep.c:1.2.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_wep.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,222 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_wep.c,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* sp_wifi_wep + * + * Purpose: + * + * Tests 802.11 frames WEP control field. + * + * Arguments: + * + * {{ '!' | {} } { ON | OFF | TRUE | FALSE } } + * + * Effect: + * + * Success on WEP control field match, failure otherwise. + * + */ + +#include +#include +#include + +#include "rules.h" +#include "decode.h" +#include "plugbase.h" +#include "parser.h" +#include "debug.h" +#include "util.h" +#include "plugin_enum.h" + + +/* don't forget to include the name of this file in plugbase.h! */ + +extern char *file_name; /* this is the file name from rules.c, generally used + for error messages */ + +extern int file_line; /* this is the file line number from rules.c that is + used to indicate file lines for error messages */ + +typedef struct _WifiWepData +{ + int val; +} WifiWepData; + +void WifiWepInit(char *, OptTreeNode *, int); +void WifiWepRuleParseFunction(char *, OptTreeNode *); +int WifiWepDetectorFunction(Packet *, struct _OptTreeNode *, OptFpList *); + +/**************************************************************************** + * + * Function: SetupWifiWep() + * + * Purpose: Generic detection engine plugin template. Registers the + * configuration function and links it to a rule keyword. This is + * the function that gets called from InitPlugins in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + ****************************************************************************/ +void SetupWifiWep() +{ + /* map the keyword to an initialization/processing function */ + RegisterPlugin("wep", WifiWepInit); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Plugin: WifiWep Setup\n");); +} + + +/**************************************************************************** + * + * Function: WifiWepInit(char *, OptTreeNode *) + * + * Purpose: Generic rule configuration function. Handles parsing the rule + * information and attaching the associated detection function to + * the OTN. + * + * Arguments: data => rule arguments/data + * otn => pointer to the current rule option list node + * + * Returns: void function + * + ****************************************************************************/ +void WifiWepInit(char *data, OptTreeNode *otn, int protocol) +{ + /* allocate the data structure and attach it to the + rule's data struct list */ + otn->ds_list[PLUGIN_WIFI_WEP_CHECK] = (WifiWepData *) calloc(sizeof(WifiWepData), sizeof(char)); + + /* be sure to check that the protocol that is passed in matches the + transport layer protocol that you're using for this rule! */ + + /* this is where the keyword arguments are processed and placed into the + rule option's data structure */ + WifiWepRuleParseFunction(data, otn); + + /* finally, attach the option's detection function to the rule's + detect function pointer list */ + AddOptFuncToList(WifiWepDetectorFunction, otn); +} + + + +/**************************************************************************** + * + * Function: WifiWepRuleParseFunction(char *, OptTreeNode *) + * + * Purpose: This is the function that is used to process the option keyword's + * arguments and attach them to the rule's data structures. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: void function + * + ****************************************************************************/ +void WifiWepRuleParseFunction(char *data, OptTreeNode *otn) +{ + WifiWepData *ds_ptr; /* data struct pointer */ + int not_flag = 0; + + /* set the ds pointer to make it easier to reference the option's + particular data struct */ + ds_ptr = otn->ds_list[PLUGIN_WIFI_WEP_CHECK]; + + /* manipulate the option arguments here */ + while(isspace((int) *data)) data++; + + if(*data == '!'){ + not_flag = 1; + data++; + } + + /* set the final option arguments here */ + if(strcmp(data, "FALSE") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "OFF") == 0) + ds_ptr->val = 0; + else if(strcmp(data, "NO") == 0) + ds_ptr->val = 0; + + else if(strcmp(data, "TRUE") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "ON") == 0) + ds_ptr->val = 1; + else if(strcmp(data, "YES") == 0) + ds_ptr->val = 1; + + else + FatalError("%s(%d) => Bad wep flag value \"%s\"\n", + file_name, file_line, data); + + if(not_flag) + ds_ptr->val = (ds_ptr->val) ? 0 : 1; + +} + + +/**************************************************************************** + * + * Function: WifiWepDetectorFunction(char *, OptTreeNode *) + * + * Purpose: Use this function to perform the particular detection routine + * that this rule keyword is supposed to encompass. + * + * Arguments: data => argument data + * otn => pointer to the current rule's OTN + * + * Returns: If the detection test fails, this function *must* return a zero! + * On success, it calls the next function in the detection list + * + ****************************************************************************/ +int WifiWepDetectorFunction(Packet *p, struct _OptTreeNode *otn, OptFpList *fp_list) +{ + + WifiWepData *plugin_data; + plugin_data = otn->ds_list[PLUGIN_WIFI_WEP_CHECK]; + + if(!p->wifih){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "Not a WIFI frame\n");); + return 0; + } + + /* your detection function tests go here */ + if (p->wifih->wep == plugin_data->val) + { + return fp_list->next->OptTestFunc(p, otn, fp_list->next); + } +#ifdef DEBUG + else + { + /* you can put debug comments here or not */ + DebugMessage(DEBUG_PLUGIN,"No match\n"); + } +#endif + + /* if the test isn't successful, this function *must* return 0 */ + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/detection-plugins/sp_wifi_wep.h diff -u /dev/null snort/src/detection-plugins/sp_wifi_wep.h:1.1.8.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/sp_wifi_wep.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,30 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: sp_wifi_wep.h,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +#ifndef __SP_WIFI_WEP_H__ +#define __SP_WIFI_WEP_H__ + +#ifdef WIRELESS + +void SetupWifiWep(); + +#endif /* WIRELESS */ + +#endif /* __SP_WIFI_WEP_H__ */ Index: snort/src/detection-plugins/wifi_datatypes.h diff -u /dev/null snort/src/detection-plugins/wifi_datatypes.h:1.3.4.1 --- /dev/null Mon Jun 13 11:23:05 2005 +++ snort/src/detection-plugins/wifi_datatypes.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,162 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: wifi_datatypes.h,v 1.3.4.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* Data types for wifi plugins */ + +#ifndef __WIFI_DATATYPES_H__ +#define __WIFI_DATATYPES_H__ + +#ifdef WIRELESS + +typedef enum { /* 802.11 frame types */ + TYPE_INVALID = -1, + TYPE_MANAGEMENT = 0x00, + TYPE_CONTROL = 0x01, + TYPE_DATA = 0x02 +} wifi_type_t; + +typedef enum { /* 802.11 management frame subtypes */ + STYPE_INVALID = -1, + STYPE_ASSOCREQ = 0x00, + STYPE_ASSOCRESP = 0x01, + STYPE_REASSOC_REQ = 0x02, + STYPE_REASSOC_RESP = 0x03, + STYPE_PROBEREQ = 0x04, + STYPE_PROBERESP = 0x05, + STYPE_BEACON = 0x08, + STYPE_ATIM = 0x09, + STYPE_DISASSOC = 0x0a, + STYPE_AUTH = 0x0b, + STYPE_DEAUTH = 0x0c, + +/* 802.11 control frame subtypes */ + STYPE_PS = 0x0a, + STYPE_RTS = 0x0b, + STYPE_CTS = 0x0c, + STYPE_ACK = 0x0d, + STYPE_CFEND = 0x0e, + STYPE_CFEND_CFACK = 0x0f, + +/* 802.11 data frame subtypes */ + STYPE_DATA = 0x00, + STYPE_CFACK = 0x01, + STYPE_CFPOLL = 0x02, + STYPE_CFACK_CFPOLL = 0x03, + STYPE_NULL = 0x04, + STYPE_CFACK_NULL = 0x05, + STYPE_CFPOLL_NULL = 0x06, + STYPE_CFACK_CFPOLL_NULL = 0x07 +} wifi_stype_t; + +typedef struct _WifiElementID{ /* 802.11 element id */ + u_int8_t id; + u_int8_t len; +} WifiElementID; + +typedef struct _WifiCapInfo{ /* 802.11 capability information */ + u_int16_t cap_ess:1; + u_int16_t cap_ibss:1; + u_int16_t cap_cfpoll:1; + u_int16_t cap_cfpoll_req:1; + u_int16_t cap_wep:1; + u_int16_t cap_reserved:11; +} WifiCapInfo; + +#define _OFFSET_MANAGEMENT_BODY sizeof(WifiHdr) - 6 + +typedef struct _WifiBeacon{ /* 802.11 beacon body */ +#define _OFFSET_TIMESTAMP 0x00 + u_int32_t *timestamp1; + u_int32_t *timestamp2; +#define _OFFSET_BEACON_INT _OFFSET_TIMESTAMP + 2 * sizeof(u_int32_t) + u_int16_t *beacon_int; +#define _OFFSET_BEACON_CAP_INFO _OFFSET_BEACON_INT + sizeof(u_int16_t) + WifiCapInfo *cap_info; +#define _OFFSET_BEACON_SSID_ID _OFFSET_BEACON_CAP_INFO + sizeof(WifiCapInfo) + WifiElementID *ssid_id; +#define _OFFSET_BEACON_SSID _OFFSET_BEACON_SSID_ID + sizeof(WifiElementID) + u_int8_t *ssid; + WifiElementID *rates_id; + u_int8_t *rates; + u_int8_t *current_chan; + /* we don't care about the rest right now */ +} WifiBeacon; + + +typedef struct _WifiAssocReq{ /* 802.11 association request body */ +#define _OFFSET_ASSOCREQ_CAP_INFO 0x00 + WifiCapInfo *cap_info; +#define _OFFSET_ASSOCREQ_LISTEN_INT _OFFSET_ASSOCREQ_CAP_INFO + sizeof(WifiCapInfo) + u_int16_t *listen_int; +#define _OFFSET_ASSOCREQ_SSID_ID _OFFSET_ASSOCREQ_LISTEN_INT + sizeof(u_int16_t) + WifiElementID *ssid_id; +#define _OFFSET_ASSOCREQ_SSID _OFFSET_ASSOCREQ_SSID_ID + sizeof(WifiElementID) + u_int8_t *ssid; + WifiElementID *rates_id; + u_int8_t *rates; +} WifiAssocReq; + +typedef struct _WifiReAssocReq{ /* 802.11 re-association request body */ +#define _OFFSET_REASSOC_REQ 0x00 + WifiCapInfo *cap_info; +#define _OFFSET_REASSOC_REQ_LISTEN_INT _OFFSET_REASSOC_REQ + sizeof(WifiCapInfo) + u_int16_t *listen_int; +#define _OFFSET_REASSOC_REQ_CURRENT_AP _OFFSET_REASSOC_REQ_LISTEN_INT + sizeof(u_int16_t) + u_int8_t *current_ap; +#define _OFFSET_REASSOC_REQ_SSID_ID _OFFSET_REASSOC_REQ_CURRENT_AP + 6 + WifiElementID *ssid_id; +#define _OFFSET_REASSOC_REQ_SSID _OFFSET_REASSOC_REQ_SSID_ID + sizeof(WifiElementID) + u_int8_t *ssid; + WifiElementID *rates_id; + u_int8_t *rates; +} WifiReAssocReq; + + +typedef struct _WifiProbeReq{ /* 802.11 probe request body */ +#define _OFFSET_PROBEREQ_SSID_ID 0 + WifiElementID *ssid_id; +#define _OFFSET_PROBEREQ_SSID _OFFSET_PROBEREQ_SSID_ID + sizeof(WifiElementID) + u_int8_t *ssid; + WifiElementID *rates_id; + u_int8_t *rates; +} WifiProbeReq; + + +typedef struct _WifiProbeResp{ /* 802.11 probe response body */ +#define _OFFSET_TIMESTAMP 0x00 + u_int32_t *timestamp1; + u_int32_t *timestamp2; +#define _OFFSET_BEACON_INT _OFFSET_TIMESTAMP + 2 * sizeof(u_int32_t) + u_int16_t *beacon_int; +#define _OFFSET_PROBERESP_CAP_INFO _OFFSET_BEACON_INT + sizeof(u_int16_t) + WifiCapInfo *cap_info; +#define _OFFSET_PROBERESP_SSID_ID _OFFSET_PROBERESP_CAP_INFO + sizeof(WifiCapInfo) + WifiElementID *ssid_id; +#define _OFFSET_PROBERESP_SSID _OFFSET_PROBERESP_SSID_ID + sizeof(WifiElementID) + u_int8_t *ssid; + WifiElementID *rates_id; + u_int8_t *rates; + u_int8_t *current_chan; + /* we don't care about the rest right now */ +} WifiProbeResp; + +#endif /* WIRELESS */ + +#endif /* __WIFI_DATATYPES_H__ */ Index: snort/src/preprocessors/Makefile.am diff -u snort/src/preprocessors/Makefile.am:1.1.1.5 snort/src/preprocessors/Makefile.am:1.3.2.4 --- snort/src/preprocessors/Makefile.am:1.1.1.5 Mon Apr 25 03:26:43 2005 +++ snort/src/preprocessors/Makefile.am Mon Jun 13 00:18:32 2005 @@ -25,7 +25,11 @@ spp_xlink2state.c spp_xlink2state.h \ xlink2state.c xlink2state.h \ str_search.c str_search.h \ -stream.h - +stream.h \ +spp_rogue_ap.c spp_rogue_ap.h \ +spp_antistumbler.c spp_antistumbler.h \ +spp_deauth_flood.c spp_deauth_flood.h \ +spp_auth_flood.c spp_auth_flood.h \ +spp_macspoof.c spp_macspoof.h INCLUDES = @INCLUDES@ Index: snort/src/preprocessors/spp_antistumbler.c diff -u /dev/null snort/src/preprocessors/spp_antistumbler.c:1.2.6.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_antistumbler.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,433 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: spp_antistumbler.c,v 1.2.6.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* spp_antistumbler + * + * Purpose: + * + * Detects wireless stations actively scanning for APs + * + * Arguments: + * + * probe_reqs => number of probe requests during time delta it takes to trigger an alert + * + * probe_period => time period used to keep count of probe requests over + * + * expire_timeout => number of seconds to wait for removing a MAC address from + * the list of detected Netstumblers + * + * Effect: + * + * Sends an alert for each station it detects actively scanning for APs + * + * Comments: + * + * Any comments? + * + */ + + +#include "generators.h" +#include "log.h" +#include "detect.h" +#include "decode.h" +#include "event.h" +#include "plugbase.h" +#include "parser.h" +#include "mstring.h" +#include "debug.h" +#include "util.h" + + +#ifndef __SPP_ANTISTUMBLER_C__ +#define __SPP_ANTISTUMBLER_C__ +#include "spp_antistumbler.h" +#endif + + +#define MODNAME "spp_antistumbler" + +/* external globals from rules.c */ +extern char *file_name; +extern int file_line; + + +AntiStumblerData antistumbler_data; + +/* + * Function: SetupAntiStumbler() + * + * Purpose: Registers the preprocessor keyword and initialization + * function into the preprocessor list. This is the function that + * gets called from InitPreprocessors() in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + */ +void SetupAntiStumbler() +{ + /* link the preprocessor keyword to the init function in + the preproc list */ + RegisterPreprocessor("antistumbler", AntiStumblerInit); + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: AntiStumbler is setup...\n");) +} + + +/* + * Function: AntiStumblerInit(u_char *) + * + * Purpose: Calls the argument parsing function, performs final setup on data + * structs, links the preproc function into the function list. + * + * Arguments: args => ptr to argument string + * + * Returns: void function + * + */ +void AntiStumblerInit(u_char *args) +{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: AntiStumbler Initialized\n");); + + /* parse the argument list from the rules file */ + AntiStumblerParseArgs(args); + + /* Set the preprocessor function into the function list */ + AddFuncToPreprocList(AntiStumblerDetect); +/* AddFuncToCleanExitList(PreprocCleanExitFunction); */ +/* AddFuncToRestartList(PreprocRestartFunction); */ +} + + + +/* + * Function: AntiStumblerParseArgs(char *) + * + * Purpose: Process the preprocessor arguements from the rules file and + * initialize the preprocessor's data struct. This function doesn't + * have to exist if it makes sense to parse the args in the init + * function. + * + * Arguments: args => argument list + * + * Returns: void function + * + */ +void AntiStumblerParseArgs(char *args) +{ + int i, n, n_args, n_arg_args; + char **arg_toks = NULL, **arg_args = NULL; + + /* init preproc data with defaults */ + antistumbler_data.probe_reqs = ANTISTUMBLER_PROBE_REQS; + antistumbler_data.probe_period = ANTISTUMBLER_PROBE_PERIOD; + antistumbler_data.expire_timeout = ANTISTUMBLER_EXPIRE_TIMEOUT; + antistumbler_data.stumblers = NULL; + + if(args == NULL) + return; + + if(*args){ + + arg_toks = mSplit(args, ",", 3, &n_args, 0); + if(n_args != 3){ + FatalError("%s: %s (%d) => antistumbler configuration format: probe_reqs , probe_period , expire_timeout \n", + MODNAME, file_name, file_line); + } + + for(i = 0; i < n_args; i++){ + + arg_args = mSplit(arg_toks[i], " ", 2, &n_arg_args, 0); + if(n_arg_args != 2){ + FatalError("%s: %s (%d) => antistumbler configuration format: probe_reqs , probe_period , expire_timeout \n", + MODNAME, file_name, file_line); + } + + if(strcmp(arg_args[0], "probe_reqs") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"probe_reqs\" must be greater than 0\n", MODNAME, file_name, file_line); + } + antistumbler_data.probe_reqs = n; + } + else if(strcmp(arg_args[0], "probe_period") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"probe_period\" must be greater than 0\n", MODNAME, file_name, file_line); + } + antistumbler_data.probe_period = n; + } + else if(strcmp(arg_args[0], "expire_timeout") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than 0\n", MODNAME, file_name, file_line); + } + antistumbler_data.expire_timeout = n; + } + else{ + FatalError("%s: %s (%d) => Invalid argument \"%s %s\"\n", MODNAME, file_name, file_line, arg_args[0], arg_args[1]); + } + } + } + else{ + FatalError("%s: %s (%d) => antistumbler configuration format: probe_reqs , probe_period , expire_timeout \n", + MODNAME, file_name, file_line); + } +} + +/* + * Function: AntiStumblerDetect(Packet *) + * + * Purpose: Perform the preprocessor's intended function. This can be + * simple (statistics collection) or complex (IP defragmentation) + * as you like. Try not to destroy the performance of the whole + * system by trying to do too much.... + * + * Arguments: p => pointer to the current packet data struct + * + * Returns: void function + * + */ +void AntiStumblerDetect(Packet *p) +{ + int on_list = 0; + time_t time_curr; + Stumbler *stumbler_ptr = NULL; + Event event; + char log_message[128]; + ProbeReq fixed_params; + Beacon beacon_body; + + time_curr = time(NULL); + + if(p->wifih == NULL) + return; + + + if(p->wifih->type == TYPE_MANAGEMENT && p->wifih->stype == STYPE_BEACON){ + beacon_body.ssid_id = p->wifih + _OFFSET_BEACON_SSID_ID; + beacon_body.ssid = p->wifih + _OFFSET_BEACON_SSID; + + if(beacon_body.ssid_id->len == 15 && beacon_body.cap_info->cap_ibss){ + if(strncmp(beacon_body.ssid, "Wavelan Network", 15) == 0){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: AdHoc network detected (SSID \"Wavelan Network\")\n");); + if(antistumbler_data.stumblers == NULL) + antistumbler_data.stumblers = AllocStumblerList(); + + stumbler_ptr = InsertStumbler(p->wifih->addr3, antistumbler_data.stumblers); + + snprintf(log_message, 128, "Detected possible Kismet use from %.2X:%.2X:%.2X:%.2X:%.2X:%.2X", + stumbler_ptr->addr[0], stumbler_ptr->addr[1], stumbler_ptr->addr[2], + stumbler_ptr->addr[3], stumbler_ptr->addr[4], stumbler_ptr->addr[5]); + SetEvent(&event, GENERATOR_SPP_ANTISTUMBLER, STUMBLER_DETECTED, 1, 4, 2, 0); + if(p->iph == NULL) /* ugh, the horrible hack arises once again */ + p->iph = (IPHdr *)calloc(1, sizeof(IPHdr)); + + CallAlertFuncs(p, log_message, NULL, &event); /* send alert */ + } + } + return; + } + + + if(p->wifih->type != TYPE_MANAGEMENT || p->wifih->stype != STYPE_PROBEREQ) + return; + + fixed_params.ssid_id = p->pkt + _OFFSET_PROBEREQ_SSID_ID; + fixed_params.ssid = p->pkt + _OFFSET_PROBEREQ_SSID; +/* fixed_params.rates_id = fixed_params.ssid + fixed_params.ssid_id->len; */ +/* fixed_params.rates = fixed_params.rates_id + sizeof(ElementID); */ + + if(fixed_params.ssid_id->len != 0){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: SSID in probe request not NULL\n", MODNAME);); + return; + } + + if(antistumbler_data.stumblers == NULL) + antistumbler_data.stumblers = AllocStumblerList(); + + stumbler_ptr = antistumbler_data.stumblers->head; + while(stumbler_ptr){ + + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: STA: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X (probe_cnt: %d, ts_init: %d, ts_last: %d, ts_diff: %d)\n", + MODNAME, stumbler_ptr->addr[0], stumbler_ptr->addr[1], stumbler_ptr->addr[2], + stumbler_ptr->addr[3], stumbler_ptr->addr[4], stumbler_ptr->addr[5], + stumbler_ptr->probe_cnt, stumbler_ptr->ts_init, stumbler_ptr->ts_last, + stumbler_ptr->ts_last - stumbler_ptr->ts_init);); + + if(memcmp(p->wifih->addr2, stumbler_ptr->addr, 6) == 0){ /* check to see if STA is on list */ + on_list = 1; + stumbler_ptr->probe_cnt++; + stumbler_ptr->ts_last = time_curr; + + + if(stumbler_ptr->probe_cnt >= antistumbler_data.probe_reqs){ + + if(stumbler_ptr->alert_flag == 0){ + stumbler_ptr->alert_flag = 1; + + snprintf(log_message, 128, "Detected Netstumbler traffic from %.2X:%.2X:%.2X:%.2X:%.2X:%.2X", + stumbler_ptr->addr[0], stumbler_ptr->addr[1], stumbler_ptr->addr[2], + stumbler_ptr->addr[3], stumbler_ptr->addr[4], stumbler_ptr->addr[5]); + + SetEvent(&event, GENERATOR_SPP_ANTISTUMBLER, STUMBLER_DETECTED, 1, 4, 2, 0); + if(p->iph == NULL) /* horrible hack to get this to show up in ACID */ + p->iph = (IPHdr *)calloc(1, sizeof(IPHdr)); + + CallAlertFuncs(p, log_message, NULL, &event); /* send alert */ + } + } + + if(stumbler_ptr->ts_last - stumbler_ptr->ts_init >= antistumbler_data.probe_period){ + stumbler_ptr->ts_init = time_curr; + stumbler_ptr->probe_cnt = 1; + } + + } + if(time_curr - stumbler_ptr->ts_last >= antistumbler_data.expire_timeout){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Removing expired STA (%.2X:%.2X:%.2X:%.2X:%.2X:%.2X) from stumbler list\n", + MODNAME, stumbler_ptr->addr[0], stumbler_ptr->addr[1], stumbler_ptr->addr[2], + stumbler_ptr->addr[3], stumbler_ptr->addr[4], stumbler_ptr->addr[5]);); + stumbler_ptr = RemoveStumbler(stumbler_ptr, antistumbler_data.stumblers); + continue; + } + + stumbler_ptr = stumbler_ptr->next; + } + + if(!on_list){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding STA (%.2X:%.2X:%.2X:%.2X:%.2X:%.2X) to stumbler list\n", MODNAME, + p->wifih->addr2[0], p->wifih->addr2[1], p->wifih->addr2[2], + p->wifih->addr2[3], p->wifih->addr2[4], p->wifih->addr2[5]);); + + InsertStumbler(p->wifih->addr2, antistumbler_data.stumblers); + } +} + + + + void PreprocCleanExitFunction(int signal) +{ + /* clean exit code goes here */ +} + +void PreprocRestartFunction(int signal) +{ + /* restart code goes here */ +} + + +StumblerList *AllocStumblerList(void){ + return (StumblerList *)calloc(1, sizeof(StumblerList)); +} + + +void DestroyStumblerList(StumblerList *list){ +#warning "Implement DestroyStumblerList()" +} + + +/* + * Function: InsertStumbler(u_int8_t *, StumblerList *) + * + * Purpose: Creates a Stumbler node from a byte array and inserts + * it into the specified StumblerList + * + * Arguments: addr => byte array containing a MAC address + * list => StumblerList to insert new node in + * + * Returns: pointer to newly inserted Stumbler node or NULL + * if bssid or list is NULL + * + */ + +Stumbler *InsertStumbler(u_int8_t *addr, StumblerList *list){ + Stumbler *stumbler_ptr = NULL; + + if(list == NULL || addr == NULL) + return NULL; + + /* allocate new Stumbler node */ + stumbler_ptr = (Stumbler *)malloc(sizeof(Stumbler)); + memcpy(stumbler_ptr->addr, addr, 6); + stumbler_ptr->alert_flag = 0; + stumbler_ptr->probe_cnt = 1; + stumbler_ptr->ts_init = time(NULL); + stumbler_ptr->ts_last = stumbler_ptr->ts_init; + stumbler_ptr->next = NULL; + stumbler_ptr->prev = NULL; + + if(list->head == NULL && list->tail == NULL){ /* if empty list, set head and tail */ + list->head = stumbler_ptr; + list->tail = stumbler_ptr; + } + else{ /* if already a tail, link new node in */ + stumbler_ptr->prev = list->tail; + list->tail->next = stumbler_ptr; + list->tail = stumbler_ptr; + } + + return stumbler_ptr; /* return pointer to new Stumbler node */ +} + + + +/* + * Function: RemoveStumbler(Stumbler *, StumblerList *) + * + * Purpose: Removes a Stumbler node from a StumblerList + * + * Arguments: node => pointer to Stumbler node to be removed + * list => StumblerList to remove node from + * + * Returns: next Stumbler node in the list or NULL if one + * does not exist + */ + +Stumbler *RemoveStumbler(Stumbler *node, StumblerList *list){ + Stumbler *stumbler_ptr; + + if(list == NULL) + return node; + + if(node == list->head){ + if((list->head = node->next) == NULL) + list->tail = NULL; + else + node->next->prev = NULL; + } + else{ + if((node->next->prev = node->next) == NULL) + list->tail = node->prev; + else + node->next->prev = node->prev; + } + + stumbler_ptr = node->next; + free(node); + + return stumbler_ptr; +} + +#endif /* WIRELESS */ Index: snort/src/preprocessors/spp_antistumbler.h diff -u /dev/null snort/src/preprocessors/spp_antistumbler.h:1.2.6.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_antistumbler.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,169 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: spp_antistumbler.h,v 1.2.6.1 2005/04/23 06:19:33 andrew Exp $ */ + +#include "snort.h" + +#ifndef __SPP_ANTISTUMBLER_H__ +#define __SPP_ANTISTUMBLER_H__ + +#ifdef WIRELESS + +#ifdef __SPP_ANTISTUMBLER_C__ + +#define ANTISTUMBLER_PROBE_REQS 5 +#define ANTISTUMBLER_PROBE_PERIOD 3 +#define ANTISTUMBLER_EXPIRE_TIMEOUT 60 + +typedef struct _Stumbler { + u_int8_t addr[6]; + int alert_flag; + int probe_cnt; + time_t ts_init, ts_last; + struct _Stumbler *next, *prev; +} Stumbler; + +typedef struct _StumblerList { + struct _Stumbler *head, *tail; +} StumblerList; + +typedef struct _AntiStumblerData +{ + int probe_reqs; + time_t probe_period; + time_t expire_timeout; + StumblerList *stumblers; +} AntiStumblerData; + + +typedef enum { /* 802.11 frame types */ + TYPE_INVALID = -1, + TYPE_MANAGEMENT = 0x00, + TYPE_CONTROL = 0x01, + TYPE_DATA = 0x02 +} wifi_type_t; + + +typedef enum { /* 802.11 management frame subtypes */ + STYPE_ASSOCREQ = 0x00, /* Subtypes are already AND'ed with their corresponding Types */ + STYPE_ASSOCRESP = 0x01, /* to prevent false positives and the need for checking the type */ + STYPE_REASSOC_REQ = 0x02, /* independently */ + STYPE_REASSOC_RESP = 0x03, + STYPE_PROBEREQ = 0x04, + STYPE_PROBERESP = 0x05, + STYPE_BEACON = 0x08, + STYPE_ATIM = 0x09, + STYPE_DIASSOC = 0x0a, + STYPE_AUTH = 0x0b, + STYPE_DEAUTH = 0x0c, + + STYPE_INVALID = 0x0d, + +/* 802.11 control frame subtypes */ + STYPE_PS = 0x0a, + STYPE_RTS = 0x0b, + STYPE_CTS = 0x0c, + STYPE_ACK = 0x0d, + STYPE_CFEND = 0x0e, + STYPE_CFEND_CFACK = 0x0f, + +/* 802.11 data frame subtypes */ + STYPE_DATA = 0x00, + STYPE_CFACK = 0x01, + STYPE_CFPOLL = 0x02, + STYPE_CFACK_CFPOLL = 0x03, + STYPE_NULLFUNC = 0x04, + STYPE_CFACK_NULLFUNC = 0x05, + STYPE_CFPOLL_NULLFUNC = 0x06, + STYPE_CFACK_CFPOLL_NULLFUNC = 0x07 +} wifi_stype_t; + +typedef struct _ElementID{ /* 802.11 element id */ + u_int8_t id; + u_int8_t len; +} ElementID; + +typedef struct _CapInfo{ /* 802.11 capability information */ + u_int16_t cap_ess:1; + u_int16_t cap_ibss:1; + u_int16_t cap_cfpoll:1; + u_int16_t cap_cfpoll_req:1; + u_int16_t cap_wep:1; + u_int16_t cap_reserved:11; +} CapInfo; + +#define _OFFSET_MANAGEMENT_BODY sizeof(WifiHdr) - 6 + +typedef struct _ProbeReq{ /* 802.11 probe request body */ +#define _OFFSET_PROBEREQ_SSID_ID 0 + ElementID *ssid_id; +#define _OFFSET_PROBEREQ_SSID _OFFSET_PROBEREQ_SSID_ID + sizeof(ElementID) + u_int8_t *ssid; + ElementID *rates_id; + u_int8_t *rates; +} ProbeReq; + + + + +typedef struct _Beacon{ /* relevant portion of beacon frame + for detecting Orinoco cards in monitor mode */ +#define _OFFSET_TIMESTAMP 0x00 + u_int32_t *timestamp1; + u_int32_t *timestamp2; + +#define _OFFSET_BEACON_INT _OFFSET_TIMESTAMP + 2 * sizeof(u_int32_t) + u_int16_t *beacon_interval; + +#define _OFFSET_BEACON_CAP_INFO _OFFSET_BEACON_INT + sizeof(u_int16_t) + CapInfo *cap_info; + +#define _OFFSET_BEACON_SSID_ID _OFFSET_BEACON_CAP_INFO + sizeof(CapInfo) + ElementID *ssid_id; +#define _OFFSET_BEACON_SSID _OFFSET_BEACON_SSID_ID + sizeof(ElementID) + u_int8_t *ssid; + + ElementID *rates_id; + u_int8_t *rates; + + u_int8_t *current_chan; + + /* we don't care about the rest right now */ +} Beacon; + +#define DECODE_PARAMS + +StumblerList *AllocStumblerList(void); +void DestroyStumblerList(StumblerList *); +Stumbler *InsertStumbler(u_int8_t *, StumblerList *); +Stumbler *RemoveStumbler(Stumbler *, StumblerList *); + +#endif /* __SPP_ANTISBUMBLER_C__ */ + +/* list of function prototypes for this preprocessor */ +void SetupAntiStumbler(); +void AntiStumblerInit(u_char *); +void AntiStumblerParseArgs(char *); +void AntiStumblerDetect(Packet *); +void PreprocRestartFunction(int); +void PreprocCleanExitFunction(int); + +#endif /* WIRELESS */ + +#endif /* __SPP_ANTISTUMBLER_H__ */ Index: snort/src/preprocessors/spp_auth_flood.c diff -u /dev/null snort/src/preprocessors/spp_auth_flood.c:1.1.2.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_auth_flood.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,676 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2004 Sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + + +/* spp_auth_flood + * + * Purpose: Detects wireless access point flooded with auth frames. + * + * auth_threshold => number of auth frames during time delta it takes + * to trigger an alert + * + * expire_timeout => time period used to keep count of auth frames + * + * target_limit => maximum number of access point inserted inside authAP + * mempool + * + * prune_period => number of seconds to wait for looking after some decayed + * flooded AP inside mempool + * + * Effect: + * + * Sends an alert for each access point having been detected as flooded + * with auth frames. + * + * Comments: + * + * Any comments? + * + */ + +#include + +#include "plugbase.h" +#include "mstring.h" +#include "debug.h" +#include "log.h" +#include "wifi_statetable.h" +#include "generators.h" +#include "ubi_BinTree.h" +#include "mempool.h" +#include "detect.h" +#include "util.h" + + +#ifndef __SPP_AUTH_FLOOD__C__ +#define __SPP_AUTH_FLOOD_C__ +#include "spp_auth_flood.h" +#endif + +#define MODNAME "spp_auth_flood" + +AuthFloodData auth_flood_data; +char logpath[STD_BUF]; + +/* external globals from rules.c */ + +extern char *file_name; +extern int file_line; + + +/* + * Function: SetupAuthFlood() + * + * Purpose: Registers the preprocessor keyword and initialization + * function into the preprocessor list. This is the function that + * gets called from InitPreprocessors() in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + */ +void SetupAuthFlood() +{ + /* link the preprocessor keyword to the init function in + the preproc list */ + + RegisterPreprocessor("auth_flood", AuthFloodInit); + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: auth_flood is setup...\n");); + return; +} + + +/* + * Function: AuthFloodInit(u_char *) + * + * Purpose: Calls the argument parsing function, performs final setup on data + * structs, links the preproc function into the function list. + * + * Arguments: args => ptr to argument string + * + * Returns: void function + * + */ +void AuthFloodInit(u_char *args) +{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: auth_flood Initialized\n");); + + memset(&auth_flood_data, 0, sizeof(AuthFloodData)); + + /* parse the argument list from the rules file */ + + AuthFloodParseArgs(args); + + auth_flood_data.AuthAPsPtr = &auth_flood_data.AuthAPs; + + /* set up the flooded AP tree */ + + ubi_trInitTree(auth_flood_data.AuthAPsPtr, authAPCompareFunc, 0); + + /* set up the node pools */ + + if(mempool_init(&auth_flood_data.AuthAPPool, + auth_flood_data.target_limit, + sizeof(AuthAP))){ + FatalError("ERROR: Can't initialize mempool for flooded APs\n"); + } + + /* setup logpath */ + + strncpy(logpath, pv.log_dir, STD_BUF); + strncat(logpath, "/authflood.log", STD_BUF); + + auth_flood_data.logfile = fopen(logpath, "a+"); + if(auth_flood_data.logfile == NULL){ + FatalError("Can't open logfile: %s", logpath); + } + auth_flood_data.offset_alert_flag = WSTInit(sizeof(u_int8_t)); + auth_flood_data.offset_nbr = WSTInit(sizeof(u_int16_t)); + auth_flood_data.offset_time = WSTInit(sizeof(struct timeval)); + + /* Set the preprocessor function into the function list */ + + AddFuncToPreprocList(AuthFloodDetect); + + AddFuncToCleanExitList(AuthFloodCleanExitFunction, &auth_flood_data); + AddFuncToRestartList(AuthFloodRestartFunction, &auth_flood_data); + return; +} + + +/* + * Function: AuthFloodParseArgs(char *) + * + * Purpose: Process the preprocessor arguments from the rules file and + * initialize the preprocessor's data struct. This function doesn't + * have to exist if it makes sense to parse the args in the init + * function. + * + * Arguments: args => argument list + * + * Returns: void function + * + */ +void AuthFloodParseArgs(char *args) +{ + int i, n, n_args, n_arg_args; + char **arg_toks = NULL, **arg_args = NULL; + + /* init preproc data with defaults */ + + auth_flood_data.auth_threshold = AUTH_FLOOD_THRESHOLD; + auth_flood_data.expire_timeout = AUTH_FLOOD_EXPIRE_TIMEOUT; + auth_flood_data.target_limit = AUTH_FLOOD_TARGET_LIMIT; + auth_flood_data.prune_period = AUTH_FLOOD_PRUNE_PERIOD; + + if(args == NULL){ + LogMessage("auth_flood initialized with defaults:\n"); + LogMessage(" %s: %u\n", AUTH_OPT_threshold, auth_flood_data.auth_threshold); + LogMessage(" %s: %u\n", AUTH_OPT_EXPIRE_TIMEOUT, auth_flood_data.expire_timeout); + LogMessage(" %s: %u\n", AUTH_OPT_TARGET_LIMIT, auth_flood_data.target_limit); + LogMessage(" %s: %u\n", AUTH_OPT_PRUNE_PERIOD, auth_flood_data.prune_period); + + /* Update wifi_statetable timeout */ + + WSTUpdateTimeout(auth_flood_data.expire_timeout); + return; + } + + arg_toks = mSplit(args, ",", 4, &n_args, 0); + if(n_args != 4){ + FatalError("%s: %s (%d) => auth_flood configuration format:" + " auth_threshold , expire_timeout ,\ntarget_limit ," + " prune_period \n", + MODNAME, file_name, file_line); + } + + for(i = 0; i < n_args; i++){ + arg_args = mSplit(arg_toks[i], " ", 2, &n_arg_args, 0); + if(n_arg_args != 2){ + FatalError("%s: %s (%d) => auth_flood configuration format:" + " auth_threshold , expire_timeout ,\ntarget_limit ," + " prune_period \n", + MODNAME, file_name, file_line); + } + + if(strcmp(arg_args[0], "auth_threshold") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"auth_threshold\" must be greater than 0\n" + , MODNAME, file_name, file_line); + } + auth_flood_data.auth_threshold = n; + } + else if(strcmp(arg_args[0], "expire_timeout") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + auth_flood_data.expire_timeout = n; + } + else if(strcmp(arg_args[0], "target_limit") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"target_limit\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + auth_flood_data.target_limit = n; + } + else if(strcmp(arg_args[0], "prune_period") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"prune_period\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + auth_flood_data.prune_period = n; + } + else{ + FatalError("%s: %s (%d) => Invalid argument \"%s %s\"\n", + MODNAME, file_name, file_line, arg_args[0], arg_args[1]); + } + } + + if(auth_flood_data.expire_timeout <= auth_flood_data.prune_period){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than prune_period\n", + MODNAME, file_name, file_line); + } + + LogMessage("auth_flood arguments:\n"); + LogMessage(" %s: %u\n", AUTH_OPT_threshold, auth_flood_data.auth_threshold); + LogMessage(" %s: %u\n", AUTH_OPT_EXPIRE_TIMEOUT, auth_flood_data.expire_timeout); + LogMessage(" %s: %u\n", AUTH_OPT_TARGET_LIMIT, auth_flood_data.target_limit); + LogMessage(" %s: %u\n", AUTH_OPT_PRUNE_PERIOD, auth_flood_data.prune_period); + + /* Update wifi_statetable timeout */ + + WSTUpdateTimeout(auth_flood_data.expire_timeout); + return; +} + + +/* + * Function: AuthFloodDetect(Packet *) + * + * Purpose: Detect wireless auth flood traffic + * + * Arguments: p => pointer to the current packet data struct + * + * Returns: void function + * + */ +void AuthFloodDetect(Packet *p) +{ + wst_flag_type flag_addr; + u_int32_t pruned; + u_int16_t *n_auth_ptr; + u_int8_t *alert_flag_ptr; + struct timeval wst_tv, tv_diff; + Event event; + char outstring[255]; + + /* Cull any expired sessions out */ + + if(p->pkth->ts.tv_sec >= (auth_flood_data.prune_time.tv_sec + auth_flood_data.prune_period)){ + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "Pruning out AP flooded memory pool due to expired prune_period\n");); + auth_flood_data.prune_time.tv_sec = p->pkth->ts.tv_sec; + pruned=PruneAuthAPs(p->pkth->ts.tv_sec); + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "%u AP removed from AuthAP memory pool\n", pruned);); + } + + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "AP flooded with auth frames count: %u\n", + ubi_trCount(auth_flood_data.AuthAPsPtr));); + + if(p->wifih == NULL){ + return; + } + + /* Is it an auth frame? */ + + if((p->wifih->type != TYPE_MANAGEMENT) || (p->wifih->stype != STYPE_AUTH)){ + return; + } + + flag_addr = WST_FLAG_DESTADDR; + + /* Calls WSTMain to fill up p->wstidx.cache_addr[flag_addr] with memory address corresponding + * with the place where destination MAC address (target) is recorded inside WST. */ + + WSTMain(p, flag_addr); + + if( p->wstidx.cache_addr[flag_addr] == WST_FAILED){ + return; + } + + /* check wheter or not an alert is already reported */ + + alert_flag_ptr = (u_int8_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + auth_flood_data.offset_alert_flag)); + + /* n_auth_ptr points to the number of auth frame received by target + according to expire_timeout condition */ + + n_auth_ptr = (u_int16_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + auth_flood_data.offset_nbr)); + if(*alert_flag_ptr){ + + /* Alert has already been sent. Purpose is now to update WST time data in order + to avoid concerned auth flooded AP to be removed from auth flooded AP + memory pool throught PruneAuthAPs function and uptade received auth + frames number */ + + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + auth_flood_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + *n_auth_ptr = (*n_auth_ptr) + 1 ; + return; + } + + memcpy(&wst_tv, ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + auth_flood_data.offset_time)), + sizeof(struct timeval)); + tv_diff = WSTTimevalSubtract(p->pkth->ts, wst_tv); + + /* check wether or not dezs station should be considered as a new potential flooded AP. + * Update WST data */ + + if( tv_diff.tv_sec > auth_flood_data.expire_timeout ){ + + /* dest station is a new potential AP flooded with auth frames. + * Update WST data */ + + *n_auth_ptr = 1; + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + auth_flood_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + } + else{ + *n_auth_ptr = (*n_auth_ptr) + 1 ; + } + + /* check whether or not threshold is reached */ + + if( *n_auth_ptr == auth_flood_data.auth_threshold){ + + /* alert condition are reached */ + + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + auth_flood_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + (*alert_flag_ptr) = 1; + + snprintf(outstring, 255, AUTHFLOOD_PREFIX_STR + "\nAddr src: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x -> Addr dst: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x" + ", Bssid: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x.", + p->wifih->addr2[0], p->wifih->addr2[1], p->wifih->addr2[2], + p->wifih->addr2[3], p->wifih->addr2[4], p->wifih->addr2[5], + p->wifih->addr1[0], p->wifih->addr1[1], p->wifih->addr1[2], + p->wifih->addr1[3], p->wifih->addr1[4], p->wifih->addr1[5], + p->wifih->addr3[0], p->wifih->addr3[1], p->wifih->addr3[2], + p->wifih->addr3[3], p->wifih->addr3[4], p->wifih->addr3[5]); + + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, "%s\n", outstring);); + + SetEvent(&event, GENERATOR_SPP_AUTHFLOOD, AUTHFLOOD_DETECTED, 1, 0, 0, 0); + CallAlertFuncs(p, outstring, NULL, &event); /* send alert & log data */ + AuthAPLog(p, 0); + + /* insert dest station inside authAP mempool */ + + AddAuthAP(p->wstidx.cache_addr[flag_addr]); + } + return; +} + + +/* + * Function: int authAPCompareFunc(ubi_trItemPtrItemPtr, + * ubi_trNodePtr NodePtr) + * + * Purpose: Callback function used by splay trees to sort authAP node + * + * Arguments: + * + * Returns: + * + */ +int authAPCompareFunc(ubi_trItemPtr ItemPtr, ubi_trNodePtr NodePtr) +{ + AuthAP *A = (AuthAP *) NodePtr; + AuthAP *B = (AuthAP *) ItemPtr; + int32_t memcmp_result; + + + memcmp_result = memcmp(&A->addr[0], &B->addr[0], 6); + if(memcmp_result < 0){ + return 1; + } + else if(memcmp_result > 0){ + return -1; + } + return 0; +} + + +/* + * Function: void AddAuthAP(u_int32_t wst_addr) + * + * Purpose: Adds a new AP to the AP flooded with auth frames tree + * + * Arguments: wst_addr => memory address where MAC address is recorded inside wst. + * + * Returns: + * + */ + +void AddAuthAP(u_int32_t wst_addr) +{ + AuthAP *authap = NULL; + MemBucket *mb = NULL; + + /* borrow a AP node from the AP node pool */ + + mb = mempool_alloc(&auth_flood_data.AuthAPPool); + + if(mb == NULL){ + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, "out of AP Nodes\n");); + return; + } + + authap = (AuthAP *) mb->data; + authap->bucket = mb; + + /* fill in the authAP struct */ + authap->wst_addr = wst_addr; + memcpy(&authap->addr[0], (u_int8_t *) wst_addr, 6); + + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "Assigning a AP with MAC addr of" + " %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + authap->addr[0],authap->addr[1],authap->addr[2],authap->addr[3],authap->addr[4],authap->addr[5]);); + + /* add this flooded AP to AP tree */ + + if(ubi_sptInsert(auth_flood_data.AuthAPsPtr, + (ubi_btNodePtr)authap, + (ubi_btNodePtr)authap, NULL) == ubi_trFALSE){ + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "Insert into flooded AP tree failed\n");); + } + else{ + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "Insert into flooded AP tree successful\n");); + } + return; +} + + +/* + * Function: u_int32_t PruneAuthAPs(u_int32_t now) + * + * Purpose: Checks whether or not AP inserted inside flooded AP tree are still + * auth flooded or not. + * If not, removes concerned APs from flooded AP tree and calls AUTHAPLogs function. + * + * Arguments: now => packet's capture time in sec + * + * Returns: number of APs removed from flooded AP tree + * + */ +u_int32_t PruneAuthAPs(u_int32_t now) +{ + AuthAP *idx; + u_int32_t pruned = 0; + u_int32_t authap_sec; + u_int8_t *alert_flag_ptr; + + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "Prune flooded AP called now: " + " %u , count: %u\n", + now, ubi_trCount(auth_flood_data.AuthAPsPtr));); + + if(ubi_trCount(auth_flood_data.AuthAPsPtr) < 1){ + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "exit PruneAuthAP function since flooded AP tree" + " is free\n");); + return(0); + } + + /* number of thing that need to be deleted */ + + idx = (AuthAP *) ubi_btFirst((ubi_btNodePtr)auth_flood_data.AuthAPsPtr->root); + + if(idx == NULL){ + return(0); + } + + do{ + authap_sec = *((u_int32_t *) (idx->wst_addr + auth_flood_data.offset_time)); + if((authap_sec + auth_flood_data.expire_timeout) < now){ + + /* AP shouldn't be much more considered as a auth flooded one. + Removes it from authAP pool */ + + alert_flag_ptr = (u_int8_t *) (idx->wst_addr + auth_flood_data.offset_alert_flag); + *alert_flag_ptr = 0; + + AuthAPLog(NULL, idx->wst_addr); + AuthAP *savidx = idx; + if(ubi_trCount(auth_flood_data.AuthAPsPtr) > 1){ + idx = (AuthAP *) ubi_btNext((ubi_btNodePtr)idx); + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, + "pruning stale flooded AP\n");); + DeleteAuthAP(savidx); + pruned++; + } + else{ + DeleteAuthAP(savidx); + pruned++; + return(pruned); + } + } + else{ + if(idx != NULL && ubi_trCount(auth_flood_data.AuthAPsPtr)){ + idx = (AuthAP *) ubi_btNext((ubi_btNodePtr)idx); + } + else{ + return pruned; + } + } + } while(idx != NULL); + + return pruned; +} + + +/* + * Function: void DeleteAuthAP(AuthAP *authap) + * + * Purpose: removed flooded auth AP from authAP mempool + * + * Arguments: + * + * Returns: + * + */ +void DeleteAuthAP(AuthAP *authap) +{ +AuthAP *oldauthap; + +oldauthap = (AuthAP *) ubi_sptRemove(auth_flood_data.AuthAPsPtr, + (ubi_btNodePtr) authap); +mempool_free(&auth_flood_data.AuthAPPool,authap->bucket); + return; +} + + +/* + * Function: void AUTHAPLog(Packet *p, u_int32_t wst_addr) + * + * Purpose: Called either when AP authentication flood is detected or finished. + * Logs data to a text file: auth_flood_data.logfile. + * + * Arguments: + * + * Returns: + * + */ +void AuthAPLog(Packet *p, u_int32_t wst_addr) +{ + char timestamp[TIMEBUF_SIZE]; + + if(p){ + ts_print((struct timeval *) &p->pkth->ts, timestamp); + fprintf(auth_flood_data.logfile, "\n%s Auth flood reported\n", timestamp); + PrintWifiHeader(auth_flood_data.logfile, p); + } + else{ + ts_print((struct timeval *) (wst_addr + auth_flood_data.offset_time), timestamp); + fprintf(auth_flood_data.logfile, "\n%s End Auth flood :" + " -> Addr dst: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x,\n" + "%u auth frame reported.\n", + timestamp, + *((u_int8_t *)(wst_addr)), *((u_int8_t *)(wst_addr + 1)), *((u_int8_t *)(wst_addr + 2)), + *((u_int8_t *)(wst_addr + 3)), *((u_int8_t *)(wst_addr + 4)), *((u_int8_t *)(wst_addr + 5)), + *((u_int16_t*)(wst_addr + auth_flood_data.offset_nbr))); + } + fflush(auth_flood_data.logfile); + return; +} + + +/* + * Function: void AuthCleanExitFunction(int, void *) + * + * Purpose: + * + * Arguments: + * + * Returns: + */ +void AuthFloodCleanExitFunction(int signal, void *arg) +{ + AuthFloodData *dfd_ptr = (AuthFloodData *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, "AuthFloodCleanExitFunction\n");); + + if(fclose(dfd_ptr->logfile)) + LogMessage("%s: fclose function failed while snort exiting: %s\n", + MODNAME, strerror(errno)); + return; +} + + + +/* + * Function: void AuthFloodCleanRestartFunction(int, void *) + * + * Purpose: + * + * Arguments: + * + * Returns: + */ +void AuthFloodRestartFunction(int signal, void *arg) +{ + AuthFloodData *dfd_ptr = (AuthFloodData *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_AUTHFLOOD, "AuthFloodRestartFunction\n");); + + if(fclose(dfd_ptr->logfile)) + LogMessage("%s: fclose function failed while snort restarting: %s\n", + MODNAME, strerror(errno)); + return; +} + +#endif /* WIRELESS */ + + + + + + + Index: snort/src/preprocessors/spp_auth_flood.h diff -u /dev/null snort/src/preprocessors/spp_auth_flood.h:1.1.2.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_auth_flood.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,100 @@ +/* +** Copyright (C) 2004 sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + + +#ifndef __SPP_AUTH_FLOOD_H__ +#define __SPP_AUTH_FLOOD_H__ + +#ifdef WIRELESS + +/* I N C L U D E S +*******************************************************************************/ +#include "snort.h" + + +/* D E F I N E S +*******************************************************************************/ + +#define AUTH_OPT_threshold "auth-threshold" +#define AUTH_OPT_EXPIRE_TIMEOUT "expire_timeout" +#define AUTH_OPT_TARGET_LIMIT "target_limit" +#define AUTH_OPT_PRUNE_PERIOD "prune_period" + + +#define AUTH_FLOOD_THRESHOLD 100 +#define AUTH_FLOOD_EXPIRE_TIMEOUT 60 +#define AUTH_FLOOD_TARGET_LIMIT 10 +#define AUTH_FLOOD_PRUNE_PERIOD 30 + +typedef struct _AuthFloodData +{ + ubi_trRoot AuthAPs; + ubi_trRootPtr AuthAPsPtr; + + MemPool AuthAPPool; + + u_int16_t offset_alert_flag; + u_int16_t offset_nbr; + u_int16_t offset_time; + + u_int32_t auth_threshold; + u_int32_t expire_timeout; + u_int32_t target_limit; + u_int32_t prune_period; + + struct timeval prune_time; + + /** Global Program Data **/ + FILE *logfile; +} AuthFloodData; + +/* this represent the authenticated station */ +typedef struct _AuthAP +{ + ubi_trNode Node; /* for the splay tree */ + MemBucket *bucket; + + u_int32_t wst_addr; + u_int8_t addr[6]; +} AuthAP; + + +/* P R O T O T Y P E S +*******************************************************************************/ + +void SetupAuthFlood(); +void AuthFloodInit(u_char *); +void AuthFloodParseArgs(char *); +void AuthFloodDetect(Packet *); +int authAPCompareFunc(ubi_trItemPtr, ubi_trNodePtr); +void AddAuthAP(u_int32_t); +u_int32_t PruneAuthAPs(u_int32_t); +void DeleteAuthAP(AuthAP *); +void AuthAPLog(Packet *, u_int32_t); +void AuthFloodRestartFunction(int, void *); +void AuthFloodCleanExitFunction(int, void *); + +#endif /* WIRELESS */ + +#endif /* __SPP_DESFLOOD_H__ */ Index: snort/src/preprocessors/spp_deauth_flood.c diff -u /dev/null snort/src/preprocessors/spp_deauth_flood.c:1.1.2.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_deauth_flood.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,675 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2004 Sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + + +/* spp_deauth_flood + * + * Purpose: Detects wireless station flooded with dehaut frames. + * + * deauth_threshold => number of deauth frames during time delta it takes + * to trigger an alert + * + * expire_timeout => time period used to keep count of deauth frames + * + * target_limit => maximum number of station inserted inside deauthstation + * mempool + * + * prune_period => number of seconds to wait for looking after some decayed + * deauthstations inside mempool + * + * Effect: + * + * Sends an alert for each station having been detected as flooded + * with deauth frames. + * + * Comments: + * + * Any comments? + * + */ + +#include + +#include "plugbase.h" +#include "mstring.h" +#include "debug.h" +#include "log.h" +#include "wifi_statetable.h" +#include "generators.h" +#include "ubi_BinTree.h" +#include "mempool.h" +#include "detect.h" +#include "util.h" + + +#ifndef __SPP_DEAUTH_FLOOD__C__ +#define __SPP_DEAUTH_FLOOD_C__ +#include "spp_deauth_flood.h" +#endif + +#define MODNAME "spp_deauth_flood" + +DeauthFloodData deauth_flood_data; +char logpath[STD_BUF]; + +/* external globals from rules.c */ + +extern char *file_name; +extern int file_line; + + +/* + * Function: SetupDeauthFlood() + * + * Purpose: Registers the preprocessor keyword and initialization + * function into the preprocessor list. This is the function that + * gets called from InitPreprocessors() in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + */ +void SetupDeauthFlood() +{ + /* link the preprocessor keyword to the init function in + the preproc list */ + + RegisterPreprocessor("deauth_flood", DeauthFloodInit); + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: deauth_flood is setup...\n");); + return; +} + + +/* + * Function: DeauthFloodInit(u_char *) + * + * Purpose: Calls the argument parsing function, performs final setup on data + * structs, links the preproc function into the function list. + * + * Arguments: args => ptr to argument string + * + * Returns: void function + * + */ +void DeauthFloodInit(u_char *args) +{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: deauth_flood Initialized\n");); + + memset(&deauth_flood_data, 0, sizeof(DeauthFloodData)); + + /* parse the argument list from the rules file */ + + DeauthFloodParseArgs(args); + + deauth_flood_data.DeauthstationsPtr = &deauth_flood_data.Deauthstations; + + /* set up the deauthenticated station tree */ + + ubi_trInitTree(deauth_flood_data.DeauthstationsPtr, deauthstationCompareFunc, 0); + + /* set up the node pools */ + + if(mempool_init(&deauth_flood_data.DeauthstationPool, + deauth_flood_data.target_limit, + sizeof(Deauthstation))){ + FatalError("ERROR: Can't initialize mempool for deauthenticated stations\n"); + } + + /* setup logpath */ + + strncpy(logpath, pv.log_dir, STD_BUF); + strncat(logpath, "/deauthflood.log", STD_BUF); + + deauth_flood_data.logfile = fopen(logpath, "a+"); + if(deauth_flood_data.logfile == NULL){ + FatalError("Can't open logfile: %s", logpath); + } + + deauth_flood_data.offset_alert_flag = WSTInit(sizeof(u_int8_t)); + deauth_flood_data.offset_nbr = WSTInit(sizeof(u_int16_t)); + deauth_flood_data.offset_time = WSTInit(sizeof(struct timeval)); + + /* Set the preprocessor function into the function list */ + + AddFuncToPreprocList(DeauthFloodDetect); + + AddFuncToCleanExitList(DeauthFloodCleanExitFunction, &deauth_flood_data); + AddFuncToRestartList(DeauthFloodRestartFunction, &deauth_flood_data); + return; +} + + +/* + * Function: DeauthFloodParseArgs(char *) + * + * Purpose: Process the preprocessor arguments from the rules file and + * initialize the preprocessor's data struct. This function doesn't + * have to exist if it makes sense to parse the args in the init + * function. + * + * Arguments: args => argument list + * + * Returns: void function + * + */ +void DeauthFloodParseArgs(char *args) +{ + int i, n, n_args, n_arg_args; + char **arg_toks = NULL, **arg_args = NULL; + + /* init preproc data with defaults */ + + deauth_flood_data.deauth_threshold = DEAUTH_FLOOD_THRESHOLD; + deauth_flood_data.expire_timeout = DEAUTH_FLOOD_EXPIRE_TIMEOUT; + deauth_flood_data.target_limit = DEAUTH_FLOOD_TARGET_LIMIT; + deauth_flood_data.prune_period = DEAUTH_FLOOD_PRUNE_PERIOD; + + if(args == NULL){ + LogMessage("deauth_flood initialized with defaults:\n"); + LogMessage(" %s: %u\n", DEAUTH_OPT_threshold, deauth_flood_data.deauth_threshold); + LogMessage(" %s: %u\n", DEAUTH_OPT_EXPIRE_TIMEOUT, deauth_flood_data.expire_timeout); + LogMessage(" %s: %u\n", DEAUTH_OPT_TARGET_LIMIT, deauth_flood_data.target_limit); + LogMessage(" %s: %u\n", DEAUTH_OPT_PRUNE_PERIOD, deauth_flood_data.prune_period); + + /* Update wifi_statetable timeout */ + + WSTUpdateTimeout(deauth_flood_data.expire_timeout); + return; + } + + arg_toks = mSplit(args, ",", 4, &n_args, 0); + if(n_args != 4){ + FatalError("%s: %s (%d) => deauth_flood configuration format:" + " deauth_threshold , expire_timeout ,\ntarget_limit ," + " prune_period \n", + MODNAME, file_name, file_line); + } + + for(i = 0; i < n_args; i++){ + arg_args = mSplit(arg_toks[i], " ", 2, &n_arg_args, 0); + if(n_arg_args != 2){ + FatalError("%s: %s (%d) => deauth_flood configuration format:" + " deauth_threshold , expire_timeout ,\ntarget_limit ," + " prune_period \n", + MODNAME, file_name, file_line); + } + + if(strcmp(arg_args[0], "deauth_threshold") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"deauth_threshold\" must be greater than 0\n" + , MODNAME, file_name, file_line); + } + deauth_flood_data.deauth_threshold = n; + } + else if(strcmp(arg_args[0], "expire_timeout") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + deauth_flood_data.expire_timeout = n; + } + else if(strcmp(arg_args[0], "target_limit") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"target_limit\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + deauth_flood_data.target_limit = n; + } + else if(strcmp(arg_args[0], "prune_period") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"prune_period\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + deauth_flood_data.prune_period = n; + } + else{ + FatalError("%s: %s (%d) => Invalid argument \"%s %s\"\n", + MODNAME, file_name, file_line, arg_args[0], arg_args[1]); + } + } + + if(deauth_flood_data.expire_timeout <= deauth_flood_data.prune_period){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than prune_period\n", + MODNAME, file_name, file_line); + } + + LogMessage("deauth_flood arguments:\n"); + LogMessage(" %s: %u\n", DEAUTH_OPT_threshold, deauth_flood_data.deauth_threshold); + LogMessage(" %s: %u\n", DEAUTH_OPT_EXPIRE_TIMEOUT, deauth_flood_data.expire_timeout); + LogMessage(" %s: %u\n", DEAUTH_OPT_TARGET_LIMIT, deauth_flood_data.target_limit); + LogMessage(" %s: %u\n", DEAUTH_OPT_PRUNE_PERIOD, deauth_flood_data.prune_period); + + /* Update wifi_statetable timeout */ + + WSTUpdateTimeout(deauth_flood_data.expire_timeout); + return; +} + + +/* + * Function: DeauthFloodDetect(Packet *) + * + * Purpose: Detect wireless auth flood traffic + * + * Arguments: p => pointer to the current packet data struct + * + * Returns: void function + * + */ +void DeauthFloodDetect(Packet *p) +{ + wst_flag_type flag_addr; + u_int32_t pruned; + u_int16_t *n_deauth_ptr; + u_int8_t *alert_flag_ptr; + struct timeval wst_tv, tv_diff; + Event event; + char outstring[255]; + + /* Cull any expired sessions out */ + + if(p->pkth->ts.tv_sec >= (deauth_flood_data.prune_time.tv_sec + deauth_flood_data.prune_period)){ + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "Pruning out deauthenticated stations due to expired prune_period\n");); + deauth_flood_data.prune_time.tv_sec = p->pkth->ts.tv_sec; + pruned = PruneDeauthstations(p->pkth->ts.tv_sec); + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "%u stations removed from Deauthstation memory pool\n", pruned);); + } + + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "Deauthenticated station count: %u\n", + ubi_trCount(deauth_flood_data.DeauthstationsPtr));); + + if(p->wifih == NULL){ + return; + } + + /* Is it a deauth frame? */ + + if((p->wifih->type != TYPE_MANAGEMENT) || (p->wifih->stype != STYPE_DEAUTH)){ + return; + } + + flag_addr = WST_FLAG_DESTADDR; + + /* Calls WSTMain to fill up p->wstidx.cache_addr[flag_addr] with memory address corresponding + * with the place where destination MAC address (target) is recorded inside WST. */ + + WSTMain(p, flag_addr); + + if( p->wstidx.cache_addr[flag_addr] == WST_FAILED){ + return; + } + + /* check wheter or not an alert is already reported */ + + alert_flag_ptr = (u_int8_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + deauth_flood_data.offset_alert_flag)); + + /* n_deauth_ptr points to the number of deauth frame received by target + according to expire_timeout condition */ + + n_deauth_ptr = (u_int16_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + deauth_flood_data.offset_nbr)); + + if(*alert_flag_ptr){ + + /* Alert has already been sent. Purpose is now to update WST time data in order + to avoid concerned deauth station to be removed from deauth stations + memory pool throught PruneDeauthstations function and uptade received deauth + frames number */ + + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + deauth_flood_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + *n_deauth_ptr = (*n_deauth_ptr) + 1 ; + return; + } + + memcpy(&wst_tv, ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + deauth_flood_data.offset_time)), + sizeof(struct timeval)); + tv_diff = WSTTimevalSubtract(p->pkth->ts, wst_tv); + + /* check wether or not station should be considered as a new potential deauthstation. + * Update WST data */ + + if( tv_diff.tv_sec > deauth_flood_data.expire_timeout ){ + + /* station is a new potential deauthstation. + * Update WST data */ + + *n_deauth_ptr = 1; + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + deauth_flood_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + } + else { + *n_deauth_ptr = (*n_deauth_ptr) + 1 ; + } + + /* check whether or not threshold is reached */ + + if( *n_deauth_ptr == deauth_flood_data.deauth_threshold){ + + /* alert condition are reached */ + + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + deauth_flood_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + (*alert_flag_ptr) = 1; + + snprintf(outstring, 255, DEAUTHFLOOD_PREFIX_STR + "\nAddr src: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x -> Addr dst: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x" + ", Bssid: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x.", + p->wifih->addr2[0], p->wifih->addr2[1], p->wifih->addr2[2], + p->wifih->addr2[3], p->wifih->addr2[4], p->wifih->addr2[5], + p->wifih->addr1[0], p->wifih->addr1[1], p->wifih->addr1[2], + p->wifih->addr1[3], p->wifih->addr1[4], p->wifih->addr1[5], + p->wifih->addr3[0], p->wifih->addr3[1], p->wifih->addr3[2], + p->wifih->addr3[3], p->wifih->addr3[4], p->wifih->addr3[5]); + + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, "%s\n", outstring);); + + SetEvent(&event, GENERATOR_SPP_DEAUTHFLOOD, DEAUTHFLOOD_DETECTED, 1, 0, 0, 0); + CallAlertFuncs(p, outstring, NULL, &event); /* send alert & log data */ + DSLog(p, 0); + + /* insert station inside deauthstation mempool */ + + AddDeauthStation(p->wstidx.cache_addr[flag_addr]); + } + return; +} + + +/* + * Function: int deauthstationCompareFunc(ubi_trItemPtrItemPtr, + * ubi_trNodePtr NodePtr) + * + * Purpose: Callback function used by splay trees to sort deauthstation node + * + * Arguments: + * + * Returns: + * + */ +int deauthstationCompareFunc(ubi_trItemPtr ItemPtr, ubi_trNodePtr NodePtr) +{ + Deauthstation *A = (Deauthstation *) NodePtr; + Deauthstation *B = (Deauthstation *) ItemPtr; + int32_t memcmp_result; + + + memcmp_result = memcmp(&A->addr[0], &B->addr[0], 6); + if(memcmp_result < 0){ + return 1; + } + else if(memcmp_result > 0){ + return -1; + } + return 0; +} + + +/* + * Function: void AddDeauthStation(u_int32_t wst_addr) + * + * Purpose: Adds a new deauthenticated station to the deauthenticated station tree + * + * Arguments: wst_addr => memory address where MAC address is recorded inside wst. + * + * Returns: + * + */ +void AddDeauthStation(u_int32_t wst_addr) +{ + Deauthstation *ds = NULL; + MemBucket *mb = NULL; + + /* borrow a deauthenticated station node from the deauthenticated station node pool */ + + mb = mempool_alloc(&deauth_flood_data.DeauthstationPool); + + if(mb == NULL){ + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, "out of deauthenticated station Nodes\n");); + return; + } + + ds = (Deauthstation *) mb->data; + ds->bucket = mb; + + /* fill in the deauthstation struct */ + + ds->wst_addr = wst_addr; + memcpy(&ds->addr[0], (u_int8_t *) wst_addr, 6); + + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "Assigning a deauthenticated station with MAC addr of" + " %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + ds->addr[0],ds->addr[1],ds->addr[2],ds->addr[3],ds->addr[4],ds->addr[5]);); + + /* add this deauthenticated station to deauthtenticated station tree */ + + if(ubi_sptInsert(deauth_flood_data.DeauthstationsPtr, + (ubi_btNodePtr)ds, + (ubi_btNodePtr)ds, NULL) == ubi_trFALSE){ + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "Insert into deauthenticated station tree failed\n");); + } + else{ + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "Insert into deauthenticated station tree successful\n");); + } + return; +} + + +/* + * Function: u_int32_t PruneDeauthstations(u_int32_t now) + * + * Purpose: Checks whether or not stations inserted inside deauthenticated + * station tree are still deauthenticated or not. + * If not, removes concerned stations from deauthenticated station tree and + * calls DSLogs function. + * + * Arguments: now => packet's capture time in sec + * + * Returns: number of station removed from deauthenticated station tree + * + */ +u_int32_t PruneDeauthstations(u_int32_t now) +{ + Deauthstation *idx; + u_int32_t pruned = 0; + u_int32_t ds_sec; + u_int8_t *alert_flag_ptr; + + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "Prune deauthenticated stations called now: " + " %u , count: %u\n", + now, ubi_trCount(deauth_flood_data.DeauthstationsPtr));); + + + if(ubi_trCount(deauth_flood_data.DeauthstationsPtr) < 1){ + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "exit PruneDeauthstation function since deauthenticated" + " station tree is free\n");); + return(0); + } + + /* number of thing that need to be deleted */ + + idx = (Deauthstation *) ubi_btFirst((ubi_btNodePtr)deauth_flood_data.DeauthstationsPtr->root); + + if(idx == NULL){ + return(0); + } + + do{ + ds_sec = *((u_int32_t *) (idx->wst_addr + deauth_flood_data.offset_time)); + if((ds_sec + deauth_flood_data.expire_timeout) < now){ + + /* station shouldn't be much more considered as a deauthedtified one. + Removes it from deauthstation pool */ + + alert_flag_ptr = (u_int8_t *) (idx->wst_addr + deauth_flood_data.offset_alert_flag); + *alert_flag_ptr = 0; + + DSLog(NULL, idx->wst_addr); + Deauthstation *savidx = idx; + if(ubi_trCount(deauth_flood_data.DeauthstationsPtr) > 1){ + idx = (Deauthstation *) ubi_btNext((ubi_btNodePtr)idx); + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, + "pruning stale deauthenticated station\n");); + DeleteDeauthstation(savidx); + pruned++; + } + else{ + DeleteDeauthstation(savidx); + pruned++; + return(pruned); + } + } + else{ + if(idx != NULL && ubi_trCount(deauth_flood_data.DeauthstationsPtr)){ + idx = (Deauthstation *) ubi_btNext((ubi_btNodePtr)idx); + } + else{ + return pruned; + } + } + } while(idx != NULL); + + return pruned; +} + + +/* + * Function: void DeleteDeauthstation(Deauthstation *ds) + * + * Purpose: removed ds from deauthstation mempool + * + * Arguments: + * + * Returns: + * + */ +void DeleteDeauthstation(Deauthstation *ds) +{ + Deauthstation *oldds; + + oldds = (Deauthstation *) ubi_sptRemove(deauth_flood_data.DeauthstationsPtr, + (ubi_btNodePtr) ds); + mempool_free(&deauth_flood_data.DeauthstationPool,ds->bucket); + return; +} + + +/* + * Function: void DSLog(Packet *p, u_int32_t wst_addr) + * + * Purpose: Called either when deauthentication flood is detected or finished. + * Logs data to a text file: deauth_flood_data.logfile. + * + * Arguments: + * + * Returns: + * + */ +void DSLog(Packet *p, u_int32_t wst_addr) +{ + char timestamp[TIMEBUF_SIZE]; + + if(p){ + ts_print((struct timeval *) &p->pkth->ts, timestamp); + fprintf(deauth_flood_data.logfile, "\n%s Deauth flood reported\n", timestamp); + PrintWifiHeader(deauth_flood_data.logfile, p); + } + else{ + ts_print((struct timeval *) (wst_addr + deauth_flood_data.offset_time), timestamp); + fprintf(deauth_flood_data.logfile, "\n%s End Deauth flood :" + " -> Addr dst: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x,\n" + "%u deauth frame reported.\n", + timestamp, + *((u_int8_t *)(wst_addr)), *((u_int8_t *)(wst_addr + 1)), *((u_int8_t *)(wst_addr + 2)), + *((u_int8_t *)(wst_addr + 3)), *((u_int8_t *)(wst_addr + 4)), *((u_int8_t *)(wst_addr + 5)), + *((u_int16_t *)(wst_addr + deauth_flood_data.offset_nbr))); + } + fflush(deauth_flood_data.logfile); + return; +} + + +/* + * Function: void DeauthCleanExitFunction(int, void *) + * + * Purpose: + * + * Arguments: + * + * Returns: + */ +void DeauthFloodCleanExitFunction(int signal, void *arg) +{ + DeauthFloodData *dfd_ptr = (DeauthFloodData *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, "DeauthFloodCleanExitFunction\n");); + + if(fclose(dfd_ptr->logfile)){ + LogMessage("%s: fclose function failed while snort exiting: %s\n", + MODNAME, strerror(errno)); + } + return; +} + + + +/* + * Function: void DeauthFloodCleanRestartFunction(int, void *) + * + * Purpose: + * + * Arguments: + * + * Returns: + */ +void DeauthFloodRestartFunction(int signal, void *arg) +{ + DeauthFloodData *dfd_ptr = (DeauthFloodData *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_DEAUTHFLOOD, "DeauthFloodRestartFunction\n");); + + if(fclose(dfd_ptr->logfile)){ + LogMessage("%s: fclose function failed while snort restarting: %s\n", + MODNAME, strerror(errno)); + } + return; +} + +#endif /* WIRELESS */ Index: snort/src/preprocessors/spp_deauth_flood.h diff -u /dev/null snort/src/preprocessors/spp_deauth_flood.h:1.1.2.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_deauth_flood.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,100 @@ +/* +** Copyright (C) 2004 sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + + +#ifndef __SPP_DEAUTH_FLOOD_H__ +#define __SPP_DEAUTH_FLOOD_H__ + +#ifdef WIRELESS + +/* I N C L U D E S +*******************************************************************************/ +#include "snort.h" + + +/* D E F I N E S +*******************************************************************************/ + +#define DEAUTH_OPT_threshold "deauth-threshold" +#define DEAUTH_OPT_EXPIRE_TIMEOUT "expire_timeout" +#define DEAUTH_OPT_TARGET_LIMIT "target_limit" +#define DEAUTH_OPT_PRUNE_PERIOD "prune_period" + + +#define DEAUTH_FLOOD_THRESHOLD 20 +#define DEAUTH_FLOOD_EXPIRE_TIMEOUT 60 +#define DEAUTH_FLOOD_TARGET_LIMIT 100 +#define DEAUTH_FLOOD_PRUNE_PERIOD 30 + +typedef struct _DeauthFloodData +{ + ubi_trRoot Deauthstations; + ubi_trRootPtr DeauthstationsPtr; + + MemPool DeauthstationPool; + + u_int16_t offset_alert_flag; + u_int16_t offset_nbr; + u_int16_t offset_time; + + u_int32_t deauth_threshold; + u_int32_t expire_timeout; + u_int32_t target_limit; + u_int32_t prune_period; + + struct timeval prune_time; + + /** Global Program Data **/ + FILE *logfile; +} DeauthFloodData; + +/* this represent the deauthenticated station */ +typedef struct _DeauthStation +{ + ubi_trNode Node; /* for the splay tree */ + MemBucket *bucket; + + u_int32_t wst_addr; + u_int8_t addr[6]; +} Deauthstation; + + +/* P R O T O T Y P E S +*******************************************************************************/ + +void SetupDeauthFlood(); +void DeauthFloodInit(u_char *); +void DeauthFloodParseArgs(char *); +void DeauthFloodDetect(Packet *); +int deauthstationCompareFunc(ubi_trItemPtr, ubi_trNodePtr); +void AddDeauthStation(u_int32_t); +u_int32_t PruneDeauthstations(u_int32_t); +void DeleteDeauthstation(Deauthstation *); +void DSLog(Packet *, u_int32_t); +void DeauthFloodRestartFunction(int, void *); +void DeauthFloodCleanExitFunction(int, void *); + +#endif /* WIRELESS */ + +#endif /* __SPP_DESFLOOD_H__ */ Index: snort/src/preprocessors/spp_macspoof.c diff -u /dev/null snort/src/preprocessors/spp_macspoof.c:1.1.2.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_macspoof.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,986 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2004 Sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** The Directeur Central de la sécurité des systèmes d'information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** 5th Fev 2004. +*/ + + +/* spp_macspoof + * + * Purpose: Detects wireless MAC addresses involved in some MAC spoofed traffic. + * + * => list of MAC addresses excluded from wireless MAC spoofing + * detection process + * + * tolerate_gap => tolerate missing frames betweeen two consecutive frames issued + * from same MAC address + * + * threshold => number of abnormal sequence number gaps during time delta + * to trigger an alert + * + * expire_timeout => time period used to keep count of abnormal sequence number gap + * + * spoofed_addr_limit => maximum number of MAC addresses inserted inside MAC spoofed + * addresses mempool + * + * prune_period => number of seconds to wait for looking after some decayed + * MAC addresses inside mempool + * + * Effect: + * + * Sends an alert whenever MAC spoofing activity is detected. + * + * Comments: + * - Because of some particuliar firmware or some electro_magnetic conditions, this + * preprocessors won't fit to all wireless features inside network. + * Those would generate too much false positive alert. + * Therefore, I suggest macspoof preprocessos users to run snort a first time + * in order to identify those particuliar features and thereafter to insert + * them inside MaskedMACaddrlist. + * + * - Whenever an alert si raised, it doesn't mean anytime that concerned MAC address + * is spoofed. Furthermore, It means that this MAC adress is involved in some MAC + * spoofed traffic (either MAC spoofed or MAC spoofing address). + * + * - whenever "end abnormal sequence number gap" is logged, it doesn't exactly mean that + * MAC spoofing ended. For example, it would occured if a spoofer succeed to divert + * a user from network while keeping using his MAC address. In such a case, neither + * abnormal sequence number gap would be detected nor alert would be sended + * while MAC spoofing still occur. + * + * Any comments? + * + */ + + +#include + +#include "plugbase.h" +#include "mstring.h" +#include "debug.h" +#include "log.h" +#include "wifi_statetable.h" +#include "generators.h" +#include "ubi_BinTree.h" +#include "mempool.h" +#include "detect.h" +#include "util.h" + +#ifndef __SPP_MACSPOOF_C__ +#define __SPP_MACSPOOF_C__ +#include "spp_macspoof.h" +#endif + +#define MODNAME "spp_macspoof" + +MACSpoofData MACspoof_data; +char logpath[STD_BUF]; + +/* external globals from rules.c */ + +extern char *file_name; +extern int file_line; + + +/* + * Function: SetupMACSpoof() + * + * Purpose: Registers the preprocessor keyword and initialization + * function into the preprocessor list. This is the function that + * gets called from InitPreprocessors() in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + */ +void SetupMACSpoof() +{ + /* link the preprocessor keyword to the init function in + the preproc list */ + + RegisterPreprocessor("macspoof", MACSpoofInit); + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: macspoof is setup...\n");); + return; +} + + +/* + * Function: MACSpoofInit(u_char *) + * + * Purpose: Calls the argument parsing function, performs final setup on data + * structs, links the preproc function into the function list. + * + * Arguments: args => ptr to argument string + * + * Returns: void function + * + */ +void MACSpoofInit(u_char *args) +{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: macspoof Initialized\n");); + + memset(&MACspoof_data, 0, sizeof(MACSpoofData)); + + /* parse the argument list from the rules file */ + + MACSpoofParseArgs(args); + + MACspoof_data.spoofed_MACaddrsPtr = &MACspoof_data.spoofed_MACaddrs; + + /* set up the MAC spoofed address tree */ + + ubi_trInitTree(MACspoof_data.spoofed_MACaddrsPtr, MACSpoofedAddrCompareFunc, 0); + + /* set up the node pools */ + + if(mempool_init(&MACspoof_data.spoofed_MACaddrPool, + MACspoof_data.spoofed_addr_limit, + sizeof(Spoofed_MACaddr))){ + FatalError("ERROR: Can't initialize mempool for MACSpoofed addresses\n"); + } + + /* setup logpath */ + + strncpy(logpath, pv.log_dir, STD_BUF); + strncat(logpath, "/MACspoof.log", STD_BUF); + + MACspoof_data.logfile = fopen(logpath, "a+"); + if(MACspoof_data.logfile == NULL){ + FatalError("Can't open logfile: %s", logpath); + } + + MACspoof_data.offset_alert_flag = WSTInit(sizeof(u_int8_t)); + MACspoof_data.offset_seq_number = WSTInit(sizeof(u_int16_t)); + MACspoof_data.offset_gap_number = WSTInit(sizeof(u_int16_t)); + MACspoof_data.offset_time = WSTInit(sizeof(struct timeval)); + + /* Set the preprocessor function into the function list */ + + AddFuncToPreprocList(MACSpoofDetect); + + AddFuncToCleanExitList(MACSpoofCleanExitFunction, &MACspoof_data); + AddFuncToRestartList(MACSpoofRestartFunction, &MACspoof_data); + return; +} + + +/* + * Function: MACSpoofParseArgs(char *) + * + * Purpose: Process the preprocessor arguments from the rules file and + * initialize the preprocessor's data struct. This function doesn't + * have to exist if it makes sense to parse the args in the init + * function. + * + * Arguments: args => argument list + * + * Returns: void function + * + */ +void MACSpoofParseArgs(char *args) +{ + int i, n, n_args, n_arg_args; + char **arg_toks = NULL, **arg_args = NULL; + MACADDR *MAC_addr_ptr; + + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Parsing macspoof preprocessor arguments\n");); + + /* init preproc data with defaults */ + + MACspoof_data.tolerate_gap = MACSPOOF_TOLERATE_GAP; + MACspoof_data.threshold = MACSPOOF_THRESHOLD; + MACspoof_data.expire_timeout = MACSPOOF_EXPIRE_TIMEOUT; + MACspoof_data.spoofed_addr_limit = MACSPOOF_SPOOFED_ADDR_LIMIT; + MACspoof_data.prune_period = MACSPOOF_PRUNE_PERIOD; + + if(args == NULL) { + LogMessage("macspoof initialized with defaults:\n"); + LogMessage(" %s: none\n", MACSPOOF_OPT_MASKED_MAC_ADDR); + LogMessage(" %s: %u\n", MACSPOOF_OPT_TOLERATE_GAP, MACspoof_data.tolerate_gap); + LogMessage(" %s: %u\n", MACSPOOF_OPT_THRESHOLD, MACspoof_data.threshold); + LogMessage(" %s: %u\n", MACSPOOF_OPT_EXPIRE_TIMEOUT, MACspoof_data.expire_timeout); + LogMessage(" %s: %u\n", MACSPOOF_OPT_SPOOFED_ADDR_LIMIT, MACspoof_data.spoofed_addr_limit); + LogMessage(" %s: %u\n", MACSPOOF_OPT_PRUNE_PERIOD, MACspoof_data.prune_period); + + /* Update wifi_statetable timeout */ + + WSTUpdateTimeout(MACspoof_data.expire_timeout); + return; + } + + /* Build masked MAC address list */ + + MACspoof_data.masked_MACaddrlist = BuildMaskedMACaddrlist(&args); + + if(MACspoof_data.masked_MACaddrlist == NULL){ + args += 4; + } + else{ + MACspoof_data.MaskedMACaddrlist_flag = 1; + } + + /* finally process tolerate_gap, threshold, expire_timeout,spoofed_addr_limit and + prune_period arguments */ + + arg_toks = mSplit(args, ",", 5, &n_args, 0); + if(n_args != 5){ + FatalError("%s: %s (%d) => macspoof configuration format:" + " tolerate_gap , threshold , expire_timeout ,\n" + "spoofed_addr_limit , prune_period \n", + MODNAME, file_name, file_line); + } + + for(i = 0; i < n_args; i++) { + arg_args = mSplit(arg_toks[i], " ", 2, &n_arg_args, 0); + if(n_arg_args != 2){ + FatalError("%s: %s (%d) => macspoof configuration format:" + " tolerate_gap , threshold , expire_timeout ,\n" + "spoofed_addr_limit , prune_period \n", + MODNAME, file_name, file_line); + } + + if(strcmp(arg_args[0], "tolerate_gap") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"tolerate_gap\" must be greater than 0\n" + , MODNAME, file_name, file_line); + } + MACspoof_data.tolerate_gap = n; + } + else if(strcmp(arg_args[0], "threshold") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 1){ + FatalError("%s: %s (%d) => \"threshold\" must be greater than 1\n" + , MODNAME, file_name, file_line); + } + MACspoof_data.threshold = n; + } + else if(strcmp(arg_args[0], "expire_timeout") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + MACspoof_data.expire_timeout = n; + } + else if(strcmp(arg_args[0], "spoofed_addr_limit") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"spoofed_addr_limit\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + MACspoof_data.spoofed_addr_limit = n; + } + else if(strcmp(arg_args[0], "prune_period") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"prune_period\" must be greater than 0\n", + MODNAME, file_name, file_line); + } + MACspoof_data.prune_period = n; + } + else{ + FatalError("%s: %s (%d) => Invalid argument \"%s %s\"\n", + MODNAME, file_name, file_line, arg_args[0], arg_args[1]); + } + } + + if(MACspoof_data.expire_timeout <= MACspoof_data.prune_period){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be greater than prune_period\n", + MODNAME, file_name, file_line); + } + + LogMessage("macspoof arguments:\n"); + if(MACspoof_data.MaskedMACaddrlist_flag){ + MAC_addr_ptr = MACspoof_data.masked_MACaddrlist->head; + LogMessage(" %s: ", MACSPOOF_OPT_MASKED_MAC_ADDR); + LogMessage("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + MAC_addr_ptr->MAC_addr[0], MAC_addr_ptr->MAC_addr[1], MAC_addr_ptr->MAC_addr[2], + MAC_addr_ptr->MAC_addr[3], MAC_addr_ptr->MAC_addr[4], MAC_addr_ptr->MAC_addr[5]); + MAC_addr_ptr = MAC_addr_ptr->next; + while(MAC_addr_ptr){ + LogMessage(" %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + MAC_addr_ptr->MAC_addr[0], MAC_addr_ptr->MAC_addr[1], MAC_addr_ptr->MAC_addr[2], + MAC_addr_ptr->MAC_addr[3], MAC_addr_ptr->MAC_addr[4], MAC_addr_ptr->MAC_addr[5]); + MAC_addr_ptr = MAC_addr_ptr->next; + } + } + else{ + LogMessage(" %s: none\n", MACSPOOF_OPT_MASKED_MAC_ADDR); + } + LogMessage(" %s: %u\n", MACSPOOF_OPT_TOLERATE_GAP, MACspoof_data.tolerate_gap); + LogMessage(" %s: %u\n", MACSPOOF_OPT_THRESHOLD, MACspoof_data.threshold); + LogMessage(" %s: %u\n", MACSPOOF_OPT_EXPIRE_TIMEOUT, MACspoof_data.expire_timeout); + LogMessage(" %s: %u\n", MACSPOOF_OPT_SPOOFED_ADDR_LIMIT, MACspoof_data.spoofed_addr_limit); + LogMessage(" %s: %u\n", MACSPOOF_OPT_PRUNE_PERIOD, MACspoof_data.prune_period); + + /* Update wifi_statetable timeout */ + + WSTUpdateTimeout(MACspoof_data.expire_timeout); + return; +} + + +/* + * Function: MACSpoofDetect(Packet *) + * + * Purpose: Detect wireless frames with spoofed source address excluding ones specified + * by the MACSPOOF_MASKEDC_ADDR variable in snort.conf + * + * Arguments: p => pointer to the current packet data struct + * + * Returns: void function + * + */ +void MACSpoofDetect(Packet *p) +{ + wst_flag_type flag_addr; + u_int32_t pruned; + u_int16_t *gap_number_ptr, *seq_number_ptr, gap; + u_int8_t *alert_flag_ptr; + int8_t src_offset; + struct timeval wst_tv, tv_diff; + Event event; + char outstring[255]; + MACADDR *MAC_addr_ptr; + + /* Cull any expired MAC spoofed addresses out */ + + if(p->pkth->ts.tv_sec >= (MACspoof_data.prune_time.tv_sec + MACspoof_data.prune_period)){ + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Pruning out MACSpoofed addr due to expired prune_period\n");); + MACspoof_data.prune_time.tv_sec = p->pkth->ts.tv_sec; + pruned=PruneMACSpoofedAddrs(p->pkth->ts.tv_sec); + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "%u addr removed from MACSpoofed addr memory pool\n", pruned);); + } + + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "MACSPoofed addr count: %u\n", + ubi_trCount(MACspoof_data.spoofed_MACaddrsPtr));); + + if(p->wifih == NULL){ + return; + } + + flag_addr = WST_FLAG_SRCADDR; + + if(MACspoof_data.MaskedMACaddrlist_flag){ + src_offset = WSTDetermineMACAddrOffset(p, flag_addr); + MAC_addr_ptr = MACspoof_data.masked_MACaddrlist->head; + do{ + if(!memcmp(MAC_addr_ptr->MAC_addr, (u_int8_t *) p->wifih + src_offset, 6)){ + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Packet ignored due to src MAC addr: %2x:%.2x:%.2x:%.2x:%.2x:%.2x " + "included inside masked MAC addr list\n", + *((u_int8_t *) p->wifih + src_offset), + *((u_int8_t *) p->wifih + src_offset + 1), + *((u_int8_t *) p->wifih + src_offset + 2), + *((u_int8_t *) p->wifih + src_offset + 3), + *((u_int8_t *) p->wifih + src_offset + 4), + *((u_int8_t *) p->wifih + src_offset + 5));); + return; + } + MAC_addr_ptr = MAC_addr_ptr->next; + } while(MAC_addr_ptr); + } + + /* Calls WSTMain to fill up p->wstidx.cache_addr[flag_addr] with memory address corresponding + * with the place where source MAC address is recorded inside WST. */ + + WSTMain(p, flag_addr); + + if( p->wstidx.cache_addr[flag_addr] == WST_FAILED) { + return; + } + + /* seq_number_ptr points to the last wireless frame sequence number issued from + source MAC address */ + + seq_number_ptr = (u_int16_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + MACspoof_data.offset_seq_number)); + + /* gap represent the difference between packet's sequence number and corresponding sequence + number recorded inside WST minus one. Furthermore, it should be considered as the total + missing frames refered to 802.11 protocol. + This means that two consecutive frames with same sequence number issued from same MAC addr + will generate a gab equal to 4095. */ + + gap = (4095 + p->wifih->seqnum - (*seq_number_ptr)) %4096; + + /* Check whether or not gap should be considered as normal refered to preprocessor's argument + tolerate_gap */ + + if( gap <= MACspoof_data.tolerate_gap){ + + /* packet sequence number fill up 802.11 protocol according to preprocessor arguments */ + + *seq_number_ptr = p->wifih->seqnum; + return; + } + + /* From now, Packet is considered as abnormal */ + + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Missing frame abnormal count issued from MAC addr: " + "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + "received frame seq nbr: %u, recorded seq nbr: %u\n\n", + *((u_int8_t *) p->wstidx.cache_addr[flag_addr]), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 1)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 2)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 3)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 4)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 5)), + p->wifih->seqnum, *seq_number_ptr);); + + /* check wheter or not an alert is already reported */ + + alert_flag_ptr = (u_int8_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + MACspoof_data.offset_alert_flag)); + + if(*alert_flag_ptr){ + + /* Alert has already been sent. Purpose is now to update WST time data in order + to avoid concerned spoofed MAC address to be removed from MAC spoofed address + memory pool throught PruneMACSpoofedAddrs function */ + + *seq_number_ptr = p->wifih->seqnum; + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + MACspoof_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + return; + } + + /* gap_number_ptr points to the number of abnormal gap associated with source MAC addr + inside WST */ + + gap_number_ptr = (u_int16_t *) ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + + MACspoof_data.offset_gap_number)); + + /* Check whether or not data recorded inside WST should be considered as decayed for + this preprocessor */ + + memcpy(&wst_tv, ((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + MACspoof_data.offset_time)), + sizeof(struct timeval)); + tv_diff = WSTTimevalSubtract(p->pkth->ts, wst_tv); + + if( tv_diff.tv_sec > MACspoof_data.expire_timeout ){ + + /* data recorded inside WST are considered as decayed for this preprocessor. + Uptade them. */ + + *gap_number_ptr = 1; + *seq_number_ptr = p->wifih->seqnum; + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + MACspoof_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + return; + } + + (*gap_number_ptr)++; + *seq_number_ptr = p->wifih->seqnum; + + /* checks if alert condition are reached */ + + if((*gap_number_ptr) == MACspoof_data.threshold){ + + /* alert condition are reached */ + + memcpy((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + MACspoof_data.offset_time), + &p->pkth->ts, sizeof(struct timeval)); + (*alert_flag_ptr) = 1; + + snprintf(outstring, 255, MACSPOOF_PREFIX_STR "\nabnormal seq number gap " + "occurs on addr: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x", + *((u_int8_t *) p->wstidx.cache_addr[flag_addr]), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 1)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 2)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 3)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 4)), + *((u_int8_t *) (p->wstidx.cache_addr[flag_addr] + 5))); + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, "%s\n", outstring);); + + /* send alert & log data */ + + SetEvent(&event, GENERATOR_SPP_MACSPOOF, MACSPOOF_DETECTED, 1, 0, 0, 0); + CallAlertFuncs(p, outstring, NULL, &event); + MACSpoofLog(p, p->wstidx.cache_addr[flag_addr]); + + /* insert station inside deauthstation mempool */ + + AddMACSpoofedAddr(p->wstidx.cache_addr[flag_addr]); + } + return; +} + + +/* + * Function: MaskedMACaddrlist *BuildMaskedMACaddrlist(char **args_ptr) + * + * Purpose: Parses MAC address argument from the preprocessor's arguments string into a + * MaskedMACaddrlist and points it to the end of the MAC address argument + * + * Arguments: args_ptr => pointer to a string containing the preprocessor's arguments + * + * Returns: a MaskedMACaddrlist of MAC addresses to exclude from alerts + * + */ +MaskedMACaddrlist *BuildMaskedMACaddrlist(char **args_ptr) +{ + char *end_ptr; + char *args = *args_ptr; + MaskedMACaddrlist *masked_MACaddrlist = NULL; + u_int8_t MAC_addr[6]; + + while(*args && isspace(*args)) + args++; + + /* checks if MAC address argument is none which means that no MAC address + will be exclude from alerts */ + + if(memcmp(args, "none", 4) == 0){ + return NULL; + } + + masked_MACaddrlist = AllocMaskedMACaddrlist(); + + /* parse the MAC addr or list of MAC addrs */ + + if(args[0] == '['){ + for(end_ptr = ++args; *end_ptr && *end_ptr != ']'; end_ptr++){ + if(*end_ptr == ','){ + *end_ptr = '\0'; + if(ParseMACAddr(MAC_addr, args) < 0){ + FatalError("%s: %s (%d) => Error parsing MAC addr \"%s\"\n", + MODNAME, file_name, file_line, args); + } + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to masked MAC list\n", + MODNAME, MAC_addr[0], MAC_addr[1], MAC_addr[2], + MAC_addr[3], MAC_addr[4], MAC_addr[5]);); + + InsertMaskedMACaddr(MAC_addr, masked_MACaddrlist); + args = end_ptr + 1; + } + } + + *end_ptr = '\0'; + if(ParseMACAddr(MAC_addr, args) < 0){ + FatalError("%s: %s (%d) => error parsing masked MAC addresses \"%s\"\n", + MODNAME, file_name, file_line, args); + } + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to masked MAC list\n", + MODNAME, MAC_addr[0], MAC_addr[1], MAC_addr[2], + MAC_addr[3], MAC_addr[4], MAC_addr[5]);); + + InsertMaskedMACaddr(MAC_addr, masked_MACaddrlist); + args = end_ptr + 1; + while(*args && *args != ','){ + args++; + } + if(*args){ + args++; + } + } + else{ + for(end_ptr = args; *end_ptr && *end_ptr != ','; end_ptr++); + + *end_ptr ='\0'; + if(ParseMACAddr(MAC_addr, args) < 0){ + FatalError("%s: %s (%d) => error parsing masked MAC addresses \"%s\"\n", + MODNAME, file_name, file_line, args); + } + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to masked MAC list\n", + MODNAME, MAC_addr[0], MAC_addr[1], MAC_addr[2], + MAC_addr[3], MAC_addr[4], MAC_addr[5]);); + + InsertMaskedMACaddr(MAC_addr, masked_MACaddrlist); + args = end_ptr + 1; + } + + *args_ptr = args; + + return masked_MACaddrlist; +} + + +/* + * Function: MaskedMACaddrlist *AllocMaskedMACaddrlist(void) + * + * Purpose: Allocates a MaskedMACaddrlist + * + * Arguments: None + * + * Returns: A pointer to the newly allocated MaskedMACaddrlist or NULL or -1 if failed + * + */ +MaskedMACaddrlist *AllocMaskedMACaddrlist(void) +{ + return (MaskedMACaddrlist *)calloc(1, sizeof(MaskedMACaddrlist)); +} + + +int ParseMACAddr(u_int8_t *MACaddr, char *MAC_str) +{ + int i = 0; + char *next = MAC_str; + + while(*next){ + MACaddr[i] = strtol(MAC_str, &next, 16); + + if(MAC_str != next && i < 6){ + MAC_str = next + 1; + i++; + } + else{ + return -1; + } + } + return 0; +} + + +/* + * Function: MACADDR *InsertMaskedMACaddr(u_int8_t *MAC_addr, MaskedMACaddrlist *list) + * + * Purpose: Creates a MACADDR node from a byte array and inserts it into the + * specified MaskedMACaddrlist + * + * Arguments: MAC_addr => byte array containing a MAC address + * list => MaskedMACaddrlist to insert new node in + * + * Returns: A pointer to newly inserted MACADDR node or NULL if MAC_addr or + * list is NULL + */ +MACADDR *InsertMaskedMACaddr(u_int8_t *MAC_addr, MaskedMACaddrlist *list) +{ + MACADDR *MACAddr_ptr = NULL; + + if(list == NULL || MAC_addr == NULL) + return NULL; + + /* allocate new MACaddr node */ + + MACAddr_ptr = (MACADDR *)malloc(sizeof(MACADDR)); + memcpy(MACAddr_ptr->MAC_addr, MAC_addr, 6); + MACAddr_ptr->next = NULL; + MACAddr_ptr->prev =NULL; + + if(list->head == NULL && list->tail == NULL){ + list->head = MACAddr_ptr; + list->tail = MACAddr_ptr; + } + else{ + MACAddr_ptr->prev = list->tail; + list->tail->next = MACAddr_ptr; + list->tail = MACAddr_ptr; + } + return MACAddr_ptr; +} + + +/* + * Function: int MACSpoofAddrCompareFunc(ubi_trItemPtrItemPtr, + * ubi_trNodePtr NodePtr) + * + * Purpose: Callback function used by splay trees to sort deauthstation node + * + * Arguments: + * + * Returns: + * + */ +int MACSpoofedAddrCompareFunc(ubi_trItemPtr ItemPtr, ubi_trNodePtr NodePtr) +{ + Spoofed_MACaddr *A = (Spoofed_MACaddr *) NodePtr; + Spoofed_MACaddr *B = (Spoofed_MACaddr *) ItemPtr; + int32_t memcmp_result; + + memcmp_result = memcmp(&A->addr[0], &B->addr[0], 6); + if(memcmp_result < 0){ + return 1; + } + else if(memcmp_result > 0){ + return -1; + } + return 0; +} + + +/* + * Function: void AddMACSpoofedAddr(u_int32_t wst_addr) + * + * Purpose: Adds a new spoofed addr into the spoofed MAC addr tree + * + * Arguments: wst_addr => memory address where MAC address is recorded inside wst. + * + * Returns: none + * + */ +void AddMACSpoofedAddr(u_int32_t wst_addr) +{ + Spoofed_MACaddr *ms = NULL; + MemBucket *mb = NULL; + + /* borrow a MAC address node from the MAC addresses node pool */ + + mb = mempool_alloc(&MACspoof_data.spoofed_MACaddrPool); + + if(mb == NULL){ + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, "out of MACSpoofed addr Nodes\n");); + return; + } + + ms = (Spoofed_MACaddr *) mb->data; + ms->bucket = mb; + + /* fill in the Spoofed_MACaddr struct */ + + ms->wst_addr = wst_addr; + memcpy(&ms->addr[0], (u_int8_t *) wst_addr, 6); + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Assigning a MACSpoofed addr of" + " %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + ms->addr[0],ms->addr[1],ms->addr[2],ms->addr[3],ms->addr[4],ms->addr[5]);); + + /* add this spoofed MAC address to the spoofed MAC addresses tree */ + + if(ubi_sptInsert(MACspoof_data.spoofed_MACaddrsPtr, + (ubi_btNodePtr)ms, + (ubi_btNodePtr)ms, NULL) == ubi_trFALSE){ + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Insert into MACSpoofed addr tree failed\n");); + } + else{ + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Insert into MACSpoofed addr tree successful\n");); + } + return; +} + + +/* + * Function: u_int32_t PruneMACSPoofedAddrs(u_int32_t now) + * + * Purpose: Checks whether or not MAC addresses inserted inside spoofed + * MAC addresses tree are still spoofed or not. + * If not, removes concerned addresses from spoofed MAC addresses tree and + * calls MACSpoofLogs function. + * + * Arguments: now => packet's capture time in sec + * + * Returns: number of MAC addresses removed from spoofed MAC addresses memory + * pool. + * + */ +u_int32_t PruneMACSpoofedAddrs(u_int32_t now) +{ + Spoofed_MACaddr *idx; + u_int32_t pruned = 0; + u_int32_t ms_sec; + u_int8_t *alert_flag_ptr; + + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "Prune MACSpoofed addr called now: " + " %u , count: %u\n", + now, ubi_trCount(MACspoof_data.spoofed_MACaddrsPtr));); + + if(ubi_trCount(MACspoof_data.spoofed_MACaddrsPtr) < 1){ + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "exit PruneMACSpoofedAddrs function since MACSpoofed addr tree is free\n");); + return(0); + } + + /* number of thing that need to be deleted */ + + idx = (Spoofed_MACaddr *) ubi_btFirst((ubi_btNodePtr)MACspoof_data.spoofed_MACaddrsPtr->root); + + if(idx == NULL){ + return(0); + } + + + do{ + ms_sec = *((u_int32_t *) (idx->wst_addr + MACspoof_data.offset_time)); + + if((ms_sec + MACspoof_data.expire_timeout) < now){ + + /* MAC addresses shouldn't much more be considered as a spoofed one. + Removes it from spoofed MAC adresses pool */ + + alert_flag_ptr = (u_int8_t *) (idx->wst_addr + MACspoof_data.offset_alert_flag); + *alert_flag_ptr = 0; + + MACSpoofLog(NULL, idx->wst_addr); + Spoofed_MACaddr *savidx = idx; + if(ubi_trCount(MACspoof_data.spoofed_MACaddrsPtr) > 1){ + idx = (Spoofed_MACaddr *) ubi_btNext((ubi_btNodePtr)idx); + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, + "pruning stale MACSpoofed addr\n");); + DeleteMACSpoofedAddr(savidx); + pruned++; + } + else{ + DeleteMACSpoofedAddr(savidx); + pruned++; + return(pruned); + } + } + else{ + if(idx != NULL && ubi_trCount(MACspoof_data.spoofed_MACaddrsPtr)){ + idx = (Spoofed_MACaddr *) ubi_btNext((ubi_btNodePtr)idx); + } + else{ + return pruned; + } + } + } while(idx != NULL); + return pruned; +} + + +/* + * Function: void DeleteMACSpoofedAddr(Spoofed_MACaddr *ms) + * + * Purpose: removed MAC address from spoofed MAC addresses mempool + * + * Arguments: ms => points to concerned MAC address + * + * Returns: none + * + */ +void DeleteMACSpoofedAddr(Spoofed_MACaddr *ms) +{ + Spoofed_MACaddr *oldms; + oldms = (Spoofed_MACaddr *) ubi_sptRemove(MACspoof_data.spoofed_MACaddrsPtr, + (ubi_btNodePtr) ms); + mempool_free(&MACspoof_data.spoofed_MACaddrPool, ms->bucket); +} + + +/* + * Function: void MACSpoofLog(Packet *p, u_int32_t wst_addr) + * + * Purpose: Called either when MAC spoofing is detected or finished. + * Logs data to a text file: MACspoof_data.logfile. + * + * Arguments: p => pointer to current packet + * wst_addr => memory address where MAC address is recorded inside wst. + * + * Returns: none + * + */ +void MACSpoofLog(Packet *p, u_int32_t wst_addr) +{ + char timestamp[TIMEBUF_SIZE]; + + if(p){ + ts_print((struct timeval *) (wst_addr + MACspoof_data.offset_time), timestamp); + fprintf(MACspoof_data.logfile, "\n%s\nabnormal sequence number gap reported on addr :" + " %.2x:%.2x:%.2x:%.2x:%.2x:%.2x, sed number: %u\n", + timestamp, + *((u_int8_t *)(wst_addr)), *((u_int8_t *)(wst_addr + 1)), *((u_int8_t *)(wst_addr + 2)), + *((u_int8_t *)(wst_addr + 3)), *((u_int8_t *)(wst_addr + 4)), *((u_int8_t *)(wst_addr + 5)), + p->wifih->seqnum); + + PrintWifiHeader(MACspoof_data.logfile, p); + + if(p->iph != NULL){ + PrintIPHeader(MACspoof_data.logfile, p); + + switch(p->iph->ip_proto) + { + case IPPROTO_TCP: + PrintTCPHeader(MACspoof_data.logfile, p); + break; + + case IPPROTO_UDP: + PrintUDPHeader(MACspoof_data.logfile, p); + break; + + case IPPROTO_ICMP: + PrintICMPHeader(MACspoof_data.logfile, p); + break; + + default: + break; + } + } + } + else{ + ts_print((struct timeval *) (wst_addr + MACspoof_data.offset_time), timestamp); + fprintf(MACspoof_data.logfile, "\n%s End abnormal sequence number gap reported on addr: " + "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + timestamp, + *((u_int8_t *)(wst_addr)), *((u_int8_t *)(wst_addr + 1)), *((u_int8_t *)(wst_addr + 2)), + *((u_int8_t *)(wst_addr + 3)), *((u_int8_t *)(wst_addr + 4)), *((u_int8_t *)(wst_addr + 5))); + } + + fflush(MACspoof_data.logfile); + return; +} + + +/* + * Function: void MACSpoofCleanExitFunction(int, void *) + * + * Purpose: + * + * Arguments: + * + * Returns: + */ +void MACSpoofCleanExitFunction(int signal, void *arg) +{ + MACSpoofData *MACsd_ptr = (MACSpoofData *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, "MACSpoofCleanExitFunction\n");); + + if(fclose(MACsd_ptr->logfile)) + LogMessage("%s: fclose function failed while snort exiting: %s\n", + MODNAME, strerror(errno)); + return; +} + + +/* + * Function: void MACSpoofCleanRestartFunction(int, void *) + * + * Purpose: + * + * Arguments: + * + * Returns: + */ +void MACSpoofRestartFunction(int signal, void *arg) +{ + MACSpoofData *MACsd_ptr = (MACSpoofData *) arg; + + DEBUG_WRAP(DebugMessage(DEBUG_MACSPOOF, "MACSpoofRestartFunction\n");); + + if(fclose(MACsd_ptr->logfile)) + LogMessage("%s: fclose function failed while snort restarting: %s\n", + MODNAME, strerror(errno)); + return; +} + +#endif /* WIRELESS */ Index: snort/src/preprocessors/spp_macspoof.h diff -u /dev/null snort/src/preprocessors/spp_macspoof.h:1.1.2.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_macspoof.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,126 @@ +/* +** Copyright (C) 2004 sebastien Gracia +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +** +** Copyright disclaimers: +** Direction Centrale des Systèmes de Sécurité de l'Information hereby +** disclaims all copyright interest in the changes and enhancements +** made by sebastien Gracia. +** The Directeur Central de la sécurité des systèmes d'information, +** Henri Serres, 5th fev 2004. +*/ + + +#ifndef __SPP_MACSPOOF_H__ +#define __SPP_MACSPOOF_H__ + +#ifdef WIRELESS + +/* I N C L U D E S +*******************************************************************************/ +#include "snort.h" + + +/* D E F I N E S +*******************************************************************************/ + +#define MACSPOOF_OPT_MASKED_MAC_ADDR "masked_MAC_addr" +#define MACSPOOF_OPT_TOLERATE_GAP "tolerate_gap" +#define MACSPOOF_OPT_THRESHOLD "threshold" +#define MACSPOOF_OPT_EXPIRE_TIMEOUT "expire_timeout" +#define MACSPOOF_OPT_SPOOFED_ADDR_LIMIT "spoofed_addr_limit" +#define MACSPOOF_OPT_PRUNE_PERIOD "prune_period" + +#define MACSPOOF_TOLERATE_GAP 5 +#define MACSPOOF_THRESHOLD 10 +#define MACSPOOF_EXPIRE_TIMEOUT 120 +#define MACSPOOF_SPOOFED_ADDR_LIMIT 100 +#define MACSPOOF_PRUNE_PERIOD 30 + + +typedef struct _MACADDR +{ + u_int8_t MAC_addr[6]; + struct _MACADDR *next, *prev; +} MACADDR; + + +typedef struct _MaskedMACaddrList +{ + struct _MACADDR *head, *tail; +} MaskedMACaddrlist; + + +typedef struct _MACSpoofData +{ + ubi_trRoot spoofed_MACaddrs; + ubi_trRootPtr spoofed_MACaddrsPtr; + + MemPool spoofed_MACaddrPool; + + u_int16_t offset_alert_flag; + u_int16_t offset_seq_number; + u_int16_t offset_gap_number; + u_int16_t offset_time; + + u_int8_t MaskedMACaddrlist_flag; + MaskedMACaddrlist *masked_MACaddrlist; + + u_int32_t tolerate_gap; + u_int32_t threshold; + u_int32_t expire_timeout; + u_int32_t spoofed_addr_limit; + u_int32_t prune_period; + + struct timeval prune_time; + + /** Global Program Data **/ + FILE *logfile; +} MACSpoofData; + +/* this represent the deauthenticated station */ +typedef struct _Spoofed_MACaddr +{ + ubi_trNode Node; /* for the splay tree */ + MemBucket *bucket; + + u_int32_t wst_addr; + u_int8_t addr[6]; +} Spoofed_MACaddr; + + +/* P R O T O T Y P E S +*******************************************************************************/ + +void SetupMACSpoof(); +void MACSpoofInit(u_char *); +void MACSpoofParseArgs(char *); +void MACSpoofDetect(Packet *); +MaskedMACaddrlist *BuildMaskedMACaddrlist(char **); +MaskedMACaddrlist *AllocMaskedMACaddrlist(void); +int ParseMACAddr(u_int8_t *, char *); +MACADDR *InsertMaskedMACaddr(u_int8_t *, MaskedMACaddrlist *); +int MACSpoofedAddrCompareFunc(ubi_trItemPtr, ubi_trNodePtr); +void AddMACSpoofedAddr(u_int32_t); +u_int32_t PruneMACSpoofedAddrs(u_int32_t); +void DeleteMACSpoofedAddr(Spoofed_MACaddr *); +void MACSpoofLog(Packet *, u_int32_t); +void MACSpoofCleanExitFunction(int, void *); +void MACSpoofRestartFunction(int, void *); + +#endif /* WIRELESS */ + +#endif /* __SPP_MACSPOOF_H__ */ Index: snort/src/preprocessors/spp_rogue_ap.c diff -u /dev/null snort/src/preprocessors/spp_rogue_ap.c:1.1.8.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_rogue_ap.c Sat Apr 23 02:19:33 2005 @@ -0,0 +1,650 @@ +#ifdef WIRELESS + +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: spp_rogue_ap.c,v 1.1.8.1 2005/04/23 06:19:33 andrew Exp $ */ + +/* spp_rogue_ap + * + * Purpose: + * + * Detects unauthorized wireless APs and AdHoc networks + * + * Arguments: + * + * , , scan_flag [0 | 1], scan_timeout , expire_timeout + * + * Where: + * + * => a single BSSID or a list specified as [, ...] + * + * => a single channel or a list specified as [, , ...] + * + * scan_flag => enable scanning of multiple channels + * + * scan_timeout => seconds to wait between scanning channels + * + * expire_timeout => expiration timeout for detected access points + * + * + * Effect: + * + * Sends an alert for each rogue network it detects of the form: + * "Rogue AP detected (BSSID XX:XX:XX:XX:XX:XX)" + * + * Comments: + * + * Detection on multiple channels will be implemented later + * + */ + +#include "generators.h" +#include "log.h" +#include "detect.h" +#include "decode.h" +#include "event.h" +#include "plugbase.h" +#include "parser.h" +#include "mstring.h" +#include "debug.h" +#include "util.h" + +#ifndef __SPP_ROGUE_AP_C__ +#define __SPP_ROGUE_AP_C__ +#include "spp_rogue_ap.h" +#endif + + +#define MODNAME "spp_rogue_ap" + +/* external globals from rules.c */ +extern char *file_name; +extern int file_line; + +RogueApData rogue_ap_data; /* preprocessor data */ + +/* + * Function: SetupRogueAp() + * + * Purpose: Registers the preprocessor keyword and initialization + * function into the preprocessor list. This is the function that + * gets called from InitPreprocessors() in plugbase.c. + * + * Arguments: None. + * + * Returns: void function + * + */ +void SetupRogueAp() +{ + /* link the preprocessor keyword to the init function in + the preproc list */ + RegisterPreprocessor("rogue_ap", RogueApInit); + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: RogueAp is setup...\n");); +} + + +/* + * Function: RogueApInit(u_char *) + * + * Purpose: Calls the argument parsing function, performs final setup on data + * structs, links the preproc function into the function list. + * + * Arguments: args => ptr to argument string + * + * Returns: void function + * + */ +void RogueApInit(u_char *args) +{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN,"Preprocessor: RogueAp Initialized\n");); + + /* parse the argument list from the rules file */ + RogueApParseArgs(args); + + /* Set the preprocessor function into the function list */ + AddFuncToPreprocList(RogueApDetect); +/* AddFuncToCleanExitList(RogueApCleanExit); */ +/* AddFuncToRestartList(RogueApRestart); */ + + + if(rogue_ap_data.scan_flag){ +#warning "Implement channel hopping" + } +} + + + +/* + * Function: RogueApParseArgs(char *) + * + * Purpose: Process the preprocessor arguements from the rules file and + * initialize the preprocessor's data struct. This function doesn't + * have to exist if it makes sense to parse the args in the init + * function. + * + * Arguments: args => argument list + * + * Returns: void function + * + */ + +void RogueApParseArgs(char *args) +{ + char *end_ptr; + char **arg_toks = NULL, **arg_args = NULL; + int i, n, n_args, n_arg_args; + BSSIDList *bssid_list; + u_int8_t bssid[6] = { 0 }; + + + memset(&rogue_ap_data, 0x00, sizeof(rogue_ap_data)); + rogue_ap_data.scan_timeout = ROGUE_AP_SCAN_TIMEOUT; /* default scan_timeout */ + rogue_ap_data.expire_timeout = ROGUE_AP_EXPIRE_TIMEOUT; /* default expire_timeout */ + + if(args == NULL) + return; + + rogue_ap_data.pass_list = BuildApList(&args); + rogue_ap_data.rogue_list = AllocBSSIDList(); + rogue_ap_data.channel_mask = BuildChannelMask(&args); + + if(*args){ + arg_toks = mSplit(args, ",", 3, &n_args, 0); + + if(n_args != 3){ + FatalError("%s: %s (%d) => rogue_ap configuration format: , ," + " scan_flag [ 0 | 1 ], scan_timeout , expire_timeout \n", MODNAME, file_name, file_line); + } + + for(i = 0; i < n_args; i++){ + arg_args = mSplit(arg_toks[i], " ", 2, &n_arg_args, 0); + if(n_arg_args != 2){ + FatalError("%s: %s (%d) => rogue_ap configuration format: , ," + " scan_flag [ 0 | 1 ], scan_timeout , expire_timeout \n", MODNAME, file_name, file_line); + } + + if(strcmp(arg_args[0], "scan_flag") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n != 0 && n != 1){ + FatalError("%s: %s (%d) => \"scan_flag\" must either be 0 or 1\n", MODNAME, file_name, file_line); + } + rogue_ap_data.scan_flag = n; + } + else if(strcmp(arg_args[0], "scan_timeout") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"scan_timeout\" must be non-negative\n", MODNAME, file_name, file_line); + } + rogue_ap_data.scan_timeout = n; + } + else if(strcmp(arg_args[0], "expire_timeout") == 0){ + n = strtol(arg_args[1], NULL, 10); + if(n <= 0){ + FatalError("%s: %s (%d) => \"expire_timeout\" must be non-negative\n", MODNAME, file_name, file_line); + } + rogue_ap_data.expire_timeout = n; + } + else{ + FatalError("%s: %s (%d) => Invalid argument \"%s %s\"\n", MODNAME, file_name, file_line, arg_args[0], arg_args[1]); + } + } + } + +} + + + +/* + * Function: RogueApDetect(Packet *) + * + * Purpose: Detect APs and AdHoc networks excluding ones specified + * by the ACCESS_POINTS variable in snort.conf + * + * Arguments: p => pointer to the current packet data struct + * + * Returns: void function + * + */ + +void RogueApDetect(Packet *p) +{ + Event event; + char log_message[128]; + BSSID *bssid_ptr; + u_int8_t *bssid; + time_t time_curr; + + if(!p->wifih) + return; + + time_curr = time(NULL); + + switch(p->wifih->type){ /* point bssid to the correct field in the frame */ + + case TYPE_MANAGEMENT: + bssid = p->wifih->addr3; + break; + + case TYPE_CONTROL: + + if(p->wifih->stype == STYPE_RTS || p->wifih->stype == STYPE_CTS || p->wifih->stype == STYPE_ACK){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Received Control frame subtype that does not contain BSSID\n", MODNAME);); + return; + } + else if(p->wifih->stype == STYPE_PS) + bssid = p->wifih->addr1; + else if(p->wifih->stype == STYPE_CFEND) + bssid = p->wifih->addr2; + else if(p->wifih->stype == STYPE_CFEND_CFACK) + bssid = p->wifih->addr2; + else{ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Received Control frame with unknown/invalid subtype\n", MODNAME);); + return; + } + + break; + + case TYPE_DATA: + if(p->wifih->to_ds){ + if(p->wifih->from_ds){ /* to_ds == 1 && from_ds == 1 */ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Received Data frame subtype that does not contain BSSID\n", MODNAME);); + return; + } + else /* to_ds == 1 && from_ds == 0 */ + bssid = p->wifih->addr1; + } + else{ + if(p->wifih->from_ds) /* to_ds == 0 && from_ds == 1 */ + bssid = p->wifih->addr2; + else /* to_ds == 0 && from_ds == 0 */ + bssid = p->wifih->addr3; + } + + break; + + default: + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Received frame with unknown/invalid type\n", MODNAME);); + return; + } + + + /* iterate through rogue AP list */ + bssid_ptr = rogue_ap_data.rogue_list->head; + while(bssid_ptr){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Checking %.2X:%.2X:%.2X:%.2X:%.2X:%.2X against rogue " + "(BSSID %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n", MODNAME, + bssid[0], bssid[1], bssid[2], + bssid[3], bssid[4], bssid[5], + bssid_ptr->bssid[0], bssid_ptr->bssid[1], bssid_ptr->bssid[2], + bssid_ptr->bssid[3], bssid_ptr->bssid[4], bssid_ptr->bssid[5]);); + + if(time_curr - bssid_ptr->timestamp >= rogue_ap_data.expire_timeout){ + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Removing expired AP from rogue AP list (BSSID %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n", + MODNAME, bssid_ptr->bssid[0], bssid_ptr->bssid[1], bssid_ptr->bssid[2], + bssid_ptr->bssid[3], bssid_ptr->bssid[4], bssid_ptr->bssid[5]);); + + bssid_ptr = RemoveBSSID(bssid_ptr, rogue_ap_data.rogue_list); /* remove BSSIDs that have expired */ + continue; + } + + if(memcmp(bssid, bssid_ptr->bssid, 6) == 0){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: BSSID already on rogue AP list (BSSID %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n", + MODNAME, bssid_ptr->bssid[0], bssid_ptr->bssid[1], bssid_ptr->bssid[2], + bssid_ptr->bssid[3], bssid_ptr->bssid[4], bssid_ptr->bssid[5]);); + return; /* return if BSSID is already on the list */ + } + + bssid_ptr = bssid_ptr->next; + } + + /* iterate through legitimate AP list */ + for(bssid_ptr = rogue_ap_data.pass_list->head; bssid_ptr != NULL; bssid_ptr = bssid_ptr->next) + if(memcmp(bssid_ptr->bssid, bssid, 6) == 0){ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: BSSID on good AP list (BSSID %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)\n", + MODNAME, bssid_ptr->bssid[0], bssid_ptr->bssid[1], bssid_ptr->bssid[2], + bssid_ptr->bssid[3], bssid_ptr->bssid[4], bssid_ptr->bssid[5]);); + return; /* return if the AP is legit */ + } + /* construct alert message */ + snprintf(log_message, 128, "Rogue AP detected (BSSID %.2X:%.2X:%.2X:%.2X:%.2X:%.2X)", + bssid[0], bssid[1], bssid[2], + bssid[3], bssid[4], bssid[5]); + + SetEvent(&event, GENERATOR_SPP_ROGUE_AP, ROGUE_AP_DETECTED, 1, 4, 2, 0); + if(p->iph == NULL) /* horrible hack to get this to show up in ACID */ + p->iph = (IPHdr *)calloc(1, sizeof(IPHdr)); + + CallAlertFuncs(p, log_message, NULL, &event); /* send alert */ + + InsertBSSID(bssid, rogue_ap_data.rogue_list); /* insert BSSID into rogue AP list */ + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to rogue AP list\n", MODNAME, + bssid[0], bssid[1], bssid[2], + bssid[3], bssid[4], bssid[5]);); +} + + + +void RogueApCleanExitFunction(int signal) +{ +#warning "Implement RogueApCleanExitFunction()" + /* clean exit code goes here */ +} + + + +void RogueApRestartFunction(int signal) +{ +#warning "Implement RogueApRestartFunction()" + /* restart code goes here */ +} + + + +/* + * Function: BuildApList(char **) + * + * Purpose: Parses bssid argument from the preprocessor's arguments string into a + * BSSIDList and points it to the end of the bssid argument + * + * Arguments: args_ptr => pointer to a string containing the preprocessor's arguments + * + * Returns: a BSSIDList of BSSIDs to exclude from alerts + * + */ + +BSSIDList *BuildApList(char **args_ptr){ + char *end_ptr; + char *args = *args_ptr; + BSSIDList *bssid_list = NULL; + u_int8_t bssid[6]; + + if(args == NULL || *args == '\0') + FatalError("%s: %s (%d) => rogue_ap configuration format: , ," + " scan_flag [ 0 | 1 ], scan_timeout , expire_timeout \n", MODNAME, file_name, file_line); + + + while(*args && isspace(*args)) /* eat up initial whitespace */ + args++; + + bssid_list = AllocBSSIDList(); + + memset(bssid, 0xff, 6); + InsertBSSID(bssid, bssid_list); + + /* parse the bssid or list of bssids */ + if(args[0] == '['){ + + for(end_ptr = ++args; *end_ptr && *end_ptr != ']'; end_ptr++) + if(*end_ptr == ','){ + *end_ptr = '\0'; + if(ParseBSSID(bssid, args) < 0) + FatalError("%s: %s (%d) => Error parsing BSSID \"%s\"\n", + MODNAME, file_name, file_line, args); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to good AP list\n", + MODNAME, bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);); + InsertBSSID(bssid, bssid_list); + args = end_ptr + 1; + } + + *end_ptr = '\0'; + if(ParseBSSID(bssid, args) < 0) + FatalError("%s: %s (%d) => Error parsing BSSID \"%s\"\n", + MODNAME, file_name, file_line, args); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to good AP list\n", + MODNAME, bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);); + InsertBSSID(bssid, bssid_list); + args = end_ptr + 1; + while(*args && *args != ',') args++; + if(*args) args++; + } + else{ + + for(end_ptr = args; *end_ptr && *end_ptr != ','; end_ptr++); + + *end_ptr = '\0'; + if(ParseBSSID(bssid, args) < 0) + FatalError("%s: %s (%d) => Error parsing BSSID \"%s\"\n", + MODNAME, file_name, file_line, args); + + DEBUG_WRAP(DebugMessage(DEBUG_PLUGIN, "%s: Adding %.2X:%.2X:%.2X:%.2X:%.2X:%.2X to good AP list\n", + MODNAME, bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);); + InsertBSSID(bssid, bssid_list); + args = end_ptr + 1; + } + + *args_ptr = args; + + return bssid_list; +} + + + +/* + * Function: BuildChannelMask(char **) + * + * Purpose: Parses channel argument from the preprocessor's arguments string into a + * bitmask and points it to the end of the channel argument + * + * Arguments: args_ptr => pointer to a string containing the preprocessor's arguments + * + * Returns: a 16 bit mask containing the channels to be monitored + * + */ + +u_int16_t BuildChannelMask(char **args_ptr){ + char *end_ptr; + char *args = *args_ptr; + u_int16_t mask = 0; + int n; + + if(args == NULL || *args == '\0') + FatalError("%s: %s (%d) => rogue_ap configuration format: , ," + " scan_flag [ 0 | 1 ], scan_timeout , expire_timeout \n", MODNAME, file_name, file_line); + + while(*args && isspace(*args)) args++; /* eat initial white space */ + + + if(args[0] == '['){ + for(end_ptr = ++args; *end_ptr && *end_ptr != ']'; end_ptr++) + if(*end_ptr == ','){ + *end_ptr = '\0'; + n = strtol(args, NULL, 10); + if(n < ROGUE_AP_MIN_CHANNEL || n > ROGUE_AP_MAX_CHANNEL) + FatalError("%s: %s (%d) => Channel \"%s\" out of range\n", + MODNAME, file_name, file_line, args); + mask |= 1 << n; + args = end_ptr + 1; + } + + *end_ptr = '\0'; + n = strtol(args, NULL, 10); + if(n < ROGUE_AP_MIN_CHANNEL || n > ROGUE_AP_MAX_CHANNEL) + FatalError("%s: %s (%d) => Channel \"%s\" out of range\n", + MODNAME, file_name, file_line, args); + mask |= 1 << n; + args = end_ptr + 1; + + /* eat up to and including next ',' */ + while(*args && *args != ',') args++; + if(*args) args++; + } + else{ + for(end_ptr = args; *end_ptr && *end_ptr != ','; end_ptr++); + *end_ptr = '\0'; + n = strtol(args, NULL, 10); + if(n < ROGUE_AP_MIN_CHANNEL || n > ROGUE_AP_MAX_CHANNEL) + FatalError("%s: %s (%d) => Channel \"%s\" out of range\n", + MODNAME, file_name, file_line, args); + mask |= 1 << n; + args = end_ptr + 1; + } + + + + *args_ptr = args; + + return mask; +} + + + +/* + * Function: AllocBSSIDList(void) + * + * Purpose: Allocates a BSSIDList + * + * Arguments: None + * + * Returns: A pointer to the newly allocated BSSIDList or + * NULL on error + * + */ + + +BSSIDList *AllocBSSIDList(void){ + return (BSSIDList *)calloc(1, sizeof(BSSIDList)); +} + + + +void DestroyBSSIDList(BSSIDList *list){ +#warning "Implement DestroyBSSIDList()" +} + + + +/* + * Function: InsertBSSID(u_int8_t *, BSSIDList *) + * + * Purpose: Creates a BSSID node from a byte array and inserts + * it into the specified BSSIDList + * + * Arguments: bssid => byte array containing a BSSID + * list => BSSIDList to insert new node in + * + * Returns: pointer to newly inserted BSSID node or NULL + * if bssid or list is NULL + * + */ + +BSSID *InsertBSSID(u_int8_t *bssid, BSSIDList *list){ + BSSID *bssid_ptr = NULL; + + if(list == NULL || bssid == NULL) + return NULL; + + /* allocate new BSSID node */ + bssid_ptr = (BSSID *)malloc(sizeof(BSSID)); + bssid_ptr->not_flag = 0; + memcpy(bssid_ptr->bssid, bssid, 6); + bssid_ptr->timestamp = time(NULL); + bssid_ptr->next = NULL; + bssid_ptr->prev = NULL; + + if(list->head == NULL && list->tail == NULL){ /* if empty list, set head and tail */ + list->head = bssid_ptr; + list->tail = bssid_ptr; + } + else{ /* if already a tail, link new node in */ + bssid_ptr->prev = list->tail; + list->tail->next = bssid_ptr; + list->tail = bssid_ptr; + } + + return bssid_ptr; /* return pointer to new BSSID node */ +} + + + +/* + * Function: RemoveBSSID(BSSID *, BSSIDList *) + * + * Purpose: Removes a BSSID node from a BSSIDList + * + * Arguments: node => pointer to BSSID node to be removed + * list => BSSIDList to remove node from + * + * Returns: next BSSID node in the list or NULL if one + * does not exist + */ + +BSSID *RemoveBSSID(BSSID *node, BSSIDList *list){ + BSSID *bssid_ptr; + + if(list == NULL) + return node; + + if(node == list->head){ + if((list->head = node->next) == NULL) + list->tail = NULL; + else + node->next->prev = NULL; + } + else{ + if((node->next->prev = node->next) == NULL) + list->tail = node->prev; + else + node->next->prev = node->prev; + } + + bssid_ptr = node->next; + free(node); + + return bssid_ptr; +} + + + +/* + * Function: ParseBSSID(u_int8_t *, char *) + * + * Purpose: Parses BSSIDs from a character string and stores them + * in a byte array. + * + * Arguments: bssid => pointer to byte array to store parsed BSSID in + * mac_str => character string containing BSSID + * + * Returns: 0 on success, -1 on error + * + */ + +int ParseBSSID(u_int8_t *bssid, char *mac_str){ + int i = 0; + char *next = mac_str; + + while(*next){ + if((bssid[i] = strtol(mac_str, &next, 16)) > 255){ + return -1; + } + if(mac_str != next && i < 6){ + mac_str = next + 1; + i++; + } + else + return -1; + } + + return 0; +} + +#endif /* WIRELESS */ Index: snort/src/preprocessors/spp_rogue_ap.h diff -u /dev/null snort/src/preprocessors/spp_rogue_ap.h:1.2.4.1 --- /dev/null Mon Jun 13 11:23:09 2005 +++ snort/src/preprocessors/spp_rogue_ap.h Sat Apr 23 02:19:33 2005 @@ -0,0 +1,134 @@ +/* +** Copyright (C) 2003 Andrew Lockhart +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* $Id: spp_rogue_ap.h,v 1.2.4.1 2005/04/23 06:19:33 andrew Exp $ */ +/* Snort Preprocessor Plugin Header File RogueAp */ + +#include "snort.h" + +#ifndef __SPP_ROGUE_AP_H__ +#define __SPP_ROGUE_AP_H__ + +#ifdef WIRELESS + +#define ROGUE_AP_NUM_ARGS 2 +#define ROGUE_AP_SCAN_TIMEOUT 60 +#define ROGUE_AP_EXPIRE_TIMEOUT 60 * 60 * 12 /* 12 hours */ +#define ROGUE_AP_MAX_BSSIDS 255 +#define ROGUE_AP_MIN_CHANNEL 1 +#define ROGUE_AP_MAX_CHANNEL 11 + +#ifdef __SPP_ROGUE_AP_C__ + +typedef struct _BSSID { + u_int8_t not_flag; + u_int8_t bssid[6]; + time_t timestamp; + struct _BSSID *next, *prev; +} BSSID; + +typedef struct _BSSIDList { + struct _BSSID *head, *tail; +} BSSIDList; + +typedef struct _RogueApData { + BSSIDList *pass_list; /* list of our BSSIDs -- var ACCESS_POINTS from snort.conf */ + BSSIDList *rogue_list; /* list of gathered rogue BSSIDs */ + u_int16_t channel_mask; /* bitmask for channels 1-11 or 1-14 */ + u_int8_t scan_flag; /* channel scan flag */ + time_t scan_timeout; /* scan_timeout from snort.conf */ + time_t expire_timeout; /* expire_timeout from snort.conf */ + time_t scan_timer; /* timer for channel switching */ +} RogueApData; + +typedef enum { /* 802.11 frame types */ + TYPE_INVALID = -1, + TYPE_MANAGEMENT = 0x00, + TYPE_CONTROL = 0x01, + TYPE_DATA = 0x02 +} wifi_type_t; + +typedef enum { /* 802.11 management frame subtypes */ + STYPE_ASSOCREQ = 0x00, /* Subtypes are already AND'ed with their corresponding Types */ + STYPE_ASSOCRESP = 0x01, /* to prevent false positives and the need for checking the type */ + STYPE_REASSOC_REQ = 0x02, /* independently */ + STYPE_REASSOC_RESP = 0x03, + STYPE_PROBEREQ = 0x04, + STYPE_PROBERESP = 0x05, + STYPE_BEACON = 0x08, + STYPE_ATIM = 0x09, + STYPE_DISASSOC = 0x0a, + STYPE_AUTH = 0x0b, + STYPE_DEAUTH = 0x0c, + + STYPE_INVALID = 0x0d, +/* STYPE_INVALID = 0x0e, */ +/* STYPE_INVALID = 0x0f, */ +/* STYPE_INVALID = 0x10, */ +/* STYPE_INVALID = 0x11, */ +/* STYPE_INVALID = 0x12, */ +/* STYPE_INVALID = 0x13, */ +/* STYPE_INVALID = 0x14, */ +/* STYPE_INVALID = 0x15, */ +/* STYPE_INVALID = 0x16, */ +/* STYPE_INVALID = 0x17, */ +/* STYPE_INVALID = 0x18, */ +/* STYPE_INVALID = 0x19, */ + + +/* 802.11 control frame subtypes */ + STYPE_PS = 0x0a, + STYPE_RTS = 0x0b, + STYPE_CTS = 0x0c, + STYPE_ACK = 0x0d, + STYPE_CFEND = 0x0e, + STYPE_CFEND_CFACK = 0x0f, + +/* 802.11 data frame subtypes */ + STYPE_DATA = 0x00, + STYPE_CFACK = 0x01, + STYPE_CFPOLL = 0x02, + STYPE_CFACK_CFPOLL = 0x03, + STYPE_NULLFUNC = 0x04, + STYPE_CFACK_NULLFUNC = 0x05, + STYPE_CFPOLL_NULLFUNC = 0x06, + STYPE_CFACK_CFPOLL_NULLFUNC = 0x07 +} wifi_stype_t; + + +BSSIDList *BuildApList(char **); +u_int16_t BuildChannelMask(char **); +BSSIDList *AllocBSSIDList(void); +void DestroyBSSIDList(BSSIDList *); +BSSID *InsertBSSID(u_int8_t *, BSSIDList *); +BSSID *RemoveBSSID(BSSID *, BSSIDList *); +int ParseBSSID(u_int8_t *, char *); + +#endif /* __SPP_ROGUE_AP_C__ */ + + +void SetupRogueAp(); +void RogueApInit(u_char *); +void RogueApParseArgs(char *); +void RogueApDetect(Packet *); +void RogueApRestart(int); +void RogueApCleanExit(int); + +#endif /* WIRELESS */ + +#endif /* !__SPP_ROGUE_AP_H__ */ Index: snort/src/preprocessors/spp_sfportscan.c diff -u snort/src/preprocessors/spp_sfportscan.c:1.1.1.3 snort/src/preprocessors/spp_sfportscan.c:1.1.1.3.2.1 --- snort/src/preprocessors/spp_sfportscan.c:1.1.1.3 Mon Apr 25 03:26:59 2005 +++ snort/src/preprocessors/spp_sfportscan.c Fri Jun 10 19:11:30 2005 @@ -35,7 +35,6 @@ #include "checksum.h" #include "packet_time.h" #include "snort.h" -#include "sfthreshold.h" #include "portscan.h" @@ -84,10 +83,9 @@ if(!p->pkth) return -1; - p->pkth = (struct pcap_pkthdr *)(((u_char *)p->pkth)); + p->pkth = (struct pcap_pkthdr *)(((u_char *)p->pkth) + 2); - /* Add 2 to align iph struct members on 4 byte boundaries - for sparc, etc */ - p->pkt = ((u_char *)p->pkth + sizeof(SnortPktHeader) + 2); + p->pkt = ((u_char *)p->pkth + sizeof(SnortPktHeader)); p->eh = (EtherHdr *)p->pkt; p->iph = (IPHdr *)(((u_char *)p->eh) + ETHERNET_HEADER_LEN); p->data = ((u_char *)p->iph) + sizeof(IPHdr); @@ -189,27 +187,13 @@ } static int LogPortscanAlert(Packet *p, char *msg, u_int32_t event_id, - u_int32_t event_ref, u_int32_t gen_id, u_int32_t sig_id) + u_int32_t event_ref) { char timebuf[TIMEBUF_SIZE]; - u_long src_addr = 0; - u_long dst_addr = 0; if(!p->iph) return -1; - /* Do not log if being suppressed */ - if ( p->iph ) - { - src_addr = p->iph->ip_src.s_addr; - dst_addr = p->iph->ip_dst.s_addr; - } - - if( !sfthreshold_test(gen_id, sig_id, src_addr, dst_addr, p->pkth->ts.tv_sec) ) - { - return 0; - } - ts_print((struct timeval *)&p->pkth->ts, timebuf); fprintf(g_logfile, "Time: %s\n", timebuf); @@ -236,7 +220,7 @@ event_id = GenerateSnortEvent(p,gen_id,sig_id,sig_rev,class,priority,msg); if(g_logfile) - LogPortscanAlert(p, msg, event_id, 0, gen_id, sig_id); + LogPortscanAlert(p,msg,event_id,0); return event_id; } @@ -267,9 +251,6 @@ if(!event_ref) return 0; - /* reset the thresholding subsystem checks for this packet */ - sfthreshold_reset(); - SetEvent(&event, gen_id, sig_id, sig_rev, class, pri, event_ref); //CallAlertFuncs(p,msg,NULL,&event); @@ -277,23 +258,10 @@ event.ref_time.tv_usec = event_time->tv_usec; if(p) - { - /* - * Do threshold test for suppression and thresholding. We have to do it - * here since these are tagged packets, which aren't subject to thresholding, - * but we want to do it for open port events. - */ - if( !sfthreshold_test(gen_id, sig_id, p->iph->ip_src.s_addr, - p->iph->ip_dst.s_addr, p->pkth->ts.tv_sec) ) - { - return 0; - } - CallLogFuncs(p,msg,NULL,&event); - } if(g_logfile) - LogPortscanAlert(p, msg, 0, event_ref, gen_id, sig_id); + LogPortscanAlert(p, msg, 0, event_ref); return event.event_id; } @@ -428,7 +396,7 @@ int iCtr; unsigned int event_ref; int portsweep = 0; - + if(!proto) return -1; @@ -502,12 +470,7 @@ { for(iCtr = 0; iCtr < proto->open_ports_cnt; iCtr++) { - PS_PKT ps_pkt; - - memset(&ps_pkt, 0x00, sizeof(PS_PKT)); - ps_pkt.pkt = (void *)p; - - if(MakePortscanPkt(&ps_pkt, proto, PS_PROTO_OPEN_PORT, + if(MakePortscanPkt(NULL, proto, PS_PROTO_OPEN_PORT, (void *)&proto->open_ports[iCtr])) return -1; Index: snort/src/preprocessors/HttpInspect/client/hi_client.c diff -u snort/src/preprocessors/HttpInspect/client/hi_client.c:1.1.1.6 snort/src/preprocessors/HttpInspect/client/hi_client.c:1.1.1.2.2.4 --- snort/src/preprocessors/HttpInspect/client/hi_client.c:1.1.1.6 Sun Apr 24 22:12:15 2005 +++ snort/src/preprocessors/HttpInspect/client/hi_client.c Fri Jun 10 19:11:31 2005 @@ -1435,6 +1435,9 @@ } } + if(Session->server_conf->chunk_length) + CheckChunkEncoding(Session, uri_ptr.delimiter, end); + /* ** Find the next pipeline request, if one is there. If we don't find ** a pipeline request, then we return NULL here, so this is always Index: snort/src/sfutil/acsmx2.c diff -u snort/src/sfutil/acsmx2.c:1.1.1.2 snort/src/sfutil/acsmx2.c:1.1.1.2.4.1 --- snort/src/sfutil/acsmx2.c:1.1.1.2 Sun Apr 24 22:12:22 2005 +++ snort/src/sfutil/acsmx2.c Sat May 14 02:22:41 2005 @@ -1,5 +1,5 @@ /* -** $Id: acsmx2.c,v 1.5.2.1 2004/11/02 22:07:18 jhewlett Exp $ +** $Id: acsmx2.c,v 1.4.2.1 2004/08/11 19:50:40 jhewlett Exp $ ** ** acsmx2.c ** @@ -1490,7 +1490,7 @@ plist->offset = 0; plist->depth = 0; plist->id = 0; - plist->iid = 0; + plist->iid = (unsigned)data; plist->next = p->acsmPatterns; p->acsmPatterns = plist; Index: snort/src/sfutil/sfeventq.c diff -u snort/src/sfutil/sfeventq.c:1.1.1.2 snort/src/sfutil/sfeventq.c:1.1.1.2.6.1 --- snort/src/sfutil/sfeventq.c:1.1.1.2 Sun Apr 24 00:26:24 2005 +++ snort/src/sfutil/sfeventq.c Thu May 5 01:12:32 2005 @@ -343,9 +343,8 @@ ** ** @return integer ** -** @retval -1 action function failed on an event -** @retval 0 no events logged -** @retval 1 events logged +** @retval 1 action function failed on an event +** @retval 0 events logged */ int sfeventq_action(int (*action_func)(void *, void *), void *user) { @@ -353,23 +352,20 @@ int logged = 0; if(!action_func) - return -1; + return 1; - if(!(s_eventq.head)) - return 0; - for(node = s_eventq.head; node; node = node->next) { if(logged >= s_eventq.log_nodes) - return 1; + return 0; if(action_func(node->event, user)) - return -1; + return 1; logged++; } - return 1; + return 0; } //#define I_WANT_MY_MAIN Index: snort/src/sfutil/sfsnprintfappend.c diff -u snort/src/sfutil/sfsnprintfappend.c:1.1.1.2 snort/src/sfutil/sfsnprintfappend.c:1.1.1.2.2.1 --- snort/src/sfutil/sfsnprintfappend.c:1.1.1.2 Sun Apr 24 23:55:33 2005 +++ snort/src/sfutil/sfsnprintfappend.c Fri Jun 10 19:11:31 2005 @@ -13,7 +13,6 @@ #include "config.h" #endif -#include #include #include #include Index: snort/src/win32/WIN32-Prj/Makefile diff -u /dev/null snort/src/win32/WIN32-Prj/Makefile:1.1.1.2 --- /dev/null Mon Jun 13 11:23:12 2005 +++ snort/src/win32/WIN32-Prj/Makefile Wed Apr 21 18:26:57 2004 @@ -0,0 +1,7 @@ +# Microsoft Visual Studio NMAKE File +# +# $Id: Makefile,v 1.2 2003/08/31 23:04:19 chris_reid Exp $ + +!MESSAGE Please use the following command line instead: +!MESSAGE NMAKE /f "snort.mak" CFG="?" + Index: snort/src/win32/WIN32-Prj/snort.plg diff -u /dev/null snort/src/win32/WIN32-Prj/snort.plg:1.1.1.1 --- /dev/null Mon Jun 13 11:23:12 2005 +++ snort/src/win32/WIN32-Prj/snort.plg Thu Jul 24 01:55:04 2003 @@ -0,0 +1,4 @@ + + + +