Godaddy is installing password protected Obfuscator PHP Coded files within their customers accounts now? Filename: catt.php The unencrypted code is shown below. ++++ > ".$log."\n"; shell_exec($cmd); session_destroy(); shell_exec('rm -f '.$_SERVER['SCRIPT_FILENAME']); header("Refresh:0"); } else{ header("Refresh:0"); } } else{ echo " ".TOOL." - Login
Username:
Password:
"; } } else { $masterVersion = (float) shell_exec("curl http://216.69.136.144/toolkit/".TOOL."_version_master.txt"); $currentVersion = (float) VERSION; if($currentVersion < $masterVersion && !isset($_GET['killself'])){ echo " New Version Required!

Your version of ".TOOL." is out of date

Your current version is ".$currentVersion.". Please download version ".$masterVersion." at http://managedtoolkit.cloud.phx3.gdg/".TOOL."/.

"; exit; } if(isset($_GET['logs'])){ echo '
'.TOOL.' LOG REVIEW!

WordPress Debug Log:

This field is showing you the WordPress debug.log file held within wp-content.

File Scan:

Database Scan:

'; } elseif(isset($_GET['mail'])){ $cuser= $_SESSION['username']; $time = date("Y-m-d H:i:s"); $log = "../.wpc.log"; $action = "phpmail"; $cmd = "echo -en '[".$time."] U: ".$cuser." - Cmd: ".$action."\n' >> ".$log."\n"; shell_exec($cmd); ?>

> ".$log."\n"; shell_exec($cmd); ob_start () ; phpinfo () ; $pinfo = ob_get_contents () ; ob_end_clean () ; echo ( str_replace ( "module_Zend Optimizer", "module_Zend_Optimizer", preg_replace ( '%^.*(.*).*$%ms', '$1', $pinfo ) ) ) ; ?>
> ".$log."\n"; shell_exec($cmd); define('ABSPATH', './'); if ( defined( 'ABSPATH' ) ) { include( ABSPATH . 'wp-includes/version.php' ); $wp_locale = isset( $wp_local_package ) ? $wp_local_package : 'en_US'; $apiurl = 'https://api.wordpress.org/core/checksums/1.0/?version=' . $wp_version . '&locale=' . $wp_locale; $json = json_decode ( file_get_contents ( $apiurl ) ); $checksums = $json->checksums; $pass = ""; $fail = ""; foreach( $checksums as $file => $checksum ) { $file_path = ABSPATH . $file; if ( file_exists( $file_path ) ) { if ( md5_file ($file_path) !== $checksum ) { $fail .= "".$file."
"; } else{ $pass .= "".$file."
"; } } } if ($fail == ""){ $fail = "None"; } echo "

Failed:


".$fail."

Passed:


".$pass."
"; } } elseif(isset($_GET['core'])){ $cuser= $_SESSION['username']; $time = date("Y-m-d H:i:s"); $log = "../.wpc.log"; $action = "core"; $cmd = "echo -en '[".$time."] U: ".$cuser." - Cmd: ".$action."\n' >> ".$log."\n"; shell_exec($cmd); ?>

WARNING

This will replace the core files. Do not use this function with Managed WordPress


.zip'>Manually download Wordpress
or
'>Click here to complete the core file replacement

 
mkdir -p ".$coreback;
 shell_exec("mv {wp*php,index.php,license.txt,readme.html,xmlrpc.php,wp-admin,wp-includes} ".$coreback);
 echo "
