Skip to content

Instantly share code, notes, and snippets.

Created September 17, 2014 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/394bad3b329c9f82df59 to your computer and use it in GitHub Desktop.
Save anonymous/394bad3b329c9f82df59 to your computer and use it in GitHub Desktop.
Code for victims of Wordpress online casino hack
<?php
/** Loads the WordPress Environment */
require( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
global $wpdb;
$blogs_details = $wpdb->get_results('SELECT <code>blog_id</code>, <code>domain</code> FROM <code>wp_blogs</code> ORDER BY <code>wp_blogs</code>.<code>blog_id</code> ASC', ARRAY_A);
foreach ($blogs_details as $blogDetails)
{
echo "Checking ". $blogDetails['domain'] ." (#". $blogDetails['blog_id'] ."):";
$casinoFixFind = "SELECT * FROM <code>wp_&quot;. $blogDetails['blog_id'] .&quot;_options</code> WHERE <code>option_name</code> = 'client_data_run'";
if ($wpdb->query($casinoFixFind)) {
echo "Darn! Found entry here... ";
$casinoFixRemove = "DELETE FROM <code>wp_&quot;. $blogDetails['blog_id'] .&quot;_options</code> WHERE <code>option_name</code> = 'client_data_run'";
if ($wpdb->query($casinoFixRemove)) {
echo "<strong style='color: green;'>Successfully fixed!";
} else {
echo "<strong style='color: red;'>SHIT!ERROR: ". mysql_error() ."";
}
} else {
echo "<strong style='color: green;'>". $blogDetails['domain'] ." is clean!";
}
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment