[Snort-devel] Stream5 issue

Arun Koshal akoshal04 at ...2499...
Sat Mar 28 00:34:40 EDT 2015


Hi,

I have written a dynamic preprocessor for inspecting some custom
application. This dynamic preprocessor depends on stream5 preprocessor from
getting the TCP stream. I am using snort in PCAP mode. I am facing
following very strange problems -

1. The data in the rebuilt stream given by stream5 does not match with the
TCP sequence number. For example - for a given TCP packet the sequence
number in packet (pkt->tcp_header->sequence) is 507351850, but the data in
pkt->payload is actually same as that of some old packet, having TCP
sequence number 507343162. This scenario happens in case there are lot of
packets getting dropped. I confirmed this with wireshark packet capture and
I have observed multiple such instances. I also noticed that I am getting
all the packets in the same buffer (pkt->payload remains same for all
packets). So it seems like that I am getting a new packet with new header
but old data. If I configure the pcap buffer_size as 512MB, the packets do
not drop and this problem does not happen.

2. The second problem that I faced was with the pcap snap_len. In my setup,
I had snort running with default pcap snap_len. I noticed that snort was
not receiving packets having 1448 bytes data (1500 bytes, excluding
Ethernet header). On reducing the MTU of the traffic generator from 1500 to
1484, Snort started receiving those packets. As a workaround, I increased
the snap_len in sfdaq.c to 1546. Is this behaviour correct?

It would be really great if someone can provide some inputs on these issues.

Thanks and regards.
Arun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20150328/4a36a5ac/attachment.html>


More information about the Snort-devel mailing list