{"id":7060,"date":"2023-09-16T10:39:25","date_gmt":"2023-09-16T02:39:25","guid":{"rendered":"https:\/\/i007.vip:15443\/wordpress\/?p=7060"},"modified":"2023-09-16T10:39:25","modified_gmt":"2023-09-16T02:39:25","slug":"windowsfirewallruleset%ef%bc%9a%e4%b8%80%e5%a5%97%e9%92%88%e5%af%b9windows%e9%98%b2%e7%81%ab%e5%a2%99%e8%a7%84%e5%88%99%e9%9b%86%e7%9a%84powershel","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/7060","title":{"rendered":"WindowsFirewallRuleset\uff1a\u4e00\u5957\u9488\u5bf9Windows\u9632\u706b\u5899\u89c4\u5219\u96c6\u7684PowerShel&#8230;"},"content":{"rendered":"<div class=\"artical-header\" data-v-06dc4b68=\"\">\n<div class=\"title\" data-v-06dc4b68=\"\"><a href=\"https:\/\/www.freebuf.com\/articles\/system\/225030.html\">cc from<\/a><\/div>\n<div class=\"author-info\" data-v-06dc4b68=\"\">\n<div class=\"author-left\" data-v-06dc4b68=\"\"><a class=\"author\" href=\"https:\/\/www.freebuf.com\/author\/Alpha_h4ck\" data-v-06dc4b68=\"\"><i class=\"anticon anticon-user\" aria-label=\"\u56fe\u6807: user\" data-v-06dc4b68=\"\"><\/i>Alpha_h4ck<\/a><span class=\"date\" data-v-06dc4b68=\"\"><i class=\"anticon anticon-clock-circle\" aria-label=\"\u56fe\u6807: clock-circle\" data-v-06dc4b68=\"\"><\/i>2020-02-02 15:00:29<\/span><span class=\"review\" data-v-06dc4b68=\"\"><i class=\"anticon anticon-fire\" aria-label=\"\u56fe\u6807: fire\" data-v-06dc4b68=\"\"><\/i>219190<\/span><span class=\"comment-num\" data-v-06dc4b68=\"\"><i class=\"anticon anticon-message\" data-v-06dc4b68=\"\" aria-label=\"\u56fe\u6807: message\"><\/i>1<\/span><\/div>\n<div data-v-06dc4b68=\"\"><\/div>\n<\/div>\n<\/div>\n<div class=\"artical-body\" data-v-06dc4b68=\"\">\n<div class=\"payread-panel\" data-v-06dc4b68=\"\">\n<div id=\"tinymce-editor\" class=\"content-detail\" data-v-06dc4b68=\"\">\n<div>\n<p><img decoding=\"async\" src=\"https:\/\/image.3001.net\/images\/20200109\/1578577293_5e172d8d231f1.jpg!small\" data-pswp-uid=\"1\" \/><\/p>\n<h2 id=\"h2-1\">WindowsFirewallRuleset<\/h2>\n<p><b>\u8be5\u5de5\u5177\u6839\u636e\u4e0b\u5217\u56e0\u7d20\uff0c\u5df2\u5c06Windows\u9632\u706b\u5899\u89c4\u5219\u7ec4\u7ec7\u6210\u4e3a\u4e86\u5355\u72ec\u7684PowerShell\u811a\u672c\uff1a<\/b><\/p>\n<blockquote><p>1\u3001\u89c4\u5219\u7ec4<\/p>\n<p>2\u3001\u6d41\u91cf\u65b9\u5411<\/p>\n<p>3\u3001IP\u7248\u672c\uff08IPv4\/IPv6\uff09<\/p>\n<p>4\u3001\u6839\u636e\u7a0b\u5e8f\u548c\u670d\u52a1\u8fdb\u884c\u8fdb\u4e00\u6b65\u5206\u7c7b<\/p><\/blockquote>\n<h3 id=\"h3-1\">\u4f8b\u5982\uff1a<\/h3>\n<blockquote><p>1\u3001ICMP\u6d41\u91cf<\/p>\n<p>2\u3001\u6d4f\u89c8\u5668\u89c4\u5219<\/p>\n<p>3\u3001Windows\u7cfb\u7edf\u89c4\u5219<\/p>\n<p>4\u3001\u5b58\u50a8\u7684\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>5\u3001Windows\u670d\u52a1<\/p>\n<p>6\u3001\u5fae\u8f6f\u7a0b\u5e8f<\/p>\n<p>7\u3001\u7b2c\u4e09\u65b9\u7a0b\u5e8f<\/p>\n<p>8\u3001\u5e7f\u64ad\u6d41\u91cf<\/p>\n<p>9\u3001\u7b49\u7b49&#8230;<\/p><\/blockquote>\n<p>\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u6765\u9009\u62e9\u4f7f\u7528\u7684\u89c4\u5219\uff0c\u4f7f\u7528\u547d\u4ee4\u5373\u53ef\u5b8c\u6210\u9632\u706b\u5899\u914d\u7f6e\u3002<\/p>\n<p>\u6240\u6709\u7684\u89c4\u5219\u90fd\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7d\u8fdb\u7ec4\u7b56\u7565\u4e2d\uff0c\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u9ed8\u8ba4\u7684Windows\u9632\u706b\u5899\u914d\u7f6e\u89c4\u5219\u66f4\u52a0\u5f3a\u5927\u3002<\/p>\n<h2 id=\"h2-2\">\u7cfb\u7edf\u8981\u6c42<\/h2>\n<blockquote><p>1\u3001Windows 10\u4e13\u4e1a\u7248\u6216\u4f01\u4e1a\u7248<\/p>\n<p>2\u3001Windows PowerShell 5.1\uff1a\u3010<a href=\"https:\/\/github.com\/PowerShell\/PowerShell\">\u70b9\u6211\u4e0b\u8f7d<\/a>\u3011<\/p>\n<p>3\u3001Git\uff08\u53ef\u9009\u9879\uff09\uff1a\u3010<a href=\"https:\/\/git-scm.com\/downloads\">\u70b9\u6211\u4e0b\u8f7d<\/a>\u3011<\/p><\/blockquote>\n<h2 id=\"h2-3\">\u5de5\u5177\u4e0b\u8f7d\u548c\u4f7f\u7528<\/h2>\n<p>\u9996\u5148\uff0c\u53f3\u952e\u70b9\u51fb\u4efb\u52a1\u680f\uff0c\u7136\u540e\u9009\u62e9\u201c\u4efb\u52a1\u680f\u8bbe\u7f6e\u201d\uff0c\u52fe\u9009\u201c\u5f53\u6211\u53f3\u952e\u70b9\u51fb\u2019\u5f00\u59cb\u2019\u6309\u94ae\u6216\u6309\u4e0bWindows\u952e+X\u65f6\uff0c\u5728\u83dc\u5355\u4e2d\u5c06\u547d\u4ee4\u63d0\u793a\u7b26\u66ff\u6362\u4e3aWindows PowerShell\u201d\u3002<\/p>\n<p>\u53f3\u952e\u70b9\u51fb\u201c\u5f00\u59cb\u201d\u6309\u94ae\uff0c\u70b9\u51fb\u201cWindows PowerShell\uff08\u7ba1\u7406\u5458\uff09\u201d\uff0c\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00PowerShell\uff0c\u8f93\u5165\u4e0b\u5217\u547d\u4ee4\uff1a<\/p>\n<pre><code>Get-ExecutionPolicy<\/code><\/pre>\n<p>\u7136\u540e\u8f93\u5165\uff1a<\/p>\n<pre><code><\/code><\/pre>\n<p>Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force<\/p>\n<pre><code><\/code><\/pre>\n<p>cd C:\\<\/p>\n<pre><code><\/code><\/pre>\n<p>git clone git@github.com:metablaster\/WindowsFirewallRuleset.git<\/p>\n<pre><code><\/code><\/pre>\n<p>cd WindowsFirewallRuleset<\/p>\n<pre><code><\/code><\/pre>\n<p>.\\SetupFirewall.ps1<\/p>\n<pre><code><\/code><\/pre>\n<p>\u6267\u884c\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u518d\u8f93\u5165\u4e0b\u5217\u547d\u4ee4\u6765\u6267\u884c\u811a\u672c\u5373\u53ef\u5b8c\u6210\u89c4\u5219\u8bbe\u7f6e\uff1a<\/p>\n<pre><code>Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force\\<\/code><\/pre>\n<h2 id=\"h2-4\">\u5e94\u7528\u5355\u72ec\u89c4\u5219\u96c6<\/h2>\n<p>\u5982\u679c\u4f60\u53ea\u60f3\u5e94\u7528\u7279\u5b9a\u7684\u89c4\u5219\uff0c\u4f60\u6709\u4e0b\u5217\u4e24\u79cd\u65b9\u6cd5\uff1a<\/p>\n<blockquote><p>1\u3001\u6267\u884cSetupFirewall.ps1\u811a\u672c\uff0c\u7136\u540e\u8f93\u51fa\u9700\u8981\u4f7f\u7528\u7684\u89c4\u5219\u96c6\uff0c\u6216\u8005\u8f93\u5165\u201cn\u201d\u5e76\u6309\u56de\u8f66\u952e\u8df3\u8fc7\u5f53\u524d\u89c4\u5219\u96c6\u3002<\/p>\n<p>2\u3001\u5728PowerShell\u7ec8\u7aef\u7a97\u53e3\u4e2d\uff0c\u8fdb\u5165\u5305\u542b\u89c4\u5219\u96c6\u811a\u672c\u7684\u76ee\u5f55\uff0c\u7136\u540e\u6267\u884c\u7279\u5b9aPowerShell\u811a\u672c\u3002<\/p>\n<p>3\u3001\u8fd0\u884cFirewallProfile.ps1\u811a\u672c\u6765\u5e94\u7528\u9ed8\u8ba4\u9632\u706b\u5899\u89c4\u5219\uff0c\u6216\u8005\u76f4\u63a5\u5728GPO\u4e2d\u624b\u52a8\u914d\u7f6e\u3002<\/p><\/blockquote>\n<h2 id=\"h2-5\">\u5220\u9664\u89c4\u5219<\/h2>\n<p>\u6839\u636e\u8be5\u7248\u672c\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u672c\u5730\u7ec4\u7b56\u7565\u4e2d\u9009\u62e9\u6211\u4eec\u9700\u8981\u5220\u9664\u7684\u89c4\u5219\uff0c\u7136\u540e\u53f3\u952e\u70b9\u51fb\u5e76\u5220\u9664\u5373\u53ef\u3002\u5982\u679c\u9700\u8981\u8fd8\u539f\u9632\u706b\u5899\u7684\u72b6\u6001\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u4eceGPO\u4e2d\u5220\u9664\u6240\u6709\u89c4\u5219\uff0c\u7136\u540e\u53f3\u952e\u70b9\u51fb\u201cWindows Defender Firewall with Advanced Security &#8211; Local Group Policy Object\u201d\u7ed3\u70b9\uff0c\u5e76\u5c06\u6240\u6709\u7684\u5c5e\u6027\u8bbe\u7f6e\u4e3a\u201cNot configured\u201d\u3002<\/p>\n<h2 id=\"h2-6\">\u7ba1\u7406\u5df2\u52a0\u8f7d\u7684\u89c4\u5219<\/h2>\n<p>\u6211\u4eec\u6709\u4e0b\u5217\u4e24\u79cd\u65b9\u6cd5\u7ba1\u7406\u5df2\u52a0\u8f7d\u7684\u89c4\u5219\uff1a<\/p>\n<blockquote><p>1\u3001\u4f7f\u7528\u672c\u5730\u7ec4\u7b56\u7565\uff0c\u8fd9\u79cd\u65b9\u6cd5\u4f1a\u5bf9\u89c4\u5219\u7684\u4f7f\u7528\u6709\u4e00\u5b9a\u7684\u9650\u5236\uff1b<\/p>\n<p>2\u3001\u7f16\u8f91PowerShell\u811a\u672c\uff0c\u8fd9\u79cd\u65b9\u6cd5\u5141\u8bb8\u6211\u4eec\u62e5\u6709\u6700\u5b8c\u6574\u7684\u63a7\u5236\u6743\uff0c\u6211\u4eec\u53ef\u4ee5\u63d0\u5347\u89c4\u5219\uff0c\u65b0\u589e\u89c4\u5219\u6216\u4fee\u6539\u89c4\u5219\uff1b<\/p><\/blockquote>\n<h3 id=\"h3-2\">\u8bb8\u53ef\u8bc1\u534f\u8bae<\/h3>\n<blockquote><p>WindowsFirewallRuleset\u8fd9\u4e2a\u9879\u76ee\u7684\u5f00\u53d1\u4e0e\u53d1\u5e03\u9075\u5faa<a href=\"https:\/\/raw.githubusercontent.com\/metablaster\/WindowsFirewallRuleset\/master\/LICENSE\">MIT\u5f00\u6e90\u8bb8\u53ef\u8bc1\u534f\u8bae<\/a>\u3002<\/p>\n<p>\u5b50\u9879\u76eeIndented.Net.IP\uff08\u7b2c\u4e09\u65b9\u4ee3\u7801\uff0c\u4f4d\u4e8e &#8220;Indented.Net.IP&#8221;\u5b50\u76ee\u5f55\uff09\u9075\u5faa<a href=\"https:\/\/raw.githubusercontent.com\/metablaster\/WindowsFirewallRuleset\/master\/Indented.Net.IP\/LICENSE\">ISC\u534f\u8bae<\/a>\u3002<\/p>\n<p>\u5b50\u9879\u76eeVSSetup\uff08\u7b2c\u4e09\u65b9\u4ee3\u7801\uff0c\u4f4d\u4e8e &#8220;VSSetup&#8221;\u5b50\u76ee\u5f55\uff09\u9075\u5faa<a href=\"https:\/\/raw.githubusercontent.com\/metablaster\/WindowsFirewallRuleset\/master\/VSSetup\/LICENSE.txt\">MIT\u534f\u8bae<\/a>\u3002<\/p><\/blockquote>\n<h2 id=\"h2-7\">\u9879\u76ee\u5730\u5740<\/h2>\n<blockquote><p>WindowsFirewallRuleset\uff1a\u3010<a href=\"https:\/\/github.com\/metablaster\/WindowsFirewallRuleset\">GitHub\u4f20\u9001\u95e8<\/a>\u3011<\/p><\/blockquote>\n<p><b>* \u53c2\u8003\u6765\u6e90\uff1a<a href=\"https:\/\/github.com\/metablaster\/WindowsFirewallRuleset\">metablaster<\/a>\uff0cFB\u5c0f\u7f16Alpha_h4ck\u7f16\u8bd1\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81eaFreeBuf.COM<\/b><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>cc from Alpha_h4ck20<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[24],"tags":[121],"class_list":["post-7060","post","type-post","status-publish","format-standard","hentry","category-value_docs","tag-05-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/7060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=7060"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/7060\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=7060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=7060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=7060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}