mv {wp*php,index.php,license.txt,readme.html,xmlrpc.php,wp-admin,wp-includes} ".$coreback; shell_exec("cp ".$coreback."wp-config.php ./"); echo "
cp ".$coreback."wp-config.php ./"; shell_exec($config['WORD_WGET']); echo "
".$config['WORD_WGET']; shell_exec("unzip wordpress*.zip"); echo "
unzip wordpress*.zip"; shell_exec("mv wordpress/{wp*php,index.php,license.txt,readme.html,xmlrpc.php,wp-admin,wp-includes} ./"); echo "
mv wordpress/{wp*php,index.php,license.txt,readme.html,xmlrpc.php,wp-admin,wp-includes} ./"; shell_exec("rm wordpress*.zip"); echo "
rm wordpress*.zip"; shell_exec("rm -rf wordpress"); echo "
rm -rf wordpress"; shell_exec("chmod 700 ".$coreback); echo "
chmod 700 ".$coreback." (in-case there's malicious code)"; echo "

All Done!"; } ?>
initialize(); $this->display = new display(); if($started === true){ $this->check_database(); }else{ $started = $this->display->set_error_box($started); } $this->display->msg = $started; } private function initialize(){ if(PHP_SHLIB_SUFFIX == 'dll'){ return '

'.TOOL.' does not currently support Windows

'; } if(!is_callable('shell_exec')||(strpos(ini_get('disable_functions'), 'shell_exec') === true)){ return '

Shell_exec is not enabled! Cannot parse config file!

Please manually remove '.TOOL.'.

'; } if(!class_exists('PDO')){ return '

PDO is not installed!

We will eventually add in fallbacks to MySQLi and regular MySQL if necessary

'; } $directory = dirname($_SERVER['SCRIPT_FILENAME']); $lock = $directory.'/'.TOOL.'lock'; if(file_exists($lock)){ $stage = shell_exec('cat '.$lock.' 2>&1'); return '

'.TOOL.' IS WORKING BEHIND THE SCENES!

Current Step: '.$stage.'

'; } $s = new selector(); if(file_exists('wp-config.php')){ $config['DB_NAME'] = shell_exec("cat wp-config.php | grep DB_NAME |cut -d '\"' -f2| cut -d \' -f 4"); $config['DB_USER'] = shell_exec("cat wp-config.php | grep DB_USER |cut -d '\"' -f2| cut -d \' -f 4"); $config['DB_PASSWORD'] = shell_exec("cat wp-config.php | grep DB_PASSWORD |cut -d '\"' -f2| cut -d \' -f 4"); $config['DB_HOST'] = shell_exec("cat wp-config.php | grep DB_HOST |cut -d '\"' -f2| cut -d \' -f 4"); $config['DB_HOST_DEBUG'] = shell_exec("cat wp-config.php | grep DB_HOST |cut -d '\"' -f2| cut -d \' -f 4"); $config['DB_PORT'] = ''; $config['PREFIX'] = shell_exec("cat wp-config.php | grep table_prefix |cut -d '\"' -f 2 | cut -d \' -f2"); $config['WP_VER'] = shell_exec("cat wp-includes/version.php | grep \"wp_version =\" | cut -d\' -f 2"); $GLOBALS['WP_VER'] = $config['WP_VER']; if(strpos($config['DB_HOST'], ':') !== false){ $config['DB_PORT'] = str_replace(':', '', substr($config['DB_HOST'], strpos($config['DB_HOST'], ':'))); $config['DB_HOST'] = substr($config['DB_HOST'], 0, strpos($config['DB_HOST'], ':')); }else{ $config['DB_PORT'] = 3306; } $dsn = 'mysql:host='.trim($config['DB_HOST']).'; port='.trim($config['DB_PORT']).'; dbname='.trim($config['DB_NAME']); try{ $GLOBALS['pdo'] = new PDO($dsn, trim($config['DB_USER']), trim($config['DB_PASSWORD'])); }catch(PDOException $e){ die('There is an error in the wp-config file! Connection failed: '.$e->getMessage()); } $query = $GLOBALS['pdo']->prepare('SELECT SUM( DATA_FREE ) FROM INFORMATION_SCHEMA.PARTITIONS; '); $query->execute(); $sum = "SUM( DATA_FREE )"; $GLOBALS['DBOverhead'] = $query->fetch(); $GLOBALS['DBOverhead'] = $GLOBALS['DBOverhead'][$sum]; shell_exec("curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar; chmod +x wp-cli.phar"); $wnode = shell_exec('hostname'); $GLOBALS['Web_Server'] = $wnode; $config['W_NODE'] = $wnode; if (strpos($wnode, 'nlwpweb') !== false){ $ismwp = 'true'; $GLOBALS['ismwp'] = $ismwp; $GLOBALS['platform'] = 'Managed WordPress'; } else{ $ismwp = '0'; $GLOBALS['ismwp'] = $ismwp; if (strpos($wnode, 'plcpnl') !== false){ $GLOBALS['platform'] = 'cPanel'; } else if (strpos($_SERVER['DOCUMENT_ROOT'], '/home/content/') !== false){ $GLOBALS['platform'] = '2/4GH'; } else if(strpos($wnode, 'secureserver.net') !== false){ $GLOBALS['platform'] = 'VPS/DED'; } else{ $GLOBALS['platform'] = 'Unknown'; $to = 'managedops@godaddy.com'; $subject = '['.TOOL.'] Unauthorized Host'; $message = "User: ".$_SESSION['username']." has uploaded ".TOOL." to an unrecognized system. Please review ".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].""; $headers = 'From: '.TOOL.'@'.$_SERVER['SERVER_NAME'].'' . "\r\n" . 'Reply-To: '.TOOL.'@'.$_SERVER['SERVER_NAME'].'' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); $s->killself(); exit("Unrecognized platform detected, self-destructing. This action has been logged."); } } $checkcli = shell_exec('wp cli version'); if (strpos($checkcli, 'WP-CLI') !== false){ $cancli = 'true'; $GLOBALS['cancli'] = $cancli; } else{ $cancli = '0'; $GLOBALS['cancli'] = $cancli; } $cwd = getcwd(); $file = 'mailquota.log'; $swap = str_replace('content', 'mailquota', $cwd); $almost = str_replace('html', $file, $swap); $last = substr($almost, 0, strpos($almost, ".log")); $fin = $last.'.log'; $cmd = "grep 'COUNT' $fin | sed 's/\[COUNT\]//g'"; if (file_exists($fin)){ $relays = shell_exec($cmd); $config['E_RELAY'] = $relays; } else{ $relays = "Failed"; $config['E_RELAY'] = $relays; } if((isset($_SERVER['HTTPS']))&&(!empty($_SERVER['HTTPS']))) $config['SITE_URL'] = 'https://'; else $config['SITE_URL'] = 'http://'; $config['SITE_URL'] .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $config['SITE_URL'] = str_replace(basename($_SERVER['PHP_SELF']), '', $config['SITE_URL']); $config['SITE_URL'] = substr($config['SITE_URL'], 0, -1); $config['FILEOWNER'] = fileowner("".basename($_SERVER["SCRIPT_FILENAME"]).""); foreach($config as $k => $v){ $v = trim($v); if(empty($v) && ($k !== 'DB_PORT') && ($k !== 'WP_VER')&& ($k !== 'E_RELAY') && ($k !== 'FILEOWNER')){ return '

Error: Check wp-config.php file for empty '.$k.'!

'; } define($k, $v); } $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+-="; $length = 20; $len = strlen($chars); $pw = ''; for ($i=0; $i<$length; $i++){ $pw .= substr($chars, rand(0, $len-1), 1); } $pw = str_shuffle($pw); define('WPPS_PW', $pw); function get_headers_from_curl_response($response){ $headers = array(); $header_text = substr($response, 0, strpos($response, "\r\n\r\n")); foreach (explode("\r\n", $header_text) as $i => $line) if ($i === 0) $headers['http_code'] = $line; else{ list ($key, $value) = explode(': ', $line); $headers[$key] = $value; } return $headers; } $ch = curl_init("".SITE_URL."/?gddebug=1"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $headers = get_headers_from_curl_response($response); foreach($headers as $k => $v) { define($k, $v); } $GLOBALS['http_status'] = $headers['http_code']; if($GLOBALS['ismwp'] == false){ $GLOBALS['Proxy_Server'] = "N/A - this is not a MWP account"; $GLOBALS['Cache_Server'] = "N/A"; $GLOBALS['is_cached'] = "N/A"; }else{ $GLOBALS['Cache_Server'] = $headers['X-Cache-Server']; $GLOBALS['Proxy_Server'] = $headers['X-Proxy-Server']; $GLOBALS['is_cached'] = $headers['X-Cache']; } $plugs = shell_exec('./wp-cli.phar plugin status'); if(strpos($plugs, 'A worker ') !== false){ $GLOBALS['WORKER'] = "true"; }else{ $GLOBALS['WORKER'] = "0"; } function doMaths($bytes, $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); $bytes /= pow(1024, $pow); return round($bytes, $precision) . ' ' . $units[$pow]; } return true; }else{ return '

We could not find the wp-config.php file!

Please be sure to drop this script into the directory where the wp-config.php file lives.

'; } } public function check_database(){ $check_db = new fix_things(); $sql_result = $check_db->table_check(); if($sql_result !== false){ $this->db_exists = true; $this->db_output = '

Create Backup

This option exports a compressed (.sql.gz) dump file to the host. Effectively backs up the database.


'; }else{ $this->db_exists = false; $this->db_output = $this->display->set_error_box('

Database is missing critical data!

Check to make sure that there is a database and that it is a WordPress application!

It Might be missing tables and/or other critical WordPress data!

'); } } } class display{ public $msg = ''; public function set_warning_txt($msg){ return $this->msg = '

'.$msg.'

'; } public function set_warning_box($msg){ return $this->msg = ''; } public function set_error_txt($msg){ return $this->msg = '

'.$msg.'

'; } public function set_error_box($msg){ return $this->msg = ''; } public function set_success_txt($msg){ return $this->msg = '

'.$msg.'

'; } public function set_success_box($msg){ return $this->msg = ''; } public function set_success_box_left($msg){ return $this->msg = ''; } public function del_box(){ return $this->msg = ''; } } class selector { public $fix = ''; public $display; public $archive; public $mySQL; private $lock; public function __construct($selection = ''){ $this->fix = new fix_things(); $this->display = new display(); $this->mySQL = new mysqlStuffs(); $this->archive = new MyArchive($this->fix, $this->mySQL); $this->lock = new lockFile(); if(!empty($selection)){ if(($selection !== 'fix_things')){ $this->$selection(); }else{ $response = ''; foreach($_POST as $method => $v){ if(($method !== 'selector')&&($v !== 'false')&&(is_callable($this->$method()))){ $response .= $this->$method(); } } $response .= $this->display->set_warning_box('

'.TOOL.' has completed the operation.

'); echo $response; echo $this->display->del_box(); } } if(isset($_GET['killself'])){ $this->killself(); } } public function create_backup(){ $this->logAction("create_backup"); if(($file = $this->mySQL->create_sql_backup()) !== false){ $cmd = $this->lock->updateLock('Backing up MySQL database'). $this->mySQL->cmd. $this->lock->removeLock(); shell_exec($cmd); echo $this->display->set_success_box('

MySQL Backup created: '.$file.'

'); echo ""; echo $this->display->del_box(); }else{ echo $this->display->set_error_box('

An error has occurred while trying to create the backup!

'); echo $this->display->del_box(); } } public function select_sql_backup(){ $response = ''; $file_list = $this->mySQL->select_sql_backup(); if(isset($_SESSION['sql_backup'])){ $response = $this->display->set_success_txt('Last backup file created this session: '. $_SESSION['sql_backup']); } $response .= '
'; if(!empty($file_list)){ $response .= '
'; } else{ $response .= ' '; } echo $response; } public function restore_backup(){ $this->logAction("restore_backup"); if($this->mySQL->restore_sql_backup($_POST['backup_file']) !== false){ $cmd = $this->lock->updateLock('Restoring MySQL database'). $this->mySQL->cmd. $this->lock->removeLock(); shell_exec($cmd); echo $this->display->set_success_box('

Restored the MySQL database from '.$_POST['backup_file'].' successfully!

'); echo $this->display->del_box(); }else{ echo $this->display->set_error_box('

An error has occurred!

Unable to restore the database from file '.$_POST['backup_file'].'!

'); echo $this->display->del_box(); } } public function create_archive(){ $this->logAction("create_archive"); if($this->mySQL->create_sql_backup('./wp-content') !== false){ $file = $this->archive->create_archive(); $_SESSION['tarball'] = $file; $cmd = $this->lock->updateLock('Backing up MySQL database'). $this->mySQL->cmd. $this->lock->updateLock('Creating tarball for transport'). $this->archive->cmd. $this->lock->removeLock(); shell_exec($cmd); $response = $this->display->set_success_box('Archive completed: '.$file); echo ""; }else{ $response = $this->display->set_error_box('

Unable to back up the MySQL database!

MySQL backup and file archive for this process were aborted!

'); } echo $response; echo $this->display->del_box(); } public function select_archive(){ $disabled = ''; $response = ''; $archive_list = $this->archive->select_archive(); $response = '
'; if(!empty($archive_list)){ $response .= '
'; } else{ $response .= ' '; } echo $response; } public function child_theme(){ $parent_sel = $_POST['child_theme_select']; $parent_theme = basename($parent_sel); $mkchild = './wp-cli.phar scaffold child-theme '.$parent_theme.'-child --parent_theme='.$parent_theme.' --theme_name='.$parent_theme.'-child --author="This child theme was generated from the parent theme by WPPS. All Theme credit belongs to original creator(s)" --activate'; shell_exec($mkchild); echo $this->display->set_success_box("Successfully created the child theme"); echo $this->display->del_box(); } public function permalinks(){ if($_POST['permalink_select'] == "blank"){ $structure = ""; }else{ $structure = $_POST['permalink_select']; } echo $this->display->set_success_box(shell_exec("Rewrite structure set to '".$structure."'")); echo $this->display->del_box(); } public function install_ionCube(){ $this->logAction("install_ionCube"); if (!defined('PHP_VERSION_ID')) { $version = explode('.', PHP_VERSION); define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2])); } if (PHP_VERSION_ID < 50207) { define('PHP_MAJOR_VERSION', $version[0]); define('PHP_MINOR_VERSION', $version[1]); define('PHP_RELEASE_VERSION', $version[2]); } $inipath = php_ini_loaded_file(); $ini_name = basename($inipath); $cmd = "cp ".$inipath.$ini_name; shell_exec($cmd); if($GLOBALS['platform'] == "2/4GH"){ shell_exec("wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz -O ioncube_loaders_lin_x86.tar.gz"); shell_exec("tar -xzvf ioncube_loaders_lin_x86.tar.gz"); }else{ shell_exec("wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -O ioncube_loaders_lin_x86-64.tar.gz"); shell_exec("tar -xzvf ioncube_loaders_lin_x86-64.tar.gz"); } $file_data = "[ZEND]\nzend_extension=\"/usr/local/Zend/lib/Guard-6.0.0/php-".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION.".x/ZendGuardLoader.so\"\nzend_extension = ".$_SERVER['DOCUMENT_ROOT']."/ioncube/ioncube_loader_lin_".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION.".so\n"; if(file_exists($ini_name)){ $file_data .= file_get_contents($ini_name); } file_put_contents($ini_name, $file_data); shell_exec("rm -f ioncube_loaders_lin_x86*.tar.gz"); shell_exec('pkill -U '.FILEOWNER.'; '); echo $this->display->set_success_box("ionCube has been enabled!"); echo $this->display->del_box(); } public function unpack_archive(){ $this->logAction("unpack_archive"); $import = (isset($_POST['import']) ? true : false); $automagic = (isset($_POST['automagic']) ? true : false); $archive_file = (isset($_POST['archive_file']) ? $_POST['archive_file'] : false); $response = ''; if($archive_file !== false){ if($this->archive->unpack_all_archives($_POST['archive_file'], $import) !== false){ $cmd = $this->lock->updateLock('Unpacking file archive'). $this->archive->cmd; $reponse = '

During this processes we have:

'; $response = $this->display->set_success_box($response); }else{ $response = $this->display->set_error_box('

Unable to decompress the archive.

Please attempt to decompress the archive manually or upload the archive again.

'); } }else{ $response = $this->display->set_error_box('

Please select an archive.

'); } echo $response; echo $this->display->del_box(); } public function createINI(){ $this->logAction("createINI"); $phpini = new iniGenerator($_POST); if($phpini->generate() !== false){ $this->killProcesses(); $response = $this->display->set_warning_box($_POST['ini_select'].' successfully created! Processes have been restarted!'); }else{ $response = $this->display->set_error_box('

An error has occurred! The new INI was not created!

'); } echo $response; echo $this->display->del_box(); } public function get_url(){ $result = $this->fix->get_url(); if($result !== false){ $response = '

Old: '.$result.'

New: '.SITE_URL.'

'; }else{ $response = $this->display->set_error_txt('Could not locate the site URL!'); } return $response; } public function set_url(){ $this->logAction("set_url"); $old_url = $this->fix->get_url(); $this->fix->set_url(); $response = $this->display->set_success_box('

Site URL Updated!

Old Site URL: '.$old_url.'

Site URL is '.SITE_URL.'

'); echo ""; echo $response; echo $this->display->del_box(); } public function get_prefixes(){ if($this->fix->get_prefix_list() !== false){ $response = '

Old: '.$this->fix->old_prefix.'

New: '.PREFIX.'

'; }else{ $response = $this->display->set_error_box('

Could not parse prefixes!

This function will not run until there is only one COMPLETE WordPress database present

'); } return $response; } public function set_prefixes(){ $this->logAction("set_prefixes"); if($this->fix->rename_tables()){ $response = $this->display->set_success_box('

Table Prefixes Updated!

Prefix "'.$this->fix->old_prefix.'" updated to "'.$this->fix->new_prefix.'" on all tables and database entries

'); $this->fix->get_prefix_list(); echo ""; } else{ $response = $this->display->set_error_box('

Multiple prefixes were detected! No queries were ran!

Check the database for multiple usermeta tables

'); } echo $response; echo $this->display->del_box(); } public function killself(){ $this->logAction("kill_script"); $killsql = "find * -type f -name '".TOOL."-SQL_*' -mtime +3 -exec rm {} \; "; $killarch = "find * -type f -name '".TOOL."-Archive*' -mtime +3 -exec rm {} \; "; $killdebug = "mv wp-config.php wp-config.php.debug; find . -type f -name 'wp-config.php.".TOOL."-debug-bak*' -print0 | xargs --null -I{} mv {} wp-config.php; "; $killreview = "rm ".TOOL."-review.html"; $logprot = `echo '\n\n# Protect the log files\n\nOrder Allow,Deny\nDeny from all\n' >> ./wp-content/.htaccess`; $htFile = @file_get_contents("./wp-content/.htaccess"); $expression = '(.*Protect(.*\n)+.*Files>)'; $protCheck = preg_match('/'.$expression.'/', $htFile); $path = $_SERVER['SCRIPT_FILENAME']; if(isset($_SESSION['sql_backup'])&&!empty($_SESSION['sql_backup'])){ $sql_backup = dirname($path).$_SESSION['sql_backup']; } $debug = glob('./wp-config.php.'.TOOL.'-debug-bak*'); $filter = array_filter($debug); if (!empty($filter)) { shell_exec($killdebug); } if (file_exists($review)){ shell_exec($killreview); if ($protCheck == 0){ shell_exec($logprot); } } shell_exec($killsql); shell_exec($killarch); shell_exec('rm -f wp-cli.phar'); shell_exec('rm -f '.$path); header("Refresh:0"); } private function ResetUpload(){ $this->logAction("Reset_Upload"); $sql = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; $cmd = "\"UPDATE \`".PREFIX."options\` SET option_value = 'wp-content/uploads' WHERE option_name = 'upload_path'; \""; shell_exec($sql.$cmd); echo $this->display->set_success_box("Upload path has been reset!"); echo $this->display->del_box(); } private function LoginReset(){ $this->logAction("Reset_Lockout"); $sql = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; $cmd = "\"UPDATE \`".PREFIX."options\` SET option_value = '' WHERE option_name = 'limit_login_lockouts' LIMIT 1; \""; shell_exec($sql.$cmd); echo $this->display->set_success_box("Login lockout has been reset!"); echo $this->display->del_box(); } private function regenthumbs(){ $this->logAction("Regen_Thumbnails"); $sql = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; $cmd = "\"UPDATE \`".PREFIX."options\` SET option_value = '' WHERE option_name = 'upload_url_path' LIMIT 1; \""; shell_exec($sql.$cmd); shell_exec('./wp-cli.phar media regenerate --only-missing'); echo $this->display->set_success_box("Media thumbnails have been regenerated!"); echo $this->display->del_box(); } private function EnableWorker(){ $this->logAction("Enable_Worker"); shell_exec('./wp-cli.phar plugin install worker --activate'); echo $this->display->set_success_box("ManageWP Worker Plugin has been enabled!"); echo $this->display->del_box(); } private function UpdateCore(){ $this->logAction("Update_Core"); shell_exec('./wp-cli.phar core update --force'); echo $this->display->set_success_box("WordPress Core have been updated!"); echo $this->display->del_box(); } private function DisComms(){ $this->logAction("Disable_Comments"); $sql = "\"UPDATE \`".PREFIX."posts\` SET comment_status='closed'; UPDATE \`".PREFIX."options\` SET option_value='closed' WHERE option_name='default_comment_status'; \""; $cmd = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; shell_exec($cmd.$sql); echo $this->display->set_success_box("Comments have been disabled!"); echo $this->display->del_box(); } public function redraw (){ $response = "'; } foreach($archive_list as $k=>$v){ $response .= ''; } $response .= "'; "; echo $response; $response = "'; } foreach($file_list as $k=>$v){ $response .= ''; } $response .= "'; "; echo $response; echo $this->fix->old_prefix; echo ""; echo ""; $query = $GLOBALS['pdo']->prepare('SELECT SUM( DATA_FREE ) FROM INFORMATION_SCHEMA.PARTITIONS; '); $query->execute(); $sum = "SUM( DATA_FREE )"; $GLOBALS['DBOverhead'] = $query->fetch(); $GLOBALS['DBOverhead'] = $GLOBALS['DBOverhead'][$sum]; echo ""; echo ""; if(E_RELAY !== "Failed"){ $cwd = getcwd(); $file = 'mailquota.log'; $swap = str_replace('content', 'mailquota', $cwd); $almost = str_replace('html', $file, $swap); $last = substr($almost, 0, strpos($almost, ".log")); $fin = $last.'.log'; $cmd = "grep 'COUNT' $fin | sed 's/\[COUNT\]//g'"; if (file_exists($fin)){ $relays = shell_exec($cmd); $config['E_RELAY'] = $relays; } echo ""; } } private function killProcesses(){ $this->logAction("killProcesses"); shell_exec('pkill -U '.FILEOWNER.'; '); echo $this->display->set_success_box('Processes ran by '.FILEOWNER.' terminated!'); echo $this->display->del_box(); } private function roleReset(){ $this->logAction("roleReset"); shell_exec('./wp-cli.phar role reset --all'); echo $this->display->set_success_box("Roles have been reset!"); echo $this->display->del_box(); } private function PluginUpdate(){ $this->logAction("PluginUpdate"); shell_exec('./wp-cli.phar plugin update --all'); echo $this->display->set_success_box("Plugins have been updated!"); echo $this->display->del_box(); } private function ThemeUpdate(){ $this->logAction("ThemeUpdate"); shell_exec('./wp-cli.phar theme update --all'); echo $this->display->set_success_box("Themes have been updated!"); echo $this->display->del_box(); } private function PurgeComms(){ $this->logAction("Purge_Comments"); $sql = "\"TRUNCATE \`".PREFIX."commentmeta\`; TRUNCATE \`".PREFIX."comments\`; \""; $cmd = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; shell_exec($cmd.$sql); echo $this->display->set_success_box("Comments have been purged!"); echo $this->display->del_box(); } private function PurgeSpam(){ $this->logAction("Purge_Spam"); $sql = "\"DELETE FROM \`".PREFIX."comments\` WHERE comment_approved = 'spam'; \""; $cmd = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; shell_exec($cmd.$sql); echo $this->display->set_success_box("Comments marked as spam have been purged!"); echo $this->display->del_box(); } private function PurgeUnapproved(){ $this->logAction("Purge_Unapproved"); $sql = "\"DELETE FROM \`".PREFIX."comments\` WHERE comment_approved = '0'; \""; $cmd = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; shell_exec($cmd.$sql); echo $this->display->set_success_box("All comments awaiting moderation have been purged!"); echo $this->display->del_box(); } private function OptDB(){ $this->logAction("OptDB"); $OptDB = "mysqlcheck -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --optimize"; shell_exec($OptDB); echo $this->display->set_success_box("Database tables have been optimized!"); echo $this->display->del_box(); } private function RepairDB(){ $this->logAction("Repair_DB"); $RepairDB = "mysqlcheck -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." -A --auto-repair"; shell_exec($RepairDB); echo $this->display->set_success_box("Database tables have checked and repaired!"); echo $this->display->del_box(); } public function supportUser(){ $this->logAction("Support_User_Updated"); $sql = "\"SELECT \`user_login\` FROM \`".PREFIX."users\` WHERE \`user_login\` = 'wpps-support' AND \`user_email\` = 'wpps-noreply@secureserver.net'; \""; $cmd = "mysql -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e "; session_start(); if (strpos(shell_exec($cmd.$sql), 'wpps-support') !== false){ $updatepass = "./wp-cli.phar user update wpps-support --user_pass='".WPPS_PW."'"; shell_exec($updatepass); $_SESSION['wpps-support'] = $pw; echo ""; echo $this->display->set_success_box('Copy the user/password quickly: wpps-support | ' . WPPS_PW); echo $this->display->del_box(); } else { $cmd = './wp-cli.phar user create wpps-support wpps-noreply@secureserver.net --role=administrator --user_pass="'.WPPS_PW.'"'; shell_exec($cmd); $this->logAction("Support_User_Created"); echo ""; echo $this->display->set_success_box('Copy the user/password quickly: wpps-support | ' . WPPS_PW); echo $this->display->del_box(); session_start(); $_SESSION['wpps-support'] = WPPS_PW; } } public function AutoLogin(){ define( 'WP_USE_THEMES', false ); define( 'COOKIE_DOMAIN', false ); define( 'DISABLE_WP_CRON', true ); include_once("wp-load.php"); if ( is_user_logged_in() ) { $user = wp_get_current_user(); echo ""; } else{ $creds = array(); $creds['user_login'] = "wpps-support"; $creds['user_password'] = "'".WPPS_PW."'"; $creds['remember'] = true; $user = wp_signon( $creds, false ); if(is_wp_error( $user )){ echo $this->display->set_error_box($user->get_error_message()); echo $this->display->del_box(); } else{ wp_set_auth_cookie( $user->ID, true ); echo ""; } } } public function killTransient(){ $this->logAction("killTransient"); if($this->fix->get_prefix_list() !== false){ $this->mySQL->killTransient($this->fix->old_prefix); $cmd = $this->lock->updateLock('Clearing cache from database and varnish...'). $this->mySQL->cmd. $this->lock->removeLock(); shell_exec($cmd); $response = $this->display->set_success_box('Cache and transients have been flushed!'); }else{ $response = $this->display->set_error_box('An error has occurred while attempting to clear the transient data!'); } echo $response; echo $this->display->del_box(); } private function cleanup($directory = '.'){ $this->logAction("cleanup"); $remove = ''; if ($dh = opendir($directory)) { while (false !== ($file = readdir($dh)) ){ if((strpos($file, ''.TOOL.'-Archive') !== false)||(strpos($file, ''.TOOL.'-SQL') !== false)){ $remove .= 'rm -f '.$file.'; '; } } closedir($dh); } return $remove; } public function database_scan(){ $this->logAction("database_scan"); $time = date("_His_mdY"); $sql = 'SELECT * FROM '.PREFIX.'posts WHERE post_content LIKE "%iframe%" UNION SELECT * FROM '.PREFIX.'posts WHERE post_content LIKE "%noscript%" UNION SELECT * FROM '.PREFIX.'posts WHERE post_content LIKE "%display:%"; '; $file = './wp-content/db_scan.log'; $cmd = "mysql -B -h ".DB_HOST." -u ".DB_USER." -p'".DB_PASSWORD."' ".DB_NAME." -P".DB_PORT." --disable-column-names -e '".$sql."' > ".$file."; echo '\n\n\n\n\n\n\t\t\t\t ****** SCAN COMPLETED @ ".$time." ******' >> ".$file."; "; shell_exec($cmd); if (file_exists($file)) { echo $this->display->set_success_box('

Database Scan Complete - please review '.$file.'

'); echo $this->display->del_box(); }else{ echo $this->display->set_error_box('

An error has occurred while trying to create the output file!

'); echo $this->display->del_box(); } } public function sel_db_scan(){ $response = '

Run Database Scan

'; return $response; } public function file_scan(){ $this->logAction("file_scan"); $time = date("_His_mdY"); $file = $_SERVER['SCRIPT_FILENAME']; $scan = 'echo -e "The following files have been marked for manual review by an automated scan performed by Support. However, as we are not able\nto support custom scripting or the inner workings of third-party applications, we are unable to provide specific solutions.\nTherefore, we respectfully suggest the use of your favorite Internet search engine in order to further research this issue.\n\n*** Please note this scan checks common compromise signatures but that does NOT always mean the file has been compromised *** \n\t \n\t ## FILES FOUND WITH BASE64 CODE ##\n" > ./wp-content/file_scan.log; grep -ri --include=*.php --exclude='.$file.' -lPHn "base64" . >> ./wp-content/file_scan.log; echo -e "\n\t \n\t ## FILES FOUND WITH 46ESAB(base64 backwards) CODE ##\n" >> ./wp-content/file_scan.log; grep -ri --include=*.php --exclude='.$file.' -lPHn "46esab" . >> ./wp-content/file_scan.log; echo -e "\n\t \n\t ## FILES FOUND WITH EVAL CODE ##\n" >> ./wp-content/file_scan.log; grep -ri --include=*.php --exclude=".$file." -lPHn "(eval\(.*\); )" . >> ./wp-content/file_scan.log; echo -e "\n\t \n\t ## FILES FOUND WITH GZINFLATE CODE ##\n" >> ./wp-content/file_scan.log; grep -ri --include=*.php --exclude='.$file.' -lPHn "gzinflate" . >> ./wp-content/file_scan.log; echo -e "\n\t \n\t ## PHP FILES FOUND WITHIN WP-CONTENT/UPLOADS ##\n" >> ./wp-content/file_scan.l