Posts Tagged ‘snort’

BotHunter Headless on ClearOS with TOR

I was inspired to play with BotHunter by this article: https://www.whataboutbob.org/public/?p=102

I’m not fond of running GUIs on firewalls (let alone virtual machines) and I’ve been writing about using TOR with ClearOS for an upcoming article so we will be building upon rstangarone’s article today. There is nothing stopping you from installing what you need to, say, tunnel X through SSH but that goes beyond the scope of this article.

You may wish to set this up in one of my pre-installed ClearOS Virtual Machines before implementing it on production systems: paravirtualized Xen, hardware emulators.

As put forward in the BotHunter documentation:

BotHunter is the first, and still the best, network-based malware infection diagnosis system out there. It tracks the two-way communication flows between your computer(s) and the Internet, comparing your network traffic against an abstract model of malware communication patterns. Its goal is to catch bots and other coordination-centric malware infesting your network, and it is exceptionally effective.

I hope their money is where their mouth is. Interestingly:

Optional: You are prompted to install Tor if it has not been installed previously. BotHunter may be configured to use Tor to interact anonymously with the BotHunter repository services.

BotHunter is based on what is described in the documentation as a heavily customized Snort implementation. I toyed for some time with the thought of unifying ClearOS’s Intrusion Prevention/Detection System implementation with it to conserve resources but ultimately decided time was better spent doing other things and swallowed the hit. You may feel differently however, if you succeed please drop me a line. The BotHunter installer will attempt to compile its Snort from source; ensure that the ClearOS build environment has been installed:

# yum install "Developer Tools"

Let’s find then install the latest version of TOR for ClearOS. You will first need libevent:

# yum install libevent

If you will be using the torify command you will need to install tsocks:

# rpm -iv ftp://ftp.univie.ac.at/systems/linux/dag/redhat/el5/en/i386/dag/RPMS/tsocks-1.8-7.beta5.2.el5.rf.i386.rpm

Now TOR (adjust for the latest version):

# rpm -iv http://deb.torproject.org/torproject.org/rpm/centos5/tor-0.2.1.28-tor.0.rh5_5.i386.rpm

Make TOR start on boot:

# chkconfig --level 2345 tor on

Tor is configured by default to listen to port 9050 on localhost. If you would like hosts on the private network to be able to route connections through this deployment you may add a second SocksListenAddress directive, set to your router’s LAN address in /etc/tor/torrc. Edit the /etc/tor/tor-tsocks.conf file on your client machines to route connections made via torify to the LAN address. Note that you should only do this for private addresses otherwise you may be opening an inadvertent public proxy.

Enable the control port by uncommenting this line in /etc/tor/torrc:

ControlPort 9051

Run this command, replacing password with the password you would like to use for the controller:

tor --hash-password password

Ignore the warning about running TOR as root; the init script has been configured by the RPM to use a non-privileged account. Uncomment and change the HashedControlPassword to the output you were provided. Start TOR:

# /etc/init.d/tor start

Before we install BotHunter we must provide ClearOS with a java environment:

# yum install java

Now let’s download the latest version of BotHunter. We’ll be following the installation instructions available at http://www.bothunter.net/doc/users_guide-UNIX.html. Go to http://www.bothunter.net/download.html and fill out the form to get your download link.

# wget {your download link}
# tar zxf {your filename}
# cd BotHunter/

Here’s the README that came with mine:

[root@router BotHunter]# cat README.txt 

            BotHunter(*) Internet Release
              www.bothunter.net
              Unix Version 1.5.0
              February 25, 2010

* HARDWARE RECOMMENDATIONS

  Your system should have a modern Intel Pentium-class or
  Motorola PowerPC processor, at least 1 GB RAM, and at least
  1 Ethernet NIC/WIC for network monitoring.

* OS AND SOFTWARE REQUIREMENTS

  BotHunter is available for use on the following operating
  systems:

  Linux:    tested on Fedora, Red Hat Enterprise Linux, Debian,
            and SuSE distributions

  FreeBSD:  tested on Product Release 7.0

  MacOS 10: tested on Tiger and Leopard, Mac OS 10.4 and 10.5

  BotHunter requires a Sun-compatible Java Runtime Environment
  (JRE) Release 1.5 or later.

  Linux: the Linux distribution of Sun's Java JRE is available at

