{"id":810,"date":"2015-06-11T09:01:25","date_gmt":"2015-06-11T00:01:25","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=810"},"modified":"2015-06-15T11:23:42","modified_gmt":"2015-06-15T02:23:42","slug":"wordpress-spam-ip-deny-list","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2015\/06\/11\/wordpress-spam-ip-deny-list\/","title":{"rendered":"WordPress \u3078\u306espam \u6295\u7a3f\u3092\u3057\u305f\u3053\u3068\u306e\u3042\u308bIP \u3092\u62d2\u5426\u3059\u308b\u3088\u3046\u306b\u3057\u305f"},"content":{"rendered":"<div style=\"font-family: 'Lucida Grande', 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Lucida Sans Unicode', Helvetica, Arial, sans-serif; font-size: 0.9em; overflow-x: hidden; overflow-y: auto; margin: 0px !important; padding: 5px 20px 26px !important; background-color: rgb(255, 255, 255);font-family: 'Hiragino Sans GB', 'Microsoft YaHei', STHeiti, SimSun, 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Segoe UI', AppleSDGothicNeo-Medium, 'Malgun Gothic', Verdana, Tahoma, sans-serif; padding: 20px;padding: 20px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', STHeiti, SimSun, 'Segoe UI', AppleSDGothicNeo-Medium, 'Malgun Gothic', Arial, freesans, sans-serif; font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; background: rgb(255, 255, 255);\">\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u6700\u8fd1WordPress \u3078\u306e\u30b3\u30e1\u30f3\u30c8\u3068\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u30b9\u30d1\u30e0\u304c\u9177\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002URL \u304c\u542b\u307e\u308c\u3066\u3044\u308b\u7269\u306f\u627f\u8a8d\u304c\u5fc5\u8981\u306a\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u9762\u5012\u3067\u3059\u3002\u3053\u306e\u3068\u304d\u306b\u30b9\u30d1\u30e0\u306f\u30b9\u30d1\u30e0\u3060\u3068\u624b\u52d5\u3067\u632f\u308a\u5206\u3051\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u632f\u308a\u5206\u3051\u305f\u3082\u306e\u304b\u3089IP \u3092\u629c\u304d\u51fa\u3057\u3066\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3092\u639b\u3051\u308b\u3068\u307e\u3057\u306b\u306a\u3089\u306a\u3044\u304b\u3068\u8a2d\u5b9a\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h1 id=\"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u8a72\u5f53ip-\u3092\u629c\u304d\u51fa\u3059\" style=\"clear: both;font-size: 2.2em; font-weight: bold; margin: 1.5em 0px 1em;\"><a name=\"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u8a72\u5f53ip-\u3092\u629c\u304d\u51fa\u3059\" href=\"#\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u8a72\u5f53ip-\u3092\u629c\u304d\u51fa\u3059\" style=\"text-decoration: none; vertical-align: baseline;color: rgb(50, 105, 160);\"><\/a>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u8a72\u5f53IP \u3092\u629c\u304d\u51fa\u3059<\/h1>\n<p style=\"margin-top: 0px;margin: 1em 0px; word-wrap: break-word;\">MySQL \u304b\u3089\u30b9\u30d1\u30e0\u3092\u6307\u5b9a\u3057\u305fIP \u306e\u4e00\u89a7\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u53d6\u5f97\u51fa\u6765\u305d\u3046\u3067\u3059\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"sql\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ cat \/etc\/wordpress\/spamcommentip.sql\r\n<span class=\"hljs-operator\"><span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">SELECT<\/span> comment_author_IP <span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">FROM<\/span> wordpress.wp_comments <span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">WHERE<\/span> comment_approved=<span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">'spam'<\/span>\r\n$ \/usr\/<span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">bin<\/span>\/mysql -umy -p &lt; \/etc\/wordpress\/spamcommentip.<span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">sql<\/span> | \/usr\/<span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">bin<\/span>\/sort -n | \/usr\/<span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\">bin<\/span>\/uniq -c| sort -n|cut -c-<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">7<\/span>|uniq -c\r\n     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">81<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>\r\n     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">31<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">2<\/span>\r\n     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">26<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">3<\/span>\r\n     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">12<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">4<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">8<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">5<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">9<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">6<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">4<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">7<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">9<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">8<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>       <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">9<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">10<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">3<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">11<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">2<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">12<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">3<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">13<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">14<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">15<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">18<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">4<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">20<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">22<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">23<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">24<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">26<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">43<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">82<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">119<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">146<\/span>\r\n      <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>     <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">394<\/span>\r\n<\/span><\/code><\/pre>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u81ea\u52d5\u5316\u3057\u305f\u3044\u306e\u3067\u3001MySQL \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u70ba\u306eMySQL \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3068\u3001IP \u3092\u629c\u304d\u51fa\u3059sql\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">MySQL \u30a2\u30af\u30bb\u30b9\u306e\u70ba\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/p>\n<pre class=\"bash hljs\" style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ <span class=\"hljs-built_in\" style=\"color: rgb(38, 139, 210);\">cd<\/span> \/etc\/wordpress\r\n$ <span class=\"hljs-built_in\" style=\"color: rgb(38, 139, 210);\">umask<\/span> <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">077<\/span>\r\n$ sudo touch .my.conf\r\n$ sudo chown www-data.root .my.conf\r\n$ vi .my.conf\r\ncat .my.conf \r\nuser=wp\r\npassword=XXXXXXXXXXXXXX\r\ndatabase=wordpress\r\n<\/code><\/pre>\n<\/li>\n<li style=\"display: list-item; line-height: 1.4em;\">\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">IP \u3092\u629c\u304d\u51fa\u3059\u70ba\u306esql\u30d5\u30a1\u30a4\u30eb<\/p>\n<pre class=\"bash hljs\" style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ sudo vi \/etc\/wordpress\/spamcommentip.sql\r\n$ cat $ cat \/etc\/wordpress\/spamcommentip.sql\r\nSELECT comment_author_IP FROM wordpress.wp_comments WHERE comment_approved=<span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">'spam'<\/span>\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066IP \u306e\u4e00\u89a7\u304c\u53d6\u5f97\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ \/usr\/bin\/mysql --defaults-file=\/etc\/wordpress\/.my.conf &lt; \/etc\/wordpress\/spamcommentip.sql\r\n<\/code><\/pre>\n<h1 id=\"apache-httpd-\u306e-.htaccess-\u3067\u6307\u5b9aip\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u306e-wordpress-\u306e\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u3068\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u3092\u5236\u9650\" style=\"clear: both;font-size: 2.2em; font-weight: bold; margin: 1.5em 0px 1em;\"><a name=\"apache-httpd-\u306e-.htaccess-\u3067\u6307\u5b9aip\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u306e-wordpress-\u306e\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u3068\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u3092\u5236\u9650\" href=\"#apache-httpd-\u306e-.htaccess-\u3067\u6307\u5b9aip\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u306e-wordpress-\u306e\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u3068\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u3092\u5236\u9650\" style=\"text-decoration: none; vertical-align: baseline;color: rgb(50, 105, 160);\"><\/a>apache httpd \u306e .htaccess \u3067\u6307\u5b9aIP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u306e WordPress \u306e\u30b3\u30e1\u30f3\u30c8\u6295\u7a3f\u3068\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u3092\u5236\u9650<\/h1>\n<p style=\"margin-top: 0px;margin: 1em 0px; word-wrap: break-word;\">Debian \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3067 WordPress \u3092\u5c0e\u5165\u3057\u3066\u3044\u308b\u306e\u3067\u5c0e\u5165\u30d1\u30b9\u306f <code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">\/usr\/share\/wordpress\/<\/code> \u3067\u3059\u3002<br style=\"clear: both;\">\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306f <code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">\/etc\/wordpress<\/code> \u4ee5\u4e0b\u3067\u3059\u3002<br style=\"clear: both;\"><code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">\/usr\/share\/wordpress\/.htaccess<\/code> \u306f <code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">\/etc\/wordpress\/htaccess<\/code> \u306e\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u30ea\u30f3\u30af\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u30a2\u30af\u30bb\u30b9\u5236\u9650\u3092\u3059\u308b\u306b\u306f <code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">.htaccess<\/code> \u306b <code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">deny from ip address<\/code> \u306a\u611f\u3058\u3067\u884c\u3051\u307e\u3059\u3002<br style=\"clear: both;\">\u3055\u3063\u304d\u306eIP\u306e\u4e00\u89a7\u53d6\u5f97\u6642\u306b\u4e26\u3079\u66ff\u3048\u3066\u540c\u4e00IP\u3092\u307e\u3068\u3081\u3066\u982d\u306b<code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">deny from<\/code> \u3092\u4ed8\u3051\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ \/usr\/bin\/mysql --defaults-file=\/etc\/wordpress\/.my.conf &lt; \/etc\/wordpress\/spamcommentip.sql | \/usr\/bin\/sort -n | \/usr\/bin\/uniq | \/bin\/grep -v <span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">'comment_author_IP'<\/span> | \/bin\/sed <span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">\"s\/^\/  deny from \/\"<\/span>\r\n<\/code><\/pre>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u3042\u307e\u308a\u7121\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u6b63\u3057\u3044IP \u30a2\u30c9\u30ec\u30b9\u3092\u767b\u9332\u3057\u3066\u3057\u307e\u3063\u3066\u3082\u672c\u6587\u304c\u8aad\u3081\u308b\u3088\u3046\u306b\u30b3\u30e1\u30f3\u30c8\u3084\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u3060\u3051\u5236\u9650\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u30b3\u30e1\u30f3\u30c8\u3001\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u306f\u6b21\u306e<code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">wp-comments-post.php \/ wp-trackback.php<\/code> \u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306a\u306e\u3067\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u5236\u9650\u3057\u307e\u3059\u3002<br style=\"clear: both;\"><code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">.htaccess<\/code> \u306e Files \u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u5229\u7528\u3057\u3066\u4ee5\u4e0b\u3088\u3046\u306a\u611f\u3058\u3067\u3044\u3051\u305d\u3046\u3067\u3059\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"apache\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\"><span class=\"hljs-tag\">&lt;Files ~ wp-comments-post.php|wp-trackback.php&gt;<\/span>\r\n  <span class=\"hljs-keyword\" style=\"color: rgb(133, 153, 0);\"><span class=\"hljs-common\">deny<\/span><\/span> from ip address\r\n<span class=\"hljs-tag\">&lt;\/Files&gt;<\/span>\r\n<\/code><\/pre>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u52d5\u4f5c\u78ba\u8a8d\u306f\u81ea\u5206\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e00\u6642\u7684\u306b\u767b\u9332\u3057\u3066\u884c\u3044\u307e\u3057\u305f\u3002blog\u672c\u6587\u306b\u306f\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u3066\u30b3\u30e1\u30f3\u30c8URL \u306f\u62d2\u5426\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">% w3m -dump_head https:\/\/matoken.org\/blog\/blog\/<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">2015<\/span>\/<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">06<\/span>\/<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">09<\/span>\/facebook-pgp\/|head -<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>\r\nHTTP\/<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1.0<\/span> <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">200<\/span> OK\r\n% w3m -dump_head https:\/\/matoken.org\/blog\/wp-comments-post.php|head -<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1<\/span>\r\nHTTP\/<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">1.1<\/span> <span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">403<\/span> Forbidden\r\n<\/code><\/pre>\n<h1 id=\"cron-\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u3059\u308b\" style=\"clear: both;font-size: 2.2em; font-weight: bold; margin: 1.5em 0px 1em;\"><a name=\"cron-\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u3059\u308b\" href=\"#cron-\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u3059\u308b\" style=\"text-decoration: none; vertical-align: baseline;color: rgb(50, 105, 160);\"><\/a>cron \u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u3059\u308b<\/h1>\n<p style=\"margin-top: 0px;margin: 1em 0px; word-wrap: break-word;\">IP list \u306f\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u306b\u3057\u3066\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3059\u308b\u3068\u4fbf\u5229\u305d\u3046\u3067\u3059\u304c\u3001Include \u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f <code style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.5em; border: 0px; background-color: rgba(0, 0, 0, 0.0666667);\">.htaccess<\/code> \u304b\u3089\u306f\u5229\u7528\u51fa\u6765\u7121\u3044\u3088\u3046\u306a\u306e\u3067\u5206\u5272\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u9023\u7d50\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">\/etc\/wordpress\/htaccess_base\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">\u5143\u306ehtaccess<\/li>\n<\/ul>\n<\/li>\n<li style=\"display: list-item; line-height: 1.4em;\">\/etc\/wordpress\/htaccess_spamhead\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">Files \u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u5148\u982d<\/li>\n<\/ul>\n<\/li>\n<li style=\"display: list-item; line-height: 1.4em;\">\/etc\/wordpress\/htaccess_spamiplist\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u629c\u304d\u51fa\u3057\u3066\u4f5c\u6210\u3057\u305f\u62d2\u5426IP\u30ea\u30b9\u30c8<\/li>\n<\/ul>\n<\/li>\n<li style=\"display: list-item; line-height: 1.4em;\">\/etc\/wordpress\/htaccess_spamtail\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">Files \u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u672b\u5c3e<\/li>\n<\/ul>\n<\/li>\n<li style=\"display: list-item; line-height: 1.4em;\">\/etc\/wordpress\/htaccess\n<ul>\n<li style=\"display: list-item; line-height: 1.4em;\">\u6700\u7d42\u7684\u306b\u7d50\u5408\u3055\u308c\u3066.htaccess \u306e\u30ea\u30f3\u30af\u5143\u306b\u306a\u308b\u30d5\u30a1\u30a4\u30eb<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">htaccess_base \/ htaccess_spamhead \/ htaccess_spamtail \u3092\u7528\u610f\u3057\u307e\u3059\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ sudo cp -p \/etc\/wordpress\/htaccess \/etc\/wordpress\/htaccess_base\r\n$ sudo sh -c <span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">\"echo '&lt;Files ~ wp-trackback.php|wp-comments-post.php&gt;' &gt; \/etc\/wordpress\/htaccess_spamhead\"<\/span>\r\n$ sudo sh -c <span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">\"echo '&lt;\/Files&gt;' &gt; \/etc\/wordpress\/htaccess_spamtail\"<\/span>\r\n<\/code><\/pre>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">htaccess_spamiplist \/ htaccess \u306fcron \u30671\u6642\u9593\u6bce\u306b\u4f5c\u6210\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre style=\"border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 0.5em;display: block; overflow-x: auto; padding: 0.5em; color: rgb(101, 123, 131); background: rgb(253, 246, 227);\"><code class=\"bash\" style=\"border: 0px; display: block;font-family: Consolas, Inconsolata, Courier, monospace; font-weight: bold; white-space: pre; margin: 0px;border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: break-word; border: 1px solid rgb(204, 204, 204); padding: 0px 5px; margin: 0px 2px;font-size: 0.9em; font-family: Consolas, Inconsolata, Courier, monospace;\">$ sudo -u www-data crontab <span class=\"hljs-operator\">-e<\/span>\r\n$ sudo -u www-data crontab <span class=\"hljs-operator\">-l<\/span>\r\n<span class=\"hljs-number\" style=\"color: rgb(42, 161, 152);\">14<\/span> * * * *      \/usr\/bin\/mysql --defaults-file=\/etc\/wordpress\/.my.conf &lt; \/etc\/wordpress\/spamcommentip.sql | \/usr\/bin\/sort -n | \/usr\/bin\/uniq | \/bin\/grep -v <span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">'comment_author_IP'<\/span> | \/bin\/sed <span class=\"hljs-string\" style=\"color: rgb(42, 161, 152);\">\"s\/^\/  deny from \/\"<\/span> &gt; \/etc\/wordpress\/htaccess_spamiplist &amp;&amp; \/bin\/cat \/etc\/wordpress\/htaccess-base \/etc\/wordpress\/htaccess_spamhead \/etc\/wordpress\/htaccess_spamiplist \/etc\/wordpress\/htaccess_spamtail &gt; \/etc\/wordpress\/htaccess\r\n<\/code><\/pre>\n<p style=\"margin: 1em 0px; word-wrap: break-word;\">\u3053\u308c\u30671\u6642\u9593\u6bce\u306bWordPress \u4e0a\u3067spam \u3068\u5224\u5b9a\u3057\u305f\u30b3\u30e1\u30f3\u30c8\/\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u306e\u9001\u4fe1\u5143IP \u304b\u3089\u30b3\u30e1\u30f3\u30c8\/\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u3092\u62d2\u5426\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br style=\"clear: both;\">\u3046\u307e\u304f\u3044\u304f\u3068\u3044\u3044\u306e\u3067\u3059\u304c\u2026\u2026\u3002<\/p>\n<p style=\"margin-top: 0px;margin: 1em 0px; word-wrap: break-word;\">\u8ffd\u8a18)<br \/>\u8a2d\u5b9a\u3057\u3066\u6570\u65e5\u7d4c\u3061\u307e\u3057\u305f\u304c\uff0cspam\u6fc0\u6e1b\u3057\u307e\u3057\u305f!<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1WordPress \u3078\u306e\u30b3\u30e1\u30f3\u30c8\u3068\u30c8\u30e9\u30c3\u30af\u30d0\u30c3\u30af\u30b9\u30d1\u30e0\u304c\u9177\u304f\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002URL \u304c\u542b\u307e\u308c\u3066\u3044\u308b\u7269\u306f\u627f\u8a8d\u304c\u5fc5\u8981\u306a\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u9762\u5012\u3067\u3059\u3002\u3053\u306e\u3068\u304d\u306b\u30b9\u30d1\u30e0\u306f\u30b9\u30d1\u30e0\u3060\u3068\u624b\u52d5\u3067\u632f\u308a\u5206\u3051\u3092\u3057\u3066\u3044\u308b\u306e\u3067\u632f\u308a\u5206\u3051\u305f\u3082\u306e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,5],"tags":[276,275,57,274],"class_list":["post-810","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-wordpress","tag-debian-linux","tag-linux","tag-mysql","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=810"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/810\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}