#!/usr/bin/perl # # html_report.plx # my $version = '2.04'; # 10-29-03, michael@bizsystems.com # GPL'd, see Copyright notice in the package README file # use strict; #use diagnostics; use LaBrea::Tarpit::Report qw( generate gen_short syslog2_cache short_report make_buttons make_image_cache ); use LaBrea::Tarpit::Util qw( cache_is_valid update_cache http_date labrea_whoami ); ######################################################### ######## READ THIS FILE FOR CONFIGURATION ############### ######################################################### # ALTER this to the path for "localTrojans.pl" use lib qw( ./ ); require 'localTrojans.pl'; # SET for your system # my $config = { # 'file' => '/path/to/cache', # used for test, overides host:port # 'd_port' => '8686', # defaults to 8686 # 'd_host' => 'localhost', # defaults to 'localhost' # 'd_timeout' => default 180, # seconds to wait for host response 'cache' => '/var/tmp/labrea.cache', # 'umask' => '', # use default 033 cache_file umask # 'cull' => default 600, # seconds to keep old threads 'scanners' => 100, # keep this many dead threads # 'port_timer' => default 86400, # seconds per collection period 'port_intvls' => 30, # keep #nintvls of port stats }; # SET THESE for your system my $look_n_feel = { # defaults shown 'face' => 'VERDANA,ARIAL,HELVETICA,SANS-SERIF', 'color' => '#ffffcc', 'bakgnd' => '#000000', # below are all for port_intervals 'images' => './', # REQUIRED, path to images # 'height' => 72, # default # 'width' => 7, # default # 'legend' => 'text for graph', # optional 'threshold' => 5, # ignore below this count # 'trojans' => \%trojans, # optional 'trojans' => $LaBrea::Tarpit::Report::localTrojans::trojans, # where %trojans is of the form # ( # info not in /etc/services # # port text # 555 => 'phAse zero', # 1243 => 'Sub-7', # # etc.... # ); # below are for html file caching # the directory for the cache file MUST be writable by the web server 'html_cache_file' => './tmp/html_report.cache', # required 'html_expire' => '60', # cache expiration, secs # optional other_sites stats cache location 'other_sites' => './tmp/site_stats', }; # comment ANY of these out to eliminate that section of the report # comment out the corresponding section in @buttons below as well my $out = { 'guests' => undef, 'guests_by_IP' => undef, 'capture_summary' => 5, 'got_away' => undef, 'my_IPs', => undef, 'port_intervals' => 30, 'versions' => 'Created by:', 'other_sites' => undef, }; my $html_report = sub { my ($input,$report,$look_n_feel,$out,$suppress) = @_; my $para = "
\n"; @_ = split('\.', $0); $_ = pop @_; my @buttons = ( 'HOME' => 'http://www.bizsystems.net', # 'TOP' => '#top', 'SUMMARY' => '#CAPTURE SUMMARY', "SOURCE IP's" => '#attackers', 'HELD SINCE' => '#captured', 'ESCAPED' => '#escaped', "DEST IP's" => '#local-ips', 'TRENDS' => '#trends', 'OTHER SITES' => '#others', # 'MULTI PAGE' => './paged_report.'.$_, ); ######################################################### ############ no more user setable parameters ############ ######################################################### $_ = $LaBrea::Tarpit::Report::localTrojans::trojans; # silence strict warning my $butsub = sub { my $name = $_[0] || ''; @_ = ($look_n_feel,'',$name,\@buttons); goto &make_buttons; }; $$report = ($_ = generate($input,$look_n_feel,$out)) ? qq|
The server said....
$_
|
Page last updated | . $out->{date} . q|
These reports show the scans / hack attempts against the
|
| . $out->{capture_summary} . q| | ||
|
Briefly:
LaBrea is a program that creates a tarpit or, as some have called it a "sticky honeypot". LaBrea takes over unused IP addresses on a network and creates "virtual machines" that answer to connection attempts. LaBrea answers those connection attempts in a way that causes the machine at the other end to get "stuck", sometimes for a very long time.
| |||
|; $$report .= &$butsub('attackers') . $para . $out->{guests_by_IP} . $para if $out->{guests_by_IP}; $$report .= &$butsub('captured') . $para . $out->{guests} . $para if $out->{guests}; $$report .= &$butsub('escaped') . $para . $out->{got_away} . $para if $out->{got_away}; $$report .= &$butsub('local-ips') . $para . $out->{my_IPs} . $para if $out->{my_IPs}; $$report .= &$butsub('trends') . $para . $out->{port_intervals} . $para if $out->{port_intervals}; if ( $out->{other_sites} ) { # insert comments my $comments = q|
To: Michael@BizSystems.comTo get the most recent list of sites using LaBrea::Tarpit, see:
Subject: LaBrea::Tarpit sitecontaining the exact URL of your report script - i.e.
http://www.foo.com/html_report.cgi
scans.bizsystems.net/other_sites.txt
or
www.bizsystems.net/downloads