http://java.sun.com/javase/downloads/index.jsp

  Mac OS:  for Mac OS X, Xcode must be installed on your system;
           it may be obtained from

http://developer.apple.com/tools/xcode/

  FreeBSD: for installing a recent version of Java, we recommend
           that you consult

http://www.freebsd.org/java/

* NETWORK REQUIREMENTS

  Installation requires Internet connectivity for downloading the
  necessary libraries, packages, and BotHunter ruleset updates.
  Your target platform should have a promiscuous mode tap, such as
  a span port or access to broadcast LAN traffic.  Ideally, your
  machine should be attached to a monitoring position on an internal
  network egress point to observe successful connection flows (e.g.,
  behind the firewall) between your internal hosts and external
  entities.

* INSTALLATION

  The following is a summary of the minimum steps necessary to install,
  configure, and start BotHunter, in its default configuration for live
  traffic monitoring.  This installation procedure should be performed
  by the root user.  You will also need to know the IP address netmask
  of the network you wish to protect, and the IP addresses of your
  email and DNS servers.

  BotHunter's installation process will NOT upgrade a previous
  installation. If you have a previous installation of BotHunter, you
  should remove the previous user installation or install BotHunter
  into a different user account.

  While installation requires root privilege, BotHunter does not
  require root privilege to run.  Instead, this installation creates
  a nonprivileged user account that runs BotHunter.

  Note: you may type '?' at any prompt for a detailed explanation of
  what is expected.

  1.  Untar the BotHunter Unix distribution.

  2.  Begin the root installation procedure.

      root% java -jar botHunterInstall.jar

      Read the EULA and if acceptable click YES.

  3.  Confirm that you wish to perform this root install.

  4.  Optional: You are prompted to install Tor if it has not been
      installed previously.  BotHunter may be configured to use Tor
      to interact anonymously with the BotHunter repository services.

  5.  Indicate the new nonprivileged user account with which you wish
      to install BotHunter (default user account = cta-bh). BotHunter
      will then install dependent packages. If you choose to install
      BotHunter over a preexisting user account, this account must
      use csh(1).

  6.  Enter your Trusted Network Mask: Provide a (comma separated)
      local network mask list, plus the IP addresses of all external
      NetBIOS shares with which your internal machines are allowed to
      communicate.

      example: 192.168.1.0/24,10.10.0.10/16

  7.  Enter the (comma separated) IP addresses of the email server(s)
      used by systems inside your network.

  8.  Enter the (comma separated) list of DNS servers used by systems
      inside your network.

  9.  Enter your network interface that BotHunter will use to monitor
      your network.

  10. Indicate whether you wish BotHunter to start automatically on
      reboot.

  11. Optional: As a last step, you may now set user cta-bh's password:

      root% /usr/bin/passwd cta-bh

  12. su to the user account that you created during the BotHunter
      installation:

      root% su -l cta-bh

  14. To set up BotHunter in its default configuration (LIVEPIPE
      mode), use the BotHunter shell alias:

      cta-bh% BotHunter

* CONFIGURING AND OPERATING BOTHUNTER

  You are now ready to configure and operate BotHunter. Please read
  the BotHunter Unix User's Guide, available at

http://www.bothunter.net/doc/users_guide-UNIX.html

  for details on how to configure and operate BotHunter.

  The User Guide is also available under the doc directory of this
  installation package.

* GOOD LUCK

  Thank you for your interest and support.

  BotHunter Developers: Phillip Porras, Martin Fong, Keith Skinner,
  Steven Dawson, Vinod Yegneswaran, Guofei Gu.

----------------------------------------------------------------------
(*) BotHunter is a U.S. Registered Trademark of
    SRI International, 333 Ravenswood Ave., Menlo Park, CA 94025

We’ll need to make a non-privileged user account and working directory for BotHunter to run under.

# mkdir /opt/bh
# useradd -d /opt/bh -s /sbin/nologin -r bh
# chown bh: /opt/bh

Now run the installer:

java -jar botHunterInstall.jar

If you chose not to start BotHunter automatically at the end of the installation procedure run:

