/home/vianto5/.trash/cititower.mx/wp-content/plugins/gotmls
NameSizeModeActions
images/-0755rm
languages/-0755rm
safe-load/-0755rm
index.php1490590644editdlrm
readme.txt387110644editdlrm
Edit: /home/vianto5/.trash/cititower.mx/wp-content/plugins/gotmls/index.php (149059B)
strlen("/".basename(__FILE__)) && substr(__FILE__, -1 * strlen($SCRIPT_FILE)) == substr($SCRIPT_FILE, -1 * strlen(__FILE__)) || !(function_exists("add_action") && function_exists("load_plugin_textdomain"))) include(dirname(__FILE__)."/safe-load/index.php"); else require_once(dirname(__FILE__)."/images/index.php"); /* ___ * / /\ GOTMLS Main Plugin File * / /:/ @package GOTMLS * /__/::\ Copyright \__\/\:\__ © 2012-2024 Eli Scheetz (email: eli@gotmls.net) * \ \:\/\ * \__\::/ This program is free software; you can redistribute it * ___ /__/:/ and/or modify it under the terms of the GNU General Public * /__/\ _\__\/ License as published by the Free Software Foundation; * \ \:\ / /\ either version 3 of the License, or (at your option) any * ___\ \:\ /:/ later version. * / /\\ \:\/:/ / /:/ \ \::/ This program is distributed in the hope that it will be useful, / /:/_ \__\/ but WITHOUT ANY WARRANTY; without even the implied warranty /__/:/ /\__ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \ \:\/:/ /\ See the GNU General Public License for more details. \ \::/ /:/ \ \:\/:/ You should have received a copy of the GNU General Public License * \ \::/ with this program; if not, write to the Free Software Foundation, * \__\/ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ function GOTMLS_install() { if (strpos(GOTMLS_get_version("URL"), '&wp=') && version_compare(GOTMLS_wp_version, GOTMLS_require_version, "<")) die(GOTMLS_htmlspecialchars(GOTMLS_require_version_LANGUAGE.", NOT version: ".GOTMLS_wp_version)); else delete_option("GOTMLS_definitions_array"); } register_activation_hook(__FILE__, "GOTMLS_install"); function GOTMLS_uninstall() { delete_option('GOTMLS_get_URL_array'); delete_option('GOTMLS_definitions_blob'); GOTMLS_create_session_file(false); } register_deactivation_hook(__FILE__, "GOTMLS_uninstall"); function GOTMLS_menu() { if (GOTMLS_user_can()) { $GLOBALS["GOTMLS"]["tmp"]["my_admin_page"] = add_menu_page($GLOBALS["GOTMLS"]["tmp"]["pluginTitle"]." ".GOTMLS_Scan_Settings_LANGUAGE, $GLOBALS["GOTMLS"]["tmp"]["pluginTitle"], $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], $GLOBALS["GOTMLS"]["tmp"]["base_page"], "GOTMLS_settings", GOTMLS_images_path.'GOTMLS-16x16.gif'); add_action('load-'.$GLOBALS["GOTMLS"]["tmp"]["my_admin_page"], 'GOTMLS_admin_add_help_tab'); add_submenu_page($GLOBALS["GOTMLS"]["tmp"]["base_page"], $GLOBALS["GOTMLS"]["tmp"]["pluginTitle"]." ".GOTMLS_Scan_Settings_LANGUAGE, GOTMLS_Scan_Settings_LANGUAGE, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], $GLOBALS["GOTMLS"]["tmp"]["base_page"], "GOTMLS_settings"); add_submenu_page($GLOBALS["GOTMLS"]["tmp"]["base_page"], $GLOBALS["GOTMLS"]["tmp"]["pluginTitle"]." Firewall Options", "Firewall Options", $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], "GOTMLS-Firewall-Options", "GOTMLS_Firewall_Options"); } } add_action("admin_menu", "GOTMLS_menu", 8); add_action("network_admin_menu", "GOTMLS_menu", 8); function GOTMLS_menu_Quarantine() { if (GOTMLS_user_can() && isset($GLOBALS["GOTMLS"]["tmp"]["my_admin_page"])) add_submenu_page($GLOBALS["GOTMLS"]["tmp"]["base_page"], $GLOBALS["GOTMLS"]["tmp"]["pluginTitle"]." ".GOTMLS_View_Quarantine_LANGUAGE, GOTMLS_View_Quarantine_LANGUAGE.(($Qs = GOTMLS_get_quarantine(true))?' '.$Qs.'':""), $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], "GOTMLS_View_Quarantine", "GOTMLS_View_Quarantine"); } add_action("admin_menu", "GOTMLS_menu_Quarantine", 16); add_action("network_admin_menu", "GOTMLS_menu_Quarantine", 16); function GOTMLS_admin_add_help_tab() { $screen = get_current_screen(); $screen->add_help_tab(array( 'id' => "GOTMLS_Getting_Started", 'title' => __("Getting Started", 'gotmls'), 'content' => '

'.__("Make sure the Definition Updates are current and Run a Complete Scan.", 'gotmls').'

'.sprintf(__("If Known Threats are found and displayed in red then there will be a button to '%s'. If only Potentional Threats are found then there is no automatic fix because those are probably not malicious.", 'gotmls'), GOTMLS_Automatically_Fix_LANGUAGE).'

'.__("A backup of the original infected files are placed in the Quarantine in case you need to restore them or just want to look at them later. You can delete these files if you don't want to save more.", 'gotmls').'

' )); $FAQMarker = '== Frequently Asked Questions =='; if (is_file(dirname(__FILE__).'/readme.txt') && ($readme = explode($FAQMarker, @file_get_contents(dirname(__FILE__).'/readme.txt').$FAQMarker)) && strlen($readme[1]) && ($readme = explode("==", $readme[1]."==")) && strlen($readme[0])) { $screen->add_help_tab(array( 'id' => "GOTMLS_FAQs", 'title' => __("FAQs", 'gotmls'), 'content' => '

'.preg_replace('/\[(.+?)\]\((.+?)\)/', "\\1", preg_replace('/[\r\n]+= /', "

", preg_replace('/ =[\r\n]+/', "

", $readme[0]))).'

' )); } } function GOTMLS_enqueue_scripts() { wp_enqueue_style('dashicons'); } add_action('admin_enqueue_scripts', 'GOTMLS_enqueue_scripts'); function GOTMLS_display_header($optional_box = "") { global $current_user, $wpdb; wp_get_current_user(); $head_nonce = GOTMLS_set_nonce(__FUNCTION__."100"); $GOTMLS_url_parts = explode('/', GOTMLS_siteurl); $Update_Definitions = array(GOTMLS_update_home.'definitions.js'.$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"].'&'.GOTMLS_get_version_URL.'&'.GOTMLS_set_nonce(GOTMLS_update_home).'&d='.ur1encode(GOTMLS_siteurl)); if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]) array_unshift($Update_Definitions, GOTMLS_admin_url('GOTMLS_load_update', $head_nonce.'&UPDATE_definitions_array=1')); else $Update_Definitions[] = GOTMLS_admin_url('GOTMLS_load_update', $head_nonce.'&UPDATE_definitions_array=1'); $Update_Link = '
response[$file]->new_version) && version_compare(GOTMLS_Version, $current->response[$file]->new_version, "<")) { $new_version = sprintf(__("Upgrade to %s now!",'gotmls'), $current->response[$file]->new_version).'

'; $Update_Link .= wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=').$file, 'upgrade-plugin_'.$file); } $Update_Link .= "\">$new_version
"; $defLatest = (is_numeric($Latest = preg_replace('/[^0-9]/', "", GOTMLS_sexagesimal($GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"]))) && is_numeric($Default = preg_replace('/[^0-9]/', "", GOTMLS_sexagesimal($GLOBALS["GOTMLS"]["tmp"]["Definition"]["Default"]))) && $Latest > $Default)?1:0; if (is_array($keys = GOTMLS_uckserialize(get_option('GOTMLS_Installation_Keys', array()))) && isset($keys[GOTMLS_installation_key])) $isRegistered = $keys[GOTMLS_installation_key]; else $isRegistered = ""; $Update_Div =''; $php_version = "
  • PHP: ".phpversion()."
  • \n"; if (isset($_SERVER["SERVER_SOFTWARE"]) && preg_match('/Apache\/([0-9\.]+)/i', $_SERVER["SERVER_SOFTWARE"], $GLOBALS["GOTMLS"]["tmp"]["apache"]) && count($GLOBALS["GOTMLS"]["tmp"]["apache"]) > 1) $php_version .= "
  • Apache: ".$GLOBALS["GOTMLS"]["tmp"]["apache"][1]."
  • \n"; elseif (isset($_SERVER["SERVER_SOFTWARE"]) && strlen($_SERVER["SERVER_SOFTWARE"])) $php_version .= "
  • ".esc_html($_SERVER["SERVER_SOFTWARE"])."
  • \n"; if ((isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]["user_email"]) && strlen($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]["user_email"]) == 32)) { $reg_email_key = $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]["user_email"]; $isRegistered = GOTMLS_get_registrant($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]); } else $reg_email_key = ""; echo GOTMLS_get_header().'
    '.GOTMLS_box(__("Updates & Registration",'gotmls'), "
      $php_version
    • ".(function_exists('classicpress_version')?"ClassicPress: ".preg_replace( '#[+-].*$#', '', classicpress_version()):"WordPress: ".GOTMLS_wp_version)."
    • \n
    • Plugin: ".GOTMLS_Version.'
    • Key: '.GOTMLS_installation_key.'
      Key: '.GOTMLS_installation_key.'
      No Key!
    • Definitions: '.$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"].'
    '.str_replace('findUpdates', 'Definition_Updates', $Update_Div).'
    '.(false && $isRegistered?'Registered to: '.$isRegistered:"").$Update_Link, "stuffbox").' '.GOTMLS_box(__("Resources & Links",'gotmls'), '
    Donate Here
    Google Safe Browsing Diagnostic', "stuffbox").$optional_box.'
    '; if (isset($GLOBALS["GOTMLS"]["tmp"]["stuffbox"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["stuffbox"])) { echo ' '; } echo '
    '; } function GOTMLS_get_scan_history() { global $wpdb; $GOTMLS_nonce_context = __FUNCTION__."285"; $GOTMLS_nonce = GOTMLS_set_nonce($GOTMLS_nonce_context); $imported = 0; $LastScan = ''; if (isset($_GET["GOTMLS_clear_history"]) && (strlen($clear_hist = preg_replace('/[^0-9a-f]++]i/', "", $_GET["GOTMLS_clear_history"])) == 32) && GOTMLS_get_nonce($GOTMLS_nonce_context) && GOTMLS_user_can()) { if (($ors = $wpdb->get_results($wpdb->prepare("SELECT ID, post_parent, post_date FROM `$wpdb->posts` WHERE post_type = %s AND post_name = %s", 'gotmls_results', $clear_hist), ARRAY_A)) && isset($ors[0]["post_parent"]) && is_numeric($ors[0]["post_parent"]) && ($ors[0]["post_parent"] > 0) && ($wpdb->get_results($wpdb->prepare("SELECT COUNT(ID) FROM `$wpdb->posts` WHERE post_type = %s AND post_parent = %s", 'gotmls_results', $ors[0]["ID"]), ARRAY_A)) && ($cleared = $wpdb->query($wpdb->prepare("DELETE FROM `$wpdb->posts` WHERE post_type = %s AND post_date < %s", 'gotmls_results', $ors[0]["post_date"])))) $wpdb->update($wpdb->posts, array("post_parent" => 0), array("post_type" => 'gotmls_results', "ID" => $ors[0]["ID"])); $LastScan .= sprintf(__("Cleared %s records from the history.",'gotmls'), $cleared); } $SQL = $wpdb->prepare("SELECT * FROM `$wpdb->posts` WHERE post_type = %s ORDER BY post_date DESC", 'gotmls_results'); $units = array("seconds"=>60,"minutes"=>60,"hours"=>24,"days"=>365,"years"=>10); if (!($prs = $wpdb->get_results($SQL, ARRAY_A))) { if ($ors = $wpdb->get_results($wpdb->prepare("SELECT substring_index(option_name, '/', -1) AS `mt`, option_name, option_value FROM `$wpdb->options` WHERE option_name LIKE %s ORDER BY mt ASC", 'GOTMLS_scan_log/%'), ARRAY_A)) { $parent = 0; foreach ($ors as $row) { $GOTMLS_scanlog = (isset($row["option_name"])?get_option($row["option_name"], array()):array()); $option_names = explode("/", "/".$row["option_name"]); $mt = array_pop($option_names); if (strlen($mt) && is_numeric($mt)) { $insert = array("post_name" => md5($mt), "post_content" => json_encode($GOTMLS_scanlog), "post_author" => GOTMLS_get_current_user_id(0), "post_type" => 'gotmls_results', "post_date_gmt" => date("Y-m-d H:i:s", (int) $mt), "post_parent" => $parent); if (isset($GOTMLS_scanlog["scan"]["type"]) && strlen($GOTMLS_scanlog["scan"]["type"])) $insert["post_title"] = GOTMLS_sanitize($GOTMLS_scanlog["scan"]["type"]); else $insert["post_title"] = "Unknown scan type"; if (isset($GOTMLS_scanlog["scan"]["dir"]) && @is_dir($GOTMLS_scanlog["scan"]["dir"])) $insert["post_title"] .= " of ".basename($GOTMLS_scanlog["scan"]["dir"]); if (isset($GOTMLS_scanlog["scan"]["start"]) && is_numeric($GOTMLS_scanlog["scan"]["start"])) { $insert["post_date"] = date("Y-m-d H:i:s", $GOTMLS_scanlog["scan"]["start"]); $insert["post_modified"] = date("Y-m-d H:i:s", $GOTMLS_scanlog["scan"]["start"]); $ukeys = array_keys($units); $insert["post_title"] .= " on ".date("Y-m-d", $GOTMLS_scanlog["scan"]["start"]); if (isset($GOTMLS_scanlog["scan"]["finish"]) && is_numeric($GOTMLS_scanlog["scan"]["finish"]) && ($GOTMLS_scanlog["scan"]["finish"] >= $GOTMLS_scanlog["scan"]["start"])) { $insert["post_modified"] = date("Y-m-d H:i:s", $GOTMLS_scanlog["scan"]["finish"]); $insert["post_modified_gmt"] = date("Y-m-d H:i:s", $GOTMLS_scanlog["scan"]["finish"]); $time = ($GOTMLS_scanlog["scan"]["finish"] - $GOTMLS_scanlog["scan"]["start"]); for ($unit = $ukeys[0], $key=0; (isset($units[$ukeys[$key]]) && $key < (count($ukeys) - 1) && $time >= (2 * $units[$ukeys[$key]])); $unit = $ukeys[++$key]) $time = floor($time/$units[$ukeys[$key]]); if (1 == $time) $unit = substr($unit, 0, -1); if ($time) $insert["post_title"] .= " ran for $time $unit"; } else $insert["post_title"] .= " was not finished!"; } else $insert["post_title"] .= " failed to started!"; if ($inserted = $wpdb->insert($wpdb->posts, $insert)) { $imported++; $parent = $wpdb->insert_id; } else return sprintf(__("Failed to Import Scan History ID %s : %s",'gotmls'), $mt, $wpdb->last_error); } else return sprintf(__("Error: Failed to migrate old Scan History from %s.",'gotmls'), $row["option_name"]); } if ($cleared = $wpdb->query($wpdb->prepare("DELETE FROM `$wpdb->options` WHERE option_name LIKE %s", 'GOTMLS_scan_log/%'))) $LastScan .= sprintf(__("Converted %s of %s records from the Scan History into the new Scan Log record. Future Scans will now store more result data in the new Log.",'gotmls'), $imported, $cleared); $prs = $wpdb->get_results($SQL, ARRAY_A); } } if ($prs && is_array($prs) && count($prs)) { $scans = 0; $PreScan = ''; } else $LastScan .= '

    '.__("No Scans have been logged",'gotmls').'

    '; return "$LastScan\n"; } function GOTMLS_get_whitelists() { global $wpdb, $post; $Q_Page = ''; if (isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["whitelist"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["whitelist"])) { $Q_Page .= '

      '.__("Globally White-listed files",'gotmls').''.__("# of patterns",'gotmls').''.__("Date Updated",'gotmls').'

      '; foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["whitelist"] as $file => $non_threats) { if (isset($non_threats[0])) { $updated = GOTMLS_sexagesimal($non_threats[0]); unset($non_threats[0]); } else $updated = "Unknown"; $Q_Page .= '
    • '.count($non_threats).''.$updated."$file
    • \n"; } if (isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"])) { $Q_Page .= '

      '.__("WordPress Core files",'gotmls').''.__("# of files",'gotmls').'

      '; foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"] as $ver => $files) { $Q_Page .= '
    • '.count($files)."Version $ver
    • \n"; } } $Q_Page .= "
    "; } $my_query = new WP_Query(array("orderby" => 'date', "post_type" => 'GOTMLS_quarantine', "post_status" => array('pending'), "posts_per_page" => 500)); if ($my_query->have_posts()) { $Q_Page .= '

    '.__("The following files have been whitelisted by you. Any infections or malicious code found in the current versions of these files will be ignored in future scans. If these files are modified or updated from the current versions recorded here or if you remove them from this list then they may be flagged again in future scans.",'gotmls').'

      '.__(" Whitelisted Files",'gotmls').''.__("Whitelisted",'gotmls').''.__("Date Modified",'gotmls').'

      '; $root_path = implode(GOTMLS_slash(), array_slice(GOTMLS_explode_dir(__FILE__), 0, (2 + intval($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"])) * -1)); while ($my_query->have_posts()) { $my_query->the_post(); $gif = 'checked.gif'; $threat = ''; $action = "\" onchange=\"document.getElementById('whitelist_buttons').style.display = 'block';"; $fa = GOTMLS_threats_found_meta(GOTMLS_object_to_array($post)); if (is_file($post->post_title)) $link = GOTMLS_error_link(__("View Whitelisted File",'gotmls').md5(GOTMLS_decode($post->post_content))."O".intval(GOTMLS_decode($post->post_content)), $post->post_title, $threat); else { $gif = "question.gif\" onload=\"document.getElementById('whitelist_buttons').style.display = 'block'; if (Whitelists = document.getElementById('box_".md5("Whitelists")."')) Whitelists.style.display = 'block';"; $_GET['Whitelists'] = "visible"; $threat = 'potential'; $action = '" checked="true'; $link = GOTMLS_error_link(__("Remove Missing File from Whitelist",'gotmls'), $post->post_title, $threat); } $chksum = preg_replace('/[^a-f\d]++/', "", $post->post_mime_type)."O".intval($post->comment_count); $Q_Page .= '
    • '.GOTMLS_error_link(__("View Whitelisted Contents $chksum",'gotmls'), $post->ID, $threat).$post->post_date_gmt.''.GOTMLS_htmlspecialchars($post->post_modified_gmt).'Q'.$link.GOTMLS_htmlspecialchars(str_replace($root_path, "...", $post->post_title))."
    • \n"; } $Q_Page .= "\n
    \n
    "; } wp_reset_query(); return "$Q_Page\n"; } function GOTMLS_Quarantine_Trash() { global $wpdb; $Q_Page = '\n"; } function GOTMLS_ajax_View_Quarantine() { GOTMLS_ajax_load_update(); die(GOTMLS_html_tags(array("html" => array("body" => GOTMLS_get_header().GOTMLS_box(GOTMLS_Quarantine_Trash().__("View Quarantine",'gotmls'), GOTMLS_get_quarantine()))))); } function GOTMLS_View_Quarantine() { GOTMLS_ajax_load_update(); $echo = GOTMLS_box($Q_Page = "Whitelists", GOTMLS_get_whitelists()); if (!isset($_GET['Whitelists'])) $echo .= "\n\n"; $echo .= GOTMLS_box(GOTMLS_Quarantine_Trash().__("View Quarantine",'gotmls'), GOTMLS_get_quarantine()); GOTMLS_display_header(); echo "$echo\n
    "; } function GOTMLS_Firewall_Options() { global $current_user, $wpdb, $table_prefix; GOTMLS_ajax_load_update(); GOTMLS_display_header(); $GOTMLS_nonce_found = GOTMLS_get_nonce(); $gt = ">"; // This local variable never changes $lt = "<"; // This local variable never changes $save_action = ""; $patch_attr = array( array( "icon" => "blocked", "language" => __("Your WordPress Login page is susceptible to a brute-force attack (just like any other login page). These types of attacks are becoming more prevalent these days and can sometimes cause your server to become slow or unresponsive, even if the attacks do not succeed in gaining access to your site. Applying this patch will block access to the WordPress Login page whenever this type of attack is detected.",'gotmls'), "status" => __('Not Installed','gotmls'), "action" => __('Install Patch','gotmls') ), array( "language" => __("Your WordPress site has the current version of my brute-force Login protection installed.",'gotmls'), "action" => __('Uninstall Patch','gotmls'), "status" => __('Enabled','gotmls'), "icon" => "checked" ), array( "language" => __("Your WordPress Login page has the old version of my brute-force protection installed. Upgrade this patch to improve the protection on the WordPress Login page and preserve the integrity of your WordPress core files.",'gotmls'), "action" => __('Upgrade Patch','gotmls'), "status" => __('Out of Date','gotmls'), "icon" => "threat" ) ); $find = '|]+xmlrpc.php>(.+?)\s*(# END GOTMLS Patch to Block XMLRPC Access\s*)*|is'; $deny = "\n\norder deny,allow\ndeny from all\nallow from ".GOTMLS_REMOTEADDR; $allow = GOTMLS_REMOTEADDR; if (isset($_SERVER["SERVER_ADDR"])) { $deny .= "\nallow from ".GOTMLS_safe_ip($_SERVER["SERVER_ADDR"]); $allow .= " ".GOTMLS_safe_ip($_SERVER["SERVER_ADDR"]); } $deny .= "\n\n\nRequire"; if (strlen(trim($allow)) > 0) $deny .= " ip $allow"; else $deny .= " all denied"; $deny .= "\n"; if (count($GLOBALS["GOTMLS"]["tmp"]["apache"]) > 1) $errdiv = ""; else { if (isset($GLOBALS["GOTMLS"]["tmp"]["apache"][0]) && (strtolower(substr($GLOBALS["GOTMLS"]["tmp"]["apache"][0]."123456", 0, 6)) == "apache")) $errdiv = ""; else $errdiv = "
    ".__('Unable to find Apache on this server, this patch work on Apache servers!','gotmls')."
    "; } $Firewall_nonce = $lt.'input type="hidden" name="'.str_replace('=', '" value="', GOTMLS_set_nonce(__FUNCTION__."420")).'"'.$gt; $XMLRPC_patch_action = $lt.'hr /'.$gt.$lt.'form method="POST" name="GOTMLS_Form_XMLRPC_patch"'.$gt.$Firewall_nonce.$lt.'script'.$gt."\nfunction setFirewall(opt, val) {\n\tif (autoUpdateDownloadGIF = document.getElementById('fw_opt'))\n\t\tautoUpdateDownloadGIF.value = opt;\n\tif (autoUpdateDownloadGIF = document.getElementById('fw_val'))\n\t\tautoUpdateDownloadGIF.value = val;\n}\nfunction testComplete() {\nif (autoUpdateDownloadGIF = document.getElementById('autoUpdateDownload'))\n\tdonationAmount = autoUpdateDownloadGIF.src.replace(/^.+\?/,'');\nif ((autoUpdateDownloadGIF.src == donationAmount) || donationAmount=='0') {\n\tif (patch_searching_div = document.getElementById('GOTMLS_XMLRPC_patch_searching')) {\n\t\tif (autoUpdateDownloadGIF.src == donationAmount)\n\t\t\tpatch_searching_div.innerHTML = '".GOTMLS_strip4java(__("You must register and donate to use this feature!",'gotmls'))."';\n\t\telse\n\t\t\tpatch_searching_div.innerHTML = '".GOTMLS_strip4java(__("This feature is available to those who have donated!",'gotmls'))."';\n\t}\n} else {\n\tshowhide('GOTMLS_XMLRPC_patch_searching');\n\tshowhide('GOTMLS_XMLRPC_patch_button', true);\n}\n}\nwindow.onload=testComplete;\n$lt/script$gt$lt".'div style="padding: 0 30px;"'.$gt.$lt.'input type="hidden" name="GOTMLS_XMLRPC_patching" value="'; $patch_found = false; $head = str_replace(array('|]+', '(.+?)', '\\s*(', '\\s*)*|is'), array(" 0) && GOTMLS_save_contents(ABSPATH.'.htaccess', "$head$htaccess")) { $XMLRPC_patch_action .= '-1"'.$gt.$lt.'input style="float: right;" type="submit" value="Unblock XMLRPC Access" /'.$gt.$lt.'p'.$gt.$lt.'img src="'.GOTMLS_images_path.'checked.gif"'.$gt.$lt.'b'.$gt.'Block XMLRPC Access (Now Blocked'; $errdiv = ""; } elseif ($GOTMLS_nonce_found && isset($_POST["GOTMLS_XMLRPC_patching"]) && ($_POST["GOTMLS_XMLRPC_patching"] > 0)) $XMLRPC_patch_action .= '1"'.$gt.$lt.'input style="float: right;" type="submit" value="Block XMLRPC Access" /'.$gt.$lt.'p'.$gt.$lt.'img src="'.GOTMLS_images_path.'threat.gif"'.$gt.$lt.'b'.$gt.'Block XMLRPC Access (Still Allowing Access: '.sprintf(__("Failed to install XMLRPC Protection [.htaccess %s]",'gotmls'),(is_readable(ABSPATH.'.htaccess')?'read-'.(is_writable(ABSPATH.'.htaccess')?'write?':'only!'):"unreadable!").": ".strlen($htaccess).GOTMLS_fileperms(ABSPATH.'.htaccess')); else $XMLRPC_patch_action .= '1"'.$gt.$lt.'input style="float: right;" type="submit" value="Block XMLRPC Access" /'.$gt.$lt.'p'.$gt.$lt.'img src="'.GOTMLS_images_path.'question.gif"'.$gt.$lt.'b'.$gt.'Block XMLRPC Access (Currently Allowing Access'; } $XMLRPC_patch_action .= ")$errdiv$lt/b$gt$lt/p$gt{$lt}b$gt".__("(This patch only works on Apache servers and requires mod_rewrite to be functional)",'gotmls')."$lt/b$gt{$lt}br$gt\n".__("Most WordPress sites do not use the XMLRPC features and hack attempts on the xmlrpc.php file are more common then ever before. Even if there are no vulnerabilities for hackers to exploit, these attempts can cause slowness or downtime similar to a DDoS attack. This patch automatically blocks all external access to the xmlrpc.php file.",'gotmls')."$lt/div$gt$lt/form$gt"; $patch_status = 0; $patch_found = -1; $find = "#if\s*\(([^\&]+\&\&)?\s*file_exists\((.+?)(safe-load|wp-login)\.php'\)\)\s*require(_once)?\((.+?)(safe-load|wp-login)\.php'\);#"; $head = str_replace(array('#', '\\(', '\\)', '(_once)?', ')\\.', '\\s*', '(.+?)(', '|', '([^\\&]+\\&\\&)?'), array(' ', '(', ')', '_once', '.', ' ', '\''.dirname(__FILE__).'/', '/', '!in_array($_SERVER["REMOTE_ADDR"], array("'.GOTMLS_REMOTEADDR.'")) &&'), $find); if (is_file(ABSPATH.'../wp-config.php') && !is_file(ABSPATH.'wp-config.php')) $wp_config = '../wp-config.php'; else $wp_config = 'wp-config.php'; $BFLP_patch_action = ""; if (is_file(ABSPATH.$wp_config)) { if (($config = @file_get_contents(ABSPATH.$wp_config)) && strlen($config)) { if ($patch_found = preg_match($find, $config)) { if (strpos($config, substr($head, strpos($head, "file_exists")))) { if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_patching"]) && ($_POST["GOTMLS_patching"] > 0) && GOTMLS_save_contents(ABSPATH.$wp_config, preg_replace('#'.$lt.'\?[ph\s]+(//.*\s*)*\?'.$gt.'#i', "", preg_replace($find, "", $config)))) $BFLP_patch_action .= GOTMLS_error_div(__("Removed Brute-Force Protection",'gotmls')); else $patch_status = 1; } else { if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_patching"]) && ($_POST["GOTMLS_patching"] > 0) && GOTMLS_save_contents(ABSPATH.$wp_config, preg_replace($find, "$head", $config))) { $BFLP_patch_action .= GOTMLS_error_div(__("Upgraded Brute-Force Protection",'gotmls'), "updated"); $patch_status = 1; } else $patch_status = 2; } } elseif ($GOTMLS_nonce_found && isset($_POST["GOTMLS_patching"]) && ($_POST["GOTMLS_patching"] > 0) && strlen($config) && ($patch_found == 0) && GOTMLS_save_contents(ABSPATH.$wp_config, "$lt?php$head// Load Brute-Force Protection by GOTMLS.NET before the WordPress bootstrap. ?$gt$config")) { $BFLP_patch_action .= GOTMLS_error_div(__("Installed Brute-Force Protection",'gotmls'), "updated"); $patch_status = 1; } elseif ($GOTMLS_nonce_found && isset($_POST["GOTMLS_patching"]) && ($_POST["GOTMLS_patching"] > 0)) $BFLP_patch_action .= GOTMLS_error_div(sprintf(__("Failed to install Brute-Force Protection (wp-config.php %s)",'gotmls'),(is_readable(ABSPATH.$wp_config)?'read-'.(is_writable(ABSPATH.$wp_config)?'write':'only'):"unreadable").": ".strlen($config).GOTMLS_fileperms(ABSPATH.$wp_config)), "updated"); } else $BFLP_patch_action .= GOTMLS_error_div(__("wp-config.php Not Readable!",'gotmls')); } else $BFLP_patch_action .= GOTMLS_error_div(__("wp-config.php Not Found!",'gotmls')); if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_firewall_option"]) && strlen($_POST["GOTMLS_firewall_option"]) && isset($_POST["GOTMLS_firewall_value"]) && strlen($_POST["GOTMLS_firewall_value"])) { $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["firewall"][GOTMLS_sanitize($_POST["GOTMLS_firewall_option"])] = (INT) $_POST["GOTMLS_firewall_value"]; if (update_option("GOTMLS_settings_array", $GLOBALS["GOTMLS"]["tmp"]["settings_array"])) $save_action = "\n{$lt}div onclick=\"this.style.display='none';\" style='position: relative; top: -40px; margin: 0 300px 0 130px;' class='updated'$gt\nSettings Saved!$lt/div$gt\n"; else $save_action = "\n{$lt}div onclick=\"this.style.display='none';\" style='position: relative; top: -40px; margin: 0 300px 0 130px;' class='updated'$gt\nSave Failed!$lt/div$gt\n"; } $sec_opts = $lt.'form method="POST" name="GOTMLS_Form_firewall"'.$gt.$lt.'input type="hidden" id="fw_opt" name="GOTMLS_firewall_option" value="traversal"'.$gt.$lt.'input type="hidden" name="GOTMLS_firewall_value" id="fw_val" value="0"'.$gt.$Firewall_nonce; if (isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"]) && array($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"])) foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["firewall"] as $TP => $VA) if (is_array($VA) && count($VA) > 3 && strlen($VA[1]) && strlen($VA[2])) $sec_opts .= $lt.'div style="padding: 0 30px;"'.$gt.$lt.'input type="submit" style="float: right;" value="'.(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["firewall"]["$TP"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["firewall"]["$TP"]?"Enable Protection\" onclick=\"setFirewall('$TP', 0);\"$gt$lt".'p'.$gt.$lt.'img src="'.GOTMLS_images_path.'threat.gif"'.$gt.$lt."b$gt$VA[1] (Currently Disabled)":"Disable Protection\" onclick=\"setFirewall('$TP', 1);\"$gt$lt".'p'.$gt.$lt.'img src="'.GOTMLS_images_path.'checked.gif"'.$gt.$lt."b$gt$VA[1] (Automatically Enabled)")."$lt/b$gt$lt/p$gt$VA[2]$lt/div$gt$lt".'hr /'.$gt; $style = ' display: none;" id="GOTMLS_patch_button"'.$gt.$lt.'div id="GOTMLS_patch_searching" style="float: right;"'.$gt.__("Checking for session compatibility ...",'gotmls').' '.$lt.'img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="Wait..." /'.$gt.$lt.'/div'.$gt; $script = ""; if ($patch_status) { $sec_opts .= $lt.'input type="submit" style="float: right; margin: 6px;" value="'.(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["firewall"]["BFLP"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["firewall"]["BFLP"]?"Show Protection Logo\" onclick=\"setFirewall('BFLP', 0);\"$gt$lt".'div style="float: right; margin: 8px;"'."$gt Logo will be hidden on the login page":"Hide Protection Logo\" onclick=\"setFirewall('BFLP', 1);\"$gt$lt".'div style="float: right; margin: 8px;"'.$gt.$lt.'img style="height: 24px; vertical-align: middle;"src="'.GOTMLS_images_path.'GOTMLS-Loading.gif" /'."$gt Brute-Force Protection is Active")."$lt/div$gt"; $style = '"'.$gt; } else $script = $lt."script type='text/javascript'$gt\nfunction search_patch_onload() {\n\tstopCheckingSession = checkupdateserver('".GOTMLS_admin_url('GOTMLS_log_session')."');\n}\nif (window.addEventListener)\n\twindow.addEventListener('load', search_patch_onload)\nelse\n\tdocument.attachEvent('onload', search_patch_onload);\n$lt/script$gt"; $sec_opts .= "$lt/form$gt\n$BFLP_patch_action\n$lt".'form method="POST" name="GOTMLS_Form_patch"'.$gt.$lt.'div style="padding: 0 30px;"'.$gt.$Firewall_nonce.$lt.'input type="submit" value="'.$patch_attr[$patch_status]["action"].'" style="float: right;'.$style.$lt.'input type="hidden" name="GOTMLS_patching" value="1"'.$gt.$lt.'p'.$gt.$lt.'img src="'.GOTMLS_images_path.$patch_attr[$patch_status]["icon"].'.gif"'.$gt.$lt.'b'.$gt.'Brute-force Protection '.$patch_attr[$patch_status]["status"].$lt.'/b'.$gt.$lt.'/p'.$gt.$patch_attr[$patch_status]["language"].__(" For more information on Brute-Force attack prevention and the WordPress wp-login-php file ",'gotmls').' '.$lt.'a target="_blank" href="'.GOTMLS_plugin_home.'tag/wp-login-php/"'.$gt.__("read my blog",'gotmls')."$lt/a$gt.$lt/div$gt$lt/form$gt\n$XMLRPC_patch_action\n$script"; $admin_notice = ""; if ($current_user->user_login == "admin") { $admin_notice .= $lt.'hr /'.$gt; if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_admin_username"]) && ($current_user->user_login != trim($_POST["GOTMLS_admin_username"])) && strlen(trim($_POST["GOTMLS_admin_username"])) && preg_match('/^\s*[a-z_0-9\@\.\-]{3,}\s*$/i', $_POST["GOTMLS_admin_username"])) { if ($wpdb->update($wpdb->users, array("user_login" => trim($_POST["GOTMLS_admin_username"])), array("user_login" => $current_user->user_login))) { $wpdb->query($wpdb->prepare("UPDATE `{$wpdb->prefix}sitemeta` SET `meta_value` = REPLACE(`meta_value`, 's:5:\"admin\";', %s) WHERE `meta_key` = 'site_admins' AND `meta_value` like %s", 's:'.strlen(trim($_POST["GOTMLS_admin_username"])).':"'.trim($_POST["GOTMLS_admin_username"]).'";', '%s:5:"admin";%')); $admin_notice .= GOTMLS_error_div(sprintf(__("You username has been change to %s. Don't forget to use your new username when you login again.",'gotmls'), $_POST["GOTMLS_admin_username"]), "updated"); } else $admin_notice .= GOTMLS_error_div(sprintf(__("SQL Error changing username: %s. Please try again later.",'gotmls'), $wpdb->last_error)); } else { if (isset($_POST["GOTMLS_admin_username"])) $admin_notice .= GOTMLS_error_div(sprintf(__("Your new username must be at least 3 characters and can only contain "%s". Please try again.",'gotmls'), "a-z0-9_.-@"), "updated"); $admin_notice .= $lt.'form method="POST" name="GOTMLS_Form_admin"'.$gt.$lt.'div style="float: right;"'.$gt.$lt.'div style="float: left;"'.$gt.__("Change your username:",'gotmls').$lt.'/div'.$gt.$Firewall_nonce.$lt.'input style="float: left;" type="text" id="GOTMLS_admin_username" name="GOTMLS_admin_username" size="6" value="'.$current_user->user_login.'"'.$gt.$lt.'input style="float: left;" type="submit" value="Change"'.$gt.$lt.'/div'.$gt.$lt.'div style="padding: 0 30px;"'.$gt.$lt.'p'.$gt.$lt.'img src="'.GOTMLS_images_path.'threat.gif"'.$gt.$lt.'b'.$gt.'Admin Notice'.$lt.'/b'.$gt.$lt.'/p'.$gt.__("Your username is \"admin\", this is the most commonly guessed username by hackers and brute-force scripts. It is highly recommended that you change your username immediately.",'gotmls').$lt.'/div'.$gt.$lt.'/form'.$gt; } } if ($GOTMLS_nonce_found && isset($_POST["GOTMLS_wpfirewall_action"])) { if ($_POST["GOTMLS_wpfirewall_action"] == "exclude_terms") update_option("WP_firewall_exclude_terms", ""); elseif ($_POST["GOTMLS_wpfirewall_action"] == "whitelisted_ip") { $ips = GOTMLS_uckserialize(get_option("WP_firewall_whitelisted_ip", "not Array!")); if (is_array($ips)) $ips = array_merge($ips, array(GOTMLS_safe_ip($_SERVER["REMOTE_ADDR"]))); else $ips = array(GOTMLS_safe_ip($_SERVER["REMOTE_ADDR"])); update_option("WP_firewall_whitelisted_ip", serialize($ips)); } } if (get_option("WP_firewall_exclude_terms", "Not Found!") == "allow") { $end = "$lt/div$gt$lt/form$gt\n{$lt}hr /$gt"; $img = 'threat.gif"'; $button = $lt.'input type="submit" onclick="document.getElementById(\'GOTMLS_wpfirewall_action\').value=\'exclude_terms\';" value="'.__("Disable this Rule",'gotmls').'"'.$gt; $wpfirewall_action = $lt.'form method="POST" name="GOTMLS_Form_wpfirewall2"'.$gt.$lt.'div style="float: right;"'.$gt.$lt.'input type="hidden" name="GOTMLS_wpfirewall_action" id="GOTMLS_wpfirewall_action" value=""'.$gt.$Firewall_nonce.$button.$lt.'/div'.$gt.$lt.'div style="padding: 0 30px;"'.$gt.$lt.'p'.$gt.$lt.'img src="'.GOTMLS_images_path.$img.$gt.$lt.'b'.$gt."WP Firewall 2 (Conflicting Firewall Rule)$lt/b$gt$lt/p$gt".__("The Conflicting Firewall Rule (WP_firewall_exclude_terms) activated by the WP Firewall 2 plugin has been shown to interfere with the Definition Updates and WP Core File Scans in my Anti-Malware plugin. I recommend that you disable this rule in the WP Firewall 2 plugin.",'gotmls').$end; if (isset($_SERVER["REMOTE_ADDR"])) { if (is_array($ips = GOTMLS_uckserialize(get_option("WP_firewall_whitelisted_ip", "not Array!"))) && in_array($_SERVER["REMOTE_ADDR"], $ips)) $wpfirewall_action = str_replace(array($img, $end), array('question.gif"', __(" However, your current IP has been Whitelisted so you could probably keep this rule enabled if you really want to.",'gotmls').$end), $wpfirewall_action); else $wpfirewall_action = str_replace(array($button, $end), array($button.$lt."br /$gt$lt".'input type="submit" onclick="document.getElementById(\'GOTMLS_wpfirewall_action\').value=\'whitelisted_ip\';" value="'.__("Whitelist your IP",'gotmls').'"'.$gt, __(" However, if you would like to keep this rule enabled you should at least Whitelist your IP.",'gotmls').$end), $wpfirewall_action); } $sec_opts = $wpfirewall_action.$sec_opts; } echo GOTMLS_box(__("Firewall Options",'gotmls'), $save_action.$sec_opts.$admin_notice)."\n
    "; } function GOTMLS_get_registrant($you) { global $current_user, $wpdb; wp_get_current_user(); if (isset($you["you"])) $you = $you["you"]; if (isset($you["user_email"]) && strlen($you["user_email"]) == 32) { if ($you["user_email"] == md5($current_user->user_email)) $registrant = $current_user->user_email; elseif (!($registrant = $wpdb->get_var($wpdb->prepare("SELECT `user_nicename` FROM `$wpdb->users` WHERE MD5(`user_email`) = %s", $you["user_email"])))) $registrant = GOTMLS_siteurl; } else $registrant = GOTMLS_siteurl; return $registrant; } function GOTMLS_ajax_load_update() { global $wpdb; $GOTMLS_nonce_found = GOTMLS_get_nonce(); $YES_user_can = GOTMLS_user_can(); $GOTMLS_definitions_versions = array(); $user_info = array(); $saved = false; $moreJS = ""; $finJS = "\n}"; $form = 'registerKeyForm'; $innerHTML = "
  • Your Installation Key could not be confirmed!
  • "; $autoUpJS = 'This new feature is currently only available to registered users who have donated $29 or more.
    '; if (is_array($GLOBALS["GOTMLS"]["tmp"]["definitions_array"])) foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"] as $threat_level=>$definition_names) foreach ($definition_names as $definition_name=>$definition_version) if (is_array($definition_version) && isset($definition_version[0]) && strlen($definition_version[0]) == 5) if (!isset($GOTMLS_definitions_versions[$threat_level]) || $definition_version[0] > $GOTMLS_definitions_versions[$threat_level]) $GOTMLS_definitions_versions[$threat_level] = $definition_version[0]; asort($GOTMLS_definitions_versions); if (isset($_REQUEST["UPDATE_definitions_array"]) && strlen($_REQUEST["UPDATE_definitions_array"]) && $GOTMLS_nonce_found && $YES_user_can) { $DEF_url = 'http:'.GOTMLS_update_home.'definitions.php?'.GOTMLS_get_version_URL.'&'.GOTMLS_set_nonce(GOTMLS_update_home).'&d='.ur1encode(GOTMLS_siteurl); if (isset($_REQUEST["dt"]) && strlen($_REQUEST["dt"])) $DEF_url .= '&dt='.preg_replace('/[^\w]/', "", $_REQUEST["dt"]); if (strlen($_REQUEST["UPDATE_definitions_array"]) > 1) { $GOTnew_definitions = GOTMLS_uckserialize(GOTMLS_decode($_REQUEST["UPDATE_definitions_array"])); if (is_array($GOTnew_definitions)) { $form = 'autoUpdateDownload'; $GLOBALS["GOTMLS"]["tmp"]["onLoad"] .= "updates_complete('Downloaded Definitions');"; } } elseif ($_REQUEST["UPDATE_definitions_array"] == "D") { $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = array(); $GOTnew_definitions = array(); delete_option('GOTMLS_get_URL_array'); } elseif (($DEF = GOTMLS_get_URL($DEF_url)) && is_array($GOTnew_definitions = GOTMLS_uckserialize(GOTMLS_decode($DEF))) && count($GOTnew_definitions)) { if (isset($GOTnew_definitions["you"]["user_email"]) && strlen($GOTnew_definitions["you"]["user_email"]) == 32) { $toInfo = GOTMLS_get_registrant($GOTnew_definitions["you"]); $innerHTML = "
  • Your Installation Key is Registered to:
    $toInfo
  • "; $form = 'autoUpdateForm'; if (isset($GOTnew_definitions["you"]["user_donations"]) && isset($GOTnew_definitions["you"]["user_donation_total"]) && isset($GOTnew_definitions["you"]["user_donation_freshness"])) { $user_donations_src = $GOTnew_definitions["you"]["user_donations"]; if ($GOTnew_definitions["you"]["user_donation_total"] > 27.99) { $autoUpJS = 'Yes | No '; $moreJS = 'if (foundUpdates = document.getElementById("check_wp_core_div_NA")) foundUpdates.innerHTML = "Set Definition Updates to Automatically Download to activate this feature.";'; } if ($user_donations_src > 0 && $GOTnew_definitions["you"]["user_donation_total"] > 0) $li = "
  • You have made $user_donations_src donation".($user_donations_src?'s totalling':' for').' $'.$GOTnew_definitions["you"]["user_donation_total"].".
  • "; } } else $innerHTML = "
  • Your Installation Key is not registered!
  • "; asort($GOTnew_definitions); if (serialize($GOTnew_definitions) == serialize($GLOBALS["GOTMLS"]["tmp"]["definitions_array"])) unset($GOTnew_definitions); else { $debug = substr(serialize($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]), 0, 9)." ".md5(serialize($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]))." ".strlen(serialize($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]))." ".substr(serialize($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]), -9)." != ".substr(serialize($GOTnew_definitions), 0, 9)." ".md5(serialize($GOTnew_definitions))." ".strlen(serialize($GOTnew_definitions)." ".substr(serialize($GOTnew_definitions), -9)); $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = $GOTnew_definitions; $GLOBALS["GOTMLS"]["tmp"]["onLoad"] .= "updates_complete('New Definitions Automatically Installed :-)');"; } $finJS .= "\nif (divNAtext)\n\tloadGOTMLS();\nelse\n\tdivNAtext = setTimeout(function() {loadGOTMLS();}, 4000);"; $finJS .= "\nif (typeof stopCheckingDefinitions !== 'undefined' && stopCheckingDefinitions)\n\tclearTimeout(stopCheckingDefinitions);"; } else $innerHTML = "
  • $GLOBALS["GOTMLS"]["get_URL"])))."');\\\">Automatic Update Connection Failed!
  • "; if (isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["backdoor"])) unset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["backdoor"]); } else { if (!$GOTMLS_nonce_found) $reason = GOTMLS_Invalid_Nonce(); elseif (!$YES_user_can) $reason = __("Permission Error: Only an administrator can update settings!", 'gotmls'); else $reason = __("definitions_array not set!", 'gotmls'); $innerHTML = "
  • ".GOTMLS_htmlspecialchars($reason)."
  • "; } if (isset($GOTnew_definitions) && is_array($GOTnew_definitions)) { $GLOBALS["GOTMLS"]["tmp"]["definitions_array"] = GOTMLS_array_replace($GLOBALS["GOTMLS"]["tmp"]["definitions_array"], $GOTnew_definitions); if (file_exists(GOTMLS_plugin_path.'definitions_update.txt')) @unlink(GOTMLS_plugin_path.'definitions_update.txt'); $saved = GOTMLS_update_option('definitions', $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]); $GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"] = array(); foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"] as $threat_level=>$definition_names) { if ($threat_level != "potential") $GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"][] = $threat_level; foreach ($definition_names as $definition_name=>$definition_version) if (is_array($definition_version) && isset($definition_version[0]) && strlen($definition_version[0]) == 5) if (!isset($GOTMLS_definitions_versions[$threat_level]) || $definition_version[0] > $GOTMLS_definitions_versions[$threat_level]) $GOTMLS_definitions_versions[$threat_level] = $definition_version[0]; } $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = $GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"]; asort($GOTMLS_definitions_versions); $autoUpJS .= '(Newest Definition Updates Installed.)'; } elseif ($form != 'registerKeyForm') { $form = 'autoUpdateDownload'; $autoUpJS .= '(No newer Definition Updates are available at this time.)'; $innerHTML .= "
  • No Newer Definition Updates Available.
  • "; } if (isset($_SERVER["SCRIPT_FILENAME"]) && preg_match('/[\/\\\\]admin-ajax\.php/i', $_SERVER["SCRIPT_FILENAME"]) && isset($_REQUEST["action"]) && $_REQUEST["action"] == "GOTMLS_load_update") { if (!$user_donations_src) $li = "
  • You have not donated yet!
  • "; if (strlen($moreJS) == 0) $moreJS = 'if (foundUpdates = document.getElementById("check_wp_core_div_NA")) foundUpdates.innerHTML = "Donate $29+ now then enable Automatic Definition Updates to Scan for Core Files changes.";'; $moreJS .= "\n\tif (foundUpdates = document.getElementById('pastDonations'))\n\tfoundUpdates.innerHTML = '$li';"; if ($GOTMLS_nonce_found) @header("Content-type: text/javascript"); else die(GOTMLS_Invalid_Nonce("Nonce Error: ")); if (is_array($GOTMLS_definitions_versions) && count($GOTMLS_definitions_versions) && (strlen($new_ver = trim(array_pop($GOTMLS_definitions_versions))) == 5) && $saved) { $innerHTML .= "
  • New Definition Updates Installed.
  • "; $finJS .= "\nif (foundUpdates = document.getElementById('GOTMLS_definitions_date')) foundUpdates.innerHTML = '$new_ver';\nif (foundUpdates = document.getElementById('autoUpdateForm')) foundUpdates.style.display = 'none';"; } elseif (isset($GOTnew_definitions) && is_array($GOTnew_definitions) && count($GOTnew_definitions)) $finJS .= "\nalert('Definition update $new_ver could not be saved because update_option Failed! (saved=".($saved?"TRUE":"FALSE").") $debug');"; if (isset($_REQUEST["UPDATE_core"]) && ($_REQUEST["UPDATE_core"] == GOTMLS_wp_version) && isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"][GOTMLS_wp_version])) { foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"][GOTMLS_wp_version] as $file => $md5) { if (is_file(ABSPATH.$file)) { GOTMLS_load_contents(file_get_contents(ABSPATH.$file)); if (GOTMLS_check_threat($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"], ABSPATH.$file)) { if (isset($GLOBALS["GOTMLS"]["tmp"]["new_contents"]) && isset($_REQUEST["UPDATE_restore"]) && ($_REQUEST["UPDATE_restore"] == md5($GLOBALS["GOTMLS"]["tmp"]["new_contents"])."O".strlen($GLOBALS["GOTMLS"]["tmp"]["new_contents"]))) $autoUpJS .= "
  • Core File Restored: $file
  • "; else $autoUpJS .= "
  • Core File MODIFIED: $file ".md5($GLOBALS["GOTMLS"]["tmp"]["file_contents"])."O".strlen($GLOBALS["GOTMLS"]["tmp"]["file_contents"])." => $md5
  • "; } } else $autoUpJS .= "
  • Core File MISSING: $file
  • "; } $autoUpJS .= GOTMLS_error_div('Definition update: '.preg_replace('/[^0-9\.]/', "", $_REQUEST["UPDATE_core"]).' checked '.count($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["wp_core"][GOTMLS_wp_version]).' core files!', "update"); } die('//'.$innerHTML.'"+inc_form; function setDivNAtext() { var foundUpdates; '.$moreJS.$finJS.' if (foundUpdates = document.getElementById("UPDATE_definitions_div")) foundUpdates.innerHTML = \''.$autoUpJS.'\'; //]]>'); } $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] = '?div=Definition_Updates'; foreach ($GOTMLS_definitions_versions as $definition_name=>$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"]) $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] .= "&def[$definition_name]=".$GLOBALS["GOTMLS"]["tmp"]["Definition"]["Latest"]; if (isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]["user_email"]) && strlen($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]["user_email"]) == 32) $GLOBALS["GOTMLS"]["tmp"]["Definition"]["Updates"] .= "&def[you]=".$GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["you"]["user_email"]; } function GOTMLS_settings() { global $wpdb, $GOTMLS_dirs_at_depth, $GOTMLS_dir_at_depth; $GOTMLS_scan_groups = array(); $gt = ">"; // This local variable never changes $lt = "<"; // This local variable never changes GOTMLS_ajax_load_update(); if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"])) $_REQUEST["check"] = $GLOBALS["GOTMLS"]["tmp"]["threat_levels"]; if (($GOTMLS_nonce_found = GOTMLS_get_nonce()) && ((isset($_REQUEST["check"]) && is_array($_REQUEST["check"])) || (isset($_POST["scan_level"]) && is_numeric($_POST["scan_level"])))) { if (isset($_REQUEST["check"]) && is_array($_REQUEST["check"])) $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = GOTMLS_sanitize($_REQUEST["check"]); update_option("GOTMLS_settings_array", $GLOBALS["GOTMLS"]["tmp"]["settings_array"]); } $dirs = GOTMLS_explode_dir(__FILE__); for ($SL=0;$SL 0) $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"] = preg_split('/[\s]*([,]+[\s]*)+/', trim(str_replace('.', ',', GOTMLS_sanitize($_POST["exclude_ext"]))), -1, PREG_SPLIT_NO_EMPTY); else $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"] = array(); } $default_exclude_ext = str_replace(",gotmls", "", implode(",", $GLOBALS["GOTMLS"]["tmp"]["skip_ext"])); $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"]; if (isset($_POST["UPDATE_definitions_checkbox"])) { if (isset($_POST[$_POST["UPDATE_definitions_checkbox"]]) && is_numeric($_POST[$_POST["UPDATE_definitions_checkbox"]])) $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"] = (INT) $_POST[$_POST["UPDATE_definitions_checkbox"]]; else $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"] = ""; } if (isset($_POST["exclude_dir"])) { if (strlen(trim(str_replace(",","",$_POST["exclude_dir"]).' ')) > 0) $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"] = preg_split('/[\s]*([,]+[\s]*)+/', trim(GOTMLS_sanitize($_POST["exclude_dir"])), -1, PREG_SPLIT_NO_EMPTY); else $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"] = array(); for ($d=0; $d $GLOBALS["GOTMLS"]["tmp"]["settings_array"])); $scan_whatopts = ''; $scan_root = "public_html"; $scan_optjs = "\n{$lt}script type=\"text/javascript\"$gt\nfunction showOnly(what) {\n"; foreach ($GOTMLS_scan_groups as $mg => $GOTMLS_scan_group) { $scan_optjs .= "document.getElementById('only$mg').style.display = 'none';\n"; $scan_whatopts = "\n$lt/div$gt\n$lt/div$gt\n$scan_whatopts"; $scan_root = $GOTMLS_scan_group; $dir = implode(GOTMLS_slash(), array_slice($dirs, 0, -1 * (2 + $mg))); $files = GOTMLS_getfiles($dir); if (isset($files) && is_array($files) && count($files)) foreach ($files as $file) if (is_dir(GOTMLS_trailingslashit($dir).$file)) $scan_whatopts = $lt.'input type="checkbox" onchange="showhide(\'custom_quick_scan\', true);" name="scan_only[]" value="'.GOTMLS_htmlspecialchars($file).'" /'.$gt.GOTMLS_htmlspecialchars($file).$lt.'br /'.$gt.$scan_whatopts; $scan_whatopts = "\n$lt".'div style="padding: 4px 30px;" id="scan_group_div_'.$mg.'"'.$gt.$lt.'input type="radio" name="scan_what" id="not-only'.$mg.'" value="'.$mg.'"'.($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"]==$mg?' checked':'').' /'.$gt.$lt.'a style="text-decoration: none;" href="#scan_what" onclick="showOnly(\''.$mg.'\');document.getElementById(\'not-only'.$mg.'\').checked=true;"'."$gt{$lt}b$gt$GOTMLS_scan_group$lt/b$gt$lt/a$gt{$lt}br /$gt\n$lt".'div class="rounded-corners" style="position: absolute; display: none; background-color: #CCF; margin: 0; padding: 10px; z-index: 10;" id="only'.$mg.'"'.$gt.$lt.'div style="padding-bottom: 6px;"'.$gt.GOTMLS_close_button('only'.$mg, 0).$lt.'b'.$gt.str_replace(" ", " ", __("Only Scan These Folders:",'gotmls')).$lt.'/b'.$gt.$lt.'/div'.$gt.$scan_whatopts; } $scan_optjs .= "document.getElementById('only'+what).style.display = 'block';\n}"; if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]) && strlen(trim(" ".$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]))) $scan_optjs .= "\nfunction auto_UPDATE_check() {\n\tif (auto_UPdef_check = document.getElementById('auto_UPDATE_definitions_".$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["auto_UPDATE_definitions"]."'))\n\t\tauto_UPdef_check.checked = true;\n}\nif (window.addEventListener)\n\twindow.addEventListener('load', auto_UPDATE_check)\nelse\n\tdocument.attachEvent('onload', auto_UPDATE_check);\n"; $scan_optjs .= "$lt/script$gt"; $GOTMLS_nonce_URL = GOTMLS_set_nonce(__FUNCTION__."790"); $scan_opts = "\n$lt".'form method="POST" id="GOTMLS_Form" name="GOTMLS_Form"'.$gt.$lt.'input type="hidden" name="'.str_replace('=', '" value="', $GOTMLS_nonce_URL).'"'.$gt.$lt.'input type="hidden" name="scan_type" id="scan_type" value="Complete Scan" /'.$gt.$lt.'div style="float: right;"'.$gt.$lt.'input type="submit" id="complete_scan" value="'.__("Run Complete Scan",'gotmls').'" class="button-primary" onclick="document.getElementById(\'scan_type\').value=\'Complete Scan\';" /'.$gt.$lt.'/div'.$gt.' '.$lt.'div style="float: right; margin: 0 5px;"'.$gt.$lt.'input style="display: none;" type="submit" id="custom_quick_scan" value="'.__("Custom Quick Scan",'gotmls').'" class="button-primary" onclick="document.getElementById(\'scan_type\').value=\'Quick Scan\';" /'.$gt.$lt.'/div'.$gt.$lt.'div id="gotmls_wtl4" style="float: left;"'.$gt.$lt.'p'.$gt.$lt.'b'.$gt.__("What to look for:",'gotmls')."$lt/b$gt".GOTMLS_dashicon_button(__("Check for all threat types, if any of these are in red or otherwise unavailable then please download the latest definition updates.",'gotmls')).GOTMLS_dashicon_button(__("If you are having trouble Posting Array Variables to your site then you can temporarily remove this section to avoid errors when Scanning or Saving from this form.",'gotmls'), 'dismiss', 'color: #F00; text-decoration: none;" onclick="if (wtl4 = document.getElementById(\'gotmls_wtl4\')) wtl4.innerHTML = \'\'')."$lt/p$gt\n$lt".'div style="padding: 0 30px;"'.$gt; $cInput = '"'.$gt.$lt.'input'; $pCheck = "$cInput checked"; $kCheck = ""; foreach ($GLOBALS["GOTMLS"]["tmp"]["threat_levels"] as $threat_level_name=>$threat_level) { $scan_opts .= $lt.'div id="check_'.$threat_level.'_div" style="padding: 0; position: relative;'; if (($threat_level != "wp_core" && isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"][$threat_level])) || isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"][$threat_level][GOTMLS_wp_version])) { if ($threat_level != "potential" && in_array($threat_level,$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"])) { $pCheck = " display: none;$cInput"; $scan_opts .= "$cInput checked"; } elseif ($threat_level == "potential") $scan_opts .= $pCheck; else $scan_opts .= $cInput; if ($threat_level != "potential") $kCheck .= ",'$threat_level'"; $scan_opts .= ' type="checkbox" onchange="pCheck(this);" name="check[]" id="check_'.$threat_level.'_Yes" value="'.$threat_level.'" /'.$gt.' '.$lt.'a style="text-decoration: none;" href="#check_'.$threat_level.'_div_0" onclick="document.getElementById(\'check_'.$threat_level.'_Yes\').checked=true;pCheck(document.getElementById(\'check_'.$threat_level.'_Yes\'));showhide(\'dont_check_'.$threat_level.'\');"'."$gt{$lt}b$gt$threat_level_name$lt/b$gt$lt/a$gt\n"; if (isset($_GET["SESSION"])) { $scan_opts .= "\n$lt".'div style="padding: 0 20px; position: relative; top: -18px; display: none;" id="dont_check_'.$threat_level.'"'.$gt.$lt.'a class="rounded-corners" style="position: absolute; left: 0; margin: 0; padding: 0 4px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;" href="#check_'.$threat_level.'_div_0" onclick="showhide(\'dont_check_'.$threat_level.'\');"'.$gt.'X'.$lt.'/a'.$gt; foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"][$threat_level] as $threat_name => $threat_regex) $scan_opts .= $lt."br /$gt\n$lt".'input type="checkbox" name="dont_check[]" value="'.GOTMLS_htmlspecialchars($threat_name).'"'.(in_array(GOTMLS_sanitize($threat_name), $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"])?' checked /'.$gt.$lt.'script'.$gt.'showhide("dont_check_'.$threat_level.'", true);'.$lt.'/script'.$gt:' /'.$gt).(isset($_SESSION["GOTMLS_debug"][$threat_name])?$lt.'div style="float: right;"'.$gt.GOTMLS_htmlspecialchars(print_r($_SESSION["GOTMLS_debug"][$threat_name],1))."$lt/div$gt":"").GOTMLS_htmlspecialchars($threat_name); $scan_opts .= "\n$lt/div$gt"; } } else $scan_opts .= $lt.'a title="'.__("Download Definition Updates to Use this feature",'gotmls').'"'.$gt.$lt.'img src="'.GOTMLS_images_path.'blocked.gif" height=16 width=16 alt="X"'.$gt.$lt.'b'.$gt.'  '.$threat_level_name.$lt.'/b'.$gt.$lt.'br /'.$gt.$lt.'div style="padding: 14px;" id="check_'.$threat_level.'_div_NA"'.$gt.$lt.'span style="color: #F00"'.$gt.__("Download the new definitions (Right sidebar) to activate this feature.",'gotmls')."$lt/span$gt$lt/div$gt"; $scan_opts .= "\n$lt/div$gt"; } $scan_opts .= $lt.'/div'.$gt.$lt.'/div'.$gt.' '.$lt.'div style="float: left;"'.$gt.$lt.'p'.$gt.$lt.'b'.$gt.__("What to scan:",'gotmls')."$lt/b$gt".GOTMLS_dashicon_button(sprintf(__("The higher up in the directory hierarchy you start the more sub-directories get scanned (e.g. scanning the %s directory will also include the sub-directories wp-content and plugins within it).",'gotmls'), $scan_root))."$lt/p$gt$scan_whatopts$scan_optjs$lt/div$gt\n$lt".'div style="float: left;" id="scanwhatfolder"'.$gt.$lt.'/div'.$gt.' '.$lt.'div style="float: left;"'.$gt.$lt.'p'.$gt.$lt.'b'.$gt.__("Directory Scan Depth:",'gotmls')."$lt/b$gt".GOTMLS_dashicon_button(__("How many directories deep to scan: -1 is infinite depth, 0 to skip the file scan completely.",'gotmls'))."$lt/p$gt\n$lt".'div style="padding: 0 30px;"'.$gt.$lt.'input type="text" value="'.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"].'" name="scan_depth" size="5"'.$gt.$lt.'/div'.$gt.$lt.'/div'.$gt.$lt.'br style="clear: left;"'.$gt; if (isset($_GET["SESSION"]) && isset($_SESSION["GOTMLS_debug"])) {$scan_opts .= $lt.'div style="float: right;"'.$gt.GOTMLS_htmlspecialchars(print_r(array("sess" => $_SESSION),1))."$lt/div$gt"; $_SESSION["GOTMLS_debug"] = array("GOTMLS_settings(811)" => microtime(true));} if (isset($_GET["eli"])) {//still testing this option['total']['total'] if ($_GET["eli"] == "find") { if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]) && isset($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["known"][$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]]) && is_array($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["known"][$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]]) && (count($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["known"][$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]]) > 1)) { $fe = $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["known"][$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]][0]; $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"] = $GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["known"][$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]][1]; } else { $fe = " no"; foreach ($GLOBALS["GOTMLS"]["tmp"]["definitions_array"]["known"] as $f => $e) if (is_array($e) && in_array($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"], $e)) $fe = " $f"; } } else $fe = ""; $scan_opts .= "\n$lt".'div style="padding: 10px;"'.$gt.$lt.'p'.$gt.$lt.'b'.$gt.__("Custom RegExp:",'gotmls').$fe.$lt.'/b'.$gt.' ('.__("For very advanced users only. Do not use this without talking to Eli first. If used incorrectly you could easily break your site.",'gotmls').')'.$lt.'/p'.$gt.$lt.'input type="text" name="check_custom" style="width: 100%;" value="'.GOTMLS_htmlspecialchars($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]).'" /'."$gt$lt/div$gt\n"; } $QuickScan = $lt.((is_dir(dirname(__FILE__)."/../../../wp-includes") && is_dir(dirname(__FILE__)."/../../../wp-admin"))?'a href="'.admin_url("admin.php?page=GOTMLS-settings&scan_type=Quick+Scan&$GOTMLS_nonce_URL").'" class="button-primary" style="min-height: 22px; height: 22px; line-height: 13px; padding: 3px;">WP_Coreget_var("SELECT `option_value` FROM `$wpdb->options` WHERE `option_name` = 'blogname'")); $title_tagline .= "$lt/li$gt{$lt}li$gt Tagline: ".GOTMLS_htmlspecialchars($wpdb->get_var("SELECT `option_value` FROM `$wpdb->options` WHERE `option_name` = 'blogdescription'")); if (preg_match('/h[\@a]ck[3e]d.*by/is', $title_tagline)) echo GOTMLS_error_div(sprintf(__("Your Site Title or Tagline suggests that you may have been hacked ...%sThis could impact the indexing of your site and may even lead to blacklisting. You can change those options on the %sGeneral Settings$lt/a$gt page.",'gotmls'), "$title_tagline$lt/li$gt", $lt.'a href="'.admin_url("options-general.php").'"'.$gt)); @ob_start(); $OB_default_handlers = array("default output handler", "zlib output compression"); $OB_handlers = @ob_list_handlers(); if (is_array($OB_handlers) && count($OB_handlers)) foreach ($OB_handlers as $OB_last_handler) if (!in_array($OB_last_handler, $OB_default_handlers)) echo GOTMLS_error_div(sprintf(__("Another Plugin or Theme is using '%s' to handle output buffers.
    This prevents actively outputting the buffer on-the-fly and could severely degrade the performance of this (and many other) Plugins.
    Consider disabling caching and compression plugins (at least during the scanning process).",'gotmls'), GOTMLS_htmlspecialchars($OB_last_handler))); GOTMLS_display_header(); $scan_groups = array_merge(array(__("Scanned Files",'gotmls')=>"scanned",__("Selected Folders",'gotmls')=>"dirs",__("Scanned Folders",'gotmls')=>"dir",__("Skipped Folders",'gotmls')=>"skipdirs",__("Skipped Files",'gotmls')=>"skipped",__("Scan/Read Errors",'gotmls')=>"errors",__("Quarantined Files",'gotmls')=>"bad"), $GLOBALS["GOTMLS"]["tmp"]["threat_levels"]); echo $lt.'script type="text/javascript"> var percent = 0; function pCheck(chkb) { var kCheck = ['.trim($kCheck,",").']; chk = true; for (var i = 0; i < kCheck.length; i++) { var chkbox = document.getElementById("check_"+kCheck[i]+"_Yes"); if (chkbox && chkb.id == "check_potential_Yes" && chkb.checked == false) { chk = false; chkbox.checked = true; } else if (chkbox && chkbox.checked) { chk = false; } } if (chkbox = document.getElementById("check_potential_Yes")) chkbox.checked = chk; if (chk) { document.getElementById("check_potential_div").style.display = "block"; alert("If you do not select any other threat types, then only potential threats will be found and the automatic fix will not be available!"); } else document.getElementById("check_potential_div").style.display = "none"; } function changeFavicon(percent) { var oldLink = document.getElementById("wait_gif"); if (oldLink) { if (percent >= 100) { document.getElementsByTagName("head")[0].removeChild(oldLink); var link = document.createElement("link"); link.id = "wait_gif"; link.type = "image/gif"; link.rel = "shortcut icon"; var threats = '.implode(" + ", array_merge($GLOBALS["GOTMLS"]["tmp"]["threat_levels"], array(__("Potential Threats",'gotmls')=>"errors",__("WP-Login Updates",'gotmls')=>"errors"))).'; if (threats > 0) { if ((errors * 2) == threats) linkhref = "blocked"; else linkhref = "threat"; } else linkhref = "checked"; link.href = "'.GOTMLS_images_path.'"+linkhref+".gif"; document.getElementsByTagName("head")[0].appendChild(link); } } else { var icons = document.getElementsByTagName("link"); var link = document.createElement("link"); link.id = "wait_gif"; link.type = "image/gif"; link.rel = "shortcut icon"; link.href = "'.GOTMLS_images_path.'wait.gif"; // document.head.appendChild(link); document.getElementsByTagName("head")[0].appendChild(link); } } function update_status(title, time) { sdir = (dir+direrrors); if (arguments[2] >= 0 && arguments[2] <= 100) percent = arguments[2]; else percent = Math.floor((sdir*100)/dirs); scan_state = "6F6"; if (percent == 100) { showhide("pause_button", true); showhide("pause_button"); title = "'.$lt.'b'.$gt.GOTMLS_strip4java(__("Scan Complete!",'gotmls')).$lt.'/b'.$gt.'"; } else scan_state = "99F"; changeFavicon(percent); if (sdir) { if (arguments[2] >= 0 && arguments[2] <= 100) timeRemaining = Math.ceil(((time-startTime)*(100/percent))-(time-startTime)); else timeRemaining = Math.ceil(((time-startTime)*(dirs/sdir))-(time-startTime)); if (timeRemaining > 59) timeRemaining = Math.ceil(timeRemaining/60)+" Minute"; else timeRemaining += " Second"; if (timeRemaining.substr(0, 2) != "1 ") timeRemaining += "s"; } else timeRemaining = "Calculating Time"; timeElapsed = Math.ceil(time); if (timeElapsed > 59) timeElapsed = Math.floor(timeElapsed/60)+" Minute"; else timeElapsed += " Second"; if (timeElapsed.substr(0, 2) != "1 ") timeElapsed += "s"; divHTML = \''.$lt.'div align="center" style="vertical-align: middle; background-color: #ccc; z-index: 3; height: 18px; width: 100%; border: solid #000 1px; position: relative; padding: 10px 0;"'.$gt.$lt.'div style="height: 18px; padding: 10px 0; position: absolute; top: 0px; left: 0px; background-color: #\'+scan_state+\'; width: \'+percent+\'%"'.$gt.$lt.'/div'.$gt.$lt.'div style="height: 32px; position: absolute; top: 3px; left: 10px; z-index: 5; line-height: 16px;" align="left"'.$gt.'\'+sdir+" Folder"+(sdir==1?"":"s")+" Checked'.$lt.'br /'.$gt.'"+timeElapsed+\' Elapsed'.$lt.'/div'.$gt.$lt.'div style="height: 38px; position: absolute; top: 0px; left: 0px; width: 100%; z-index: 5; line-height: 38px; font-size: 30px; text-align: center; box-sizing: content-box;"'.$gt.'\'+percent+\'%'.$lt.'/div'.$gt.$lt.'div style="height: 32px; position: absolute; top: 3px; right: 10px; z-index: 5; line-height: 16px;" align="right"'.$gt.'\'+(dirs-sdir)+" Folder"+((dirs-sdir)==1?"":"s")+" Remaining'.$lt.'br /'.$gt.'"+timeRemaining+" Remaining'.$lt.'/div'.$gt.$lt.'/div'.$gt.'"; document.getElementById("status_bar").innerHTML = divHTML; document.getElementById("status_text").innerHTML = title; dis="none"; divHTML = \''.$lt.'ul style="float: right; margin: 0 20px; text-align: right;"'.$gt.'\'; /*'.$lt.'!--*'.'/'; $MAX = 0; $vars = "var i, intrvl, direrrors=0"; $fix_button_js = ""; $found = ""; $li_js = "return false;"; if ((isset($_REQUEST["scan_type"]) && $_REQUEST["scan_type"] == "Quick Scan") || (!(isset($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"]) && is_array($GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"])))) { $GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"] = array(); foreach ($GLOBALS["GOTMLS"]["tmp"]["threat_levels"] as $check) if ($check != "potential") $GLOBALS["GOTMLS"]["scan"]["log"]["settings"]["check"][] = $check; } foreach ($scan_groups as $scan_name => $scan_group) { if ($MAX++ == 6) { $quarantineCountOnly = GOTMLS_get_quarantine(true); $vars .= ", $scan_group=$quarantineCountOnly"; echo "/*--{$gt}*"."/\n\tif ($scan_group > 0)\n\t\tscan_state = ' potential'; \n\telse\n\t\tscan_state = '';\n\tdivHTML += '