{"id":919,"date":"2021-03-16T12:56:48","date_gmt":"2021-03-16T16:56:48","guid":{"rendered":"https:\/\/increasec.com\/?p=919"},"modified":"2021-03-16T12:56:48","modified_gmt":"2021-03-16T16:56:48","slug":"windows-geofiltering-the-cheap-and-hacky-way","status":"publish","type":"post","link":"https:\/\/increasec.com\/?p=919","title":{"rendered":"Windows GeoFiltering the cheap and hacky way"},"content":{"rendered":"\n<p>I started from this <a href=\"https:\/\/www.reddit.com\/r\/cybersecurity\/comments\/e4lzsu\/easy_geoblocking_of_troublesome_countries_win10\/\">post <\/a>and moved the file downloads into powershell<\/p>\n\n\n\n<p>rem<br>rem http:\/\/www.gregsitservices.com\/ip-security\/ip-security-package.zip<\/p>\n\n\n\n<p>wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/cn-aggregated.zone&#8221; -outfile &#8220;cn-aggregated.zone&#8221;<br>wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/ru-aggregated.zone&#8221; -outfile &#8220;ru-aggregated.zone&#8221;<br>wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/ir-aggregated.zone&#8221; -outfile &#8220;ir-aggregated.zone&#8221;<br>wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/kp-aggregated.zone&#8221; -outfile &#8220;kp-aggregated.zone&#8221;<br>wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/kr-aggregated.zone&#8221; -outfile &#8220;kr-aggregated.zone&#8221;<\/p>\n\n\n\n<p>PowerShell.exe -ExecutionPolicy Bypass<br>.\\Import-Firewall-Blocklist.ps1 -inputfile cn-aggregated.zone<br>.\\Import-Firewall-Blocklist.ps1 -inputfile ru-aggregated.zone<br>.\\Import-Firewall-Blocklist.ps1 -inputfile ir-aggregated.zone<br>.\\Import-Firewall-Blocklist.ps1 -inputfile kp-aggregated.zone<br>.\\Import-Firewall-Blocklist.ps1 -inputfile kr-aggregated.zone<br>PowerShell.exe -ExecutionPolicy Restricted<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>this is not a complete project, had to move on to other priorities but checkout the SANS article <a href=\"https:\/\/www.sans.org\/blog\/windows-firewall-script-to-block-ip-addresses-and-country-network-ranges\/\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I started from this post and moved the file downloads into powershell remrem http:\/\/www.gregsitservices.com\/ip-security\/ip-security-package.zip wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/cn-aggregated.zone&#8221; -outfile &#8220;cn-aggregated.zone&#8221;wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/ru-aggregated.zone&#8221; -outfile &#8220;ru-aggregated.zone&#8221;wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/ir-aggregated.zone&#8221; -outfile &#8220;ir-aggregated.zone&#8221;wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/kp-aggregated.zone&#8221; -outfile &#8220;kp-aggregated.zone&#8221;wget &#8220;https:\/\/www.ipdeny.com\/ipblocks\/data\/aggregated\/kr-aggregated.zone&#8221; -outfile &#8220;kr-aggregated.zone&#8221;&#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,21],"class_list":["post-919","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-security","tag-windows"],"_links":{"self":[{"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/919","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=919"}],"version-history":[{"count":2,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/919\/revisions"}],"predecessor-version":[{"id":1351,"href":"https:\/\/increasec.com\/index.php?rest_route=\/wp\/v2\/posts\/919\/revisions\/1351"}],"wp:attachment":[{"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/increasec.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}