[- use DBI; -] [- use POSIX; -] [- use Socket -] [- $req = shift; -] [# Lets look for UNIX Metacharacters in the query string from the browser #] [$ if $ENV{'QUERY_STRING'} =~ /([;\*\/'\$!#\(\)\[\]\{\}:'"])/ $] [- Execute ('error.html') -] [- exit -] [$ endif $] [- $LanChoice = $fdat{LanChoice}; -] [- chomp $LanChoice; -] [- $HostChoice = $fdat{HostChoice} -] [- chomp $HostChoice; -] [- $Event = $fdat{Event} -] [- chomp $Event; -] [$ if $Event eq "Inbnd" $] [- $TableName = "InBnd" -] [$ elsif $Event eq "Outbnd" $] [- $TableName = "OutBnd" -] [$ endif $] [- ($dsn) = "DBI:mysql:FireWatch"; -] [- $dsn .= ";mysql_read_default_file=./roll-sql.cnf"; -] [- $dbh = DBI->connect($dsn); -]
Event Count | Source Host | Source Port | Dest. Port | Protocol | |
[+ @row[0] +] | [- $ip =(inet_ntoa(pack"N", hex(@row[1]))) -] [- chomp $ip; -] [- $host = `(dig +short -x $ip)`; -] [- chomp $host; -] [$ if $host ne "" $][+ $ip +]   [+ $host +] | [$ else $][+ $ip +] Failed to Resolve | [$ endif $][+ @row[2] +] | [+ @row[3] +] | [+ @row[4] +] |