{"id":123,"date":"2025-07-27T09:49:19","date_gmt":"2025-07-27T01:49:19","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=123"},"modified":"2025-07-27T09:49:19","modified_gmt":"2025-07-27T01:49:19","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%98%b2%e5%be%a1%e5%a6%82%e4%bd%95%e7%a1%ae%e4%bf%9d%e5%ae%89%e5%85%a8%e7%a8%b3%e5%ae%9a%e8%bf%90%e8%a1%8c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/123.html","title":{"rendered":"\u670d\u52a1\u5668\u9632\u5fa1\u5982\u4f55\u786e\u4fdd\u5b89\u5168\u7a33\u5b9a\u8fd0\u884c\uff1f"},"content":{"rendered":"<p><h2>\u670d\u52a1\u5668\u9632\u5fa1\u6280\u672f\u4ecb\u7ecd\u53ca\u64cd\u4f5c\u6b65\u9aa4<\/h2>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/2lgR0V.jpg\" alt=\"\u670d\u52a1\u5668\u9632\u5fa1\u5982\u4f55\u786e\u4fdd\u5b89\u5168\u7a33\u5b9a\u8fd0\u884c\uff1f\" title=\"\u670d\u52a1\u5668\u9632\u5fa1\u5982\u4f55\u786e\u4fdd\u5b89\u5168\u7a33\u5b9a\u8fd0\u884c\uff1f\"><\/p>\n<p><p>\u670d\u52a1\u5668\u9632\u5fa1\u662f\u786e\u4fdd\u670d\u52a1\u5668\u5b89\u5168\u7a33\u5b9a\u8fd0\u884c\u7684\u91cd\u8981\u73af\u8282\u3002\u968f\u7740\u7f51\u7edc\u653b\u51fb\u624b\u6bb5\u7684\u65e5\u76ca\u591a\u6837\u5316\uff0c\u5982\u4f55\u6709\u6548\u9632\u5fa1\u670d\u52a1\u5668\u653b\u51fb\u6210\u4e3a\u6bcf\u4e2a\u7cfb\u7edf\u7ba1\u7406\u5458\u5fc5\u987b\u9762\u5bf9\u7684\u8bfe\u9898\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u79cd\u57fa\u4e8eLinux\u64cd\u4f5c\u7cfb\u7edf\u7684\u670d\u52a1\u5668\u9632\u5fa1\u6280\u672f\uff0c\u5305\u62ec\u5177\u4f53\u7684\u64cd\u4f5c\u6b65\u9aa4\u3001\u547d\u4ee4\u793a\u4f8b\u53ca\u89e3\u91ca\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7\u3002<\/p>\n<\/p>\n<p><h2>\u6280\u672f\u6982\u8ff0<\/h2>\n<\/p>\n<p><p>\u672c\u6587\u4ecb\u7ecd\u7684\u670d\u52a1\u5668\u9632\u5fa1\u6280\u672f\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u65b9\u9762\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u9632\u706b\u5899\u8bbe\u7f6e<\/li>\n<li>\u5165\u4fb5\u68c0\u6d4b\u7cfb\u7edf<\/li>\n<li>\u5b89\u5168\u5ba1\u8ba1<\/li>\n<\/ul>\n<p><h2>\u9632\u706b\u5899\u8bbe\u7f6e<\/h2>\n<\/p>\n<p><h3>1. \u5b89\u88c5\u9632\u706b\u5899\u8f6f\u4ef6<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5\u4e00\u6b3e\u9632\u706b\u5899\u8f6f\u4ef6\u3002\u4ee5\u4e0b\u4ee5iptables\u4e3a\u4f8b\u8fdb\u884c\u4ecb\u7ecd\u3002<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install iptables<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u8bbe\u7f6e\u9ed8\u8ba4\u7b56\u7565<\/h3>\n<\/p>\n<p><p>\u914d\u7f6e\u9632\u706b\u5899\u7684\u9ed8\u8ba4\u7b56\u7565\uff0c\u5141\u8bb8\u672c\u5730\u6d41\u91cf\uff0c\u62d2\u7edd\u6240\u6709\u5176\u4ed6\u6d41\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code>sudo iptables -P INPUT DROP<\/p>\r\n<p>sudo iptables -P FORWARD DROP<\/p>\r\n<p>sudo iptables -P OUTPUT ACCEPT<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u5f00\u653e\u7279\u5b9a\u7aef\u53e3<\/h3>\n<\/p>\n<p><p>\u6839\u636e\u5b9e\u9645\u9700\u8981\uff0c\u5f00\u653e\u670d\u52a1\u5668\u6240\u5fc5\u9700\u7684\u7aef\u53e3\u3002\u4ee5\u4e0b\u4ee5\u5f00\u653e80\u7aef\u53e3\u4e3a\u4f8b\u3002<\/p>\n<\/p>\n<p><pre><code>sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4. \u4fdd\u5b58\u9632\u706b\u5899\u89c4\u5219<\/h3>\n<\/p>\n<p><p>\u5c06\u9632\u706b\u5899\u89c4\u5219\u4fdd\u5b58\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u4ee5\u4fbf\u91cd\u542f\u7cfb\u7edf\u540e\u6062\u590d\u89c4\u5219\u3002<\/p>\n<\/p>\n<p><pre><code>sudo iptables-save > \/etc\/iptables\/rules.v4<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5165\u4fb5\u68c0\u6d4b\u7cfb\u7edf<\/h2>\n<\/p>\n<p><h3>1. \u5b89\u88c5\u5165\u4fb5\u68c0\u6d4b\u8f6f\u4ef6<\/h3>\n<\/p>\n<p><p>\u4ee5\u4e0b\u4ee5Snort\u4e3a\u4f8b\u8fdb\u884c\u4ecb\u7ecd\u3002<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install snort<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u914d\u7f6eSnort\u89c4\u5219<\/h3>\n<\/p>\n<p><p>\u7f16\u8f91Snort\u914d\u7f6e\u6587\u4ef6\uff0c\u8bbe\u7f6e\u62a5\u8b66\u65b9\u5f0f\u548c\u76d1\u63a7\u7aef\u53e3\u3002<\/p>\n<\/p>\n<p><pre><code>sudo vi \/etc\/snort\/snort.conf<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u4ee5\u4e0b\u914d\u7f6e\u6dfb\u52a0\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code>output alert:syslog:local7<\/p>\r\n<p>#output alert:sql:file:\/var\/log\/snort\/rules.sql<\/p>\r\n<p>#output alert:alert:syslog:local7<\/p>\r\n<p>#output log:fast:file:\/var\/log\/snort\/log.txt<\/p>\r\n<p>#output log:full:file:\/var\/log\/snort\/full.log<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u542f\u52a8Snort\u670d\u52a1<\/h3>\n<\/p>\n<p><p>\u542f\u52a8Snort\u670d\u52a1\uff0c\u5f00\u59cb\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code>sudo snort -i eth0 -c \/etc\/snort\/snort.conf<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u5b89\u5168\u5ba1\u8ba1<\/h2>\n<\/p>\n<p><h3>1. \u5b89\u88c5\u5b89\u5168\u5ba1\u8ba1\u5de5\u5177<\/h3>\n<\/p>\n<p><p>\u4ee5\u4e0b\u4ee5Logwatch\u4e3a\u4f8b\u8fdb\u884c\u4ecb\u7ecd\u3002<\/p>\n<\/p>\n<p><pre><code>sudo apt-get install logwatch<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u914d\u7f6eLogwatch<\/h3>\n<\/p>\n<p><p>\u7f16\u8f91Logwatch\u914d\u7f6e\u6587\u4ef6\uff0c\u8bbe\u7f6e\u62a5\u544a\u683c\u5f0f\u548c\u53d1\u9001\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code>sudo vi \/etc\/logwatch\/logwatch.conf<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u4ee5\u4e0b\u914d\u7f6e\u6dfb\u52a0\u5230\u6587\u4ef6\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code>mailhost mailserver.example.com<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u8fd0\u884cLogwatch<\/h3>\n<\/p>\n<p><p>\u5b9a\u671f\u8fd0\u884cLogwatch\uff0c\u751f\u6210\u5b89\u5168\u5ba1\u8ba1\u62a5\u544a\u3002<\/p>\n<\/p>\n<p><pre><code>sudo logwatch<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u5b9a\u671f\u66f4\u65b0\u7cfb\u7edf\u8f6f\u4ef6\u5305\uff0c\u4fdd\u6301\u7cfb\u7edf\u5b89\u5168\u3002<\/li>\n<li>\u76d1\u63a7\u670d\u52a1\u5668\u6027\u80fd\uff0c\u53d1\u73b0\u5f02\u5e38\u60c5\u51b5\u53ca\u65f6\u5904\u7406\u3002<\/li>\n<li>\u5907\u4efd\u91cd\u8981\u6570\u636e\uff0c\u9632\u6b62\u6570\u636e\u4e22\u5931\u3002<\/li>\n<li>\u9650\u5236\u7528\u6237\u6743\u9650\uff0c\u964d\u4f4e\u7cfb\u7edf\u98ce\u9669\u3002<\/li>\n<li>\u5b66\u4e60\u66f4\u591a\u5b89\u5168\u77e5\u8bc6\uff0c\u63d0\u9ad8\u9632\u5fa1\u80fd\u529b\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u670d\u52a1\u5668\u9632\u5fa1\u6280\u672f\u4ecb\u7ecd\u53ca\u64cd\u4f5c\u6b65\u9aa4 \u670d\u52a1\u5668\u9632\u5fa1\u662f\u786e\u4fdd\u670d\u52a1\u5668\u5b89\u5168\u7a33\u5b9a\u8fd0\u884c\u7684\u91cd\u8981\u73af\u8282\u3002\u968f\u7740\u7f51\u7edc\u653b\u51fb\u624b\u6bb5\u7684\u65e5\u76ca\u591a\u6837\u5316\uff0c\u5982\u4f55\u6709\u6548\u9632\u5fa1\u670d\u52a1\u5668\u653b\u51fb\u6210\u4e3a\u6bcf\u4e2a\u7cfb\u7edf\u7ba1\u7406\u5458\u5fc5\u987b\u9762\u5bf9\u7684\u8bfe\u9898\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u79cd\u57fa\u4e8eLinux\u64cd\u4f5c\u7cfb\u7edf\u7684\u670d\u52a1\u5668\u9632\u5fa1\u6280\u672f\uff0c\u5305\u62ec\u5177\u4f53\u7684\u64cd\u4f5c\u6b65\u9aa4\u3001&#8230;<\/p>\n","protected":false},"author":1,"featured_media":124,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[19,80,79],"topic":[],"class_list":["post-123","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-foreign-server","tag-19","tag-80","tag-79"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/123","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=123"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions"}],"predecessor-version":[{"id":126,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/123\/revisions\/126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/124"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=123"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}