{"id":11430,"date":"2026-07-10T14:46:03","date_gmt":"2026-07-10T05:46:03","guid":{"rendered":"https:\/\/www.k-in.co.jp\/niwakan\/?p=11430"},"modified":"2026-08-07T16:50:47","modified_gmt":"2026-08-07T07:50:47","slug":"apache%e3%81%aeaccess_log%e3%81%8b%e3%82%89%e6%8e%92%e9%99%a4%e3%81%99%e3%82%8bip%e3%82%92%e6%8e%a2%e3%81%99%ef%bc%88%e3%81%9d%e3%81%ae2%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.k-in.co.jp\/niwakan\/archives\/2026\/07\/11430\/","title":{"rendered":"apache\u306eaccess_log\u304b\u3089\u6392\u9664\u3059\u308bip\u3092\u63a2\u3059\uff08\u305d\u306e2\uff09"},"content":{"rendered":"<p>\u30ed\u30b0\u304c\u7a7a\u3044\u3066\u304f\u308b\u3068\u3001\u8272\u3005\u306a\u3082\u306e\u304c\u898b\u3048\u3066\u304f\u308b\u3002<br \/>\n\u4f8b\u3048\u3070\u3053\u3046\u8a00\u3063\u305f\u306e\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"access_log\">2026\/07\/10 12:01:19 (165.154.41.232)- \"GET \/ HTTP\/1.1\" 200 334 \"-\" \"curl\/7.29.0\"\r\n2026\/07\/10 12:04:20 (47.250.82.134)- \"GET \/ HTTP\/1.1\" 200 334 \"-\" \"curl\/7.64.1\"\r\n2026\/07\/10 12:04:25 (47.250.82.134)- \"GET \/ HTTP\/1.1\" 200 334 \"-\" \"curl\/7.74.0\"<\/pre>\n<p><!--more--><\/p>\n<p>\u306a\u306e\u3067\u3001\u4f55\u6642\u3082\u306e\u69d8\u306b\u3001\u3053\u3046\u3084\u3063\u3066\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\">#!\/bin\/sh\r\n#\r\n# add_pf_curl.sh\r\n# curl\u4f7f\u3063\u3066\u304f\u308b\u3088\u3046\u306a\u9023\u4e2d\u3092\u6392\u9664\u3059\u308b\r\n#\r\ngrep \"200 .* curl\" \/opt\/local\/var\/log\/apache2\/access_log | \\\r\ngrep -v \"192\\.168\\.0\\.[0-9]{1,3}\" | \r\ngrep -v \"49.96.23[2-9]\\.[0-9]{1,3}\" | \\\r\ngrep -oE \"\\(([0-9]{1,3}\\.){3}[0-9]{1,3}\\)\" | \\\r\nsed 's\/[()]\/\/g' | \\\r\nsort -u | pfctl -t murus.blacklist -T add -f -<\/pre>\n<p>\u3053\u308c\u3067curl\u3067\u6765\u308b\u9023\u4e2d\u3092\u5f3e\u3051\u308b\u3002<br \/>\n\u3053\u308c\u3067\u554f\u984c\u306a\u3051\u308c\u3070\u826f\u3044\u306e\u3060\u3051\u308c\u3069\u3002<br \/>\n\u305d\u308c\u3068\u3001daylyPF.sh\u304c\u968f\u5206\u3068\u592a\u3063\u3066\u3057\u307e\u3063\u305f\u3002<\/p>\n<pre class=\"height:300 lang:default decode:true\" title=\"\">#!\/bin\/sh\r\n#\r\n# dayliyPF.sh\r\n#\r\n\r\n# 1. postfix.log\u304b\u3089submission\u306b\u76f4\u63a5access\u304d\u305f\u5974\u3089\u3092pf\u306b\u767b\u9332\u3057\u3066\u66ab\u304f\u5f3e\u304f\r\n\/usr\/local\/sbin\/add_pf_unknown.sh > \/var\/tmp\/daylyPF.tmp\r\n\r\n# 2. postfix.log\u304b\u3089authentication failed\u3092\u62fe\u3063\u3066pf\u306b\u767b\u9332\u3059\u308b\r\n\/usr\/local\/sbin\/add_pf_authFailed.sh >> \/var\/tmp\/daylyPF.tmp\r\n\r\n# 3. dovecot\u306einfo.log\u304b\u3089dovecot\u306bscan\u3057\u3066\u304d\u305f\u5974\u3089\u3092pf\u306b\u767b\u9332\u3057\u3066\u5f3e\u304f\r\n\/usr\/local\/sbin\/add_pf_dovecot.sh\r\n\r\n# 4. postfix.log\u304b\u3089DNSBL rank\u3067\u5f3e\u304f\r\n\/usr\/local\/sbin\/add_pf_DNSBLrank.sh\r\n\r\n# 5. postfix.log\u304b\u3089PREGREET\u3067\u5f3e\u304f\r\n\/usr\/local\/sbin\/add_pf_pregreet.sh\r\n\r\n# 6. apache2\u306eaccess_log\u304b\u3089status code \"400 224\"\u3092\u5f3e\u304f\r\n\/usr\/local\/sbin\/add_pf_http.sh\r\n\r\n# 7. curl\u4f7f\u3063\u3066\u304f\u308b\u3088\u3046\u306a\u9023\u4e2d\u3092\u6392\u9664\u3059\u308b\r\n\/usr\/local\/sbin\/add_pf_curl.sh\r\n\r\n# last. \u4eca\u56de\u66f8\u304d\u8fbc\u3093\u3060\u30d6\u30ed\u30c3\u30af\u6570\u3092\u30ed\u30b0\u306b\u66f8\u304d\u51fa\u3059\r\necho \"$(date '+%Y\u5e74%m\u6708%d\u65e5 %H\u6642%M\u5206%S\u79d2') - Current blocklist count: $(sudo pfctl -t murus.blacklist -T show | wc -l)\" >> \/opt\/local\/var\/log\/pf\/pf_update_history.log<\/pre>\n<p>\u6bce\u56depfctl\u3092\u52d5\u304b\u3057\u3066\u3044\u308b\uff08\u307e\u3041\u5927\u3057\u305f\u8ca0\u8377\u3058\u3083\u306a\u3044\u3093\u3060\u3051\u308c\u3069\uff09\u304b\u3089\u3001\u7d71\u4e00\u3059\u308b\u306e\u3082\u826f\u3055\u305d\u3046\u3060\u3002<br \/>\ntmp file\u306b\u66f8\u304d\u51fa\u3057\u3066\u3001\u305d\u308c\u3092\u4e00\u62ec\u3067pfctl\u306b\u9001\u308a\u8fbc\u3080\u3053\u3068\u3082\u8003\u3048\u3088\u3046\u3002<br \/>\n\u30ed\u30b0\u3082\u5358\u4f53\uff08daylyPF.sh\u306e\u62bd\u51fa\u5206\uff09\u3067\u5224\u308b\u3057\u3002\uff08\u4f46\u3057\u3001\u5168\u90e8\u767b\u9332\u3055\u308c\u305f\u304b\u306f\u5224\u3089\u306a\u3044\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ed\u30b0\u304c\u7a7a\u3044\u3066\u304f\u308b\u3068\u3001\u8272\u3005\u306a\u3082\u306e\u304c\u898b\u3048\u3066\u304f\u308b\u3002 \u4f8b\u3048\u3070\u3053\u3046\u8a00\u3063\u305f\u306e\u3002 2026\/07\/10 12:01:19 (165.154.41.232)- &#8220;GET \/ HTTP\/1.1&#8221; 200 334 &#8220;-&#8221; &#8220;curl\/7.2 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.k-in.co.jp\/niwakan\/archives\/2026\/07\/11430\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;apache\u306eaccess_log\u304b\u3089\u6392\u9664\u3059\u308bip\u3092\u63a2\u3059\uff08\u305d\u306e2\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[246],"tags":[159,245],"class_list":["post-11430","post","type-post","status-publish","format-standard","hentry","category-my-macmini-server","tag-apache","tag-packet-filter"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/11430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/comments?post=11430"}],"version-history":[{"count":2,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/11430\/revisions"}],"predecessor-version":[{"id":11751,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/posts\/11430\/revisions\/11751"}],"wp:attachment":[{"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/media?parent=11430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/categories?post=11430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.k-in.co.jp\/niwakan\/wp-json\/wp\/v2\/tags?post=11430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}