netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Snooping expected connections in a user CT helper
@ 2016-08-17  4:51 Kevin Cernekee
  2016-08-18  1:12 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Cernekee @ 2016-08-17  4:51 UTC (permalink / raw)
  To: netfilter-devel, ashley.hughes

Hi,

I am trying to extend the ssdp user helper in conntrackd to handle
event subscriptions on a UPnP control point.  The flow looks like
this:

1) Outbound multicast M-SEARCH packet (dst: 1900/udp)
 - Create expectation for unicast reply from <any host> to source port

2) Inbound unicast reply (there may be several of these from different devices)
 - Find the device's URL, e.g.
   LOCATION: http://192.168.1.123:1400/xml/device_description.xml
 - Create expectation to track connections to this host:port (tcp)

3) Outbound connection to device's web server (there will be several of these)
 - Watch for a SUBSCRIBE request
 - Find the control point's callback URL, e.g.
   CALLBACK: <http://192.168.1.124:3500/notify>
 - Create expectation to open up inbound connections to this host:port

4) Inbound connection to control point's web server
 - Once this is complete, the subscription should work

So, all of the port numbers except 1900 are dynamic, and thus each
stage depends on the result of the previous stage.  Therefore I need
the callback to inspect the traffic for stages (1)-(3).

Currently, ssdp_helper_cb() only gets called for stage (1).  Is there
something I can do when creating the expectation to tell netfilter
that I would like to receive callbacks when the unicast reply from (2)
is received?

Alternatively, is there an iptables rule that I should be creating for
this purpose?  I tried this:

    iptables -t raw -I INPUT -m helper --helper ssdp -j CT --helper ssdp

but `-m helper` did not work in the raw table, and `-j CT` did not
work in the filter table.  `-m state --state RELATED` also did not
work in the raw table.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-09 10:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17  4:51 Snooping expected connections in a user CT helper Kevin Cernekee
2016-08-18  1:12 ` Pablo Neira Ayuso
2016-08-23  3:34   ` Kevin Cernekee
2016-08-23 15:36     ` Pablo Neira Ayuso
2016-09-01 23:47       ` Kevin Cernekee
2016-09-08 22:02         ` Kevin Cernekee
2016-09-08 22:18           ` Pablo Neira Ayuso
2016-09-09 10:47             ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).