# /etc/init.d/zzzBotHunter_bh start

Check on the status of BotHunter:

# cd /opt/bh/BotHunter/LIVEPIPE_CONFIG
# sudo -u bh java -jar ../botHunterInstall.jar status

Note that the paths must be the same as used above. You will only be able to query the daemon if you connect to it as the user it is running under.

[root@router LIVEPIPE_CONFIG]# sudo -u bh java -jar ../botHunterInstall.jar status
Issuing net query signal.

CTA BotHunter 1.5.0 status #2 as of 2011/01/13 18:42:46 EST
  Process elapsed time:               0 00:08:12
  Memory usage:                       43880 Kbytes
  Input events read:                  2
  Input events parsed:                2
  Local text BotHunter profiles:      1
  NetQuery requests made:             2
  NetQuery responses received:        1
  Repository messages queued:         1
  Messages sent to repository:        2
  Sensor connected to repository:     true
  Most recently seen author ID:       ***********
  Most recently seen observer ID:     ********
 
CTA BotHunter: Process is active.

Now let’s add an alias to our ~/.bashrc:

alias cwdBotHunter='sudo -u bh java -Xmx104m -jar /opt/bh/BotHunter/botHunterInstall.jar'
alias BotHunter='cd /opt/bh/BotHunter/LIVEPIPE_CONFIG; cwdBotHunter'

Start a new bash instance (log out/log in or run ‘bash’). You should now be able to run

BotHunter status

as root from any location.

I want e-mail notifications so let’s open /opt/bh/BotHunter/LIVEPIPE_CONFIG/CTA_BotHunter/CTA_BotHunter.config and add these lines:

# ----------------------------------------------------------------------
# e-mail parameters
mailTo=your@email.com
mailHost=xxx.xxx.xxx.xxx
mailFrom=bothunter@fibre.whatever.com 
mailSubject=BotHunter Profile %m(score) %df(yyyyMMdd_HHmmssSSS)
mailSubjSubs=true

Save the file then restart BotHunter to apply your changes:

# /etc/init.d/zzzBotHunter_bh restart

That’s all, folks!

Cleaning up Snort’s Droppings on ClearOS

In the last couple of weeks a wave of attacks has seen the snort packet logs on a client’s firewall fill the disc to capacity, causing all sorts of wonderful problems. Packet logging is optional and usually only worth the trouble if you are actively trying to solve an attack or false positive, in which cases it can be added at that time. For most folks it simply provides a hindrance on performance and, if your storage is not well diversified, a hazard as we have seen with this router:

Disable packet logging by editing /etc/init.d/snort to start the daemon with the -N flag:

  start)
        echo -n $"Starting $prog: "
        if test "x`/sbin/pidof snort`" != x; then
                failure
                echo ""
        else
                automagic
                # Add support for multiwan
                if [ -n "$EXTIF" ]; then
                                for INTERFACE in $EXTIF; do
                                                daemon snort -N -i $INTERFACE -D -c /etc/snort.conf
                                done
                else
                                daemon snort -N -D -c /etc/snort.conf
                fi
                RETVAL=$?
                echo
                [ $RETVAL -eq 0 ] && touch /var/lock/snort
        fi
        ;;

Restart snort via its init script:

# /etc/init.d/snort restart

If you take a look at the logrotate configuration file for snort at /etc/logrotate.d/snort you’ll see:

# A bit of a kludge here - the logrotate file is empty and
# created by /etc/rc.d/init.d/snort.
/var/log/snort/logrotate {
 missingok
 postrotate
 tar -czf /var/log/snort.tar.gz /var/log/snort 2> /dev/null
 rm -rf /var/log/snort/[0-9]* /var/log/snort/snort.log.[0-9]* 2> /dev/null
 killall -HUP snort 2> /dev/null || true
 endscript
}

I’m not sure why the ClearOS people are using a “kludge” here, at best guess it seems the point is to put the snort.tar.gz archive directly under /var/log rather than in its own directory. Maybe it has to do with accommodating snort’s built-in log rotation. I don’t know. I don’t really care.

If you’re concerned about aesthetics keep the init script from creating the blank:

        # Creates a dummy file for /etc/logrotate.d/snort script
