{"id":10,"date":"2019-06-14T17:21:00","date_gmt":"2019-06-14T16:21:00","guid":{"rendered":"https:\/\/increasec.com\/?p=10"},"modified":"2022-07-20T14:29:19","modified_gmt":"2022-07-20T18:29:19","slug":"outbound-filtering","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=10","title":{"rendered":"Outbound Filtering"},"content":{"rendered":"\n<p>Outbound Port filtering is a simple method to prevent users from accidentally giving away their credentials.<\/p>\n\n\n\n<p>Scenario:<br> BadGuy sends a phishing email including a link to an internet server owned by BadGuy.<br> User in your network is fooled into clicking on the link which is in the format \\\\server.LooksLikeMyDomain.NotReally\\ShareName  <br> the users computer gladly reaches outside your network, onto the internet and tries to authenticate  <br> BadServerSays:  I need to authenticate you, whats your password<br> TrustingComputerSays:  This is my password, Am I authenticated?<br> BadServerSays:  Why yes, thanks for giving me your password, SUCKER!<\/p>\n\n\n\n<p>Someone is going to &#8220;correct&#8221; me and say that its a password HASH that gets sent, but since the BadGuy controls the server he can ask the user to hash an empty string.<\/p>\n\n\n\n<p>The easy solution is to block the ports that make this possible.  This won&#8217;t affect internal authentication as that doesn&#8217;t go through a firewall. <\/p>\n\n\n\n<p>You can test if you are vulnerable by clicking the links below.  (this is a test only and doesn&#8217;t give away any credentials)  If you are vulnerable a webpage will be displayed titled &#8220;Outgoing port tester&#8221;<br> <a href=\"http:\/\/portquiz.net:135\/\">http:\/\/portquiz.net:135\/<\/a><br> <a href=\"http:\/\/portquiz.net:137\/\">http:\/\/portquiz.net:137\/<\/a><br> <a href=\"http:\/\/portquiz.net:139\/\">http:\/\/portquiz.net:139\/<\/a><\/p>\n\n\n\n<p>The browser test is blocked in Firefox, Partially in Chrome<br> But works great in M$ Edge or IE (you&#8217;re not still using IE, right?)<br> The portquiz page gives some alternate methods of testing.<\/p>\n\n\n\n<p>How to fix; put a rule in your firewall that blocks tcp ports 135-139 outbound.  This process will be different for each manufacturer.  Pfsense process is <a href=\"https:\/\/www.informaticar.net\/how-to-define-firewall-rules-on-pfsense\/\">here <\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>DNS port 53 is also commonly used to ex-filtrate data out of a compromised network.  I recommend filtering UDP 53 and only allowing a pre-defined list of DNS servers.   <\/p>\n\n\n\n<p>I manage a lot of Fortigate firewalls so i have some rules I paste into the CLI<\/p>\n\n\n\n<p>config firewall address<br>edit &#8220;DNS_Fortinet1&#8221;<br>set subnet 96.45.45.45 255.255.255.255<br>next<br>edit &#8220;DNS_Fortinet2&#8221;<br>set subnet 96.45.46.46 255.255.255.255<br>next<br>edit &#8220;DNS_Cisco1&#8221;<br>set subnet 208.67.222.222 255.255.255.255<br>next<br>edit &#8220;DNS_Cisco2&#8221;<br>set subnet 208.67.220.220 255.255.255.255<br>next<br>edit &#8220;DNS_Cloudflare1&#8221;<br>set subnet 1.1.1.1 255.255.255.255<br>next<br>edit &#8220;DNS_Cloudflare2&#8221;<br>set subnet 1.0.0.1 255.255.255.255<br>next<br>edit &#8220;DNS_Google2&#8221;<br>set subnet 8.8.4.4 255.255.255.255<br>next<br>edit &#8220;DNS_Google1&#8221;<br>set subnet 8.8.8.8 255.255.255.255<br>next<br>edit &#8220;DNS_Quad91&#8221;<br>set subnet 9.9.9.9 255.255.255.255<br>next<br>edit &#8220;DNS_Quad92&#8221;<br>set subnet 149.112.112.112 255.255.255.255<br>next<br>edit &#8220;DNS_cira1&#8221;<br>set subnet 149.112.121.20 255.255.255.255<br>next<br>edit &#8220;DNS_cira2&#8221;<br>set subnet 149.112.122.20 255.255.255.255<br>next<br>edit &#8220;DNS_8x8_1&#8221;<br>set subnet 8.28.0.9 255.255.255.255<br>next<br>edit &#8220;DNS_8x8_2&#8221;<br>set subnet 192.84.18.11 255.255.255.255<br>next<\/p>\n\n\n\n<p>edit &#8220;DNS_Approved&#8221;<br>set member &#8220;DNS_Cisco1&#8221; &#8220;DNS_Cisco2&#8221; &#8220;DNS_Cloudflare1&#8221; &#8220;DNS_Cloudflare2&#8221; &#8220;DNS_Fortinet1&#8221; &#8220;DNS_Fortinet2&#8221; &#8220;DNS_Google1&#8221; &#8220;DNS_Google2&#8221; &#8220;DNS_Quad91&#8221; &#8220;DNS_Quad92&#8221; &#8220;DNS_cira1&#8221; &#8220;DNS_cira2&#8221; &#8220;DNS_8x8_1&#8221; &#8220;DNS_8x8_2&#8221;<br>set color 3<br>next<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Outbound Port filtering is a simple method to prevent users from accidentally giving away their credentials. Scenario: BadGuy sends a phishing email including a link to an internet server owned&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[4,3],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-security","tag-smb"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10"}],"version-history":[{"count":5,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":2127,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/10\/revisions\/2127"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}