aquaballoon

Snort Barnyard2 PulledPork Base

Sep 12th, 2013
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 38.69 KB | None | 0 0
  1. http://nachum234.no-ip.org/security/snort/1-snort-installation-on-ubuntu-12-04/
  2. http://wiki.aanval.com/wiki/Community:Snort_2.9.2.3_Installation_Guide_for_Ubuntu_12.04,_with_Barnyard2,_Pulledpork,_and_Aanval
  3. http://www.rivy.org/2013/03/updating-snort-rules-using-pulled-pork/
  4.  
  5. ### Setup the network interface you will be using for sniffing traffic in promiscuous mode
  6.  
  7. nano /etc/network/interfaces
  8. auto eth1
  9. 
iface eth1 inet manual

  10. up ifconfig $IFACE 0.0.0.0 up
  11. 
up ip link set $IFACE promisc on
  12. down ip link set $IFACE promisc off

  13. down ifconfig $IFACE down
  14. ################ the End #######################
  15.  
  16. /etc/init.d/networking restart
  17.  
  18. ### Setup Snort ###
  19.  
  20. apt-get install mysql-server nmap nbtscan apache2 php5 php5-mysql php5-gd libpcap0.8-dev libpcre3-dev g++ bison flex libpcap-ruby make zlib1g-dev libmysqld-dev libdnet libdnet-dev libpcre3 libpcre3-dev gcc make flex byacc bison linux-headers-generic libxml2-dev libdumbnet-dev zlib1g zlib1g-dev
  21.  
  22. #Download and install DAQ
  23. mkdir /usr/local/src/snort
  24. cd /usr/local/src/snort
  25. wget http://www.snort.org/dl/snort-current/daq-0.6.2.tar.gz
  26. tar -xvzf daq-0.6.2.tar.gz
  27. cd daq-0.6.2
  28. ./configure
  29. make
  30. make install
  31. //ldconfig -v
  32.  
  33. #Install Snort
  34. cd /usr/local/src/snort
  35. wget http://www.snort.org/dl/snort-current/snort-2.9.2.3.tar.gz
  36. tar -xvzf snort-2.9.2.3.tar.gz
  37. cd snort-2.9.2.3
  38. ./configure --prefix /usr/local/snort && make && make install
  39.  
  40. groupadd snort
  41. useradd -g snort snort
  42.  
  43. ln -s /usr/local/snort/bin/snort /usr/sbin/
  44. ln -s /usr/local/snort/etc /etc/snort
  45.  
  46. wget http://labs.snort.org/snort/2940/snort.conf -O /usr/local/snort/etc/snort.conf
  47.  
  48. cd /usr/local/src/snort
  49. wget -O snortrules-snapshot-2923.tar.gz http://www.snort.org/reg-rules/snortrules-snapshot-2923.tar.gz/51a424f2ff6f7a9bef35c154587eb9f14fb28baa
  50. cd /usr/local/snort
  51. tar -xvzf /usr/local/src/snort/snortrules-snapshot-2*
  52.  
  53. mkdir -p /usr/local/snort/var/log
  54. chown snort:snort /usr/local/snort/var/log
  55. ln -s /usr/local/snort/var/log /var/log/snort
  56.  
  57. mkdir /usr/local/snort/lib/snort_dynamicrules
  58. uname -a
  59. # 32-bit
  60. cd /usr/local/src/snort
  61. cp /usr/local/snort/so_rules/precompiled/Ubuntu-12-04/i386/2.9*/*so /usr/local/snort/lib/snort_dynamicrules
  62.  
  63. # 64-bit
  64. cd /usr/local/src/snort
  65. cp /usr/local/snort/so_rules/precompiled/Ubuntu-12-04/x86-64/2.9*/*so /usr/local/snort/lib/snort_dynamicrules
  66.  
  67. ln -s /usr/local/snort/lib/snort_dynamicpreprocessor /usr/local/lib/snort_dynamicpreprocessor
  68. ln -s /usr/local/snort/lib/snort_dynamicengine /usr/local/lib/snort_dynamicengine
  69. ln -s /usr/local/snort/lib/snort_dynamicrules /usr/local/lib/snort_dynamicrules
  70.  
  71. snort -c /usr/local/snort/etc/snort.conf --dump-dynamic-rules=/usr/local/snort/so_rules
  72.  
  73. chown -R snort:snort /usr/local/snort
  74.  
  75. nano /usr/local/snort/etc/snort.conf
  76. # Reputation preprocessor. For more information see README.reputation
  77. #preprocessor reputation: \
  78. #   memcap 500, \
  79. #   priority whitelist, \
  80. #   nested_ip inner, \
  81. #   whitelist $WHITE_LIST_PATH/white_list.rules, \
  82. #   blacklist $BLACK_LIST_PATH/black_list.rules
  83.  
  84. # output unified2: filename merged.log, limit 128, nostamp, mpls_event_types, vlan_event_types
  85. output unified2: filename snort.log, limit 128
  86. ################ the End #######################
  87.  
  88. nano /usr/local/snort/etc/snort.conf
  89. # dynamic library rules
  90. include $SO_RULE_PATH/bad-traffic.rules
  91. include $SO_RULE_PATH/chat.rules
  92. include $SO_RULE_PATH/dos.rules
  93. include $SO_RULE_PATH/exploit.rules
  94. include $SO_RULE_PATH/icmp.rules
  95. include $SO_RULE_PATH/imap.rules
  96. include $SO_RULE_PATH/misc.rules
  97. include $SO_RULE_PATH/multimedia.rules
  98. include $SO_RULE_PATH/netbios.rules
  99. include $SO_RULE_PATH/nntp.rules
  100. include $SO_RULE_PATH/p2p.rules
  101. include $SO_RULE_PATH/smtp.rules
  102. include $SO_RULE_PATH/snmp.rules
  103. include $SO_RULE_PATH/specific-threats.rules
  104. include $SO_RULE_PATH/web-activex.rules
  105. include $SO_RULE_PATH/web-client.rules
  106. include $SO_RULE_PATH/web-iis.rules
  107. include $SO_RULE_PATH/web-misc.rules
  108. ################ the End #######################
  109.  
  110. snort -c /usr/local/snort/etc/snort.conf -T
  111.  
  112. cd /usr/local/src/snort/snort-2*
  113. #cp rpm/snortd /etc/init.d/
  114. chmod +x /etc/init.d/snortd
  115.  
  116. nano /etc/init.d/snortd
  117. #!/bin/sh
  118. # $Id$
  119. #
  120. # snortd         Start/Stop the snort IDS daemon.
  121. #
  122. # chkconfig: 2345 40 60
  123. # description:  snort is a lightweight network intrusion detection tool that \
  124. #                currently detects more than 1100 host and network \
  125. #                vulnerabilities, portscans, backdoors, and more.
  126. #
  127.  
  128. # Source function library.
  129. #. /etc/rc.d/init.d/functions
  130.  
  131. # Source the local configuration file
  132. . /etc/default/snort
  133.  
  134. # Convert the /etc/sysconfig/snort settings to something snort can
  135. # use on the startup line.
  136. if [ "$ALERTMODE"X = "X" ]; then
  137.    ALERTMODE=""
  138. else
  139.    ALERTMODE="-A $ALERTMODE"
  140. fi
  141.  
  142. if [ "$USER"X = "X" ]; then
  143.    USER="snort"
  144. fi
  145.  
  146. if [ "$GROUP"X = "X" ]; then
  147.    GROUP="snort"
  148. fi
  149.  
  150. if [ "$BINARY_LOG"X = "1X" ]; then
  151.    BINARY_LOG="-b"
  152. else
  153.    BINARY_LOG=""
  154. fi
  155.  
  156. if [ "$CONF"X = "X" ]; then
  157.    CONF="-c /etc/snort/snort.conf"
  158. else
  159.    CONF="-c $CONF"
  160. fi
  161.  
  162. if [ "$INTERFACE"X = "X" ]; then
  163.    INTERFACE="-i eth0"
  164. else
  165.    INTERFACE="-i $INTERFACE"
  166. fi
  167.  
  168. if [ "$DUMP_APP"X = "1X" ]; then
  169.    DUMP_APP="-d"
  170. else
  171.    DUMP_APP=""
  172. fi
  173.  
  174. if [ "$NO_PACKET_LOG"X = "1X" ]; then
  175.    NO_PACKET_LOG="-N"
  176. else
  177.    NO_PACKET_LOG=""
  178. fi        
  179.  
  180. if [ "$PRINT_INTERFACE"X = "1X" ]; then
  181.    PRINT_INTERFACE="-I"
  182. else
  183.    PRINT_INTERFACE=""
  184. fi
  185.  
  186. if [ "$PASS_FIRST"X = "1X" ]; then
  187.    PASS_FIRST="-o"
  188. else
  189.    PASS_FIRST=""
  190. fi
  191.  
  192. if [ "$LOGDIR"X = "X" ]; then
  193.    LOGDIR=/var/log/snort
  194. fi
  195.  
  196. # These are used by the 'stats' option
  197. if [ "$SYSLOG"X = "X" ]; then
  198.    SYSLOG=/var/log/messages
  199. fi
  200.  
  201. if [ "$SECS"X = "X" ]; then
  202.    SECS=5
  203. fi
  204.  
  205. if [ ! "$BPFFILE"X = "X" ]; then
  206.    BPFFILE="-F $BPFFILE"
  207. fi
  208.  
  209. ######################################
  210. # Now to the real heart of the matter:
  211.  
  212. # See how we were called.
  213. case "$1" in
  214.   start)
  215.         echo -n "Starting snort: "
  216.         cd $LOGDIR
  217.         if [ "$INTERFACE" = "-i ALL" ]; then
  218.            for i in `cat /proc/net/dev|grep eth|awk -F ":" '{ print $1; }'`
  219.            do
  220.                 mkdir -p "$LOGDIR/$i"
  221.                 chown -R $USER:$GROUP $LOGDIR
  222.                  /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
  223.            done
  224.         else
  225.            # check if more than one interface is given
  226.            
  227.               for i in `echo $INTERFACE | sed s/"-i "//`
  228.                 do
  229.                   mkdir -p "$LOGDIR/$i"
  230.                   chown -R $USER:$GROUP $LOGDIR
  231.                    /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
  232.              done
  233.            
  234.               # Run with a single interface (default)
  235.              
  236.         fi
  237.         touch /var/lock/snort
  238.         echo
  239.         ;;
  240.   stop)
  241.         echo -n "Stopping snort: "
  242.         killall snort
  243.         rm -f /var/lock/snort
  244.         echo
  245.         ;;
  246.   reload)
  247.         echo "Sorry, not implemented yet"
  248.         ;;
  249.   restart)
  250.         $0 stop
  251.         $0 start
  252.         ;;
  253.   condrestart)
  254.         [ -e /var/lock/snort ] && $0 restart
  255.         ;;
  256.   status)
  257.         status snort
  258.         ;;
  259.   stats)
  260.         TC=125                          # Trailing context to grep
  261.         SNORTNAME='snort'               # Process name to look for
  262.  
  263.         if [ ! -x "/sbin/pidof" ]; then
  264.            echo "/sbin/pidof not present, sorry, I cannot go on like this!"
  265.            exit 1
  266.         fi
  267.  
  268.         #Grab Snort's PID
  269.         PID=`pidof -o $$ -o $PPID -o %PPID -x ${SNORTNAME}`
  270.  
  271.         if [ ! -n "$PID" ]; then        # if we got no PID then:
  272.            echo "No PID found: ${SNORTNAME} must not running."
  273.            exit 2
  274.         fi
  275.  
  276.         echo ""
  277.         echo "*******"
  278.         echo "WARNING:  This feature is EXPERIMENTAL - please report errors!"
  279.         echo "*******"
  280.         echo ""
  281.         echo "You can also run: $0 stats [long | opt]"
  282.         echo ""
  283.         echo "Dumping ${SNORTNAME}'s ($PID) statistics"
  284.         echo "please wait..."
  285.  
  286.         # Get the date and tell Snort to dump stats as close together in
  287.         # time as possible--not 100%, but it seems to work.
  288.         startdate=`date '+%b %e %H:%M:%S'`
  289.  
  290.         # This causes the stats to be dumped to syslog
  291.         kill -USR1 $PID
  292.  
  293.         # Sleep for $SECS secs to give syslog a chance to catch up
  294.         # May need to be adjusted for slow/busy systems
  295.         sleep $SECS
  296.  
  297.         if [ "$2" = "long" ]; then              # Long format
  298.             egrep -B 3 -A $TC "^$startdate .* snort.*: ={79}" $SYSLOG | \
  299.                 grep snort.*:
  300.         elif [ "$2" = "opt" ]; then             # OPTimize format
  301.            # Just show stuff useful for optimizing Snort
  302.             egrep -B 3 -A $TC "^$startdate .* snort.*: ={79}" $SYSLOG | \
  303.                 egrep "snort.*: Snort analyzed |snort.*: dropping|emory .aults:"
  304.         else                                    # Default format
  305.             egrep -B 3 -A $TC "^$startdate .* snort.*: ={79}" $SYSLOG | \
  306.                 grep snort.*: | cut -d: -f4-
  307.         fi
  308.         ;;
  309.   *)
  310.         echo "Usage: $0 {start|stop|reload|restart|condrestart|status|stats (long|opt)}"
  311.         exit 2
  312. esac
  313.  
  314. exit 0
  315. ################ the End #######################
  316.  
  317. cd /usr/local/src/snort/snort-2*
  318. cp rpm/snort.sysconfig /etc/default/snort
  319.  
  320. nano /etc/default/snort
  321. LOGDIR=/var/log/snort/
  322. #ALERTMODE=fast
  323. #BINARY_LOG=1
  324.  
  325. update-rc.d snortd defaults
  326.  
  327. service snortd restart
  328.  
  329.  
  330. ### Setup Barnyard ###
  331. apt-get install mysql-client libmysqlclient-dev mysql-server git autoconf2.13 libtool -y
  332.  
  333. mysqladmin create snort -p
  334. mysql -p
  335. grant ALL PRIVILEGES on snort.* to snort@localhost with GRANT option;
  336. SET PASSWORD FOR snort@localhost=PASSWORD('snort');
  337. flush privileges;
  338. quit;
  339.  
  340. cd /usr/local/src/snort
  341. mysql -u root -p -D snortdb < /usr/local/src/snort/snort-2.9.2.3/schemas/create_mysql
  342.  
  343. cd /usr/local/src/snort
  344. wget http://www.securixlive.com/download/barnyard2/barnyard2-1.9.tar.gz
  345. tar -xvzf barnyard2-1.9.tar.gz
  346. cd barnyard2-1.9
  347.  
  348. //On i386 system
  349. ./configure --with-mysql --with-mysql-libraries=/usr/lib/i386-linux-gnu/
  350.  
  351. //On x86_64 system
  352. ./configure --with-mysql --with-mysql-libraries=/usr/lib/x86_64-linux-gnu/
  353.  
  354. nano /etc/init.d/barnyard2
  355. #!/bin/sh
  356. #
  357. # Init file for Barnyard2
  358. #
  359. #
  360. # chkconfig: 2345 40 60
  361. # description:  Barnyard2 is an output processor for snort.
  362. #
  363. # processname: barnyard2
  364. # config: /etc/sysconfig/barnyard2
  365. # config: /etc/snort/barnyard.conf
  366. # pidfile: /var/lock/subsys/barnyard2.pid
  367.  
  368.  
  369. [ -x /usr/sbin/snort ] || exit 1
  370. [ -r /etc/snort/snort.conf ] || exit 1
  371.  
  372. ### Default variables
  373. SYSCONFIG="/etc/default/barnyard2"
  374.  
  375. ### Read configuration
  376. [ -r "$SYSCONFIG" ] && . "$SYSCONFIG"
  377.  
  378. RETVAL=0
  379. prog="barnyard2"
  380. desc="Snort Output Processor"
  381.  
  382. start() {
  383.         echo -n $"Starting $desc ($prog): "
  384.         for INT in $INTERFACES; do
  385.                 PIDFILE="/var/lock/barnyard2-$INT.pid"
  386.                 ARCHIVEDIR="$SNORTDIR/$INT/archive"
  387.                 WALDO_FILE="$SNORTDIR/$INT/barnyard2.waldo"
  388.                 BARNYARD_OPTS="-D -c $CONF -d $SNORTDIR/${INT} -w $WALDO_FILE -l $SNORTDIR/${INT} -a $ARCHIVEDIR -f $LOG_FILE -X $PIDFILE $EXTRA_ARGS"
  389.                 $prog $BARNYARD_OPTS
  390.         done
  391.         RETVAL=$?
  392.         echo
  393.         [ $RETVAL -eq 0 ] && touch /var/lock/$prog
  394.         return $RETVAL
  395. }
  396.  
  397. stop() {
  398.         echo -n $"Shutting down $desc ($prog): "
  399.         killall $prog
  400.         RETVAL=$?
  401.         echo
  402.         [ $RETVAL -eq 0 ] && rm -f /var/lock/$prog
  403.         return $RETVAL
  404. }
  405.  
  406. restart() {
  407.         stop
  408.         start
  409. }
  410.  
  411.  
  412. reload() {
  413.         echo -n $"Reloading $desc ($prog): "
  414.         killall $prog -HUP
  415.         RETVAL=$?
  416.         echo
  417.         return $RETVAL
  418. }
  419.  
  420.  
  421. case "$1" in
  422.   start)
  423.         start
  424.         ;;
  425.   stop)
  426.         stop
  427.         ;;
  428.   restart)
  429.         restart
  430.         ;;
  431.   reload)
  432.         reload
  433.         ;;
  434.   condrestart)
  435.         [ -e /var/lock/$prog ] && restart
  436.         RETVAL=$?
  437.         ;;
  438.   status)
  439.         status $prog
  440.         RETVAL=$?
  441.         ;;
  442.   dump)
  443.         dump
  444.         ;;
  445.   *)
  446.         echo $"Usage: $0 {start|stop|restart|reload|condrestart|status|dump}"
  447.         RETVAL=1
  448. esac
  449.  
  450. exit $RETVAL
  451.  
  452. ################ the End #######################
  453.  
  454.  
  455. chmod +x /etc/init.d/barnyard2
  456.  
  457. cd /usr/local/src/snort/barnyard2
  458. cp rpm/barnyard2.config /etc/default/barnyard2
  459.  
  460. nano /etc/default/barnyard2
  461. ...
  462. LOG_FILE="snort.log"
  463. ...
  464.  
  465. update-rc.d barnyard2 defaults 98
  466.  
  467. ln -s /usr/local/etc/barnyard2.conf /etc/snort/barnyard.conf
  468. ln -s /usr/local/bin/barnyard2 /usr/bin/
  469. mkdir -p /var/log/snort/eth0/archive/
  470. mkdir -p /var/log/snort/eth1/archive/
  471.  
  472. nano /usr/local/etc/barnyard2.conf
  473. ...
  474. output database: log, mysql, user=snort password=snort dbname=snort host=localhost
  475. ...
  476.  
  477. service snortd start
  478. service barnyard2 start
  479.  
  480. ### Setup Pulled Pork
  481.  
  482. apt-get install libcrypt-ssleay-perl liblwp-protocol-https-perl
  483. cd /usr/local/bin
  484. wget http://pulledpork.googlecode.com/svn/trunk/pulledpork.pl
  485. chmod 755 pulledpork.pl
  486.  
  487. mkdir /etc/pulledpork
  488. cd /etc/pulledpork
  489. wget http://www.rivy.org/custom/pulledpork.conf
  490.  
  491. sed -i '/^include $RULE_PATH/d' /etc/snort/snort.conf
  492. echo "include \$RULE_PATH/snort.rules" >> /etc/snort/snort.conf
  493. echo "include \$RULE_PATH/local.rules" >> /etc/snort/snort.conf
  494. rm /etc/snort/rules/*.rules
  495.  
  496. #var RULE_PATH ../rules
  497. #var SO_RULE_PATH ../so_rules
  498. #var PREPROC_RULE_PATH ../preproc_rules
  499. var RULE_PATH /etc/snort/rules
  500. var SO_RULE_PATH /etc/snort/so_rules
  501. var PREPROC_RULE_PATH /etc/snort/preproc_rules
  502.  
  503. nano /etc/snort/snort.conf
  504. #--------------------------------------------------
  505. #   VRT Rule Packages Snort.conf
  506. #
  507. #   For more information visit us at:
  508. #     http://www.snort.org                   Snort Website
  509. #     http://vrt-blog.snort.org/    Sourcefire VRT Blog
  510. #
  511. #     Mailing list Contact:      [email protected]
  512. #     False Positive reports:    [email protected]
  513. #     Snort bugs:                [email protected]
  514. #
  515. #     Compatible with Snort Versions:
  516. #     VERSIONS : 2.9.2.3
  517. #
  518. #     Snort build options:
  519. #     OPTIONS : --enable-ipv6 --enable-gre --enable-mpls --enable-targetbased --enable-decoder-preprocessor-rules --enable-ppm --enable-perfprofiling --enable-zlib --enable-active-response --enable-normalizer --enable-reload --enable-react --enable-flexresp3
  520. #
  521. #     Additional information:
  522. #     This configuration file enables active response, to run snort in
  523. #     test mode -T you are required to supply an interface -i <interface>
  524. #     or test mode will fail to fully validate the configuration and
  525. #     exit with a FATAL error
  526. #--------------------------------------------------
  527.  
  528. ###################################################
  529. # This file contains a sample snort configuration.
  530. # You should take the following steps to create your own custom configuration:
  531. #
  532. #  1) Set the network variables.
  533. #  2) Configure the decoder
  534. #  3) Configure the base detection engine
  535. #  4) Configure dynamic loaded libraries
  536. #  5) Configure preprocessors
  537. #  6) Configure output plugins
  538. #  7) Customize your rule set
  539. #  8) Customize preprocessor and decoder rule set
  540. #  9) Customize shared object rule set
  541. ###################################################
  542.  
  543. ###################################################
  544. # Step #1: Set the network variables.  For more information, see README.variables
  545. ###################################################
  546.  
  547. # Setup the network addresses you are protecting
  548. ipvar HOME_NET any
  549.  
  550. # Set up the external network addresses. Leave as "any" in most situations
  551. ipvar EXTERNAL_NET any
  552.  
  553. # List of DNS servers on your network
  554. ipvar DNS_SERVERS $HOME_NET
  555.  
  556. # List of SMTP servers on your network
  557. ipvar SMTP_SERVERS $HOME_NET
  558.  
  559. # List of web servers on your network
  560. ipvar HTTP_SERVERS $HOME_NET
  561.  
  562. # List of sql servers on your network
  563. ipvar SQL_SERVERS $HOME_NET
  564.  
  565. # List of telnet servers on your network
  566. ipvar TELNET_SERVERS $HOME_NET
  567.  
  568. # List of ssh servers on your network
  569. ipvar SSH_SERVERS $HOME_NET
  570.  
  571. # List of ftp servers on your network
  572. ipvar FTP_SERVERS $HOME_NET
  573.  
  574. # List of sip servers on your network
  575. ipvar SIP_SERVERS $HOME_NET
  576.  
  577. # List of ports you run web servers on
  578. portvar HTTP_PORTS [80,81,311,383,591,593,901,1220,1414,1741,1830,2301,2381,2809,3037,3128,3702,4343,4848,5250,6988,7000,7001,7144,7145,7510,7777,7779,8000,8008,8014,8028,8080,8085,8088,8090,8118,8123,8180,8181,8243,8280,8300,8800,8888,8899,9000,9060,9080,9090,9091,9443,9999,11371,34443,34444,41080,50002,55555]
  579.  
  580. # List of ports you want to look for SHELLCODE on.
  581. portvar SHELLCODE_PORTS !80
  582.  
  583. # List of ports you might see oracle attacks on
  584. portvar ORACLE_PORTS 1024:
  585.  
  586. # List of ports you want to look for SSH connections on:
  587. portvar SSH_PORTS 22
  588.  
  589. # List of ports you run ftp servers on
  590. portvar FTP_PORTS [21,2100,3535]
  591.  
  592. # List of ports you run SIP servers on
  593. portvar SIP_PORTS [5060,5061,5600]
  594.  
  595. # List of file data ports for file inspection
  596. portvar FILE_DATA_PORTS [$HTTP_PORTS,110,143]
  597.  
  598. # List of GTP ports for GTP preprocessor
  599. portvar GTP_PORTS [2123,2152,3386]
  600.  
  601. # other variables, these should not be modified
  602. ipvar AIM_SERVERS [64.12.24.0/23,64.12.28.0/23,64.12.161.0/24,64.12.163.0/24,64.12.200.0/24,205.188.3.0/24,205.188.5.0/24,205.188.7.0/24,205.188.9.0/24,205.188.153.0/24,205.188.179.0/24,205.188.248.0/24]
  603.  
  604. # Path to your rules files (this can be a relative path)
  605. # Note for Windows users:  You are advised to make this an absolute path,
  606. # such as:  c:\snort\rules
  607. #var RULE_PATH ../rules
  608. #var SO_RULE_PATH ../so_rules
  609. #var PREPROC_RULE_PATH ../preproc_rules
  610.  
  611. var RULE_PATH /etc/snort/rules
  612. var SO_RULE_PATH /etc/snort/so_rules
  613. var PREPROC_RULE_PATH /etc/snort/preproc_rules
  614.  
  615. # If you are using reputation preprocessor set these
  616. # Currently there is a bug with relative paths, they are relative to where snort is
  617. # not relative to snort.conf like the above variables
  618. # This is completely inconsistent with how other vars work, BUG 89986
  619. # Set the absolute path appropriately
  620. var WHITE_LIST_PATH ../rules
  621. var BLACK_LIST_PATH ../rules
  622.  
  623. ###################################################
  624. # Step #2: Configure the decoder.  For more information, see README.decode
  625. ###################################################
  626.  
  627. # Stop generic decode events:
  628. config disable_decode_alerts
  629.  
  630. # Stop Alerts on experimental TCP options
  631. config disable_tcpopt_experimental_alerts
  632.  
  633. # Stop Alerts on obsolete TCP options
  634. config disable_tcpopt_obsolete_alerts
  635.  
  636. # Stop Alerts on T/TCP alerts
  637. config disable_tcpopt_ttcp_alerts
  638.  
  639. # Stop Alerts on all other TCPOption type events:
  640. config disable_tcpopt_alerts
  641.  
  642. # Stop Alerts on invalid ip options
  643. config disable_ipopt_alerts
  644.  
  645. # Alert if value in length field (IP, TCP, UDP) is greater th elength of the packet
  646. # config enable_decode_oversized_alerts
  647.  
  648. # Same as above, but drop packet if in Inline mode (requires enable_decode_oversized_alerts)
  649. # config enable_decode_oversized_drops
  650.  
  651. # Configure IP / TCP checksum mode
  652. config checksum_mode: all
  653.  
  654. # Configure maximum number of flowbit references.  For more information, see README.flowbits
  655. # config flowbits_size: 64
  656.  
  657. # Configure ports to ignore
  658. # config ignore_ports: tcp 21 6667:6671 1356
  659. # config ignore_ports: udp 1:17 53
  660.  
  661. # Configure active response for non inline operation. For more information, see REAMDE.active
  662. # config response: eth0 attempts 2
  663.  
  664. # Configure DAQ related options for inline operation. For more information, see README.daq
  665. #
  666. # config daq: <type>
  667. # config daq_dir: <dir>
  668. # config daq_mode: <mode>
  669. # config daq_var: <var>
  670. #
  671. # <type> ::= pcap | afpacket | dump | nfq | ipq | ipfw
  672. # <mode> ::= read-file | passive | inline
  673. # <var> ::= arbitrary <name>=<value passed to DAQ
  674. # <dir> ::= path as to where to look for DAQ module so's
  675.  
  676. # Configure specific UID and GID to run snort as after dropping privs. For more information see snort -h command line options
  677. #
  678. # config set_gid:
  679. # config set_uid:
  680.  
  681. # Configure default snaplen. Snort defaults to MTU of in use interface. For more information see README
  682. #
  683. # config snaplen:
  684. #
  685.  
  686. # Configure default bpf_file to use for filtering what traffic reaches snort. For more information see snort -h command line options (-F)
  687. #
  688. # config bpf_file:
  689. #
  690.  
  691. # Configure default log directory for snort to log to.  For more information see snort -h command line options (-l)
  692. #
  693. # config logdir:
  694.  
  695.  
  696. ###################################################
  697. # Step #3: Configure the base detection engine.  For more information, see  README.decode
  698. ###################################################
  699.  
  700. # Configure PCRE match limitations
  701. config pcre_match_limit: 3500
  702. config pcre_match_limit_recursion: 1500
  703.  
  704. # Configure the detection engine  See the Snort Manual, Configuring Snort - Includes - Config
  705. config detection: search-method ac-split search-optimize max-pattern-len 20
  706.  
  707. # Configure the event queue.  For more information, see README.event_queue
  708. config event_queue: max_queue 8 log 5 order_events content_length
  709.  
  710. ###################################################
  711. ## Configure GTP if it is to be used.
  712. ## For more information, see README.GTP
  713. ####################################################
  714.  
  715. # config enable_gtp
  716.  
  717. ###################################################
  718. # Per packet and rule latency enforcement
  719. # For more information see README.ppm
  720. ###################################################
  721.  
  722. # Per Packet latency configuration
  723. #config ppm: max-pkt-time 250, \
  724. #   fastpath-expensive-packets, \
  725. #   pkt-log
  726.  
  727. # Per Rule latency configuration
  728. #config ppm: max-rule-time 200, \
  729. #   threshold 3, \
  730. #   suspend-expensive-rules, \
  731. #   suspend-timeout 20, \
  732. #   rule-log alert
  733.  
  734. ###################################################
  735. # Configure Perf Profiling for debugging
  736. # For more information see README.PerfProfiling
  737. ###################################################
  738.  
  739. #config profile_rules: print all, sort avg_ticks
  740. #config profile_preprocs: print all, sort avg_ticks
  741.  
  742. ###################################################
  743. # Configure protocol aware flushing
  744. # For more information see README.stream5
  745. ###################################################
  746. config paf_max: 16000
  747.  
  748. ###################################################
  749. # Step #4: Configure dynamic loaded libraries.  
  750. # For more information, see Snort Manual, Configuring Snort - Dynamic Modules
  751. ###################################################
  752.  
  753. # path to dynamic preprocessor libraries
  754. dynamicpreprocessor directory /usr/local/lib/snort_dynamicpreprocessor/
  755.  
  756. # path to base preprocessor engine
  757. dynamicengine /usr/local/lib/snort_dynamicengine/libsf_engine.so
  758.  
  759. # path to dynamic rules libraries
  760. dynamicdetection directory /usr/local/lib/snort_dynamicrules
  761.  
  762. ###################################################
  763. # Step #5: Configure preprocessors
  764. # For more information, see the Snort Manual, Configuring Snort - Preprocessors
  765. ###################################################
  766.  
  767. # GTP Control Channle Preprocessor. For more information, see README.GTP
  768. # preprocessor gtp: ports { 2123 3386 2152 }
  769.  
  770. # Inline packet normalization. For more information, see README.normalize
  771. # Does nothing in IDS mode
  772. preprocessor normalize_ip4
  773. preprocessor normalize_tcp: ips ecn stream
  774. preprocessor normalize_icmp4
  775. preprocessor normalize_ip6
  776. preprocessor normalize_icmp6
  777.  
  778. # Target-based IP defragmentation.  For more inforation, see README.frag3
  779. preprocessor frag3_global: max_frags 65536
  780. preprocessor frag3_engine: policy windows detect_anomalies overlap_limit 10 min_fragment_length 100 timeout 180
  781.  
  782. # Target-Based stateful inspection/stream reassembly.  For more inforation, see README.stream5
  783. preprocessor stream5_global: track_tcp yes, \
  784.    track_udp yes, \
  785.    track_icmp no, \
  786.    max_tcp 262144, \
  787.    max_udp 131072, \
  788.    max_active_responses 2, \
  789.    min_response_seconds 5
  790. preprocessor stream5_tcp: policy windows, detect_anomalies, require_3whs 180, \
  791.    overlap_limit 10, small_segments 3 bytes 150, timeout 180, \
  792.     ports client 21 22 23 25 42 53 79 109 110 111 113 119 135 136 137 139 143 \
  793.         161 445 513 514 587 593 691 1433 1521 1741 2100 3306 6070 6665 6666 6667 6668 6669 \
  794.         7000 8181 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779, \
  795.     ports both 80 81 311 383 443 465 563 591 593 636 901 989 992 993 994 995 1220 1414 1830 2301 2381 2809 3037 3128 3702 4343 4848 5250 6988 7907 7000 7001 7144 7145 7510 7802 7777 7779 \
  796.         7801 7900 7901 7902 7903 7904 7905 7906 7908 7909 7910 7911 7912 7913 7914 7915 7916 \
  797.         7917 7918 7919 7920 8000 8008 8014 8028 8080 8085 8088 8090 8118 8123 8180 8243 8280 8300 8800 8888 8899 9000 9060 9080 9090 9091 9443 9999 11371 34443 34444 41080 50002 55555
  798. preprocessor stream5_udp: timeout 180
  799.  
  800. # performance statistics.  For more information, see the Snort Manual, Configuring Snort - Preprocessors - Performance Monitor
  801. # preprocessor perfmonitor: time 300 file /var/snort/snort.stats pktcnt 10000
  802.  
  803. # HTTP normalization and anomaly detection.  For more information, see README.http_inspect
  804. preprocessor http_inspect: global iis_unicode_map unicode.map 1252 compress_depth 65535 decompress_depth 65535
  805. preprocessor http_inspect_server: server default \
  806.     http_methods { GET POST PUT SEARCH MKCOL COPY MOVE LOCK UNLOCK NOTIFY POLL BCOPY BDELETE BMOVE LINK UNLINK OPTIONS HEAD DELETE TRACE TRACK CONNECT SOURCE SUBSCRIBE UNSUBSCRIBE PROPFIND PROPPATCH BPROPFIND BPROPPATCH RPC_CONNECT PROXY_SUCCESS BITS_POST CCM_POST SMS_POST RPC_IN_DATA RPC_OUT_DATA RPC_ECHO_DATA } \
  807.     chunk_length 500000 \
  808.     server_flow_depth 0 \
  809.     client_flow_depth 0 \
  810.     post_depth 65495 \
  811.     oversize_dir_length 500 \
  812.     max_header_length 750 \
  813.     max_headers 100 \
  814.     max_spaces 200 \
  815.     small_chunk_length { 10 5 } \
  816.     ports { 80 81 311 383 591 593 901 1220 1414 1741 1830 2301 2381 2809 3037 3128 3702 4343 4848 5250 6988 7000 7001 7144 7145 7510 7777 7779 8000 8008 8014 8028 8080 8085 8088 8090 8118 8123 8180 8181 8243 8280 8300 8800 8888 8899 9000 9060 9080 9090 9091 9443 9999 11371 34443 34444 41080 50002 55555 } \
  817.     non_rfc_char { 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 } \
  818.     enable_cookie \
  819.     extended_response_inspection \
  820.     inspect_gzip \
  821.     normalize_utf \
  822.     unlimited_decompress \
  823.     normalize_javascript \
  824.     apache_whitespace no \
  825.     ascii no \
  826.     bare_byte no \
  827.     directory no \
  828.     double_decode no \
  829.     iis_backslash no \
  830.     iis_delimiter no \
  831.     iis_unicode no \
  832.     multi_slash no \
  833.     utf_8 no \
  834.     u_encode yes \
  835.     webroot no
  836.  
  837. # ONC-RPC normalization and anomaly detection.  For more information, see the Snort Manual, Configuring Snort - Preprocessors - RPC Decode
  838. preprocessor rpc_decode: 111 32770 32771 32772 32773 32774 32775 32776 32777 32778 32779 no_alert_multiple_requests no_alert_large_fragments no_alert_incomplete
  839.  
  840. # Back Orifice detection.
  841. preprocessor bo
  842.  
  843. # FTP / Telnet normalization and anomaly detection.  For more information, see README.ftptelnet
  844. preprocessor ftp_telnet: global inspection_type stateful encrypted_traffic no check_encrypted
  845. preprocessor ftp_telnet_protocol: telnet \
  846.     ayt_attack_thresh 20 \
  847.     normalize ports { 23 } \
  848.     detect_anomalies
  849. preprocessor ftp_telnet_protocol: ftp server default \
  850.     def_max_param_len 100 \
  851.     ports { 21 2100 3535 } \
  852.     telnet_cmds yes \
  853.     ignore_telnet_erase_cmds yes \
  854.     ftp_cmds { ABOR ACCT ADAT ALLO APPE AUTH CCC CDUP } \
  855.     ftp_cmds { CEL CLNT CMD CONF CWD DELE ENC EPRT } \
  856.     ftp_cmds { EPSV ESTA ESTP FEAT HELP LANG LIST LPRT } \
  857.     ftp_cmds { LPSV MACB MAIL MDTM MIC MKD MLSD MLST } \
  858.     ftp_cmds { MODE NLST NOOP OPTS PASS PASV PBSZ PORT } \
  859.     ftp_cmds { PROT PWD QUIT REIN REST RETR RMD RNFR } \
  860.     ftp_cmds { RNTO SDUP SITE SIZE SMNT STAT STOR STOU } \
  861.     ftp_cmds { STRU SYST TEST TYPE USER XCUP XCRC XCWD } \
  862.     ftp_cmds { XMAS XMD5 XMKD XPWD XRCP XRMD XRSQ XSEM } \
  863.     ftp_cmds { XSEN XSHA1 XSHA256 } \
  864.     alt_max_param_len 0 { ABOR CCC CDUP ESTA FEAT LPSV NOOP PASV PWD QUIT REIN STOU SYST XCUP XPWD } \
  865.     alt_max_param_len 200 { ALLO APPE CMD HELP NLST RETR RNFR STOR STOU XMKD } \
  866.     alt_max_param_len 256 { CWD RNTO } \
  867.     alt_max_param_len 400 { PORT } \
  868.     alt_max_param_len 512 { SIZE } \
  869.     chk_str_fmt { ACCT ADAT ALLO APPE AUTH CEL CLNT CMD } \
  870.     chk_str_fmt { CONF CWD DELE ENC EPRT EPSV ESTP HELP } \
  871.     chk_str_fmt { LANG LIST LPRT MACB MAIL MDTM MIC MKD } \
  872.     chk_str_fmt { MLSD MLST MODE NLST OPTS PASS PBSZ PORT } \
  873.     chk_str_fmt { PROT REST RETR RMD RNFR RNTO SDUP SITE } \
  874.     chk_str_fmt { SIZE SMNT STAT STOR STRU TEST TYPE USER } \
  875.     chk_str_fmt { XCRC XCWD XMAS XMD5 XMKD XRCP XRMD XRSQ } \
  876.     chk_str_fmt { XSEM XSEN XSHA1 XSHA256 } \
  877.     cmd_validity ALLO < int [ char R int ] > \    
  878.     cmd_validity EPSV < [ { char 12 | char A char L char L } ] > \
  879.     cmd_validity MACB < string > \
  880.     cmd_validity MDTM < [ date nnnnnnnnnnnnnn[.n[n[n]]] ] string > \
  881.     cmd_validity MODE < char ASBCZ > \
  882.     cmd_validity PORT < host_port > \
  883.     cmd_validity PROT < char CSEP > \
  884.     cmd_validity STRU < char FRPO [ string ] > \    
  885.     cmd_validity TYPE < { char AE [ char NTC ] | char I | char L [ number ] } >
  886. preprocessor ftp_telnet_protocol: ftp client default \
  887.     max_resp_len 256 \
  888.     bounce yes \
  889.     ignore_telnet_erase_cmds yes \
  890.     telnet_cmds yes
  891.  
  892.  
  893. # SMTP normalization and anomaly detection.  For more information, see README.SMTP
  894. preprocessor smtp: ports { 25 465 587 691 } \
  895.     inspection_type stateful \
  896.     b64_decode_depth 0 \
  897.     qp_decode_depth 0 \
  898.     bitenc_decode_depth 0 \
  899.     uu_decode_depth 0 \
  900.     log_mailfrom \
  901.     log_rcptto \
  902.     log_filename \
  903.     log_email_hdrs \
  904.     normalize cmds \
  905.     normalize_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \
  906.     normalize_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \
  907.     normalize_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \
  908.     normalize_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \
  909.     max_command_line_len 512 \
  910.     max_header_line_len 1000 \
  911.     max_response_line_len 512 \
  912.     alt_max_command_line_len 260 { MAIL } \
  913.     alt_max_command_line_len 300 { RCPT } \
  914.     alt_max_command_line_len 500 { HELP HELO ETRN EHLO } \
  915.     alt_max_command_line_len 255 { EXPN VRFY ATRN SIZE BDAT DEBUG EMAL ESAM ESND ESOM EVFY IDENT NOOP RSET } \
  916.     alt_max_command_line_len 246 { SEND SAML SOML AUTH TURN ETRN DATA RSET QUIT ONEX QUEU STARTTLS TICK TIME TURNME VERB X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \
  917.     valid_cmds { ATRN AUTH BDAT CHUNKING DATA DEBUG EHLO EMAL ESAM ESND ESOM ETRN EVFY } \
  918.     valid_cmds { EXPN HELO HELP IDENT MAIL NOOP ONEX QUEU QUIT RCPT RSET SAML SEND SOML } \
  919.     valid_cmds { STARTTLS TICK TIME TURN TURNME VERB VRFY X-ADAT X-DRCP X-ERCP X-EXCH50 } \
  920.     valid_cmds { X-EXPS X-LINK2STATE XADR XAUTH XCIR XEXCH50 XGEN XLICENSE XQUE XSTA XTRN XUSR } \
  921.     xlink2state { enabled }
  922.  
  923. # Portscan detection.  For more information, see README.sfportscan
  924. # preprocessor sfportscan: proto  { all } memcap { 10000000 } sense_level { low }
  925.  
  926. # ARP spoof detection.  For more information, see the Snort Manual - Configuring Snort - Preprocessors - ARP Spoof Preprocessor
  927. # preprocessor arpspoof
  928. # preprocessor arpspoof_detect_host: 192.168.40.1 f0:0f:00:f0:0f:00
  929.  
  930. # SSH anomaly detection.  For more information, see README.ssh
  931. preprocessor ssh: server_ports { 22 } \
  932.                   autodetect \
  933.                   max_client_bytes 19600 \
  934.                   max_encrypted_packets 20 \
  935.                   max_server_version_len 100 \
  936.                   enable_respoverflow enable_ssh1crc32 \
  937.                   enable_srvoverflow enable_protomismatch
  938.  
  939. # SMB / DCE-RPC normalization and anomaly detection.  For more information, see README.dcerpc2
  940. preprocessor dcerpc2: memcap 102400, events [co ]
  941. preprocessor dcerpc2_server: default, policy WinXP, \
  942.     detect [smb [139,445], tcp 135, udp 135, rpc-over-http-server 593], \
  943.     autodetect [tcp 1025:, udp 1025:, rpc-over-http-server 1025:], \
  944.     smb_max_chain 3, smb_invalid_shares ["C$", "D$", "ADMIN$"]
  945.  
  946. # DNS anomaly detection.  For more information, see README.dns
  947. preprocessor dns: ports { 53 } enable_rdata_overflow
  948.  
  949. # SSL anomaly detection and traffic bypass.  For more information, see README.ssl
  950. preprocessor ssl: ports { 443 465 563 636 989 992 993 994 995 7801 7802 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 }, trustservers, noinspect_encrypted
  951.  
  952. # SDF sensitive data preprocessor.  For more information see README.sensitive_data
  953. preprocessor sensitive_data: alert_threshold 25
  954.  
  955. # SIP Session Initiation Protocol preprocessor.  For more information see README.sip
  956. preprocessor sip: max_sessions 40000, \
  957.    ports { 5060 5061 5600 }, \
  958.    methods { invite \
  959.              cancel \
  960.              ack \
  961.              bye \
  962.              register \
  963.              options \
  964.              refer \
  965.              subscribe \
  966.              update \
  967.              join \
  968.              info \
  969.              message \
  970.              notify \
  971.              benotify \
  972.              do \
  973.              qauth \
  974.              sprack \
  975.              publish \
  976.              service \
  977.              unsubscribe \
  978.              prack }, \
  979.    max_uri_len 512, \
  980.    max_call_id_len 80, \
  981.    max_requestName_len 20, \
  982.    max_from_len 256, \
  983.    max_to_len 256, \
  984.    max_via_len 1024, \
  985.    max_contact_len 512, \
  986.    max_content_len 2048
  987.  
  988. # IMAP preprocessor.  For more information see README.imap
  989. preprocessor imap: \
  990.    ports { 143 } \
  991.    b64_decode_depth 0 \
  992.    qp_decode_depth 0 \
  993.    bitenc_decode_depth 0 \
  994.    uu_decode_depth 0
  995.  
  996. # POP preprocessor. For more information see README.pop
  997. preprocessor pop: \
  998.    ports { 110 } \
  999.    b64_decode_depth 0 \
  1000.    qp_decode_depth 0 \
  1001.    bitenc_decode_depth 0 \
  1002.    uu_decode_depth 0
  1003.  
  1004. # Modbus preprocessor. For more information see README.modbus
  1005. preprocessor modbus: ports { 502 }
  1006.  
  1007. # DNP3 preprocessor. For more information see README.dnp3
  1008. preprocessor dnp3: ports { 20000 } \
  1009.    memcap 262144 \
  1010.    check_crc
  1011.  
  1012. # Reputation preprocessor. For more information see README.reputation
  1013. #preprocessor reputation: \
  1014. #   memcap 500, \
  1015. #   priority whitelist, \
  1016. #   nested_ip inner, \
  1017. #   whitelist $WHITE_LIST_PATH/white_list.rules, \
  1018. #   blacklist $BLACK_LIST_PATH/black_list.rules
  1019.  
  1020. ###################################################
  1021. # Step #6: Configure output plugins
  1022. # For more information, see Snort Manual, Configuring Snort - Output Modules
  1023. ###################################################
  1024.  
  1025. # unified2
  1026. # Recommended for most installs
  1027. # output unified2: filename merged.log, limit 128, nostamp, mpls_event_types, vlan_event_types
  1028.  
  1029. output unified2: filename snort.log, limit 128
  1030.  
  1031. # Additional configuration for specific types of installs
  1032. # output alert_unified2: filename snort.alert, limit 128, nostamp
  1033. # output log_unified2: filename snort.log, limit 128, nostamp
  1034.  
  1035. # syslog
  1036. # output alert_syslog: LOG_AUTH LOG_ALERT
  1037.  
  1038. # pcap
  1039. # output log_tcpdump: tcpdump.log
  1040.  
  1041. # database
  1042. # output database: alert, <db_type>, user=<username> password=<password> test dbname=<name> host=<hostname>
  1043. # output database: log, <db_type>, user=<username> password=<password> test dbname=<name> host=<hostname>
  1044.  
  1045. # prelude
  1046. # output alert_prelude
  1047.  
  1048. # metadata reference data.  do not modify these lines
  1049. include classification.config
  1050. include reference.config
  1051.  
  1052.  
  1053. ###################################################
  1054. # Step #7: Customize your rule set
  1055. # For more information, see Snort Manual, Writing Snort Rules
  1056. #
  1057. # NOTE: All categories are enabled in this conf file
  1058. ###################################################
  1059.  
  1060. # site specific rules
  1061.  
  1062.  
  1063. ###################################################
  1064. # Step #8: Customize your preprocessor and decoder alerts
  1065. # For more information, see README.decoder_preproc_rules
  1066. ###################################################
  1067.  
  1068. # decoder and preprocessor event rules
  1069. # include $PREPROC_RULE_PATH/preprocessor.rules
  1070. # include $PREPROC_RULE_PATH/decoder.rules
  1071. # include $PREPROC_RULE_PATH/sensitive-data.rules
  1072.  
  1073. ###################################################
  1074. # Step #9: Customize your Shared Object Snort Rules
  1075. # For more information, see http://vrt-blog.snort.org/2009/01/using-vrt-certified-shared-object-rules.html
  1076. ###################################################
  1077.  
  1078. # dynamic library rules
  1079. include $SO_RULE_PATH/bad-traffic.rules
  1080. include $SO_RULE_PATH/chat.rules
  1081. include $SO_RULE_PATH/dos.rules
  1082. include $SO_RULE_PATH/exploit.rules
  1083. include $SO_RULE_PATH/icmp.rules
  1084. include $SO_RULE_PATH/imap.rules
  1085. include $SO_RULE_PATH/misc.rules
  1086. include $SO_RULE_PATH/multimedia.rules
  1087. include $SO_RULE_PATH/netbios.rules
  1088. include $SO_RULE_PATH/nntp.rules
  1089. include $SO_RULE_PATH/p2p.rules
  1090. include $SO_RULE_PATH/smtp.rules
  1091. include $SO_RULE_PATH/snmp.rules
  1092. include $SO_RULE_PATH/specific-threats.rules
  1093. include $SO_RULE_PATH/web-activex.rules
  1094. include $SO_RULE_PATH/web-client.rules
  1095. include $SO_RULE_PATH/web-iis.rules
  1096. include $SO_RULE_PATH/web-misc.rules
  1097.  
  1098. # Event thresholding or suppression commands. See threshold.conf
  1099. include threshold.conf
  1100. include $RULE_PATH/snort.rules
  1101. include $RULE_PATH/local.rules
  1102.  
  1103. ################ the End ####################
  1104.  
  1105.  
  1106. cp -R /usr/local/snort/preproc_rules /etc/snort/preproc-rules
  1107. cp -R /usr/local/snort/so_rules /etc/snort/so_rules
  1108. cp -R /usr/local/snort/rules /etc/snort/rules
  1109.  
  1110. cd /etc/snort/rules
  1111. touch snort.rules
  1112. touch local.rules
  1113.  
  1114. mkdir iplists
  1115. cd /etc/snort/rules/iplists
  1116. touch default.blacklist
  1117.  
  1118. pulledpork.pl -c /etc/pulledpork/pulledpork.conf
  1119.  
  1120. service snortd restart
  1121.  
  1122. crontab -e
  1123. 00 01 * * *  /usr/local/bin/pulledpork.pl -c /etc/pulledpork/pulledpork.conf
  1124.  
  1125.  
  1126. ### Setup BASE
  1127.  
  1128. apt-get install apache2 libapache2-mod-php5 php5 php5-mysql php5-common php5-gd php5-cli php-pear unzip -y
  1129.  
  1130. pear install -f Image_Graph
  1131.  
  1132. cd /usr/local/src/snort
  1133. wget http://sourceforge.net/projects/adodb/files/adodb-php5-only/adodb-514-for-php5/adodb514.zip
  1134. cd /var/
  1135. unzip /usr/local/src/snort/adodb514.zip
  1136. mv adodb5 adodb
  1137.  
  1138. cd /usr/local/src/snort
  1139. wget http://sourceforge.net/projects/secureideas/files/BASE/base-1.4.5/base-1.4.5.tar.gz
  1140. cd /var/www/
  1141. tar zxvf /usr/local/src/snort/base-1.4.5.tar.gz
  1142. mv base-1.4.5 base
  1143.  
  1144. cd /var/www/base
  1145. cp base_conf.php.dist base_conf.php
  1146. nano base_conf.php
  1147. ....
  1148. $BASE_urlpath = '/base';
  1149. ...
  1150. $DBlib_path = '/var/adodb/';
  1151. ...
  1152. $alert_dbname   = 'snort';
  1153. $alert_host     = 'localhost';
  1154. $alert_port     = '';
  1155. $alert_user     = 'snort';
  1156. $alert_password = 'snort';
  1157. ...
  1158.  
  1159. chown -R www-data:www-data /var/www/base
  1160.  
  1161. service apache2 restart
  1162. snort_ip_address/base/index.php
Advertisement
Add Comment
Please, Sign In to add comment