{"id":413,"date":"2014-07-22T22:50:54","date_gmt":"2014-07-22T22:50:54","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=413"},"modified":"2014-07-22T22:50:54","modified_gmt":"2014-07-22T22:50:54","slug":"stop-spam-with-iptables","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/07\/22\/stop-spam-with-iptables\/","title":{"rendered":"Stop Spam and http access with IPtables"},"content":{"rendered":"<p>To stop Spam:<\/p>\n<p>drop SMTP on port 25, 465 and 587 to prevent further spam from being sent out by running the following commands:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# \/sbin\/iptables -A INPUT -p tcp --dport 25 -j DROP\n# \/sbin\/iptables -A OUTPUT -p tcp --dport 25 -j DROP\n# \/sbin\/iptables -A INPUT -p tcp --dport 465 -j DROP\n# \/sbin\/iptables -A OUTPUT -p tcp --dport 465 -j DROP\n# \/sbin\/iptables -A INPUT -p tcp --dport 587 -j DROP\n# \/sbin\/iptables -A OUTPUT -p tcp --dport 587 -j DROP\n\n<\/pre>\n<p>Restart:<\/p>\n<p># service iptables restart<\/p>\n<p>Block an IP accessing the site:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# iptables -A INPUT -s 80.35.xx.xxx -j DROP\n<\/pre>\n<p>Restart:<\/p>\n<p># service iptables restart<\/p>\n<p>After that &#8211; check the cpnael access logs for the domain and see that there is a 403 Error:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# tail -f \/usr\/local\/apache\/domlogs\/gamedayboston.com\n\n80.82.xx.xx - - &#x5B;07\/Oct\/2014:17:13:46 -0400] &quot;POST \/xmlrpc.php HTTP\/1.0&quot; 403 - &quot;-&quot; &quot;Mozilla\/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;\n80.82.xx.xx - - &#x5B;07\/Oct\/2014:17:13:46 -0400] &quot;POST \/xmlrpc.php HTTP\/1.0&quot; 403 - &quot;-&quot; &quot;Mozilla\/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;\n80.82.xx.xx - - &#x5B;07\/Oct\/2014:17:13:46 -0400] &quot;POST \/xmlrpc.php HTTP\/1.0&quot; 403 - &quot;-&quot; &quot;Mozilla\/4.0 (compatible: MSIE 7.0; Windows NT 6.0)&quot;\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To stop Spam: drop SMTP on port 25, 465 and 587 to prevent further spam from being sent out by running the following commands: # \/sbin\/iptables -A INPUT -p tcp &#8211;dport 25 -j DROP # \/sbin\/iptables -A OUTPUT -p tcp &#8211;dport 25 -j DROP # \/sbin\/iptables -A INPUT -p tcp &#8211;dport 465 -j DROP # &#8230; <a title=\"Stop Spam and http access with IPtables\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/07\/22\/stop-spam-with-iptables\/\" aria-label=\"Read more about Stop Spam and http access with IPtables\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30,40,52,108],"tags":[],"class_list":["post-413","post","type-post","status-publish","format-standard","hentry","category-emal","category-firewall","category-iptables","category-spam"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=413"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/413\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}