[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oisf-users
Subject:    Re: [Oisf-users] Issue with having Suricata alert successfully on successive creation of alert condi
From:       bakul khanna <bakulkhanna () gmail ! com>
Date:       2014-09-17 20:49:46
Message-ID: CA+fzBArJ5vYW_mJH6iA5chDHNPHg+QQLiE_06OEgyhru-OcSbQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks for your suggestions.

The problem I was seeing with "successive alerts on  tcpreplay of a pcap
file" turned out to be a networking issue that caused all packets in the
pcap file to not be delivered to the Suricata machine on successive
tcpreplays, although on the first tcpreplay all packets in the pcap file
were delivered successfully. Waiting 300s (5 min) after the first tcpreplay
cleared this networking condition and allowed all packets in the pcap file
to be delivered successfully again.

I confirmed this by replaying the pcap files from the same machine that
Suricata was running on and observed successive alerts (earlier when I had
tried this test and reported that it didn't work, I believe I had not yet
lowered the tcp-timeouts).

Thanks,

-Bakul



On Mon, Sep 15, 2014 at 1:01 PM, Peter Manev <petermanev@gmail.com> wrote:

> On Mon, Sep 15, 2014 at 6:20 PM, bakul khanna <bakulkhanna@gmail.com>
> wrote:
> > I tried both (feeding the pcap file from a different machine as well as
> > feeding it from the same machine running Suricata).
> >
> > Some more answers/observations:
> > 1. I am not using unix-socket
> > 2. Regardless of the tcp timeout configurations, I cannot get the
> > sid=2016808 to occur closer than 5 min in time.
> >
>
> Two suggestions to consider:
> 1 - is all NIC offloading disabled? (when you try it on the same machine)
> 2 - decrease the "chunk size" config parameter in suricata.yaml.
>
> thanks
>
> > Thanks.
> >
> > On Mon, Sep 15, 2014 at 9:41 AM, Peter Manev <petermanev@gmail.com>
> wrote:
> >>
> >> On Sun, Sep 14, 2014 at 5:22 PM, bakul khanna <bakulkhanna@gmail.com>
> >> wrote:
> >> > Thanks Peter.
> >> >
> >> > Here are the timeouts from my suricata.yaml file:
> >> >
> >> > default:
> >> >     new: 30
> >> >     established: 300
> >> >     closed: 0
> >> >     emergency-new: 10
> >> >     emergency-established: 100
> >> >     emergency-closed: 0
> >> > tcp:
> >> >     new: 10
> >> >     established: 10
> >> >     closed: 10
> >> >     emergency-new: 10
> >> >     emergency-established: 10
> >> >     emergency-closed: 10
> >> >
> >> > I invoke suricata using the following command:
> >> > suricata -D -c /etc/suricata/suricata.yaml -i eth0 --pidfile
> >> > /var/run/suricata.pid
> >> >
> >> > Following the successful alert for sid=2016808, I also immediately see
> >> > the
> >> > following alerts:
> >> > 2210032 - ..Suricata Stream FIN1 F1with wrong seq... (sometimes)
> >> > 2210045 - ..Suricata stream packet with invalid ack..
> >> > 2210046 - ..Suricata stream shutdown RST invalid ack...
> >> >
> >> > Also, I noticed that I don't have to wait an hour to generate
> successful
> >> > 2016808 alerts, I can now generate successive alerts if I wait to
> 10-15
> >> > min.
> >> >
> >> > Thanks,
> >> >
> >> > -Bakul
> >> >
> >> >
> >> >
> >>
> >> How do you feed the pcaps for reading - tcpreplay?
> >> Is it from another machine or from the same one that has Suricata
> running?
> >>
> >> thanks
> >>
> >> >
> >> >
> >> >
> >> > On Sun, Sep 14, 2014 at 5:37 AM, Peter Manev <petermanev@gmail.com>
> >> > wrote:
> >> >>
> >> >> On Sun, Sep 14, 2014 at 2:35 AM, bakul khanna <bakulkhanna@gmail.com
> >
> >> >> wrote:
> >> >> > I am experimenting with having Suricata generate an alert, for an
> ET
> >> >> > rule
> >> >> > (sid=2016808), when I perform a  tcpreplay of a pcap file for this
> >> >> > rule.
> >> >> >
> >> >> > The first time after a Suricata bringup, it does generate the
> alert.
> >> >> > On
> >> >> > subsequent replays of the same pcap file it does not generate the
> >> >> > alert.
> >> >> > However if I wait a long time (I tried an hour) and then replay the
> >> >> > pcap
> >> >> > file, Suricata successfully alerts then. There is no threshold
> limits
> >> >> > applied to this rule.
> >> >> >
> >> >> > I tried reducing the flow and TCP timeouts in suricata.yaml, but
> that
> >> >> > didn't
> >> >> > seem to help.
> >> >> >
> >> >> > Any suggestion on how I can get Suricata to alert successfully on
> >> >> > successive
> >> >> > tcpreplays of this pcap file?
> >> >> >
> >> >> > Thanks,
> >> >> >
> >> >> > -Bakul
> >> >> >
> >> >> > _______________________________________________
> >> >>
> >> >>
> >> >>
> >> >> Hi,
> >> >>
> >> >> The way you describe the problem it seems TCP timeouts is the
> problem.
> >> >> I can't be sure though.
> >> >>
> >> >> Can you please provide your timeout values as set up in yaml and the
> >> >> set up you use - how do you start Suricata, do you use  unix
> >> >> socket(most likely the case)...so on?
> >> >>
> >> >>
> >> >>
> >> >> thanks
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Regards,
> >> >> Peter Manev
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Regards,
> >> Peter Manev
> >
> >
>
>
>
> --
> Regards,
> Peter Manev
>

[Attachment #5 (text/html)]

<div dir="ltr">Thanks for your suggestions.<div><br></div><div>The problem I was \
seeing with &quot;successive alerts on   tcpreplay of a pcap file&quot; turned out to \
be a networking issue that caused all packets in the pcap file to not be delivered to \
the Suricata machine on successive tcpreplays, although on the first tcpreplay all \
packets in the pcap file were delivered successfully. Waiting 300s (5 min) after the \
first tcpreplay cleared this networking condition and allowed all packets in the pcap \
file to be delivered successfully again.  </div><div><br></div><div>I confirmed this \
by replaying the pcap files from the same machine that Suricata was running on and \
observed successive alerts (earlier when I had tried this test and reported that it \
didn&#39;t work, I believe I had not yet lowered the tcp-timeouts).  \
</div><div><br></div><div>Thanks,</div><div><br></div><div>-Bakul<br><div><br></div><div><br></div></div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 15, 2014 at 1:01 PM, \
Peter Manev <span dir="ltr">&lt;<a href="mailto:petermanev@gmail.com" \
target="_blank">petermanev@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">On Mon, Sep 15, 2014 at 6:20 PM, bakul khanna &lt;<a \
href="mailto:bakulkhanna@gmail.com">bakulkhanna@gmail.com</a>&gt; wrote:<br> &gt; I \
tried both (feeding the pcap file from a different machine as well as<br> &gt; \
feeding it from the same machine running Suricata).<br> &gt;<br>
&gt; Some more answers/observations:<br>
&gt; 1. I am not using unix-socket<br>
&gt; 2. Regardless of the tcp timeout configurations, I cannot get the<br>
&gt; sid=2016808 to occur closer than 5 min in time.<br>
&gt;<br>
<br>
Two suggestions to consider:<br>
1 - is all NIC offloading disabled? (when you try it on the same machine)<br>
2 - decrease the &quot;chunk size&quot; config parameter in suricata.yaml.<br>
<br>
thanks<br>
<br>
&gt; Thanks.<br>
&gt;<br>
&gt; On Mon, Sep 15, 2014 at 9:41 AM, Peter Manev &lt;<a \
href="mailto:petermanev@gmail.com">petermanev@gmail.com</a>&gt; wrote:<br> \
&gt;&gt;<br> &gt;&gt; On Sun, Sep 14, 2014 at 5:22 PM, bakul khanna &lt;<a \
href="mailto:bakulkhanna@gmail.com">bakulkhanna@gmail.com</a>&gt;<br> &gt;&gt; \
wrote:<br> &gt;&gt; &gt; Thanks Peter.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Here are the timeouts from my suricata.yaml file:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; default:<br>
&gt;&gt; &gt;        new: 30<br>
&gt;&gt; &gt;        established: 300<br>
&gt;&gt; &gt;        closed: 0<br>
&gt;&gt; &gt;        emergency-new: 10<br>
&gt;&gt; &gt;        emergency-established: 100<br>
&gt;&gt; &gt;        emergency-closed: 0<br>
&gt;&gt; &gt; tcp:<br>
&gt;&gt; &gt;        new: 10<br>
&gt;&gt; &gt;        established: 10<br>
&gt;&gt; &gt;        closed: 10<br>
&gt;&gt; &gt;        emergency-new: 10<br>
&gt;&gt; &gt;        emergency-established: 10<br>
&gt;&gt; &gt;        emergency-closed: 10<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I invoke suricata using the following command:<br>
&gt;&gt; &gt; suricata -D -c /etc/suricata/suricata.yaml -i eth0 --pidfile<br>
&gt;&gt; &gt; /var/run/suricata.pid<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Following the successful alert for sid=2016808, I also immediately \
see<br> &gt;&gt; &gt; the<br>
&gt;&gt; &gt; following alerts:<br>
&gt;&gt; &gt; 2210032 - ..Suricata Stream FIN1 F1with wrong seq... (sometimes)<br>
&gt;&gt; &gt; 2210045 - ..Suricata stream packet with invalid ack..<br>
&gt;&gt; &gt; 2210046 - ..Suricata stream shutdown RST invalid ack...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Also, I noticed that I don&#39;t have to wait an hour to generate \
successful<br> &gt;&gt; &gt; 2016808 alerts, I can now generate successive alerts if \
I wait to 10-15<br> &gt;&gt; &gt; min.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; -Bakul<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; How do you feed the pcaps for reading - tcpreplay?<br>
&gt;&gt; Is it from another machine or from the same one that has Suricata \
running?<br> &gt;&gt;<br>
&gt;&gt; thanks<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Sun, Sep 14, 2014 at 5:37 AM, Peter Manev &lt;<a \
href="mailto:petermanev@gmail.com">petermanev@gmail.com</a>&gt;<br> &gt;&gt; &gt; \
wrote:<br> &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Sun, Sep 14, 2014 at 2:35 AM, bakul khanna &lt;<a \
href="mailto:bakulkhanna@gmail.com">bakulkhanna@gmail.com</a>&gt;<br> &gt;&gt; \
&gt;&gt; wrote:<br> &gt;&gt; &gt;&gt; &gt; I am experimenting with having Suricata \
generate an alert, for an ET<br> &gt;&gt; &gt;&gt; &gt; rule<br>
&gt;&gt; &gt;&gt; &gt; (sid=2016808), when I perform a   tcpreplay of a pcap file for \
this<br> &gt;&gt; &gt;&gt; &gt; rule.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; The first time after a Suricata bringup, it does generate the \
alert.<br> &gt;&gt; &gt;&gt; &gt; On<br>
&gt;&gt; &gt;&gt; &gt; subsequent replays of the same pcap file it does not generate \
the<br> &gt;&gt; &gt;&gt; &gt; alert.<br>
&gt;&gt; &gt;&gt; &gt; However if I wait a long time (I tried an hour) and then \
replay the<br> &gt;&gt; &gt;&gt; &gt; pcap<br>
&gt;&gt; &gt;&gt; &gt; file, Suricata successfully alerts then. There is no threshold \
limits<br> &gt;&gt; &gt;&gt; &gt; applied to this rule.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; I tried reducing the flow and TCP timeouts in suricata.yaml, \
but that<br> &gt;&gt; &gt;&gt; &gt; didn&#39;t<br>
&gt;&gt; &gt;&gt; &gt; seem to help.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Any suggestion on how I can get Suricata to alert successfully \
on<br> &gt;&gt; &gt;&gt; &gt; successive<br>
&gt;&gt; &gt;&gt; &gt; tcpreplays of this pcap file?<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Thanks,<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; -Bakul<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The way you describe the problem it seems TCP timeouts is the \
problem.<br> &gt;&gt; &gt;&gt; I can&#39;t be sure though.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Can you please provide your timeout values as set up in yaml and \
the<br> &gt;&gt; &gt;&gt; set up you use - how do you start Suricata, do you use   \
unix<br> &gt;&gt; &gt;&gt; socket(most likely the case)...so on?<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; thanks<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Regards,<br>
&gt;&gt; &gt;&gt; Peter Manev<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
<span class="HOEnZb"><font color="#888888">&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Regards,<br>
&gt;&gt; Peter Manev<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Regards,<br>
Peter Manev<br>
</font></span></blockquote></div><br></div>



_______________________________________________
Suricata IDS Users mailing list: oisf-users@openinfosecfoundation.org
Site: http://suricata-ids.org | Support: http://suricata-ids.org/support/
List: https://lists.openinfosecfoundation.org/mailman/listinfo/oisf-users
OISF: http://www.openinfosecfoundation.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic