<div dir="ltr">Hi,<div><br></div><div><div>I am going through UDP events bro generates.</div><div>I have a one use case, for example, UDP transaction is initiated by a control point to auto discover devices present in the network. Control point broadcasts, UDP request for lets say, IP1(192.168.1.1)-&gt;Broadcast(192.168.1.255)-&gt;SP(54632-&gt;DP(3702)-&gt;UDP and the contents exchanged in the request.</div><div>Devices who receives those broadcast requests, responds with unicast message saying I am the one you are looking for, IP2(192.168.1.2)-&gt;IP1(192.168.1.1)-&gt;DP(3702)-&gt;SP(54632)-&gt;UDP and the contents exchanged in the response.</div><div><br></div><div>There will be two different connections for bro because of two different 5 tuples.</div><div>What I wish to extract is the raw content exchanged over both request and response packet.</div><div>I came across udp_content event. After looking in the implementation, configuration supports only destination ports to be checked. But for response packet, bro has maintained a different connection in which source port is the one I am interested in. Flow also will not be flipped by bro because the port is not added in <b>&quot;likely_server_ports&quot;</b>. Also I tried adding port 3702 in <b>&quot;likely_server_ports&quot; </b>list, bro still did not raise udp_content event.</div><div><br></div><div>Is there any way I can extract UDP contents from both request(no problem extracting request content) and response without adding ports in &quot;<b>likely_server_ports&quot; </b>list??</div><div>Or</div><div>Even when I am adding those ports in the list, I don&#39;t get the event.</div></div><div><br></div><div><br></div><div><b><u>Here&#39;s how the configuration looks like,</u></b></div><div>const udp_content_delivery_ports_orig: table[port] of bool = {[3702/udp] = T} &amp;redef;<br>const udp_content_delivery_ports_resp: table[port] of bool = {[3702/udp] = T} &amp;redef;<br></div><div><div>const udp_content_deliver_all_orig = F &amp;redef;<br>const udp_content_deliver_all_resp = F &amp;redef;  <br></div><div></div></div><div><br></div><div><b>test.bro</b></div><div>const ports = {37020/udp, 1900/udp, 3702/udp};<br>redef likely_server_ports += { ports };<br></div><div>event udp_contents(c: connection, is_orig: bool, contents: string)<br>{<br>    print &quot;-----------------------------------------------------&quot;;<br>    print &quot;Contents:&quot;, c$id, is_orig, |contents|, contents;<br>    print &quot;-----------------------------------------------------&quot;;<br>}<br></div><div><br></div><div>Output:</div><div>-----------------------------------------------------<br>Contents:, [orig_h=10.113.14.94, orig_p=50818/udp, resp_h=239.255.255.250, resp_p=3702/udp], T, 488, &lt;real content&gt;<br>-----------------------------------------------------<br>Bro did not raise an event for response packet.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><b><u>When I change configuration to,</u></b></div><div>const udp_content_deliver_all_orig = T &amp;redef;<br>const udp_content_deliver_all_resp = T &amp;redef;  <br></div><div><br></div><div><b>Output:</b></div><div>-----------------------------------------------------<br>Contents:, [orig_h=10.113.14.94, orig_p=50818/udp, resp_h=239.255.255.250, resp_p=3702/udp], T, 488, &lt;real content&gt;<br>-----------------------------------------------------<br></div><div>-----------------------------------------------------<br>Contents:, [orig_h=10.113.14.94, orig_p=50818/udp, resp_h=10.113.14.197, resp_p=3702/udp], F, 3289, &lt;real content&gt;<br>-----------------------------------------------------  <br></div><div><br></div><div>I got event for both request and response.</div><div><br></div><div><br></div><div>What am I doing wrong?</div><div><br></div><div><br></div><div>Thanks and Regards,</div><div>Nabil</div><div>Phone: +91 81477 17034</div></div>