{"id":301,"date":"2012-05-07T00:02:21","date_gmt":"2012-05-06T13:02:21","guid":{"rendered":"https:\/\/lucazoid.com\/bilateral\/?p=301"},"modified":"2012-05-07T00:15:06","modified_gmt":"2012-05-06T13:15:06","slug":"wordpress-pharma-hack-removal-instructions","status":"publish","type":"post","link":"https:\/\/lucazoid.com\/bilateral\/wordpress-pharma-hack-removal-instructions\/","title":{"rendered":"WordPress Pharma hack removal instructions"},"content":{"rendered":"<p>these are notes to self compiled with help from greg. not guaranteed to work for others. proceed with caution!<\/p>\n<p>&#8212;<\/p>\n<p>Starting from this:<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"ANVFF3qvpb\"><p><a href=\"https:\/\/blog.sucuri.net\/2010\/07\/understanding-and-cleaning-the-pharma-hack-on-wordpress.html\">Understanding and Cleaning the Pharma Hack on WordPress<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Understanding and Cleaning the Pharma Hack on WordPress&#8221; &#8212; Sucuri Blog\" src=\"https:\/\/blog.sucuri.net\/2010\/07\/understanding-and-cleaning-the-pharma-hack-on-wordpress.html\/embed#?secret=V5qV7izDxC#?secret=ANVFF3qvpb\" data-secret=\"ANVFF3qvpb\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>&#8211; &#8212; <\/p>\n<p>1. back up the database and uploads folder, and your theme folder, and scrap everything else (wordpress core files and plugins). <\/p>\n<p>(copy whole wordpress folder to &#8220;mywordpressfolder.pharma&#8221; for example &#8211; you can always retrieve files you need from this folder later)<\/p>\n<p>(backup database via myphpadmin to desktop)<\/p>\n<p>delete original wordpress install folder.<\/p>\n<p>&#8211; &#8211; &#8211;<\/p>\n<p>2. run those SQL commands on the infected database:<\/p>\n<p>delete from wp_options where option_name = &#8216;class_generic_support&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;widget_generic_support&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;fwp&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;wp_check_hash&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;ftp_credentials&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;rss_7988287cd8f4f531c6b94fbdbc4e1caf&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;rss_d77ee8bfba87fa91cd91469a5ba5abea&#8217;;<br \/>\ndelete from wp_options where option_name = &#8216;rss_552afe0001e673901a9f2caebdd3141d&#8217;;<\/p>\n<p>(make sure the quotation marks are &#8220;raw&#8221; quote marks (unformatted, not &#8220;smart&#8221;)<\/p>\n<p>when inside phpmyadmin, hit the &#8220;SQL&#8221; tab and cut and paste the above code within the &#8220;run SQL query on database&#8221;<\/p>\n<p>&#8211; &#8211; &#8211;<\/p>\n<p>3. check the uploads folder for bad files<\/p>\n<p>using the terminal (ssh shell)<\/p>\n<p>cd wp-content<br \/>\nfind uploads\/ -name *php -delete<\/p>\n<p>&#8211; &#8211; &#8211;<\/p>\n<p>4. reinstall latest wordpress and plugins from scratch<\/p>\n<p>using dreamhost one click installer, put new wordpress install where the old one used to be<br \/>\npoint the database to your old database<\/p>\n<p>however, dreamhost thinks you&#8217;re making a brand new blog, so gives a new database table prefix to this new install. it also makes the new wp-config.php file point to these new database tables.<\/p>\n<p>so, you need to edit your wp-config file to set the database prefix to be wp_ (ie, the old database tables prefix)<\/p>\n<p>now in phpmyadmin, delete the new database tables which dreamhost created:<br \/>\n(select them and then click &#8220;with selected&#8221; and then &#8220;drop&#8221; (in sql, drop means delete table)<\/p>\n<p>&#8211; &#8211; &#8211;<\/p>\n<p>5. Move the cleaned uploads, and theme folders to their normal place<\/p>\n<p>(move them from mywordpress.pharma to the clean mywordpress folder)<\/p>\n<p>in terminal:<\/p>\n<p>cd ~\/mydomain.com<\/p>\n<p>mv mywordpress.pharma\/wp-content\/themes mywordpress\/wp-content\/<\/p>\n<p>and also:<\/p>\n<p>mv mywordpress.pharma\/wp-content\/uploads mywordpress\/wp-content\/<\/p>\n<p>6. check it all works! If so, then move to next step&#8230;<\/p>\n<p>7. Delete the mywordpress.pharma folder: <\/p>\n<p>rm -rf ~\/mydomain.com\/mywordpress.pharma<\/p>\n","protected":false},"excerpt":{"rendered":"<p>these are notes to self compiled with help from greg. not guaranteed to work for others. proceed with caution! &#8212; Starting from this: Understanding and Cleaning the Pharma Hack on WordPress &#8211; &#8212; 1. back up the database and uploads folder, and your theme folder, and scrap everything else (wordpress core files and plugins). (copy [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,293],"tags":[],"class_list":["post-301","post","type-post","status-publish","format-standard","hentry","category-blogging","category-workplace-relations"],"_links":{"self":[{"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":4,"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":306,"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/posts\/301\/revisions\/306"}],"wp:attachment":[{"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lucazoid.com\/bilateral\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}