{"id":183,"date":"2025-07-27T09:50:19","date_gmt":"2025-07-27T01:50:19","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=183"},"modified":"2025-07-27T09:50:19","modified_gmt":"2025-07-27T01:50:19","slug":"%e9%ab%98%e9%98%b2%e6%8a%80%e6%9c%af%ef%bc%9a%e6%8f%90%e5%8d%87%e7%bd%91%e7%bb%9c%e5%ae%89%e5%85%a8%e7%9a%84%e5%a4%9a%e5%b0%91%e7%ad%96%e7%95%a5","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/183.html","title":{"rendered":"\u9ad8\u9632\u6280\u672f\uff1a\u63d0\u5347\u7f51\u7edc\u5b89\u5168\u7684\u591a\u5c11\u7b56\u7565"},"content":{"rendered":"<p><h2>\u9ad8\u9632\u6280\u672f\u4ecb\u7ecd\u53ca\u672c\u6587\u4efb\u52a1<\/h2>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/M8I5Kn.jpg\" alt=\"\u9ad8\u9632\u6280\u672f\uff1a\u63d0\u5347\u7f51\u7edc\u5b89\u5168\u7684\u591a\u5c11\u7b56\u7565\" title=\"\u9ad8\u9632\u6280\u672f\uff1a\u63d0\u5347\u7f51\u7edc\u5b89\u5168\u7684\u591a\u5c11\u7b56\u7565\"><\/p>\n<p>\u9ad8\u9632\u6280\u672f\uff0c\u5373\u9ad8\u9632\u5fa1\u80fd\u529b\u6280\u672f\uff0c\u662f\u6307\u5728\u7f51\u7edc\u73af\u5883\u4e2d\uff0c\u901a\u8fc7\u4e00\u7cfb\u5217\u6280\u672f\u548c\u624b\u6bb5\uff0c\u63d0\u9ad8\u7cfb\u7edf\u6216\u670d\u52a1\u7684\u9632\u5fa1\u80fd\u529b\uff0c\u9632\u6b62\u5404\u79cd\u653b\u51fb\uff0c\u5982DDoS\u653b\u51fb\u3001SQL\u6ce8\u5165\u7b49\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u9ad8\u9632\u6280\u672f\u7684\u64cd\u4f5c\u6b65\u9aa4\u3001\u547d\u4ee4\u793a\u4f8b\u53ca\u89e3\u91ca\uff0c\u5e76\u63d0\u4f9b\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7\u3002<\/p>\n<p><h2>\u64cd\u4f5c\u6b65\u9aa4<\/h2>\n<\/p>\n<p><h3>1. \u73af\u5883\u51c6\u5907<\/h3>\n<\/p>\n<p>\u5728\u5f00\u59cb\u9ad8\u9632\u914d\u7f6e\u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u60a8\u7684\u670d\u52a1\u5668\u73af\u5883\u6ee1\u8db3\u4ee5\u4e0b\u8981\u6c42\uff1a<\/p>\n<p>&#8211; \u670d\u52a1\u5668\u5df2\u5b89\u88c5\u9632\u706b\u5899\u8f6f\u4ef6\uff0c\u5982iptables\u3002<\/p>\n<p>&#8211; \u670d\u52a1\u5668\u5df2\u5b89\u88c5SSH\u5ba2\u6237\u7aef\uff0c\u5982PuTTY\u3002<\/p>\n<p><h3>2. \u5b89\u88c5\u9ad8\u9632\u8f6f\u4ef6<\/h3>\n<\/p>\n<p>\u4ee5\u4e0b\u4ee5\u5b89\u88c5iptables\u4e3a\u4f8b\uff0c\u8bf4\u660e\u5982\u4f55\u5b89\u88c5\u9ad8\u9632\u8f6f\u4ef6\u3002<\/p>\n<ol>\n<li>\u767b\u5f55\u670d\u52a1\u5668\u3002<\/li>\n<li>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5iptables\uff1a<\/p>\n<p><pre><code>sudo apt-get install iptables<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770biptables\u7248\u672c\uff1a<\/p>\n<p><pre><code>iptables --version<\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>3. \u914d\u7f6e\u9ad8\u9632\u89c4\u5219<\/h3>\n<\/p>\n<p>\u4ee5\u4e0b\u4ee5\u914d\u7f6eiptables\u4e3a\u4f8b\uff0c\u8bf4\u660e\u5982\u4f55\u914d\u7f6e\u9ad8\u9632\u89c4\u5219\u3002<\/p>\n<ol>\n<li>\u521b\u5efa\u9632\u706b\u5899\u89c4\u5219\u6587\u4ef6\uff1a<\/p>\n<p><pre><code>sudo vi \/etc\/iptables\/rules.v4<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u6dfb\u52a0\u4ee5\u4e0b\u89c4\u5219\uff1a<\/p>\n<p><pre><code>iptables -A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT<\/p>\r\n<p>iptables -A INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT<\/p>\r\n<p>iptables -A INPUT -p icmp -j ACCEPT<\/p>\r\n<p>iptables -A INPUT -j DROP<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668\u3002<\/li>\n<li>\u4f7f\u9632\u706b\u5899\u89c4\u5219\u751f\u6548\uff1a<\/p>\n<p><pre><code>sudo iptables-restore < \/etc\/iptables\/rules.v4<\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>4. \u9a8c\u8bc1\u9ad8\u9632\u914d\u7f6e<\/h3>\n<\/p>\n<p>\u4ee5\u4e0b\u4ee5\u9a8c\u8bc1iptables\u4e3a\u4f8b\uff0c\u8bf4\u660e\u5982\u4f55\u9a8c\u8bc1\u9ad8\u9632\u914d\u7f6e\u3002<\/p>\n<ol>\n<li>\u67e5\u770b\u9632\u706b\u5899\u89c4\u5219\uff1a<\/p>\n<p><pre><code>sudo iptables -L<\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u4f7f\u7528\u5de5\u5177\uff08\u5982Nmap\uff09\u6d4b\u8bd5\u670d\u52a1\u5668\u7aef\u53e3\u662f\u5426\u88ab\u9632\u706b\u5899\u963b\u6b62\uff1a<\/p>\n<p><pre><code>nmap -p 80,443 [\u670d\u52a1\u5668IP\u5730\u5740]<\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u547d\u4ee4\u793a\u4f8b\u53ca\u89e3\u91ca<\/h2>\n<\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u9ad8\u9632\u6280\u672f\u4e2d\u5e38\u7528\u7684\u547d\u4ee4\u53ca\u5176\u89e3\u91ca\uff1a<\/p>\n<ul>\n<li>\n<p>    <strong>iptables -A INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT<\/strong><\/p>\n<p>    - \u8be5\u547d\u4ee4\u8868\u793a\u5141\u8bb8\u6240\u6709\u6765\u81ea\u5916\u90e8\u7f51\u7edc\uff08INPUT\u94fe\uff09\u7684TCP\u7aef\u53e380\uff08HTTP\u670d\u52a1\uff09\u7684\u65b0\u8fde\u63a5\u548c\u5df2\u5efa\u7acb\u7684\u8fde\u63a5\u901a\u8fc7\u3002<\/p>\n<\/li>\n<li>\n<p>    <strong>iptables -A INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT<\/strong><\/p>\n<p>    - \u8be5\u547d\u4ee4\u8868\u793a\u5141\u8bb8\u6240\u6709\u6765\u81ea\u5916\u90e8\u7f51\u7edc\uff08INPUT\u94fe\uff09\u7684TCP\u7aef\u53e3443\uff08HTTPS\u670d\u52a1\uff09\u7684\u65b0\u8fde\u63a5\u548c\u5df2\u5efa\u7acb\u7684\u8fde\u63a5\u901a\u8fc7\u3002<\/p>\n<\/li>\n<li>\n<p>    <strong>iptables -A INPUT -p icmp -j ACCEPT<\/strong><\/p>\n<p>    - \u8be5\u547d\u4ee4\u8868\u793a\u5141\u8bb8\u6240\u6709\u6765\u81ea\u5916\u90e8\u7f51\u7edc\uff08INPUT\u94fe\uff09\u7684ICMP\uff08ping\uff09\u6570\u636e\u5305\u901a\u8fc7\u3002<\/p>\n<\/li>\n<li>\n<p>    <strong>iptables -A INPUT -j DROP<\/strong><\/p>\n<p>    - \u8be5\u547d\u4ee4\u8868\u793a\u5c06\u6240\u6709\u672a\u88ab\u5176\u4ed6\u89c4\u5219\u5339\u914d\u7684\u8f93\u5165\u6570\u636e\u5305\u4e22\u5f03\u3002<\/p>\n<\/li>\n<\/ul>\n<p><h2>\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<p><h3>1. \u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<ul>\n<li>\u5728\u914d\u7f6e\u9ad8\u9632\u89c4\u5219\u65f6\uff0c\u8bf7\u786e\u4fdd\u4e0d\u8981\u9519\u8bef\u5730\u963b\u6b62\u4e86\u5fc5\u8981\u7684\u7aef\u53e3\u548c\u670d\u52a1\u3002<\/li>\n<li>\u5728\u4fee\u6539\u9632\u706b\u5899\u89c4\u5219\u540e\uff0c\u8bf7\u52a1\u5fc5\u4f7f\u89c4\u5219\u751f\u6548\uff0c\u5426\u5219\u914d\u7f6e\u5c06\u4e0d\u4f1a\u751f\u6548\u3002<\/li>\n<li>\u5728\u914d\u7f6e\u9ad8\u9632\u89c4\u5219\u65f6\uff0c\u8bf7\u8003\u8651\u670d\u52a1\u5668\u6240\u5728\u7f51\u7edc\u7684\u5b89\u5168\u7b56\u7565\u548c\u4e1a\u52a1\u9700\u6c42\u3002<\/li>\n<\/ul>\n<p><h3>2. \u5b9e\u7528\u6280\u5de7<\/h3>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u53ef\u89c6\u5316\u5de5\u5177\uff08\u5982iptables-save\uff09\u67e5\u770b\u9632\u706b\u5899\u89c4\u5219\u3002<\/li>\n<li>\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\uff08\u5982Nmap\uff09\u6d4b\u8bd5\u670d\u52a1\u5668\u7aef\u53e3\u662f\u5426\u88ab\u9632\u706b\u5899\u963b\u6b62\u3002<\/li>\n<li>\u5b9a\u671f\u68c0\u67e5\u548c\u66f4\u65b0\u9ad8\u9632\u89c4\u5219\uff0c\u4ee5\u5e94\u5bf9\u65b0\u7684\u5b89\u5168\u5a01\u80c1\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u9ad8\u9632\u6280\u672f\u4ecb\u7ecd\u53ca\u672c\u6587\u4efb\u52a1 \u9ad8\u9632\u6280\u672f\uff0c\u5373\u9ad8\u9632\u5fa1\u80fd\u529b\u6280\u672f\uff0c\u662f\u6307\u5728\u7f51\u7edc\u73af\u5883\u4e2d\uff0c\u901a\u8fc7\u4e00\u7cfb\u5217\u6280\u672f\u548c\u624b\u6bb5\uff0c\u63d0\u9ad8\u7cfb\u7edf\u6216\u670d\u52a1\u7684\u9632\u5fa1\u80fd\u529b\uff0c\u9632\u6b62\u5404\u79cd\u653b\u51fb\uff0c\u5982DDoS\u653b\u51fb\u3001SQL\u6ce8\u5165\u7b49\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u9ad8\u9632\u6280\u672f\u7684\u64cd\u4f5c\u6b65\u9aa4\u3001\u547d\u4ee4\u793a\u4f8b\u53ca\u89e3\u91ca\uff0c\u5e76\u63d0\u4f9b\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7\u3002 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":184,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[110,103,109],"topic":[],"class_list":["post-183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-usa-server","tag-iptables","tag-103","tag-109"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/183\/revisions\/186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/184"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=183"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}