Hello,
I already had the opportunity to expose this doubt here in the forum but the answer I got was not clear enough.
Moreover, I also discussed this matter (by private message) with @jufajardini who helped me in some sense and suggested I should expose this doubt again in the general forum.
So the doubt arose around this rule:
alert udp $EXTERNAL_NET any → $HOME_NET 5060 (msg: "ET VOIP INVITE Message Flood UDP"; content: "INVITE"; depth:6; threshold: type both , track by_src, count 100, seconds 60; reference:url,[doc. emergingthreats.net/2009698;](http://doc.emergingthreats.net/2009698;) classtype:tryted-dos; sid:2009698; rev:1; metadata:created_at 2010_07_30, updated_at 2010_07_30;)
I am aware that this rule throws an alert whenever the number of packets “INVITE” exceeds 100 within 1 minute.
However, checking the alerts, I notice that the number of packets is always 1:
{"timestamp":"2022-05-26T13:03:02. 367332+0100","flow_id":1139748701117156,"in_iface":"enp2s0f1","event_type":"alert","vlan":[x],"src_ip":"x","src_port": 5218,"dest_ip": "x", "dest_port":5060, "proto": "UDP", "community_id": "1:l+MotXIB6yBwded2+MzymYVNPus=", "alert":{"action": "allowed", "gid": 1, "signature_id": 2009698, "rev":1, "signature": "ET VOIP INVITE Message Flood UDP", "category": "Attempted Denial of Service", "severity": 1, "metadata":{"created_at":["2010_07_30"], "updated_at":["2010_07_30"]}}, "sip":{"method": "INVITE", "uri": "sip:100@x", "version": "SIP/2. 0","request_line":"INVITE sip:100@x SIP/2.0"},"app_proto":"sip","flow":{"pkts_toserver":1,"pkts_toclient":0,"bytes_toserver":435,"bytes_toclient":0,"start":"2022-05-26T13:03:02.367332+0100"}"stream":0
@jufajardini suggested that
“since we are dealing with UDP here, and these are ‘INVITE’ packets, I think Suri might consider each new packet to be part of a new stream, since Suri will only consider a UDP stream to be established after there are packets flowing in both directions. What I think is happening is that Suri is detecting a lot of traffic like that, but the threshold causes you to only see very few alerts. If the destination changes, that is considered something new, since you are tracking by src, right, so these will trigger if Suri sees 100 within 60 seconds, if I remember the rule correctly.”
One way to test this is to create a similar rule, but changing the threshold variables, and see how that affects the alerts it sees. If you don’t use both types, but type threshold, maybe you see more alerts/packets for the same stream?
After testing the proposed solution, the problem remained. The alerts only show up 1 "packet_toserver"
. I cannot understand why this is happening and would appreciate an explanation if this is normal behavior
Sorry for the long post.