Snort mailing list archives

RE: Some PHP guru on Snort?


From: Steve Halligan <agent33 () geeksquad com>
Date: Tue, 4 Dec 2001 14:30:08 -0600

I know it's a VERY BIG off topic but well, here goes. I'm making a
little PHP script to count unique attacks from the alerts.ids file
generated by my snort installation.
I have done similar hashing voodoo with perl, but PHP seems to be a
little more reticent.
Thanks
Ivan Hernandez

Now, this is the script:

#***********************************************
<?
      include("config.php");

      $fp = fopen("$logs_path/alert.ids", "r");
      while (!feof($fp)) {
              $sign = fgets($fp,100);
              if (substr($sign,0,4)== "[**]") {
                      $count{$sign}++;
              } 
      }
      fclose($fp);
?>
#***********************************************

And the output says:
Warning: Undefined variable: count in c:\program files\apache
group\apache\htdocs\snortscan\x.php on line 8

is $count supposed to be the function count() or an array?
If the former it should be count($sign), if the latter it should be
$count[$sign]

-steve

_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: