Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Snort-users] How to enable mail notication?

0 views
Skip to first unread message

Glenn E. Bailey III

unread,
Jan 23, 2002, 11:24:40 AM1/23/02
to
Here is a quick and really dirty script I run, you have
to setup snort to log via syslog and setup syslog to log
snort alerts to a seperate file .. Only good if you have
a small site really, and like I said, it's dirty:

#!/usr/bin/perl

use strict;

my $snort_log = '/var/log/snort.log'; # location of snort.log generated
by syslog
my $snort_log_old = '/var/log/snort/old/snort'; # path to dir where to store
old logs
my $notify_log = '/var/log/snort/notify.log'; # path to log where to log
notifications
my $email = 'your...@blah.com'; # guess what this is ;-)

open(SNORT_LOG, "$snort_log");

if (! <SNORT_LOG>) {
exit();
}

else {
system("mail $email -s \"Snort alert\" < $snort_log");

open(NOTIFY, ">>$notify_log");
my $localtime = localtime();
print NOTIFY "$localtime - Alert sent to $email\n";
close NOTIFY;

my $time = time();
system("mv $snort_log $snort_log_old.$time");
system("kill -SIGHUP \`cat /var/run/syslogd.pid\`");
exit();
}

-----Original Message-----
From: snort-us...@lists.sourceforge.net
[mailto:snort-us...@lists.sourceforge.net]On Behalf Of Erek Adams
Sent: Wednesday, January 23, 2002 9:50 AM
To: My Security
Cc: snort...@lists.sourceforge.net
Subject: Re: [Snort-users] How to enable mail notication?


On Wed, 23 Jan 2002, My Security wrote:

> I would like to enable sending mail if there is alert
> on my email address.
>
> How will I be able to configure this option to the
> snort.conf.

You can't.

http://www.snort.org/docs/faq.html#5.7

Also read the users manual from the Documentation page. The rest of the FAQ
won't hurt either....

-----
Erek Adams
Nifty-Type-Guy
TheAdamsFamily.Net


_______________________________________________
Snort-users mailing list
Snort...@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


_______________________________________________
Snort-users mailing list
Snort...@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

My Security

unread,
Jan 23, 2002, 1:12:14 PM1/23/02
to
Thanks for your feedback. I will try this later on.

--- Matt Kettler <mket...@evi-inc.com> wrote:
>
> from the snort FAQ:
> -----------
> 5.7 --faq-- --snort-- --faq-- --snort-- --faq--
> --snort-- --faq--
>
> Q: How do I get snort to e-mail me alerts? A: Log to
> syslog and use swatch
> or logcheck.
> -----------
>
> See FAQ 5.9 for why doing computationally expensive
> things in the logging
> chain of snort creates security holes. (It is about
> invoking processes in
> the log chain, but I suspect doing a SMTP client in
> the log chain is pretty
> bad too, for the very same reasons.)
>
>
> At 06:58 AM 1/23/2002 -0800, My Security wrote:
> >Hi there!


> >
> >I would like to enable sending mail if there is
> alert
> >on my email address.
> >
> >How will I be able to configure this option to the
> >snort.conf.
> >

> >Thanks in advance.
>


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

Michael Aylor

unread,
Jan 23, 2002, 8:38:22 PM1/23/02
to
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1A42E.9BA44710
Content-Type: text/plain;
charset="iso-8859-1"

This is fantastic, been meaning to figure out how to do this...

Can you provide a glimpse of what your syslog.conf file looks like?


Mike

#!/usr/bin/perl

use strict;

open(SNORT_LOG, "$snort_log");

> I would like to enable sending mail if there is alert
> on my email address.
>
> How will I be able to configure this option to the
> snort.conf.

You can't.

http://www.snort.org/docs/faq.html#5.7

Also read the users manual from the Documentation page. The rest of the FAQ
won't hurt either....

-----
Erek Adams
Nifty-Type-Guy
TheAdamsFamily.Net

_______________________________________________
Snort-users mailing list
Snort...@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


_______________________________________________
Snort-users mailing list
Snort...@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


CONFIDENTIALITY NOTICE:

************************************************************************

The information contained in this ELECTRONIC MAIL transmission
is confidential. It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s). If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.

************************************************************************

------_=_NextPart_001_01C1A42E.9BA44710
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Snort-users] How to enable mail notication?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>This is fantastic, been meaning to figure out how to do t=
his...</FONT>
</P>

<P><FONT SIZE=3D2>Can you provide a glimpse of what your syslog.conf file l=
ooks like?&nbsp; </FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Mike</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Glenn E. Bailey III [<A HREF=3D"mailto:gbailey@spr=
ocketdata.com">mailto:gba...@sprocketdata.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, January 23, 2002 9:58 AM</FONT>
<BR><FONT SIZE=3D2>To: snort...@lists.sourceforge.net</FONT>
<BR><FONT SIZE=3D2>Subject: RE: [Snort-users] How to enable mail notication=
?</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Here is a quick and really dirty script I run, you have</=
FONT>
<BR><FONT SIZE=3D2>to setup snort to log via syslog and setup syslog to log=
</FONT>
<BR><FONT SIZE=3D2>snort alerts to a seperate file .. Only good if you have=
</FONT>
<BR><FONT SIZE=3D2>a small site really, and like I said, it's dirty:</FONT>
</P>

<P><FONT SIZE=3D2>#!/usr/bin/perl</FONT>
</P>

<P><FONT SIZE=3D2>use strict;</FONT>
</P>

<P><FONT SIZE=3D2>my $snort_log&nbsp;&nbsp;&nbsp;&nbsp; =3D '/var/log/snort=
.log'; # location of snort.log generated</FONT>
<BR><FONT SIZE=3D2>by syslog</FONT>
<BR><FONT SIZE=3D2>my $snort_log_old =3D '/var/log/snort/old/snort'; # path=
to dir where to store</FONT>
<BR><FONT SIZE=3D2>old logs</FONT>
<BR><FONT SIZE=3D2>my $notify_log&nbsp;&nbsp;&nbsp; =3D '/var/log/snort/not=
ify.log'; # path to log where to log</FONT>
<BR><FONT SIZE=3D2>notifications</FONT>
<BR><FONT SIZE=3D2>my $email&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; =3D 'your...@blah.com'; # guess what this is ;-)</FONT>
</P>

<P><FONT SIZE=3D2>open(SNORT_LOG, &quot;$snort_log&quot;);</FONT>
</P>

<P><FONT SIZE=3D2>if (! &lt;SNORT_LOG&gt;) {</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit();</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
</P>

<P><FONT SIZE=3D2>else {</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; system(&quot;=
mail $email -s \&quot;Snort alert\&quot; &lt; $snort_log&quot;);</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open(NOTIFY, &=
quot;&gt;&gt;$notify_log&quot;);</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $localtime=
=3D localtime();</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print NOTIFY =
&quot;$localtime - Alert sent to $email\n&quot;;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; close NOTIFY;=
</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $time =3D t=
ime();</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; system(&quot;=
mv $snort_log $snort_log_old.$time&quot;);</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; system(&quot;=
kill -SIGHUP \`cat /var/run/syslogd.pid\`&quot;);</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit();</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: snort-us...@lists.sourceforge.net</FONT>
<BR><FONT SIZE=3D2>[<A HREF=3D"mailto:snort-us...@lists.sourceforge.n=
et">mailto:snort-us...@lists.sourceforge.net</A>]On Behalf Of Erek Ad=
ams</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, January 23, 2002 9:50 AM</FONT>
<BR><FONT SIZE=3D2>To: My Security</FONT>
<BR><FONT SIZE=3D2>Cc: snort...@lists.sourceforge.net</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Snort-users] How to enable mail notication=
?</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>On Wed, 23 Jan 2002, My Security wrote:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; I would like to enable sending mail if there is aler=
t</FONT>
<BR><FONT SIZE=3D2>&gt; on my email address.</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; How will I be able to configure this option to the<=
/FONT>
<BR><FONT SIZE=3D2>&gt; snort.conf.</FONT>
</P>

<P><FONT SIZE=3D2>You can't.</FONT>
</P>

<P><FONT SIZE=3D2><A HREF=3D"http://www.snort.org/docs/faq.html#5.7" TARGET=
=3D"_blank">http://www.snort.org/docs/faq.html#5.7</A></FONT>
</P>

<P><FONT SIZE=3D2>Also read the users manual from the Documentation page.&n=
bsp; The rest of the FAQ</FONT>
<BR><FONT SIZE=3D2>won't hurt either....</FONT>
</P>

<P><FONT SIZE=3D2>-----</FONT>
<BR><FONT SIZE=3D2>Erek Adams</FONT>
<BR><FONT SIZE=3D2>Nifty-Type-Guy</FONT>
<BR><FONT SIZE=3D2>TheAdamsFamily.Net</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Snort-users mailing list</FONT>
<BR><FONT SIZE=3D2>Snort...@lists.sourceforge.net</FONT>
<BR><FONT SIZE=3D2>Go to this URL to change user options or unsubscribe:</F=
ONT>
<BR><FONT SIZE=3D2><A HREF=3D"https://lists.sourceforge.net/lists/listinfo/=
snort-users" TARGET=3D"_blank">https://lists.sourceforge.net/lists/listinfo=
/snort-users</A></FONT>
<BR><FONT SIZE=3D2>Snort-users list archive:</FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.geocrawler.com/redir-sf.php3?list=
=3Dsnort-users" TARGET=3D"_blank">http://www.geocrawler.com/redir-sf.php3?l=
ist=3Dsnort-users</A></FONT>
</P>
<BR>

<P><FONT SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Snort-users mailing list</FONT>
<BR><FONT SIZE=3D2>Snort...@lists.sourceforge.net</FONT>
<BR><FONT SIZE=3D2>Go to this URL to change user options or unsubscribe:</F=
ONT>
<BR><FONT SIZE=3D2><A HREF=3D"https://lists.sourceforge.net/lists/listinfo/=
snort-users" TARGET=3D"_blank">https://lists.sourceforge.net/lists/listinfo=
/snort-users</A></FONT>
<BR><FONT SIZE=3D2>Snort-users list archive:</FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.geocrawler.com/redir-sf.php3?list=
=3Dsnort-users" TARGET=3D"_blank">http://www.geocrawler.com/redir-sf.php3?l=
ist=3Dsnort-users</A></FONT>
</P>

<CODE><FONT SIZE=3D3><BR>
<BR>
CONFIDENTIALITY NOTICE:<BR>
<BR>
************************************************************************<BR>
<BR>
The information contained in this ELECTRONIC MAIL transmission<BR>
is confidential. It may also be privileged work product or proprietary<BR>
information. This information is intended for the exclusive use of the<BR>
addressee(s). If you are not the intended recipient, you are hereby<BR>
notified that any use, disclosure, dissemination, distribution [other<BR>
than to the addressee(s)], copying or taking of any action because<BR>
of this information is strictly prohibited.<BR>
<BR>
************************************************************************<BR>
</FONT></CODE></BODY>
</HTML>
------_=_NextPart_001_01C1A42E.9BA44710--

0 new messages