#       if [ -d /var/log/snort ]; then
#               echo "Used for logrotate... do not delete" > /var/log/snort/logrotate
#       fi

If I read that right it’s saying “Used for logrotate… please delete.”

# yes | rm -r /var/log/snort/*

ISC.Org ANY Request DRDoS Update

It has been some time now since I started talking about the curious case of the isc.org ANY request flood (later revealed to be a UDP amplification attack) and our friends are still knocking at the gates hot and heavy. In the past couple of days I have noticed some particularly voluminous activity, culminating in this wave this afternoon.

ID 	Blocked IP 	  	Date 	Time 	Time Remaining

4000002 	69.197.22.82 		11/17/10 	15:36:49 	1d 00:00:00

4000002 	72.20.9.147 		11/17/10 	15:35:31 	23:58:42

4000002 	72.20.9.154 		11/17/10 	15:24:38 	23:47:49

4000002 	95.168.172.188 		11/17/10 	15:24:01 	23:47:12

4000002 	85.195.105.91 		11/17/10 	15:22:31 	23:45:42

4000002 	72.20.9.150 		11/17/10 	15:19:21 	23:42:32

4000002 	84.16.227.96 		11/17/10 	15:15:08 	23:38:19

4000002 	78.159.121.149 		11/17/10 	15:13:21 	23:36:32

4000002 	178.162.182.250 	11/17/10 	15:11:02 	23:34:13

4000002 	72.20.9.156 		11/17/10 	15:10:21 	23:33:32

4000002 	78.159.99.146 		11/17/10 	15:07:53 	23:31:04

4000002 	78.129.164.142 		11/17/10 	15:05:57 	23:29:08

4000002 	78.159.107.219 		11/17/10 	15:05:13 	23:28:24

4000002 	72.20.9.149 		11/17/10 	15:04:32 	23:27:43

4000002 	206.217.216.249 	11/17/10 	15:02:50 	23:26:01

4000002 	95.154.240.8 		11/17/10 	15:00:38 	23:23:49

4000002 	72.20.56.237 		11/17/10 	14:58:20 	23:21:31

4000002 	78.159.108.198 		11/17/10 	14:50:12 	23:13:23

Since the attacks are so frequent the IPS is having a hard time keeping up and enough packets are getting through that I have decided this is no longer amusing enough to keep tracking. At the bottom of this page is the netfilter panacea.

For the curious, this is what I have been seeing in my packet captures:

0000  00 16 3e cc 00 02 00 16  3e bb 00 02 08 00 45 00   ..>..... >.....E.
0010  05 dc b6 5b 20 00 40 11  a1 8a 00 00 00 00 48 14   ...[ .@. ......H.
0020  09 93 00 35 63 01 06 c7  8d 82 2a 39 81 00 00 01   ...5c... ..*9....
0030  00 00 00 08 00 0f 03 69  73 63 03 6f 72 67 00 00   .......i sc.org..
0040  ff 00 01 c0 0c 00 02 00  01 00 00 76 ac 00 0e 04   ........ ...v....
0050  73 66 62 61 06 73 6e 73  2d 70 62 c0 0c c0 0c 00   sfba.sns -pb.....
0060  02 00 01 00 00 76 ac 00  06 03 6f 72 64 c0 2a c0   .....v.. ..ord.*.
0070  0c 00 02 00 01 00 00 76  ac 00 06 03 61 6d 73 c0   .......v ....ams.
0080  2a c0 0c 00 02 00 01 00  00 76 ac 00 19 02 6e 73   *....... .v....ns
0090  03 69 73 63 0b 61 66 69  6c 69 61 73 2d 6e 73 74   .isc.afi lias-nst
00a0  04 69 6e 66 6f 00 c0 0c  00 2e 00 01 00 00 93 fe   .info... ........
00b0  00 9b 00 02 05 02 00 00  a8 c0 4d 0a b9 03 4c e3   ........ ..M...L.
00c0  2c 03 38 79 03 69 73 63  03 6f 72 67 00 52 d3 b5   ,.8y.isc .org.R..
00d0  f4 98 f3 d6 75 d8 6c 8f  1b 95 b8 55 82 4b 1a ff   ....u.l. ...U.K..
00e0  93 99 29 95 09 a4 d8 1f  46 8b c9 92 45 6c 72 05   ..)..... F...Elr.
00f0  96 28 a7 53 4c 8c d6 e6  a3 b2 4d d6 3d 45 8b be   .(.SL... ..M.=E..
0100  c4 5b a5 2b f9 f1 95 3a  9a 66 02 d7 5e 58 f5 7a   .[.+...: .f..^X.z
0110  f2 f3 d6 94 f1 da a6 2b  e8 43 9a 86 71 48 a1 7b   .......+ .C..qH.{
0120  2e e2 d2 1c a9 9f 68 61  66 11 43 ca 70 88 d9 a0   ......ha f.C.p...
0130  03 82 0f af d3 e8 46 f7  86 33 21 ae 01 b8 62 01   ......F. .3!...b.
0140  84 41 f1 fe 88 23 2d 9c  27 7a 36 6c b7 c0 9a 00   .A...#-. 'z6l....
0150  2b 00 01 00 01 3c bd 00  18 32 5c 05 01 98 21 13   +....< .. .2\...!.
0160  d0 8b 4c 6a 1d 9f 6a ee  1e 22 37 ae f6 9f 3f 97   ..Lj..j. ."7...?.
0170  59 c0 9a 00 2b 00 01 00  01 3c bd 00 24 32 5c 05   Y...+... .<..$2\.
0180  02 f1 e1 84 c0 e1 d6 15  d2 0e b3 c2 23 ac ed 3b   ........ ....#..;
0190  03 c7 73 dd 95 2d 5f 0e  b5 c7 77 58 6d e1 8d a6   ..s..-_. ..wXm...
01a0  b5 c0 9a 00 2e 00 01 00  01 3c bd 00 97 00 2b 07   ........ .<....+.
01b0  02 00 01 51 80 4c f6 79  3a 4c e3 f6 2a f0 9e 03   ...Q.L.y :L..*...
01c0  6f 72 67 00 64 1a d8 1f  c6 51 40 a6 25 28 e7 b9   org.d... .Q@.%(..
01d0  21 c2 2a 4b 30 a0 e8 74  30 83 76 b2 52 eb 0c ec   !.*K0..t 0.v.R...
01e0  e4 e2 4c 3f f1 0e ec 6d  3a d6 b7 d6 2e 4e a3 4a   ..L?...m :....N.J
01f0  5d f6 ac 08 40 25 a5 de  0a 89 90 5d d9 c0 b3 d3   ]...@%.. ...]....
0200  ef 4b d0 8a c3 d5 c2 49  fa c4 c3 84 29 4e 4e 16   .K.....I ....)NN.
0210  47 2e 5c f4 09 9f c4 70  9d 2c 40 c2 63 4b 52 2a   G.\....p .,@.cKR*
0220  14 5b 55 ef 54 9d cc 20  9b 71 61 f4 6e 88 84 49   .[U.T..  .qa.n..I
0230  2c f3 08 77 c4 f0 4d cf  54 ea 64 19 be d3 bf 6c   ,..w..M. T.d....l
0240  cd c0 cb 2f c0 63 00 01  00 01 00 01 1f 6c 00 04   .../.c.. .....l..
0250  c7 fe 3f fe c0 63 00 1c  00 01 00 01 1f 6c 00 10   ..?..c.. .....l..
0260  20 01 05 00 00 2c 00 00  00 00 00 00 00 00 02 54    ....,.. .......T
0270  c0 51 00 01 00 01 00 00  93 fd 00 04 c7 06 01 1e   .Q...... ........
0280  c0 51 00 1c 00 01 00 00  93 fd 00 10 20 01 05 00   .Q...... .... ...
0290  00 60 00 00 00 00 00 00  00 00 00 30 c0 3f 00 01   .`...... ...0.?..
02a0  00 01 00 00 93 fd 00 04  c7 06 00 1e c0 3f 00 1c   ........ .....?..
02b0  00 01 00 00 93 fe 00 10  20 01 05 00 00 71 00 00   ........  ....q..
02c0  00 00 00 00 00 00 00 30  c0 25 00 01 00 01 00 00   .......0 .%......
02d0  76 ac 00 04 95 14 40 03  c0 25 00 1c 00 01 00 00   v.....@. .%......
02e0  76 ac 00 10 20 01 04 f8  00 00 00 02 00 00 00 00   v... ... ........
02f0  00 00 00 19 c0 51 00 2e  00 01 00 00 93 fd 00 9b   .....Q.. ........
0300  00 01 05 04 00 00 a8 c0  4d 0a b9 03 4c e3 2c 03   ........ M...L.,.
0310  38 79 03 69 73 63 03 6f  72 67 00 bb dc f9 a8 90   8y.isc.o rg......
0320  58 9c 7a 62 dd 73 82 89  78 82 1d b2 d6 6f e6 e6   X.zb.s.. x....o..
0330  36 d1 af d5 a1 a7 ff d7  54 c8 70 f2 14 57 f9 89   6....... T.p..W..
0340  99 fa 4e cb 70 23 cd 56  cc dd 8f 5b a7 a7 b7 ad   ..N.p#.V ...[....
0350  32 68 1b a1 c0 de 1b e5  a7 f8 7a 5c 57 1c 72 09   2h...... ..z\W.r.
0360  3f f4 1a 22 c1 9d d9 f7  28 91 b9 e2 17 09 f9 a2   ?..".... (.......
0370  52 89 a5 d8 7f 7f d9 ba  31 52 d0 53 f0 de a5 b2   R....... 1R.S....
0380  37 6e 30 fb 0c e4 0d 46  dc b6 f5 50 55 64 3d 32   7n0....F ...PUd=2
0390  ec 3d 26 41 fa 56 ad ad  20 13 29 c0 51 00 2e 00   .=&A.V..  .).Q...
03a0  01 00 00 93 fd 00 9b 00  1c 05 04 00 00 a8 c0 4d   ........ .......M
03b0  0a b9 03 4c e3 2c 03 38  79 03 69 73 63 03 6f 72   ...L.,.8 y.isc.or
03c0  67 00 47 51 42 a0 24 40  77 c3 eb 0d 1d 92 8f 04   g.GQB.$@ w.......
03d0  78 3e b2 f6 e7 93 73 98  41 ae ea e2 60 87 97 65   x>....s. A...`..e
03e0  4f e5 45 d1 3f b6 c9 ad  3b 52 48 e3 f8 cd 81 cc   O.E.?... ;RH.....
03f0  18 75 50 90 26 58 28 47  39 f5 b7 a7 7d 39 de aa   .uP.&X(G 9...}9..
0400  69 59 d0 36 de 09 a9 10  33 2b 0c ad 51 4e e0 74   iY.6.... 3+..QN.t
0410  dc ab 35 6c 1b a9 0d c4  31 31 b9 b6 b5 f1 42 11   ..5l.... 11....B.
0420  ef 08 c6 4f 4f eb 32 d6  9b fb 85 7d 67 1c 3f 8d   ...OO.2. ...}g.?.
0430  25 cc 50 c4 55 1f 40 2a  0e f8 db 78 38 8f 74 0f   %.P.U.@* ...x8.t.
0440  58 65 c0 3f 00 2e 00 01  00 00 93 fd 00 9b 00 01   Xe.?.... ........
0450  05 04 00 00 a8 c0 4d 0a  b9 03 4c e3 2c 03 38 79   ......M. ..L.,.8y
0460  03 69 73 63 03 6f 72 67  00 0d fd 01 af 6b 47 87   .isc.org .....kG.
0470  51 e1 92 82 64 82 f2 b4  27 36 d1 e5 55 79 21 14   Q...d... '6..Uy!.
0480  31 e9 78 e9 2a 64 b8 bc  1a 59 67 33 e0 cf 5d c6   1.x.*d.. .Yg3..].
0490  ac 30 be 9d 02 75 a0 1e  03 9e 40 46 63 9c b5 cc   .0...u.. ..@Fc...
04a0  18 fb 81 6d ca f5 7b c3  35 ce 2e 7a ad 6c a3 6f   ...m..{. 5..z.l.o
04b0  df 6f 14 4f ee 71 57 fe  f3 96 d0 b0 7b 43 54 65   .o.O.qW. ....{CTe
04c0  cf c8 d1 56 4e 9b 62 82  32 b5 db 73 67 3b f1 35   ...VN.b. 2..sg;.5
04d0  02 19 3a 1c bd cc d5 ad  7c 23 2c 53 1a 8c 0a 45   ..:..... |#,S...E
04e0  eb 10 f2 83 21 68 f3 7d  7a c0 3f 00 2e 00 01 00   ....!h.} z.?.....
04f0  00 93 fe 00 9b 00 1c 05  04 00 00 a8 c0 4d 0a b9   ........ .....M..
0500  03 4c e3 2c 03 38 79 03  69 73 63 03 6f 72 67 00   .L.,.8y. isc.org.
0510  76 61 9f e1 a7 45 ee c6  78 71 d9 a2 a3 e0 20 56   va...E.. xq.... V
0520  d6 64 17 a7 25 d1 11 5b  51 80 50 24 c5 9f 4b 19   .d..%..[ Q.P$..K.
0530  fa 5c e3 6f e2 f2 ca 9e  e9 c0 9d ee 13 f8 21 03   .\.o.... ......!.
0540  22 d9 58 54 92 48 5f 71  95 d7 f4 4b 94 d4 5f 54   ".XT.H_q ...K.._T
0550  bf 1e da c1 f4 95 35 28  75 8f 09 f8 6a 15 11 eb   ......5( u...j...
0560  ef 86 99 6f 45 5b 37 4d  bc c8 8c 2b de b7 fc 7c   ...oE[7M ...+...|
0570  77 e5 15 06 b4 cd 03 66  6b 32 da aa c1 c1 f5 0f   w......f k2......
0580  46 24 ea cb 9e 2b 2a 04  b7 2a d4 b7 3d be 58 23   F$...+*. .*..=.X#
0590  c0 25 00 2e 00 01 00 00  76 ac 00 9b 00 01 05 04   .%...... v.......
05a0  00 00 a8 c0 4d 0a b9 03  4c e3 2c 03 38 79 03 69   ....M... L.,.8y.i
05b0  73 63 03 6f 72 67 00 45  62 4e 36 4e c3 e8 69 a4   sc.org.E bN6N..i.
05c0  94 da 56 f0 6a 73 e5 1f  16 e0 56 c8 95 b4 83 0b   ..V.js.. ..V.....
05d0  28 d1 dd 06 10 da da 0c  78 43 4b c0 60 09 88 26   (....... xCK.`..&
05e0  d8 36 8e a0 69 3a 7d cd  9e 31                     .6..i:}. .1

The above seems to be a new version of the attack which makes use of fragmentation. It has a differing payload in each packet and comes in short waves. This one seems to be emanating (or targeting) mostly from the 72.20.9.0/24 block. It appears to be getting used in conjunction with the old request:

0000  00 16 3e bb 00 02 00 16  3e cc 00 02 08 00 45 00   ..>..... >.....E.
0010  00 40 a6 11 00 00 e8 11  2f 70 48 14 09 93 00 00   .@...... /pH.....
0020  00 00 63 01 00 35 00 2c  00 00 2a 39 01 00 00 01   ..c..5., ..*9....
0030  00 00 00 00 00 01 03 69  73 63 03 6f 72 67 00 00   .......i sc.org..
0040  ff 00 01 00 00 29 10 00  00 00 80 00 00 00         .....).. ......

Here is the magic rule my friends:

# iptables -A INPUT -p udp -m string --hex-string "|03697363036f726700|" --algo bm --to 65535 -j DROP

UPDATE Thanks to David (below) for pointing out –to (all ports) is inefficient and could interfere with legitimate traffic. Additionally, I was able to fix a problem resolving domains that involve .nl tld servers by broadening the pattern:

# iptables -A INPUT -p udp -m string --hex-string "|00000000000103697363036f726700|" --algo bm --to 65535 --dport 53 -j DROP
Return top
foxpa.ws
Online Marketing Toplist
Internet
Technology Blogs - Blog Rankings

Internet Blogs - BlogCatalog Blog Directory

Technology blogs
Bad Karma Networks

Please Donate!


Made in Canada  •  There's a fox in the Gibson!  •  2010-12