NAME

  LaBrea::Tarpit - Utilities and web displays for 
  Tom Liston's LaBrea scanner/worm disruptor
  See: http://sourceforge.net/projects/labrea/


SYNOPSIS

  use LaBrea::Tarpit qw( [exportable functions] );
  or
  require LaBrea::Tarpit;
  daemon(%hash or \%hash);
  $bandwidth = bandwidth(\%tarpit);
  $midnight = midnight($epoch_time,$tz);
  $timezone = timezone($now);
  $sec = $tz2_sec($tz);
  $time_string = their_date($gmtime,$tz);
  $rv = restore_tarpit(\%tarpit,path2cache_file);
  $rv = log2_mem(\%tarpit,log_line,is_daemon,port_intvls,DShield);
  $rv = process_log(\%tarpit,path2log_file,is_daemon,port_intvls);
  $rv = cull_threads(\%tarpit,timeout,scanners,port_intvls,DShield);
  $rv = write_cache_file(\%tarpit,path2cache_file,umask,flag);
        prep_report(\%tarpit,\%hash);
  $rv = find_old_threads(\%tarpit,\%report,$age);


INSTALL


DESCRIPTION - LaBrea::Tarpit

A comprehensive Hack Attack reporting module when used in conjunction with Tom Liston's LaBrea scanner/worm disruptor. When configured with reporting and stat collection it provides a detailed HTML page containing:

For more information on LaBrea see: http://sourceforge.net/projects/labrea/ or contact the author of LaBrea, Tom Liston tliston@hackbusters.net.

The parsed output of either syslog data or STDOUT from LaBrea using -o or -O options is readily turned into text reports or an html output page.

Basically there are two methods of operation. You can use the daemon mode to create an almost realtime cache that may be parsed using the report routines, or you can use the update and report routines to parse the syslog files on an as needed basis. If you plan to create web page reports, the daemon model will use less system resources in the long run and avoids running syslog with the high volume output of LaBrea.

Improvements VERSION 1.00

As of version 1.00, daemon.pl uses network sockets to provide data for the report modules. This means that the daemon can run on a remote machine and the report scripts and web server can be somewhere else.

For those of you upgrading from older versions, you MUST upgrade all of your report scripts as well. Older versions use a pipe or FIFO and this is no longer supported as there were problems maintaining separate sessions.

scanners is enabled by setting to a positive number. Since all IP's that are seen but not captured can potentially be saved, this list could grow very large. You can limit the amount of memory used by setting the number of items that can be saved. There is no default, a value <= 0 turns of this feature. Scanners are saved on a fifo basis, when full, the oldest will be deleted first.

 Signals:
  HUP           cull then write new cache file
  TERM          cull, write cache, exit
  Killing the daemon with SIG_KILL (-9) will NOT write
  a new cache file and will leave LaBrea running.
  YOU SHOULD NOT DO THIS

daemon operation: The daemon parses the output of LaBrea in real time and collects the information in its memory cache, periodically pruning away threads that are no longer active to minimize the memory footprint. Upon receiving a HUP, it immediately prunes memory of old threads and writes its cache to file.

data retrieval

  Usage:
        connect to TCP port 8686
        send "standard" (endline)
          or
        send "active" (endline)
          or
        send "short" (endline)
          or
        send "config" (endline)

to receive the complete memory cache described above or only active threads or a truncated version suitable for making a short report. config sends the daemon configuration file information to the client.


DEPENDENCIES

        Net::Whois::IP version 0.35     
        Net::Netmask version 1.8 or higher
        LaBrea version 2.4b3 or higher

See the INSTALL document for complete information


EXPORT

  None by default.


EXPORT_OK

        recurse_hash2txt
        daemon
        bandwidth
        midnight
        timezone
        tz2_sec
        their_date
        restore_tarpit
        log2_mem
        process_log
        cull_threads
        write_cache_file
        prep_report
        find_old_threads
        array2_tarpit


COPYRIGHT

Copyright 2002, 2003, 2004, Michael Robinton & BizSystems 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.


AUTHOR

Michael Robinton, michael@bizsystems.com


SEE ALSO

perl(1), LaBrea::Codes(3), LaBrea::Tarpit::Get(3), LaBrea::Tarpit::Report(3), LaBrea::Tarpit::Util(3), LaBrea::Tarpit::DShield(3)