{"id":2046,"date":"2019-02-17T16:39:57","date_gmt":"2019-02-17T15:39:57","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=2046"},"modified":"2022-11-20T15:08:57","modified_gmt":"2022-11-20T14:08:57","slug":"transparent-proxy-udp","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=2046","title":{"rendered":"Transparent proxy UDP"},"content":{"rendered":"<p>In a previous <a href=\"https:\/\/labalec.fr\/erwan\/?p=2032\" target=\"_blank\" rel=\"noopener\">article<\/a>, we had built a transparent proxy for tcp (outbound) connections.<\/p>\n<p>In short any tcp outbound connection on port_x would be redirected to ip:port_z.<\/p>\n<p>Main usage was to implement a transparent proxy for http traffic (applications would \u00ab\u00a0transparently\u00a0\u00bb be redirected to a proxy accepting \u00ab\u00a0intercepted\u00a0\u00bb traffic).<\/p>\n<p>This time, lets do the same for (outbound) UDP.<\/p>\n<p>One possible scenario : intercept all outbound dns traffic and redirect to another dns server.<\/p>\n<p>Syntax:<br \/>\n<code><br \/>\nproxy-udp 1.0 by erwan2212@gmail.com<br \/>\nproxy-udp original_port new_port new_ip [local]<br \/>\nremember that if you divert to a local app, this local app could be diverted as well.<br \/>\n<\/code><\/p>\n<p>Example : proxy-udp 53 53 192.168.1.144 local<br \/>\nWith a rogue dns server running locally (skip the &lsquo;local&rsquo; if the rogue server is running on another host).<\/p>\n<p>Note the warning about diverting to a local app.<br \/>\nFor instance, you could be running your local rogue server locally but then since this rogue server will also perform dns queries, you would end up in catch 22 situation.<br \/>\nPossible workarounds :<br \/>\n-have your rogue server \u00ab\u00a0escape\u00a0\u00bb the filter and use a remote udp port different than the filtered one (i.e something different than 53) OR a different protocol (i.e something different than UDP)<br \/>\n-review the code and filter on the original dns server<br \/>\n-review the code and exclude the dns server used by the rogue server<\/p>\n<p>Source code and binaries can be found on my <a href=\"https:\/\/github.com\/erwan2212\/windivert-fpc\" target=\"_blank\" rel=\"noopener\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous article, we had built a transparent proxy for tcp (outbound) connections. In short any tcp outbound connection on port_x would be redirected to ip:port_z. Main usage was to implement a transparent proxy for http traffic (applications would \u00ab\u00a0transparently\u00a0\u00bb be redirected to a proxy accepting \u00ab\u00a0intercepted\u00a0\u00bb traffic). This time, lets do the same <a href='https:\/\/labalec.fr\/erwan\/?p=2046' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[105],"class_list":["post-2046","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-windivert","category-1-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/2046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2046"}],"version-history":[{"count":9,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/2046\/revisions"}],"predecessor-version":[{"id":2393,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/2046\/revisions\/2393"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}