{"id":16056,"date":"2024-11-18T10:21:59","date_gmt":"2024-11-18T02:21:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/16056\/"},"modified":"2024-11-18T10:21:59","modified_gmt":"2024-11-18T02:21:59","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e7%bd%91%e7%bb%9cids%e4%bf%9d%e6%8a%a4centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%85%8d%e5%8f%97%e7%bd%91%e7%bb%9c%e6%94%bb%e5%87%bb","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/16056\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528\u7f51\u7edcIDS\u4fdd\u62a4CentOS\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb"},"content":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528\u7f51\u7edcids\u4fdd\u62a4centos\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb<\/p>\n<p>\u5bfc\u8a00\uff1a<br \/>\u968f\u7740\u7f51\u7edc\u7684\u5feb\u901f\u53d1\u5c55\u548c\u4f7f\u7528\uff0c\u5728\u4e92\u8054\u7f51\u4e0a\u4fdd\u62a4\u670d\u52a1\u5668\u514d\u53d7\u5404\u79cd\u7f51\u7edc\u653b\u51fb\u7684\u91cd\u8981\u6027\u6108\u53d1\u663e\u73b0\u3002\u7f51\u7edc\u5165\u4fb5\u68c0\u6d4b\u7cfb\u7edf\uff08Intrusion Detection System\uff0cIDS\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u68c0\u6d4b\u548c\u963b\u6b62\u6076\u610f\u7f51\u7edc\u6d3b\u52a8\u7684\u91cd\u8981\u5de5\u5177\u3002\u672c\u6587\u5c06\u5411\u60a8\u4ecb\u7ecd\u5982\u4f55\u5728CentOS\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u7f51\u7edcIDS\u6765\u4fdd\u62a4\u60a8\u7684\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb\u3002<\/p>\n<p>\u4e00\u3001\u4ec0\u4e48\u662f\u7f51\u7edcIDS\uff1f<\/p>\n<p>\u7f51\u7edcIDS\u662f\u4e00\u79cd\u7528\u4e8e\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u548c\u68c0\u6d4b\u6f5c\u5728\u7684\u653b\u51fb\u884c\u4e3a\u7684\u7cfb\u7edf\u3002\u5b83\u53ef\u4ee5\u901a\u8fc7\u68c0\u6d4b\u884c\u4e3a\u6a21\u5f0f\u548c\u7279\u5b9a\u7684\u653b\u51fb\u7279\u5f81\u6765\u8bc6\u522b\u653b\u51fb\uff0c\u4ee5\u4fbf\u53ca\u65f6\u91c7\u53d6\u76f8\u5e94\u7684\u63aa\u65bd\u3002<\/p>\n<p>\u4e8c\u3001CentOS\u670d\u52a1\u5668\u4e0a\u7684\u7f51\u7edcIDS\u5b89\u88c5<\/p>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u7f51\u7edcIDS\u8f6f\u4ef6\u3002\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9009\u62e9Suricata\u4f5c\u4e3a\u7f51\u7edcIDS\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Suricata\uff1a<\/p>\n<pre>sudo yum install epel-release\nsudo yum install suricata<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eSuricata\u4ee5\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u3002\u6253\u5f00Suricata\u914d\u7f6e\u6587\u4ef6\/etc\/suricata\/suricata.yaml\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u8c03\u6574\uff0c\u5982\u6307\u5b9a\u8981\u76d1\u63a7\u7684\u7f51\u7edc\u63a5\u53e3\u3001\u914d\u7f6e\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u7b49\u3002<\/p>\n<p>\u4e09\u3001\u8bbe\u7f6e\u7f51\u7edcIDS\u89c4\u5219<\/p>\n<p>\u7f51\u7edcIDS\u4f9d\u8d56\u4e8eIDS\u89c4\u5219\u6765\u68c0\u6d4b\u6f5c\u5728\u7684\u653b\u51fb\u884c\u4e3a\u3002Suricata\u4f7f\u7528\u89c4\u5219\u6587\u4ef6\u8fdb\u884c\u7f51\u7edcIDS\u68c0\u6d4b\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cSuricata\u4f1a\u4ece\/etc\/suricata\/rules\u76ee\u5f55\u52a0\u8f7d\u89c4\u5219\u6587\u4ef6\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u7f16\u5199\u81ea\u5b9a\u4e49\u89c4\u5219\uff0c\u4e5f\u53ef\u4ee5\u4ece\u4e92\u8054\u7f51\u4e0a\u4e0b\u8f7d\u5df2\u6709\u7684\u89c4\u5219\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u793a\u4f8b\u89c4\u5219\uff0c\u7528\u4e8e\u68c0\u6d4bSSH\u66b4\u529b\u7834\u89e3\u653b\u51fb\uff1a<\/p>\n<pre>alert tcp any any -&amp;gt; $HOME_NET 22 (msg: \"Possible SSH Brute Force Attack\"; flow: established,to_server; content: \"SSH-\"; threshold: type threshold, track by_src, count 5, seconds 60; sid: 1000001; rev: 1;)<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5c06\u8fd9\u4e2a\u89c4\u5219\u4fdd\u5b58\u5230\/etc\/suricata\/rules\u76ee\u5f55\u4e0b\u7684custom.rules\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u56db\u3001\u542f\u52a8\u7f51\u7edcIDS<\/p>\n<p>\u5728\u5b8c\u6210\u914d\u7f6e\u548c\u89c4\u5219\u8bbe\u7f6e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u542f\u52a8Suricata\u6765\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u5e76\u8fdb\u884c\u653b\u51fb\u68c0\u6d4b\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8Suricata\uff1a<\/p>\n<pre>sudo systemctl start suricata<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\uff0c\u60a8\u53ef\u4ee5\u68c0\u67e5Suricata\u7684\u72b6\u6001\uff1a<\/p>\n<pre>sudo systemctl status suricata<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e94\u3001\u76d1\u63a7\u548c\u54cd\u5e94\u7f51\u7edc\u653b\u51fb<\/p>\n<p>\u4e00\u65e6Suricata\u5f00\u59cb\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\uff0c\u5b83\u5c06\u5728\u68c0\u6d4b\u5230\u6f5c\u5728\u653b\u51fb\u65f6\u53d1\u51fa\u8b66\u62a5\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Suricata\u63d0\u4f9b\u7684\u65e5\u5fd7\u6587\u4ef6\u6765\u76d1\u63a7\u8b66\u62a5\u548c\u653b\u51fb\u4e8b\u4ef6\u3002\u67e5\u770bSuricata\u65e5\u5fd7\u6587\u4ef6\u7684\u8def\u5f84\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u8c03\u6574\u3002<\/p>\n<p>\u5f53\u7f51\u7edcIDS\u53d1\u73b0\u653b\u51fb\u884c\u4e3a\u65f6\uff0c\u53ef\u4ee5\u91c7\u53d6\u591a\u79cd\u54cd\u5e94\u63aa\u65bd\uff0c\u5982\u65ad\u5f00\u8fde\u63a5\u3001\u5c01\u9501\u653b\u51fb\u8005IP\u7b49\u3002\u60a8\u53ef\u4ee5\u914d\u7f6eSuricata\u4ee5\u5b9e\u73b0\u7279\u5b9a\u7684\u54cd\u5e94\u884c\u4e3a\u3002<\/p>\n<p>\u7ed3\u8bba\uff1a<\/p>\n<p>\u901a\u8fc7\u5728CentOS\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u7f51\u7edcIDS\uff0c\u6211\u4eec\u53ef\u4ee5\u6709\u6548\u5730\u4fdd\u62a4\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb\u3002\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u5b89\u88c5\u3001\u914d\u7f6e\u548c\u4f7f\u7528Suricata\u4f5c\u4e3a\u7f51\u7edcIDS\u7684\u793a\u4f8b\u3002\u901a\u8fc7\u6b63\u786e\u8bbe\u7f6e\u89c4\u5219\u5e76\u76d1\u63a7\u548c\u54cd\u5e94\u8b66\u62a5\uff0c\u60a8\u53ef\u4ee5\u63d0\u9ad8\u670d\u52a1\u5668\u7684\u5b89\u5168\u6027\u5e76\u4fdd\u62a4\u670d\u52a1\u5668\u5185\u7684\u654f\u611f\u6570\u636e\u3002\u8bf7\u8bb0\u4f4f\uff0c\u7f51\u7edcIDS\u53ea\u662f\u5b89\u5168\u4f53\u7cfb\u4e2d\u7684\u4e00\u90e8\u5206\uff0c\u8fd8\u9700\u8981\u5176\u4ed6\u5b89\u5168\u63aa\u65bd\u6765\u5168\u9762\u4fdd\u62a4\u670d\u52a1\u5668\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528\u7f51\u7edcIDS\u4fdd\u62a4CentOS\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528\u7f51\u7edcids\u4fdd\u62a4centos\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb \u5bfc\u8a00\uff1a\u968f\u7740\u7f51\u7edc\u7684\u5feb\u901f\u53d1\u5c55\u548c\u4f7f\u7528\uff0c\u5728\u4e92\u8054\u7f51\u4e0a\u4fdd\u62a4\u670d\u52a1\u5668\u514d\u53d7\u5404\u79cd\u7f51\u7edc\u653b\u51fb\u7684\u91cd\u8981\u6027\u6108\u53d1\u663e\u73b0\u3002\u7f51\u7edc\u5165\u4fb5\u68c0\u6d4b\u7cfb\u7edf\uff08Intrusion Detection System\uff0cIDS\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u68c0\u6d4b\u548c\u963b\u6b62\u6076\u610f\u7f51\u7edc\u6d3b\u52a8\u7684\u91cd\u8981\u5de5\u5177\u3002\u672c\u6587\u5c06\u5411\u60a8\u4ecb\u7ecd\u5982\u4f55\u5728CentOS\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u7f51\u7edcIDS\u6765\u4fdd\u62a4\u60a8\u7684\u670d\u52a1\u5668\u514d\u53d7\u7f51\u7edc\u653b\u51fb\u3002 \u4e00\u3001\u4ec0\u4e48\u662f\u7f51\u7edcIDS\uff1f \u7f51\u7edcIDS\u662f\u4e00\u79cd\u7528\u4e8e\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u548c\u68c0\u6d4b\u6f5c\u5728\u7684\u653b\u51fb\u884c\u4e3a\u7684\u7cfb\u7edf\u3002\u5b83\u53ef\u4ee5\u901a\u8fc7\u68c0\u6d4b\u884c\u4e3a\u6a21\u5f0f\u548c\u7279\u5b9a\u7684\u653b\u51fb\u7279\u5f81\u6765\u8bc6\u522b\u653b\u51fb\uff0c\u4ee5\u4fbf\u53ca\u65f6\u91c7\u53d6\u76f8\u5e94\u7684\u63aa\u65bd\u3002 \u4e8c\u3001CentOS\u670d\u52a1\u5668\u4e0a\u7684\u7f51\u7edcIDS\u5b89\u88c5 \u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u7f51\u7edcIDS\u8f6f\u4ef6\u3002\u5728\u672c\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9009\u62e9Suricata\u4f5c\u4e3a\u7f51\u7edcIDS\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Suricata\uff1a sudo yum install epel-release sudo yum install suricata \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6eSuricata\u4ee5\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u3002\u6253\u5f00Suricata\u914d\u7f6e\u6587\u4ef6\/etc\/suricata\/suricata.yaml\uff0c\u5e76\u8fdb\u884c\u76f8\u5e94\u7684\u8c03\u6574\uff0c\u5982\u6307\u5b9a\u8981\u76d1\u63a7\u7684\u7f51\u7edc\u63a5\u53e3\u3001\u914d\u7f6e\u65e5\u5fd7\u6587\u4ef6\u8def\u5f84\u7b49\u3002 \u4e09\u3001\u8bbe\u7f6e\u7f51\u7edcIDS\u89c4\u5219 \u7f51\u7edcIDS\u4f9d\u8d56\u4e8eIDS\u89c4\u5219\u6765\u68c0\u6d4b\u6f5c\u5728\u7684\u653b\u51fb\u884c\u4e3a\u3002Suricata\u4f7f\u7528\u89c4\u5219\u6587\u4ef6\u8fdb\u884c\u7f51\u7edcIDS\u68c0\u6d4b\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cSuricata\u4f1a\u4ece\/etc\/suricata\/rules\u76ee\u5f55\u52a0\u8f7d\u89c4\u5219\u6587\u4ef6\u3002 \u60a8\u53ef\u4ee5\u7f16\u5199\u81ea\u5b9a\u4e49\u89c4\u5219\uff0c\u4e5f\u53ef\u4ee5\u4ece\u4e92\u8054\u7f51\u4e0a\u4e0b\u8f7d\u5df2\u6709\u7684\u89c4\u5219\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u793a\u4f8b\u89c4\u5219\uff0c\u7528\u4e8e\u68c0\u6d4bSSH\u66b4\u529b\u7834\u89e3\u653b\u51fb\uff1a alert tcp any any -&amp;gt; $HOME_NET 22 (msg: &#8220;Possible SSH Brute Force Attack&#8221;; flow: established,to_server; content: &#8220;SSH-&#8220;; threshold: type threshold, track by_src, count 5, seconds 60; sid: 1000001; rev: 1;) \u767b\u5f55\u540e\u590d\u5236 \u5c06\u8fd9\u4e2a\u89c4\u5219\u4fdd\u5b58\u5230\/etc\/suricata\/rules\u76ee\u5f55\u4e0b\u7684custom.rules\u6587\u4ef6\u4e2d\u3002 \u56db\u3001\u542f\u52a8\u7f51\u7edcIDS \u5728\u5b8c\u6210\u914d\u7f6e\u548c\u89c4\u5219\u8bbe\u7f6e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u542f\u52a8Suricata\u6765\u76d1\u63a7\u7f51\u7edc\u6d41\u91cf\u5e76\u8fdb\u884c\u653b\u51fb\u68c0\u6d4b\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8Suricata\uff1a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-16056","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/16056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=16056"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/16056\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=16056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=16056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=16056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}