{"id":3118,"date":"2024-11-19T16:21:02","date_gmt":"2024-11-19T08:21:02","guid":{"rendered":"https:\/\/jir.idv.tw\/wordpress\/?p=3118"},"modified":"2024-11-19T16:23:00","modified_gmt":"2024-11-19T08:23:00","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8rkhunter%e6%89%be%e5%88%b0%e7%96%91%e4%bc%bc%e6%84%9f%e6%9f%93%e7%9a%84%e9%a0%85%e7%9b%ae%e5%92%8c%e5%be%ae%e8%aa%bf%e5%8f%83%e6%95%b8%e9%99%8d%e4%bd%8e%e8%aa%a4%e5%88%a4","status":"publish","type":"post","link":"https:\/\/jir.idv.tw\/wordpress\/?p=3118","title":{"rendered":"\u5982\u4f55\u5728rkhunter\u627e\u5230\u7591\u4f3c\u611f\u67d3\u7684\u9805\u76ee\u548c\u5fae\u8abf\u53c3\u6578\u964d\u4f4e\u8aa4\u5224"},"content":{"rendered":"<p>rkhunter\u5728LINUX\u7cfb\u7d71\u4e2d\uff0c\u662f\u4e00\u500b\u5f88\u597d\u7684\u5c0f\u5957\u4ef6\uff0c\u5e6b\u5fd9\u8f14\u52a9\u6383\u63cf\u5224\u65b7\u81ea\u5df1\u7684\u7cfb\u7d71\u6709\u6c92\u6709\u88ab\u60e1\u610f\u611f\u67d3\u6216\u57f7\u884c\u7570\u5e38\u7684\u7a0b\u5f0f\u3002<br \/>\n\u4f46\u662f\u6709\u4e00\u4e9b\u9810\u8a2d\u7684\u53c3\u6578\uff0c\u82e5\u6c92\u6709\u9069\u7576\u7684\u5fae\u8abf\uff0c\u6703\u4e00\u76f4\u51fa\u73fe\u8aa4\u5224\u548c\u63d0\u9192\u8a2d\u5099\u5df2\u7d93\u6709\u554f\u984c\u3002<br \/>\n\u7528\u5b83\u7522\u51fa\u7684LOG\u6a94\u6848\uff0c\u6709\u6642\u5019\u9805\u76ee\u592a\u591a\uff0c\u4e5f\u5f88\u96e3\u95b1\u8b80\u548c\u627e\u5230\u91cd\u9ede\u53bb\u8655\u7406\u3002<br \/>\n\u9019\u6642\u5019\u53ef\u4ee5\u8a66\u8457\u9019\u6a23\u57f7\u884c\u6307\u4ee4\uff1a<br \/>\n<code>sudo rkhunter --check --sk --report-warnings-only --rwo<\/code><\/p>\n<p>\u8b93\u7522\u51fa\u7684\u5831\u544a\u986f\u793a\uff0c\u6703\u53ea\u6709\u986f\u793aWarning\u7684\u72c0\u614b\u3002<br \/>\n\u4f8b\u5982\u6211\u7684\u8a2d\u5099\u51fa\u73fe\u9019\u500b\u5f88\u60f1\u4eba\u7684\u539f\u56e0\u662f\u9019\u6a23\u7684\u60c5\u5f62\uff1a<br \/>\n<code>Warning: The following suspicious (large) shared memory segments have been found:<br \/>\n         Process: \/usr\/lib\/x86_64-linux-gnu\/xfce4\/notifyd\/xfce4-notifyd    PID: ____    Owner: xxx    Size: 4.0MB (configured size allowed: 1.0MB)<br \/>\n         Process: \/usr\/bin\/pcmanfm    PID: ____    Owner: xxx    Size: 64MB (configured size allowed: 1.0MB)<br \/>\n         Process: \/usr\/bin\/lxpanel    PID: ____    Owner: xxx    Size: 2.0MB (configured size allowed: 1.0MB)<br \/>\n         Process: \/usr\/bin\/lxterminal    PID: ____    Owner: xxx    Size: 1.0MB (configured size allowed: 1.0MB)<br \/>\nWarning: Hidden directory found: \/etc\/.java<\/code><br \/>\n<!--more--><br \/>\n\u9019\u500b\u7d50\u679c\uff0c\u770b\u8d77\u4f86\u6709\u5169\u500b\u554f\u984c\u8981\u8655\u7406\u3002<br \/>\n1.<br \/>\n\u9996\u5148\u662fSHM\u5171\u4eab\u8a18\u61b6\u9ad4\uff0c\u9810\u8a2d\u662f\u8d85\u904e1MB\u7684\u57f7\u884c\u6a94\u6848\uff0c\u5c31\u6703\u5224\u65b7\u6709\u7570\u5e38\u3002<br \/>\n\u4f46\u662f\u770b\u5217\u51fa\u4f86\u627e\u5230\u7684\u9805\u76ee\uff0c\u4e26\u4e0d\u50cf\u662f\u6709\u554f\u984c\u7684\u57f7\u884c\u6a94\u6848\u3002<br \/>\n\u6211\u5011\u5c31\u53ef\u4ee5\u5230rkhunter.conf\uff0c\u4fee\u6539\u52a0\u5165\u8981\u5ffd\u7565\u7684\u7a0b\u5f0f\u3002<br \/>\n<code>sudo nano \/etc\/rkhunter.conf<\/p>\n<p>\u627e\u5230\u4e0b\u65b9\u95dc\u9375\u5b57\u985e\u4f3c\u9019\u6a23\uff1a<br \/>\n# Allow the specified process pathnames to use shared memory segments.<br \/>\n#<br \/>\n# This option may be specified more than once, and may use wildcard characters.<br \/>\n#<br \/>\n# The default value is the null string.<br \/>\n#<br \/>\n#ALLOWIPCPROC=\/usr\/bin\/firefox<br \/>\n#ALLOWIPCPROC=\/usr\/bin\/vlc<br \/>\nALLOWIPCPROC=\/usr\/bin\/lxpanel<br \/>\nALLOWIPCPROC=\/usr\/bin\/pcmanfm<br \/>\nALLOWIPCPROC=\/usr\/lib\/x86_64-linux-gnu\/xfce4\/notifyd\/xfce4-notifyd<br \/>\nALLOWIPCPROC=\/usr\/bin\/lxterminal<\/code><\/p>\n<p>2.<br \/>\n\u63a5\u8457\u662f\u96b1\u85cf\u8cc7\u6599\u593e\u7684\u90e8\u5206\uff0c\u6709\u4e00\u4e9b\u5c08\u7528\u7684\u5957\u4ef6\u6703\u662f\u9019\u6a23\u7684\u8655\u7406\u3002<br \/>\n\u6240\u4ee5\u53ea\u8981\u78ba\u5b9a\u6383\u7784\u5230\u7684\u8cc7\u6599\u593e\u662f\u7121\u7919\u7121\u5bb3\u7684\uff0c\u6211\u5011\u53ef\u4ee5\u5230rkhunter.conf\uff0c\u4fee\u6539\u52a0\u5165\u8981\u5ffd\u7565\u7684\u8cc7\u6599\u593e\u3002<br \/>\n\u50cf\u6211\u9019\u6b21\u63d0\u9192\u7684\u662fJAVA\u7684\u7a0b\u5f0f\u57f7\u884c\u6a94\uff0c\u6211\u9700\u8981\u628a#\u53bb\u9664\u4f86\u5ffd\u7565\u3002<br \/>\n<code>sudo nano \/etc\/rkhunter.conf<\/p>\n<p>\u627e\u5230\u4e0b\u65b9\u95dc\u9375\u5b57\u985e\u4f3c\u9019\u6a23\uff1a<br \/>\n# Allow the specified hidden directory to be whitelisted.<br \/>\n#<br \/>\n# This option may be specified more than once, and may use wildcard characters.<br \/>\n#<br \/>\n# The default value is the null string.<br \/>\nALLOWHIDDENDIR=\/etc\/.java<br \/>\n#ALLOWHIDDENDIR=\/etc\/.git<br \/>\n#ALLOWHIDDENDIR=\/dev\/.lxc<br \/>\n<\/code><\/p>\n<p>\u4ee5\u4e0a\u9019\u6a23\u65b0\u589e\u8a2d\u5b9a\u5f8c\uff0c\u518d\u57f7\u884c\u4e00\u6b21\u6383\u63cf\u61c9\u8a72\u5c31\u4e0d\u6703\u518d\u7522\u751f\u8aa4\u5224\u7684\u7591\u554f\u6a94\u6848\u4e86\u3002<br \/>\n\u81f3\u65bc\u9810\u8a2d\u6383\u63cf\u8d85\u904e1MB\u7684\u6a94\u6848\uff0c\u96d6\u7136rkhunter.conf\u6709\u9019\u500b\u8a2d\u5b9a\u53ef\u4ee5\u52a0\u5927\u6a94\u6848\u3002<br \/>\n\u4f46\u662f\u6211\u500b\u4eba\u50be\u5411\u4fdd\u7559\uff0c\u9019\u6a23\u5b83\u81ea\u52d5\u6392\u7a0b\u6383\u63cf\u7684\u6642\u5019\uff0c\u5982\u679c\u4e5f\u6709\u65b0\u4f86\u7684\u7570\u5e38\u7684\u57f7\u884c\u6a94\u6848\uff0c\u624d\u6703\u53ca\u6642\u518d\u88ab\u767c\u73fe\u5230\u8df3\u8b66\u5831\u63d0\u9192\u3002<br \/>\n<code># This option can be used to set the maximum shared memory segment size<br \/>\n# (in bytes) that is not considered suspicious. Any segment above this size,<br \/>\n# and with 600 or 666 permissions, will be considered suspicious during the<br \/>\n# shared memory check.<br \/>\n#<br \/>\n# The default is 1048576 (1M) bytes.<br \/>\n#<br \/>\n#IPC_SEG_SIZE=1048576<\/code><\/p>\n<p>\u5176\u4ed6\u53c3\u8003\u6587\u7ae0\uff1a<br \/>\n<a href=\"https:\/\/www.atlantic.net\/dedicated-server-hosting\/detect-linux-security-holes-and-rootkits-with-rkhunter-on-ubuntu\/\" rel=\"noopener\" target=\"_blank\">https:\/\/www.atlantic.net\/dedicated-server-hosting\/detect-linux-security-holes-and-rootkits-with-rkhunter-on-ubuntu\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>rkhunter\u5728LINUX\u7cfb\u7d71\u4e2d\uff0c\u662f\u4e00\u500b\u5f88\u597d\u7684\u5c0f\u5957\u4ef6\uff0c\u5e6b\u5fd9\u8f14\u52a9\u6383\u63cf\u5224\u65b7\u81ea\u5df1\u7684\u7cfb\u7d71\u6709\u6c92\u6709\u88ab\u60e1\u610f\u611f\u67d3\u6216\u57f7\u884c\u7570\u5e38\u7684\u7a0b\u5f0f\u3002 \u4f46\u662f\u6709\u4e00\u4e9b\u9810\u8a2d\u7684\u53c3\u6578\uff0c\u82e5\u6c92\u6709\u9069\u7576\u7684\u5fae\u8abf\uff0c\u6703\u4e00\u76f4\u51fa\u73fe\u8aa4\u5224\u548c\u63d0\u9192\u8a2d\u5099\u5df2\u7d93\u6709\u554f\u984c\u3002 \u7528\u5b83\u7522\u51fa\u7684LOG\u6a94\u6848\uff0c\u6709\u6642\u5019\u9805\u76ee\u592a\u591a\uff0c\u4e5f\u5f88\u96e3\u95b1\u8b80\u548c\u627e\u5230\u91cd\u9ede\u53bb\u8655\u7406\u3002 \u9019\u6642\u5019\u53ef\u4ee5\u8a66\u8457\u9019\u6a23\u57f7\u884c\u6307\u4ee4\uff1a sudo rkhunter &#8211;check &#8211;sk &#8211;report-warnings-only &#8211;rwo \u8b93\u7522\u51fa\u7684\u5831\u544a\u986f\u793a\uff0c\u6703\u53ea\u6709\u986f\u793aWarning\u7684\u72c0\u614b\u3002 \u4f8b\u5982\u6211\u7684\u8a2d\u5099\u51fa\u73fe\u9019\u500b\u5f88\u60f1\u4eba\u7684\u539f\u56e0\u662f\u9019\u6a23\u7684\u60c5\u5f62\uff1a Warning: The following suspicious (large) shared memory segments have been found: Process: \/usr\/lib\/x86_64-linux-gnu\/xfce4\/notifyd\/xfce4-notifyd PID: ____ Owner: xxx Size: 4.0MB (configured size allowed: 1.0MB) Process: \/usr\/bin\/pcmanfm PID: ____ &#8230; <a href=\"https:\/\/jir.idv.tw\/wordpress\/?p=3118\" class=\"readmore\">Read more (\u5b8c\u6574\u6587\u7ae0\u5167\u5bb9)<span class=\"screen-reader-text\">\u5982\u4f55\u5728rkhunter\u627e\u5230\u7591\u4f3c\u611f\u67d3\u7684\u9805\u76ee\u548c\u5fae\u8abf\u53c3\u6578\u964d\u4f4e\u8aa4\u5224<\/span><span class=\"fa fa-angle-double-right\" aria-hidden=\"true\"><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-3118","post","type-post","status-publish","format-standard","hentry","category-4","content-layout-excerpt-thumb"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3118"}],"version-history":[{"count":3,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3118\/revisions"}],"predecessor-version":[{"id":3121,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3118\/revisions\/3121"}],"wp:attachment":[{"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jir.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}