{"id":3139,"date":"2023-02-10T10:21:00","date_gmt":"2023-02-10T01:21:00","guid":{"rendered":"https:\/\/www.kinryo.net\/?p=3139"},"modified":"2025-05-29T13:31:24","modified_gmt":"2025-05-29T04:31:24","slug":"%ef%bc%96%ef%bc%9a%e3%82%a2%e3%83%b3%e3%83%81%e3%82%a6%e3%82%a4%e3%83%ab%e3%82%b9%e3%82%bd%e3%83%95%e3%83%88%e5%b0%8e%e5%85%a5clam-antivirus","status":"publish","type":"post","link":"https:\/\/www.kinryo.net\/?p=3139","title":{"rendered":"\uff16\uff1a\u30a2\u30f3\u30c1\u30a6\u30a4\u30eb\u30b9\u30bd\u30d5\u30c8\u5c0e\u5165(Clam AntiVirus)"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">\u53c2\u8003\uff1ahttps:\/\/centossrv.com\/almalinux\/clamav.shtml<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">dnf install -y epel-release<\/span>\u3000\u2190\u3000EPEL\u30ea\u30dd\u30b8\u30c8\u30ea\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">dnf -y install clamav clamav-server-systemd clamav-update clamav-scanner-systemd<\/span>\u3000\u2190\u3000Clam AntiVirus\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">gedit \/etc\/freshclam.conf<\/span><br \/><span style=\"color: #0000ff;\">#NotifyClamd \/path\/to\/clamd.conf\u3000\u3000\u2190 #\u3092\u53d6\u3063\u3066\u4e0b\u8a18\u306b\u5909\u66f4<\/span><br \/><span style=\"color: #0000ff;\">NotifyClamd \/etc\/clamd.d\/scan.conf\u3000\u2190\u3000\u8ffd\u52a0\uff08\u30a6\u30a4\u30eb\u30b9\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u66f4\u65b0\u3092clamd\u306b\u901a\u77e5\u3059\u308b\uff09<\/span> <br \/>\u4fdd\u5b58\u5f8c<br \/><span style=\"color: #ff6600;\">#<\/span><span style=\"color: #008000;\"> freshclam<\/span>\u3000\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb\u6700\u65b0\u5316<br \/><span style=\"color: #0000ff;\">\u524d\u7565<\/span><br \/><span style=\"color: #0000ff;\">bytecode.cvd updated (version: 333, sigs: 92, f-level: 63, builder: awillia2)<\/span><br \/><span style=\"color: #0000ff;\">ERROR: NotifyClamd: No communication socket specified in \/etc\/clamd.d\/scan.conf<\/span><br \/><span style=\"color: #0000ff;\">ERROR: Can&#8217;t send to clamd: Socket operation on non-socket<\/span><br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">gedit \/etc\/clamd.d\/scan.conf<\/span>\u3000\u3000\u2190\u3000Clam AntiVirus\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u7de8\u96c6<br \/><span style=\"color: #0000ff;\">#User clamscan\u3000\u2190\u3000\u884c\u982d\u306b#\u3092\u8ffd\u52a0\u3057\u3066\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8(root\u6a29\u9650\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u3059\u308b)<\/span><\/p>\r\n<p><span style=\"color: #0000ff;\">\r\n\r\n<\/span><\/p>\r\n<p class=\"wp-block-paragraph\"><span style=\"color: #0000ff;\"># Path to a local socket file the daemon will listen on.<\/span><br \/><span style=\"color: #0000ff;\"># Default: disabled (must be specified by a user)<\/span><br \/><span style=\"color: #0000ff;\">LocalSocket \/run\/clamd.scan\/clamd.sock\u3000\u2190\u3000\u884c\u982d\u306e#\u3092\u524a\u9664<\/span><\/p>\r\n<p><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">systemctl start clamd@scan<\/span>\u3000\u2190\u3000clamd\u8d77\u52d5<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">systemctl enable clamd@scan<\/span>\u3000\u2190\u3000clamd\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a [root@almalinux ~]<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">systemctl start clamav-freshclam<\/span>\u3000\u2190\u3000clamav-freshclam\u8d77\u52d5 [root@almalinux ~]<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">systemctl enable clamav-freshclam<\/span>\u3000\u2190\u3000clamav-freshclam\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a <br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">clamdscan -c \/etc\/clamd.d\/scan.conf &#8211;remove<\/span>\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u30b9\u30ad\u30e3\u30f3\u30c6\u30b9\u30c8(\u30a6\u30a4\u30eb\u30b9\u306a\u3057\u306e\u5834\u5408)<br \/><span style=\"color: #ff6600;\">\/root: OK<\/span><\/p>\r\n<p><span style=\"color: #ff6600;\">\r\n\r\n<\/span><\/p>\r\n<p class=\"wp-block-paragraph\"><span style=\"color: #ff6600;\">&#8212;&#8212;&#8212;&#8211; SCAN SUMMARY &#8212;&#8212;&#8212;&#8211;<\/span><br \/><span style=\"color: #ff6600;\">Infected files: 0<\/span><br \/><span style=\"color: #ff6600;\">Time: 53.727 sec (0 m 53 s)<\/span><br \/><span style=\"color: #ff6600;\">Start Date: 2023:02:10 09:54:05<\/span><br \/><span style=\"color: #ff6600;\">End Date: 2023:02:10 09:54:59<\/span><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">wget http:\/\/www.eicar.org\/download\/eicar.com<\/span>\u3000\u2190\u3000\u30c6\u30b9\u30c8\u7528\u30a6\u30a4\u30eb\u30b9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">wget http:\/\/www.eicar.org\/download\/eicar.com.txt<\/span>\u3000\u2190\u3000\u3003 <br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">wget http:\/\/www.eicar.org\/download\/eicar_com.zip<\/span>\u3000\u2190\u3000\u3003 <br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">wget http:\/\/www.eicar.org\/download\/eicarcom2.zip<\/span>\u3000\u2190\u3000\u3003<\/p>\r\n<p><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">clamdscan -c \/etc\/clamd.d\/scan.conf &#8211;remove<\/span>\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u30b9\u30ad\u30e3\u30f3\u30c6\u30b9\u30c8(\u30a6\u30a4\u30eb\u30b9\u3042\u308a\u306e\u5834\u5408) <br \/><span style=\"color: #ff6600;\">\/root\/eicar.com: Eicar-Test-Signature FOUND\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u691c\u77e5 \/root\/eicar.com: Removed.\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u524a\u9664 <\/span><br \/><span style=\"color: #ff6600;\">\/root\/eicar.com.txt: Eicar-Test-Signature FOUND\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u691c\u77e5 \/root\/eicar.com.txt: Removed.\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u524a\u9664 <\/span><br \/><span style=\"color: #ff6600;\">\/root\/eicar_com.zip: Eicar-Test-Signature FOUND\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u691c\u77e5 \/root\/eicar_com.zip: Removed.\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u524a\u9664 \/root\/eicarcom2.zip: Eicar-Test-Signature FOUND\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u691c\u77e5 <\/span><br \/><span style=\"color: #ff6600;\">\/root\/eicarcom2.zip: Removed.\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u524a\u9664 <\/span><br \/><span style=\"color: #ff6600;\">&#8212;&#8212;&#8212;&#8211; SCAN SUMMARY &#8212;&#8212;&#8212;&#8211; <\/span><br \/><span style=\"color: #ff6600;\">Infected files: 4\u3000\u2190\u30004\u3064\u306e\u30a6\u30a4\u30eb\u30b9\u3092\u691c\u77e5\u3057\u305f <\/span><br \/><span style=\"color: #ff6600;\">Time: 23.913 sec (0 m 23 s)<\/span><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">gedit \/etc\/cron.daily\/clamdscan<\/span>\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u30b9\u30ad\u30e3\u30f3\u65e5\u6b21\u5b9f\u884c\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210 <br \/><span style=\"color: #0000ff;\">#!\/bin\/bash <\/span><br \/><span style=\"color: #0000ff;\"># \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/span><br \/><span style=\"color: #0000ff;\">CONFIG=\/etc\/clamd.d\/scan.conf <\/span><br \/><span style=\"color: #0000ff;\"># \u30b9\u30ad\u30e3\u30f3\u5b9f\u884c # \u203b\u30a6\u30a4\u30eb\u30b9\u691c\u77e5\u6642\u306f\u9694\u96e2\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u9694\u96e2 <\/span><br \/><span style=\"color: #0000ff;\">CLAMSCANLOG=`mktemp` <\/span><br \/><span style=\"color: #0000ff;\">QUARANTINEDIR=\/tmp\/clamdscan-quarantinedir-$(date +%Y%m%d) <\/span><br \/><span style=\"color: #0000ff;\">mkdir -p ${QUARANTINEDIR}<\/span><br \/><span style=\"color: #0000ff;\">clamdscan -c ${CONFIG} &#8211;move=${QUARANTINEDIR} \/ &gt; ${CLAMSCANLOG} 2&gt;&amp;1<\/span><br \/><span style=\"color: #0000ff;\"># \u30a6\u30a4\u30eb\u30b9\u691c\u77e5\u6642\u306e\u307froot\u5b9b\u306b\u30e1\u30fc\u30eb\u901a\u77e5<\/span><br \/><span style=\"color: #0000ff;\">if [ -z &#8220;$(grep FOUND$ ${CLAMSCANLOG})&#8221; ]; then<\/span><br \/><span style=\"color: #0000ff;\">rm -rf ${QUARANTINEDIR}<\/span><br \/><span style=\"color: #0000ff;\">else<\/span><br \/><span style=\"color: #0000ff;\">grep -A 1 FOUND$ ${CLAMSCANLOG} | mail -s &#8220;Virus Found in `hostname` =&gt; ${QUARANTINEDIR}&#8221; root<\/span><br \/><span style=\"color: #0000ff;\">fi<\/span><br \/><span style=\"color: #0000ff;\"># \u30b9\u30ad\u30e3\u30f3\u30ed\u30b0\u3092\u30b7\u30b9\u30ed\u30b0\u306b\u51fa\u529b cat ${CLAMSCANLOG} | logger -t $(basename ${0})<\/span><br \/><span style=\"color: #0000ff;\">rm -f ${CLAMSCANLOG}<\/span><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">chmod +x \/etc\/cron.daily\/clamdsca<\/span>n\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u30b9\u30ad\u30e3\u30f3\u65e5\u6b21\u5b9f\u884c\u30b9\u30af\u30ea\u30d7\u30c8\u3078\u5b9f\u884c\u6a29\u9650\u4ed8\u52a0<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">echo ExcludePath ^\/tmp\/clamdscan-quarantinedir-.*\/ &gt;&gt; \/etc\/clamd.d\/scan.conf<\/span>\u3000\u2190\u3000\u30a6\u30a4\u30eb\u30b9\u9694\u96e2\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u5916\u306b\u3059\u308b<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">echo ExcludePath ^\/proc\/ &gt;&gt; \/etc\/clamd.d\/scan.conf<\/span>\u3000\u2190\u3000\u4f8b\u3068\u3057\u3066\/proc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u5916\u306b\u3059\u308b<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">echo ExcludePath ^\/sys\/ &gt;&gt; \/etc\/clamd.d\/scan.conf<\/span>\u3000\u2190\u3000\u4f8b\u3068\u3057\u3066\/sys\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30b9\u30ad\u30e3\u30f3\u5bfe\u8c61\u5916\u306b\u3059\u308b<br \/><span style=\"color: #ff6600;\">#<\/span> <span style=\"color: #008000;\">systemctl restart clamd@scan<\/span>\u3000\u2190\u3000clamd\u518d\u8d77\u52d5\uff08\u30b9\u30ad\u30e3\u30f3\u9664\u5916\u8a2d\u5b9a\u53cd\u6620\uff09<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\uff1ahttps:\/\/centossrv.com\/almalinux\/clamav.shtml# dnf install -y epel-release\u3000\u2190\u3000EPEL\u30ea\u30dd\u30b8\u30c8\u30ea\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb# dnf -y install &hellip; <a href=\"https:\/\/www.kinryo.net\/?p=3139\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","footnotes":""},"categories":[27],"tags":[],"class_list":["post-3139","post","type-post","status-publish","format-standard","hentry","category-almalinux"],"acf":[],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/3139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3139"}],"version-history":[{"count":3,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/3139\/revisions"}],"predecessor-version":[{"id":4263,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=\/wp\/v2\/posts\/3139\/revisions\/4263"}],"wp:attachment":[{"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kinryo.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}