The decoder and preprocessor rules are located in the preproc_rules/ directory in the top level source tree, and have the names decoder.rules and preprocessor.rules respectively. These files are updated as new decoder and preprocessor events are added to Snort. The gen-msg.map under etc directory is also updated with new decoder and preprocessor rules.
To enable these rules in snort.conf, define the path to where the rules are located and uncomment the include lines in snort.conf that reference the rules files.
var PREPROC_RULE_PATH /path/to/preproc_rules ... include $PREPROC_RULE_PATH/preprocessor.rules include $PREPROC_RULE_PATH/decoder.rules
To disable any rule, just comment it with a # or remove the rule completely from the file (commenting is recommended).
To change the rule type or action of a decoder/preprocessor rule, just replace alert with the desired rule type. Any one of the following rule types can be used:
alert log pass drop sdrop reject
For example one can change:
alert ( msg: "DECODE_NOT_IPV4_DGRAM"; sid: 1; gid: 116; rev: 1; \ metadata: rule-type decode ; classtype:protocol-command-decode;)
drop ( msg: "DECODE_NOT_IPV4_DGRAM"; sid: 1; gid: 116; rev: 1; \ metadata: rule-type decode ; classtype:protocol-command-decode;)
to drop (as well as alert on) packets where the Ethernet protocol is IPv4 but version field in IPv4 header has a value other than 4.
See README.decode, README.gre and the various preprocessor READMEs for descriptions of the rules in decoder.rules and preprocessor.rules.
The generator ids ( gid ) for different preprocessors and the decoder are as follows:
|105||Back Orifice preprocessor|
|106||RPC Decode preprocessor|
|119||HTTP Inspect preprocessor ( Client )|
|120||HTTP Inspect preprocessor ( Server )|
|125||FTP (FTP) preprocessor|
|126||FTP (Telnet) preprocessor|