Closed AlyaGomaa closed 1 year ago
@AlyaGomaa , very nice catch!
i guess this means that suricata is the one doing something wrong, and not pycommunityid?
It looks like, yes. I moved it over to the Suricata project: https://redmine.openinfosecfoundation.org/issues/6276 https://github.com/OISF/suricata/pull/9399/files
(I don't have permissions to close the issue - maybe you could yourself?)
Hey thanks for your help! will close.
Thanks again for this from me too — very helpful. Your finding made me realize an omission in the test data over in https://github.com/corelight/community-id-spec — the test traces have only individual flows (for example just one for IPv6 traffic), so they don't fully cover the endpoint-flipping logic if you only report per-flow Community IDs. I remember briefly comparing the Zeek and Suricata implementations with those traces and, seeing that they matched, moving on. But that was very incomplete...
hey @ckreibich we've all been there, glad i could help!
Issue
I have a pcap, when i run suricata on it, it produces flows with cids when I run zeek on it, and generate the cid of each zeek flow using pycommunityid library, some flows don't have the same cids produced by suricata
Steps to reproduce
here's the pcap i used: https://github.com/stratosphereips/StratosphereLinuxIPS/blob/develop/dataset/test7-malicious.pcap
i ran suricata using the following command on it
suricata -r test7-malicious.pcap
i ran zeek using the following cmd on it
zeek -C -r test7-malicious.pcap
for each line in the zeek conn.log output i ran the following script to get the cid of each flow
now for example this flow produced by suricata:
is the same as this flow produced by zeek:
however, pycommunity id gives me this cid: 1:Ij3wBn8AhEgwlNMz41h3vXi0yL8= which doesn't match the one produced by suricata for the same flow
update
when I tried generating the cid using zeek's corelight plugin
Corelight/CommunityID
, I got the same uid as pycommunityid libraryi guess this means that suricata is the one doing something wrong, and not pycommunityid?