{"id":2639,"date":"2012-07-15T11:35:54","date_gmt":"2012-07-15T09:35:54","guid":{"rendered":"http:\/\/glandium.org\/blog\/?p=2639"},"modified":"2019-09-03T15:30:35","modified_gmt":"2019-09-03T06:30:35","slug":"comment-spam","status":"publish","type":"post","link":"https:\/\/glandium.org\/blog\/?p=2639","title":{"rendered":"Comment spam"},"content":{"rendered":"<p>Three weeks ago, I slightly modified the comment system on this blog for an experiment. This blog is a standard wordpress installation. Comments are normally directed to the <code>wp-comments-post.php<\/code> script by the HTML form. What I did is:<\/p>\n<ul>\n<li>Create a <code>comments-post.php<\/code> wrapper script that just includes <code>wp-comments-post.php<\/code> (this allows things to still work properly after wordpress upgrades),<\/li>\n<li>Make the HTML form direct to a <code>comments-post.php<\/code> script,<\/li>\n<li>Add a <code>usedForm=1<\/code> parameter to the HTML form action, such that <code>comments-post.php<\/code> is supposed to always be called with it,<\/li>\n<li>Add a simple javascript that adds a <code>hasJS=1<\/code> parameter to the HTML form action when the page is loaded, and a <code>Submit=1<\/code> parameter when the form is submitted.<\/li>\n<\/ul>\n<p>During the past three weeks, on this blog, there were 7170 comments, 8 of which were actual comments. 7162 were spam (~99.9%).<\/p>\n<ul>\n<li>3165 spams (~44.1%) were sent to the original WordPress comment handler (<code>wp-comments-post.php<\/code>) from 1589 unique IP addresses.<\/li>\n<li>0 spam were sent to the new comment handler without a query string (<code>comments-post.php<\/code>), but 1 was sent with an empty query string (<code>comments-post.php?<\/code>).<\/li>\n<li>18 spams were sent to the new comment handler with a lowercased query string (<code>comments-post.php?usedform=1<\/code>) from 6 unique IP addresses.<\/li>\n<li>3971 spams (~55.4%) were sent to the new comment handler with the form query string (<code>comments-post.php?usedForm=1<\/code>) from 1153 unique IP addresses.<\/li>\n<li>7 spams (~0.1%) were sent to the new comment handler with the full query string, including what is added through javascript (<code>comments-post.php?usedForm=1&hasJS=1&Submit=1<\/code>) from 5 unique IP addresses.<\/li>\n<\/ul>\n<p>This means a large portion of spammers didn't care about actually checking the comment forms and used the standard wordpress url, and another large portion don't run javascript on their bots, although a very few do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Three weeks ago, I slightly modified the comment system on this blog for an experiment. This blog is a standard wordpress installation. Comments are normally directed to the wp-comments-post.php script by the HTML form. What I did is: Create a comments-post.php wrapper script that just includes wp-comments-post.php (this allows things to still work properly after [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,25,4],"tags":[23],"class_list":["post-2639","post","type-post","status-publish","format-standard","hentry","category-pdo","category-planet-mozilla","category-website","tag-en"],"_links":{"self":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2639"}],"version-history":[{"count":11,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2639\/revisions"}],"predecessor-version":[{"id":2650,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2639\/revisions\/2650"}],"wp:attachment":[{"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/glandium.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}