Anti-Malware Security and Brute-Force Firewall - Version 4.14.53

Version Description

  • Added option to skip scanning the Quaratined files.
  • Updated Brute-Force patch to fix the problem of being included more that once.
  • Fixed a few minor bugs (better window positioning and css, cleaner results page, updated new help tab, etc.).
Download this release

Release Info

Developer scheeeli
Plugin Icon 128x128 Anti-Malware Security and Brute-Force Firewall
Version 4.14.53
Comparing to
See all releases

Code changes from version 4.14.52 to 4.14.53

Files changed (7) hide show
  1. images/index.php +191 -156
  2. index.php +216 -163
  3. languages/gotmls.pot +42 -29
  4. readme.txt +11 -3
  5. safe-load/index.php +5 -3
  6. safe-load/session.php +11 -1
  7. safe-load/wp-login.php +33 -31
images/index.php CHANGED
@@ -4,45 +4,107 @@
4
  * @package GOTMLS
5
  */
6
 
7
- define("GOTMLS_local_images_path", dirname(__FILE__)."/");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
- if ((isset($_SERVER["SCRIPT_FILENAME"]) && substr(__FILE__, -1 * strlen($_SERVER["SCRIPT_FILENAME"])) == substr($_SERVER["SCRIPT_FILENAME"], -1 * strlen(__FILE__))) || !defined("GOTMLS_plugin_path")) {
10
  header("Content-type: image/gif");
11
  $img_src = GOTMLS_local_images_path.'GOTMLS-16x16.gif';
12
  if (!(file_exists($img_src) && $img_bin = @file_get_contents($img_src)))
13
- $img_bin = base64_decode('R0lGODlhEAAQAIABAAAAAP///yH5BAEAAAEALAAAAAAQABAAAAIshB0Qm+eo2HuJNWdrjlFm3S2hKB7kViKaxZmr98YgSo/jzH6tiU0974MADwUAOw==');
14
  die($img_bin);
15
  } elseif (isset($_GET["no_error_reporting"]))
16
  @error_reporting(0);
17
 
18
- define("GOTMLS_plugin_dir", "gotmls");
19
- define("GOTMLS_Version", "4.14.52");
20
- define("GOTMLS_require_version", "3.0");
21
- define("GOTMLS_Failed_to_list_LANGUAGE", __("Failed to list files in directory!",'gotmls'));
22
- define("GOTMLS_Run_Complete_Scan_LANGUAGE", __("Run Complete Scan",'gotmls'));
23
- define("GOTMLS_Run_Quick_Scan_LANGUAGE", __("Run Quick Scan",'gotmls'));
24
- define("GOTMLS_View_Quarantine_LANGUAGE", __("View Quarantine",'gotmls'));
25
- define("GOTMLS_Tested_your_site_LANGUAGE", __("Tested your site. It appears we didn't break anything",'gotmls'));
26
- define("GOTMLS_require_version_LANGUAGE", sprintf(__("This Plugin requires WordPress version %s or higher",'gotmls'), GOTMLS_require_version));
27
- define("GOTMLS_Scan_Settings_LANGUAGE", __("Scan Settings",'gotmls'));
28
- define("GOTMLS_Loading_LANGUAGE", __("Loading, Please Wait ...",'gotmls'));
29
- define("GOTMLS_too_long_LANGUAGE", __("If this is taking too long, click here.",'gotmls'));
30
- define("GOTMLS_Could_not_find_server_LANGUAGE", __("Could not find server!",'gotmls'));
31
- define("GOTMLS_Plugin_Updates_LANGUAGE", __("Plugin Updates for WP",'gotmls'));
32
- define("GOTMLS_Searching_updates_LANGUAGE", __("Searching for updates ...",'gotmls'));
33
- define("GOTMLS_Definition_Updates_LANGUAGE", __("Definition Updates",'gotmls'));
34
- define("GOTMLS_Please_donate_LANGUAGE", __("Please make a donation for the use of this wonderful feature!",'gotmls'));
35
- define("GOTMLS_Automatically_Fix_LANGUAGE", __("Automatically Fix SELECTED Files Now",'gotmls'));
36
- define("GOTMLS_Scan_Details_LANGUAGE", __("Scan Details:",'gotmls'));
37
- define("GOTMLS_Last_Scan_Status_LANGUAGE", __("Scan Status",'gotmls'));
38
- define("GOTMLS_update_images_path", "/wp-content/plugins/update/images/");
39
- define("GOTMLS_siteurl", get_option("siteurl"));
40
- define("GOTMLS_images_path", plugins_url('/', __FILE__));
41
- define("GOTMLS_installation_key", md5(GOTMLS_siteurl));
42
 
43
  $GLOBALS["GOTMLS"] = array("tmp"=>array("mt"=>((isset($_GET["mt"])&&is_numeric($_GET["mt"]))?$_GET["mt"]:microtime(true)), "default_ext"=>"ieonly.", "skip_ext"=>array("png", "jpg", "jpeg", "gif", "bmp", "tif", "tiff", "psd", "fla", "flv", "mov", "mp3", "exe", "zip", "pdf", "css", "pot", "po", "mo", "so", "doc", "docx", "svg", "ttf")));
44
- define("GOTMLS_script_URI", preg_replace('/\&(last_)?mt=[0-9\.]+/','', str_replace('&', '&', htmlspecialchars($_SERVER["REQUEST_URI"], ENT_QUOTES))).'&mt='.$GLOBALS["GOTMLS"]["tmp"]["mt"]);
45
- $GLOBALS["GOTMLS"]["log"] = get_option('GOTMLS_scan_log/'.(isset($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:"0.0.0.0").'/'.$GLOBALS["GOTMLS"]["tmp"]["mt"], array());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  $GOTMLS_loop_execution_time = 60;
47
  $GOTMLS_chmod_file = (0644);
48
  $GOTMLS_chmod_dir = (0755);
@@ -59,23 +121,23 @@ $GOTMLS_dir_at_depth = array();
59
  $GOTMLS_dirs_at_depth = array();
60
  $GOTMLS_scanfiles = array();
61
  $GOTMLS_skip_dirs = array(".", "..");
62
- $GOTMLS_settings_array = get_option('GOTMLS_settings_array', array());
63
  if (isset($_GET['img']) && substr(strtolower($_SERVER["SCRIPT_FILENAME"]), -15) == "/admin-ajax.php" && !in_array(GOTMLS_get_ext($_GET['img']), $GLOBALS["GOTMLS"]["tmp"]["skip_ext"]))
64
  include(dirname(__FILE__)."/../safe-load/index.php");
65
- if (!(isset($GOTMLS_settings_array["msg_position"]) && is_array($GOTMLS_settings_array["msg_position"]) && count($GOTMLS_settings_array["msg_position"]) == 4))
66
- $GOTMLS_settings_array["msg_position"] = array('80px', '40px', '400px', '600px');
67
- if (!isset($GOTMLS_settings_array["menu_group"]))
68
- $GOTMLS_settings_array["menu_group"] = 0;
69
- if (!isset($GOTMLS_settings_array["scan_what"]))
70
- $GOTMLS_settings_array["scan_what"] = 2;
71
- if (!isset($GOTMLS_settings_array["scan_depth"]))
72
- $GOTMLS_settings_array["scan_depth"] = -1;
73
- if (!(isset($GOTMLS_settings_array["exclude_ext"]) && is_array($GOTMLS_settings_array["exclude_ext"])))
74
- $GOTMLS_settings_array["exclude_ext"] = $GLOBALS["GOTMLS"]["tmp"]["skip_ext"];
75
- if (!isset($GOTMLS_settings_array["check_custom"]))
76
- $GOTMLS_settings_array["check_custom"] = "";
77
- if (!(isset($GOTMLS_settings_array['exclude_dir']) && is_array($GOTMLS_settings_array['exclude_dir'])))
78
- $GOTMLS_settings_array["exclude_dir"] = array();
79
  $GOTMLS_total_percent = 0;
80
  $GOTMLS_HeadersError = "";
81
  function GOTMLS_admin_notices() {
@@ -126,7 +188,9 @@ function GOTMLS_loaded() {
126
  if (!is_numeric($linenum))
127
  $linenum = __("unknown",'gotmls');
128
  $GOTMLS_HeadersError = '<div class="error">'.sprintf(__('<b>Headers already sent</b> in %1$s on line %2$s.<br />This is not a good sign, it may just be a poorly written plugin but Headers should not have been sent at this point.<br />Check the code in the above mentioned file to fix this problem.','gotmls'), $filename, $linenum).'</div>';
129
- } elseif (!session_id() && isset($_GET["eli"])) { @session_start(); $_SESSION["GOTMLS_debug"]=array();}
 
 
130
  }
131
 
132
  if (!function_exists("add_action")) {
@@ -177,8 +241,10 @@ function GOTMLS_check_threat($check_threats, $file='UNKNOWN') {
177
  $GOTMLS_threats_found = array();
178
  if (is_array($check_threats)) {
179
  foreach ($check_threats as $threat_name=>$threat_definitions) {
180
- if (isset($_SESSION["GOTMLS_debug"])){ $_SESSION["GOTMLS_debug"]["threat_name"] = $threat_name;
181
- $_SESSION["GOTMLS_debug"]["last"]["threat_name"] = microtime(true);}
 
 
182
  if (is_array($threat_definitions) && count($threat_definitions) > 1 && strlen(array_shift($threat_definitions)) == 5) {
183
  while ($threat_definition = array_shift($threat_definitions)) {
184
  if ($found = @preg_match_all($threat_definition, $GOTMLS_file_contents, $threats_found)) {
@@ -189,19 +255,21 @@ if (isset($_SESSION["GOTMLS_debug"])){ $_SESSION["GOTMLS_debug"]["threat_name"
189
  }
190
  }
191
  }
192
- if (isset($_SESSION["GOTMLS_debug"])){ $file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["threat_name"], 6);
193
- if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["total"]))
194
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["total"] += $file_time;
195
- else
196
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["total"] = $file_time;
197
- if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["count"]))
198
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["count"] ++;
199
- else
200
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["count"] = 1;
201
- if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["least"]) || $file_time < $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["least"])
202
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["least"] = $file_time;
203
- if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["most"]) || $file_time > $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["most"])
204
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["most"] = $file_time;}
 
 
205
  }
206
  } elseif (strlen($check_threats) && isset($_GET['eli']) && substr($check_threats, 0, 1) == '/' && ($found = preg_match_all($check_threats, $GOTMLS_file_contents, $threats_found))) {
207
  foreach ($threats_found[0] as $find) {
@@ -209,24 +277,26 @@ if (isset($_SESSION["GOTMLS_debug"])){ $file_time = round(microtime(true) - $_
209
  $GOTMLS_new_contents = str_replace($find, "", $GOTMLS_new_contents);
210
  }
211
  }
212
- if (isset($_SESSION["GOTMLS_debug"])){ $file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["threat_level"], 6);
213
- if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["total"]))
214
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["total"] += $file_time;
215
- else
216
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["total"] = $file_time;
217
- if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["count"]))
218
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["count"] ++;
219
- else
220
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["count"] = 1;
221
- if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["least"]) || $file_time < $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["least"])
222
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["least"] = $file_time;
223
- if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["most"]) || $file_time > $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["most"])
224
- $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["most"] = $file_time;}
 
 
225
  return count($GOTMLS_threats_found);
226
  }
227
 
228
  function GOTMLS_scanfile($file) {
229
- global $GOTMLS_core_files, $wp_version, $GOTMLS_threat_levels, $GOTMLS_threat_files, $GOTMLS_definitions_array, $GOTMLS_threats_found, $GOTMLS_chmod_file, $GOTMLS_chmod_dir, $GOTMLS_settings_array, $GOTMLS_file_contents, $GOTMLS_new_contents;
230
  $GOTMLS_threats_found = array();
231
  $found = false;
232
  $threat_link = "";
@@ -258,27 +328,33 @@ function GOTMLS_scanfile($file) {
258
  if (isset($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"]) && strlen($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"]) && isset($_GET['eli']) && substr($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"], 0, 1) == '/' && ($found = GOTMLS_check_threat($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"])))
259
  $className = "known";
260
  else {
261
- if (isset($_SESSION["GOTMLS_debug"])){ $_SESSION["GOTMLS_debug"]["file"] = $file;
262
- $_SESSION["GOTMLS_debug"]["last"]["total"] = microtime(true);}
 
 
263
  foreach ($GOTMLS_threat_levels as $threat_level) {
264
- if (isset($_SESSION["GOTMLS_debug"])){ $_SESSION["GOTMLS_debug"]["threat_level"] = $threat_level;
265
- $_SESSION["GOTMLS_debug"]["last"]["threat_level"] = microtime(true);}
 
 
266
  if (in_array($threat_level, $GLOBALS["GOTMLS"]["log"]["settings"]["check"]) && !$found && isset($GOTMLS_definitions_array[$threat_level]) && (!array_key_exists($threat_level,$GOTMLS_core_files) || (substr($file."e", (-1 * strlen($GOTMLS_core_files[$threat_level]."e"))) == $GOTMLS_core_files[$threat_level]."e")) && (!array_key_exists($threat_level,$GOTMLS_threat_files) || ((GOTMLS_get_ext($file) == "gotmls" && isset($_GET["eli"]) && $_GET["eli"] == "quarantine")?(substr(GOTMLS_decode(array_pop(explode(".", '.'.substr($file, strlen(dirname($file))+1, -7))))."e", (-1 * strlen($GOTMLS_threat_files[$threat_level]."e"))) == $GOTMLS_threat_files[$threat_level]."e"):(substr($file."e", (-1 * strlen($GOTMLS_threat_files[$threat_level]."e"))) == $GOTMLS_threat_files[$threat_level]."e"))) && ($found = GOTMLS_check_threat($GOTMLS_definitions_array[$threat_level],$file)))
267
  $className = $threat_level;
268
  }
269
- if (isset($_SESSION["GOTMLS_debug"])){ $file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["total"], 5);
270
- if (isset($_SESSION["GOTMLS_debug"]["total"]["total"]))
271
- $_SESSION["GOTMLS_debug"]["total"]["total"] += $file_time;
272
- else
273
- $_SESSION["GOTMLS_debug"]["total"]["total"] = $file_time;
274
- if (isset($_SESSION["GOTMLS_debug"]["total"]["count"]))
275
- $_SESSION["GOTMLS_debug"]["total"]["count"] ++;
276
- else
277
- $_SESSION["GOTMLS_debug"]["total"]["count"] = 1;
278
- if (!isset($_SESSION["GOTMLS_debug"]["total"]["least"]) || $file_time < $_SESSION["GOTMLS_debug"]["total"]["least"])
279
- $_SESSION["GOTMLS_debug"]["total"]["least"] = $file_time;
280
- if (!isset($_SESSION["GOTMLS_debug"]["total"]["most"]) || $file_time > $_SESSION["GOTMLS_debug"]["total"]["most"])
281
- $_SESSION["GOTMLS_debug"]["total"]["most"] = $file_time;}
 
 
282
  }
283
  } else {
284
  $GOTMLS_file_contents = (filesize($file)?__("Failed to read file contents!",'gotmls').' '.(is_readable($file)?'(file_is_readable)':(file_exists($file)?(isset($_GET["eli"])?(@chmod($file, $GOTMLS_chmod_file)?'chmod':'read-only'):'(file_not_readable)'):'(does_not_exist)')):__("Empty file!",'gotmls'));
@@ -389,27 +465,6 @@ function GOTMLS_getfiles($dir) {
389
  return $files;
390
  }
391
 
392
- function GOTMLS_encode($unencoded_string) {
393
- if (function_exists("base64_encode"))
394
- $encoded_string = base64_encode($unencoded_string);
395
- elseif (function_exists("mb_convert_encoding"))
396
- $encoded_string = mb_convert_encoding($unencoded_string, "BASE64", "UTF-8");
397
- else
398
- $encoded_string = "Cannot encode: $unencoded_string function_exists: ";
399
- $encoded_array = explode("=", $encoded_string.'=');
400
- return strtr($encoded_array[0], "+/", "-_").(count($encoded_array)-1);
401
- }
402
-
403
- function GOTMLS_decode($encoded_string) {
404
- $encoded_string = strtr(substr($encoded_string, 0, -1), "-_", "+/").str_repeat("=", intval('0'.substr($encoded_string, -1)));
405
- if (function_exists("base64_decode"))
406
- return base64_decode($encoded_string);
407
- elseif (function_exists("mb_convert_encoding"))
408
- return mb_convert_encoding($encoded_string, "UTF-8", "BASE64");
409
- else
410
- return "Cannot decode: $encoded_string";
411
- }
412
-
413
  function GOTMLS_decodeBase64($encoded_string) {
414
  if (function_exists("base64_decode"))
415
  $unencoded_string = base64_decode($encoded_string);
@@ -459,13 +514,17 @@ function GOTMLS_explode_dir($dir, $pre = '') {
459
  return explode(GOTMLS_slash($dir), $dir);
460
  }
461
 
462
- function GOTMLS_quarantine($file) {
463
- if (!isset($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"])) {
464
  $upload = wp_upload_dir();
465
  $err403 = '<html><head><title>403 Forbidden</title></head><body><h1>Forbidden</h1><p>You don\'t have permission to access this directory.</p></body></html>';
466
- $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"] = GOTMLS_trailingslashit($upload['basedir']).'quarantine';
 
 
 
 
467
  if (!is_dir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) && !@mkdir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]))
468
- $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"] = $upload['basedir'];
469
  if (is_file(GOTMLS_trailingslashit($upload['basedir']).'.htaccess') && file_get_contents(GOTMLS_trailingslashit($upload['basedir']).'.htaccess') == 'Options -Indexes')
470
  if (!@unlink(GOTMLS_trailingslashit($upload['basedir']).'.htaccess'))
471
  @GOTMLS_file_put_contents(GOTMLS_trailingslashit($upload['basedir']).'.htaccess', '');
@@ -473,10 +532,10 @@ function GOTMLS_quarantine($file) {
473
  @GOTMLS_file_put_contents(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'.htaccess', 'Options -Indexes');
474
  if (!is_file(GOTMLS_trailingslashit($upload['basedir']).'index.php'))
475
  @GOTMLS_file_put_contents(GOTMLS_trailingslashit($upload['basedir']).'index.php', $err403);
476
- if (!is_file(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'index.php'))
477
- @GOTMLS_file_put_contents(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'index.php', $err403);
478
  }
479
- return GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).GOTMLS_sexagesimal().'.'.GOTMLS_encode($file).'.GOTMLS';
480
  }
481
 
482
  function GOTMLS_update_status($status, $percent = -1) {
@@ -489,7 +548,7 @@ function GOTMLS_update_status($status, $percent = -1) {
489
 
490
  function GOTMLS_flush($tag = "") {
491
  $output = "";
492
- if (!(isset($_GET["eli"]) && $_GET["eli"]=="debug") && ($output = @ob_get_contents())) {
493
  @ob_clean();
494
  $output = preg_replace('/\/\*\<\!--\*\/(.*?)\/\*--\>\*\//s', "", "$output/*-->*"."/");
495
  }
@@ -566,14 +625,16 @@ function GOTMLS_readdir($dir, $current_depth = 1) {
566
 
567
  function GOTMLS_sexagesimal($timestamp = 0) {
568
  if (!is_numeric($timestamp) && strlen($timestamp) == 5) {
 
569
  foreach (str_split($timestamp) as $bit)
570
- $timestamp .= "-".substr("00".(ord($bit)>96?ord($bit)-61:(ord($bit)>64?ord($bit)-55:ord($bit)-48)), -2);
571
- return substr($timestamp, -14);
572
  } else {
573
- if (preg_match('/^[0-5][0-9]-[0-1][0-9]-[0-3][0-9]-[0-2][0-9]-[0-5][0-9]$/', $timestamp))
574
- $date = $timestamp;
575
- elseif (is_numeric($timestamp) && strlen(trim($timestamp.' ')) == 10)
576
- $date = preg_replace('/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})$/', "\\1-\\2-\\3-\\4-\\5", $timestamp);
 
577
  else
578
  $date = date("y-m-d-H-i", time());
579
  foreach (explode("-", $date) as $bit)
@@ -593,10 +654,10 @@ function GOTMLS_strip4java($item) {
593
 
594
  function GOTMLS_error_link($errorTXT, $file = "", $class = "errors") {
595
  if ($file)
596
- $clean_file = 'loadIframe(\''.str_replace("\"", "&quot;", '<div style="float: left;">Examine&nbsp;File&nbsp;...&nbsp;</div><div style="overflow: hidden; position: relative; height: 20px;"><div style="position: absolute; right: 0px; text-align: right; width: 9000px;">'.GOTMLS_strip4java($file)).'</div></div>\');" href="'.GOTMLS_script_URI.'&GOTMLS_scan='.GOTMLS_encode($file);
597
  else
598
- $clean_file = 'return false;';
599
- return "<a title=\"$errorTXT\" target=\"GOTMLS_iFrame\" onclick=\"$clean_file\" class=\"GOTMLS_plugin $class\">";
600
  }
601
 
602
  function GOTMLS_check_file($file) {
@@ -679,29 +740,13 @@ function GOTMLS_scandir($dir) {
679
  }
680
 
681
  function GOTMLS_reset_settings($item, $key) {
682
- global $GOTMLS_settings_array;
683
  $key_parts = explode("_", $key."_");
684
  if (strlen($key_parts[0]) != 4 && $key_parts[0] != "exclude")
685
- unset($GOTMLS_settings_array[$key]);
686
  }
687
 
688
  $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"] = dirname(GOTMLS_quarantine(__FILE__));
689
  $GLOBALS["GOTMLS"]["tmp"]["default_ext"] .= "com";
690
- $GOTMLS_encode .= substr($GLOBALS["GOTMLS"]["tmp"]["default_ext"], 0, 2);
691
- if(!isset($_SERVER["SERVER_NAME"]) || !$_SERVER["SERVER_NAME"]) {
692
- if(!isset($_ENV["SERVER_NAME"]))
693
- getenv("SERVER_NAME");
694
- $_SERVER["SERVER_NAME"] = $_ENV["SERVER_NAME"];
695
- }
696
- if(!isset($_SERVER["SERVER_PORT"]) || !$_SERVER["SERVER_PORT"]) {
697
- if(!isset($_ENV["SERVER_PORT"]))
698
- getenv("SERVER_PORT");
699
- $_SERVER["SERVER_PORT"] = $_ENV["SERVER_PORT"];
700
- }
701
- if ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on" || $_SERVER["HTTPS"] == 1)) || 'ssl'.$_SERVER["SERVER_PORT"] == 'ssl443')
702
- $GLOBALS["GOTMLS"]["tmp"]["protocol"] .= "https:";
703
- else
704
- $GLOBALS["GOTMLS"]["tmp"]["protocol"] = "http:";
705
  $GOTMLS_plugin_home = $GLOBALS["GOTMLS"]["tmp"]["protocol"].'//wordpress.'.$GLOBALS["GOTMLS"]["tmp"]["default_ext"];
706
  $GOTMLS_update_home = $GLOBALS["GOTMLS"]["tmp"]["protocol"]."//gotmls.net/";
707
  $definition_version = "A0000";
@@ -746,16 +791,6 @@ function GOTMLS_scan_log() {
746
  }
747
 
748
  function GOTMLS_get_URL($URL) {
749
- if (isset($_SERVER['HTTP_REFERER']))
750
- $SERVER_HTTP_REFERER = $_SERVER['HTTP_REFERER'];
751
- elseif (isset($_SERVER['HTTP_HOST']))
752
- $SERVER_HTTP_REFERER = 'HOST://'.$_SERVER['HTTP_HOST'];
753
- elseif (isset($_SERVER['SERVER_NAME']))
754
- $SERVER_HTTP_REFERER = 'NAME://'.$_SERVER['SERVER_NAME'];
755
- elseif (isset($_SERVER['SERVER_ADDR']))
756
- $SERVER_HTTP_REFERER = 'ADDR://'.$_SERVER['SERVER_ADDR'];
757
- else
758
- $SERVER_HTTP_REFERER = 'NULL://not.anything.com';
759
  $ReadFile = '';
760
  if (function_exists('curl_init')) {
761
  $curl_hndl = curl_init();
4
  * @package GOTMLS
5
  */
6
 
7
+ if (!function_exists("GOTMLS_define")) {
8
+ function GOTMLS_define($DEF, $val) {
9
+ if (!defined($DEF))
10
+ define($DEF, $val);
11
+ }}
12
+
13
+ GOTMLS_define("GOTMLS_Version", "4.14.53");
14
+ GOTMLS_define("GOTMLS_require_version", "3.3");
15
+ GOTMLS_define("GOTMLS_plugin_dir", "gotmls");
16
+ GOTMLS_define("GOTMLS_local_images_path", dirname(__FILE__)."/");
17
+ GOTMLS_define("GOTMLS_plugin_path", dirname(GOTMLS_local_images_path).'/');
18
+
19
+ if (!function_exists("GOTMLS_encode")) {
20
+ function GOTMLS_encode($unencoded_string) {
21
+ if (function_exists("base64_encode"))
22
+ $encoded_string = base64_encode($unencoded_string);
23
+ elseif (function_exists("mb_convert_encoding"))
24
+ $encoded_string = mb_convert_encoding($unencoded_string, "BASE64", "UTF-8");
25
+ else
26
+ $encoded_string = "Cannot encode: $unencoded_string function_exists: ";
27
+ $encoded_array = explode("=", $encoded_string.'=');
28
+ return strtr($encoded_array[0], "+/", "-_").(count($encoded_array)-1);
29
+ }}
30
+
31
+ if (!function_exists("GOTMLS_decode")) {
32
+ function GOTMLS_decode($encoded_string) {
33
+ $tail = 0;
34
+ if (strlen($encoded_string) > 1 && is_numeric(substr($encoded_string, -1)) && substr($encoded_string, -1) > 0)
35
+ $tail = substr($encoded_string, -1) - 1;
36
+ else
37
+ $encoded_string .= "$tail";
38
+ $encoded_string = strtr(substr($encoded_string, 0, -1), "-_", "+/").str_repeat("=", $tail);
39
+ if (function_exists("base64_decode"))
40
+ return base64_decode($encoded_string);
41
+ elseif (function_exists("mb_convert_encoding"))
42
+ return mb_convert_encoding($encoded_string, "UTF-8", "BASE64");
43
+ else
44
+ return "Cannot decode: $encoded_string";
45
+ }}
46
 
47
+ if ((isset($_SERVER["SCRIPT_FILENAME"]) && strlen($_SERVER["SCRIPT_FILENAME"]) > strlen(basename(__FILE__)) && substr(__FILE__, -1 * strlen($_SERVER["SCRIPT_FILENAME"])) == substr($_SERVER["SCRIPT_FILENAME"], -1 * strlen(__FILE__))) || !defined("GOTMLS_plugin_path")) {
48
  header("Content-type: image/gif");
49
  $img_src = GOTMLS_local_images_path.'GOTMLS-16x16.gif';
50
  if (!(file_exists($img_src) && $img_bin = @file_get_contents($img_src)))
51
+ $img_bin = GOTMLS_decode('R0lGODlhEAAQAIABAAAAAP///yH5BAEAAAEALAAAAAAQABAAAAIshB0Qm+eo2HuJNWdrjlFm3S2hKB7kViKaxZmr98YgSo/jzH6tiU0974MADwUAOw==');
52
  die($img_bin);
53
  } elseif (isset($_GET["no_error_reporting"]))
54
  @error_reporting(0);
55
 
56
+ if (!function_exists("__")) {
57
+ function __($text, $domain) {
58
+ return $text;
59
+ }}
60
+
61
+ GOTMLS_define("GOTMLS_Skip_Quarantine_LANGUAGE", __("Skip scanning the Quarantine:",'gotmls'));
62
+ GOTMLS_define("GOTMLS_Failed_to_list_LANGUAGE", __("Failed to list files in directory!",'gotmls'));
63
+ GOTMLS_define("GOTMLS_Run_Quick_Scan_LANGUAGE", __("Run Quick Scan",'gotmls'));
64
+ GOTMLS_define("GOTMLS_View_Quarantine_LANGUAGE", __("View Quarantine",'gotmls'));
65
+ GOTMLS_define("GOTMLS_require_version_LANGUAGE", sprintf(__("This Plugin requires WordPress version %s or higher",'gotmls'), GOTMLS_require_version));
66
+ GOTMLS_define("GOTMLS_Scan_Settings_LANGUAGE", __("Scan Settings",'gotmls'));
67
+ GOTMLS_define("GOTMLS_Loading_LANGUAGE", __("Loading, Please Wait ...",'gotmls'));
68
+ GOTMLS_define("GOTMLS_Automatically_Fix_LANGUAGE", __("Automatically Fix SELECTED Files Now",'gotmls'));
69
+ GOTMLS_define("GOTMLS_update_images_path", "/wp-content/plugins/update/images/");
 
 
 
 
 
 
 
 
 
 
70
 
71
  $GLOBALS["GOTMLS"] = array("tmp"=>array("mt"=>((isset($_GET["mt"])&&is_numeric($_GET["mt"]))?$_GET["mt"]:microtime(true)), "default_ext"=>"ieonly.", "skip_ext"=>array("png", "jpg", "jpeg", "gif", "bmp", "tif", "tiff", "psd", "fla", "flv", "mov", "mp3", "exe", "zip", "pdf", "css", "pot", "po", "mo", "so", "doc", "docx", "svg", "ttf")));
72
+ $GOTMLS_encode .= substr($GLOBALS["GOTMLS"]["tmp"]["default_ext"], 0, 2);
73
+ if (isset($_SERVER['HTTP_HOST']))
74
+ $SERVER_HTTP = 'HOST://'.$_SERVER['HTTP_HOST'];
75
+ elseif (isset($_SERVER['SERVER_NAME']))
76
+ $SERVER_HTTP = 'NAME://'.$_SERVER['SERVER_NAME'];
77
+ elseif (isset($_SERVER['SERVER_ADDR']))
78
+ $SERVER_HTTP = 'ADDR://'.$_SERVER['SERVER_ADDR'];
79
+ else
80
+ $SERVER_HTTP = 'NULL://not.anything.com';
81
+ if (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"])
82
+ $SERVER_HTTP .= ":".$_SERVER["SERVER_PORT"];
83
+ $SERVER_parts = explode(":", $SERVER_HTTP);
84
+ if ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on" || $_SERVER["HTTPS"] == 1)) || (count($SERVER_parts) > 2 && $SERVER_parts[2] == '443'))
85
+ $GLOBALS["GOTMLS"]["tmp"]["protocol"] .= "https:";
86
+ else
87
+ $GLOBALS["GOTMLS"]["tmp"]["protocol"] = "http:";
88
+ if (function_exists("get_option")) {
89
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"] = get_option('GOTMLS_settings_array', array());
90
+ GOTMLS_define("GOTMLS_siteurl", get_option("siteurl"));
91
+ $GLOBALS["GOTMLS"]["log"] = get_option('GOTMLS_scan_log/'.(isset($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:"0.0.0.0").'/'.$GLOBALS["GOTMLS"]["tmp"]["mt"], array());
92
+ } else {
93
+ GOTMLS_define("GOTMLS_siteurl", $GLOBALS["GOTMLS"]["tmp"]["protocol"].$SERVER_parts[1].((count($SERVER_parts) > 2 && ($SERVER_parts[2] == '80' || $SERVER_parts[2] == '443'))?"":":".$SERVER_parts[2])."/");
94
+ $GLOBALS["GOTMLS"]["log"] = array();
95
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"] = array();
96
+ }
97
+ GOTMLS_define("GOTMLS_installation_key", md5(GOTMLS_siteurl));
98
+ GOTMLS_define("GOTMLS_script_URI", preg_replace('/\&(last_)?mt=[0-9\.]+/','', str_replace('&amp;', '&', htmlspecialchars($_SERVER["REQUEST_URI"], ENT_QUOTES))).'&mt='.$GLOBALS["GOTMLS"]["tmp"]["mt"]);
99
+ if (function_exists("plugins_url"))
100
+ GOTMLS_define("GOTMLS_images_path", plugins_url('/', __FILE__));
101
+ elseif (isset($_SERVER["DOCUMENT_ROOT"]) && ($_SERVER["DOCUMENT_ROOT"]) && strlen($_SERVER["DOCUMENT_ROOT"]) < __FILE__ && substr(__FILE__, 0, strlen($_SERVER["DOCUMENT_ROOT"])) == $_SERVER["DOCUMENT_ROOT"])
102
+ GOTMLS_define("GOTMLS_images_path", substr(dirname(__FILE__), strlen($_SERVER["DOCUMENT_ROOT"])));
103
+ elseif (isset($_SERVER["SCRIPT_FILENAME"]) && isset($_SERVER["DOCUMENT_ROOT"]) && ($_SERVER["DOCUMENT_ROOT"]) && strlen($_SERVER["DOCUMENT_ROOT"]) < strlen($_SERVER["SCRIPT_FILENAME"]) && substr($_SERVER["SCRIPT_FILENAME"], 0, strlen($_SERVER["DOCUMENT_ROOT"])) == $_SERVER["DOCUMENT_ROOT"])
104
+ GOTMLS_define("GOTMLS_images_path", substr(dirname($_SERVER["SCRIPT_FILENAME"]), strlen($_SERVER["DOCUMENT_ROOT"])));
105
+ else
106
+ GOTMLS_define("GOTMLS_images_path", str_replace("/update/", GOTMLS_plugin_dir, GOTMLS_update_images_path));
107
+
108
  $GOTMLS_loop_execution_time = 60;
109
  $GOTMLS_chmod_file = (0644);
110
  $GOTMLS_chmod_dir = (0755);
121
  $GOTMLS_dirs_at_depth = array();
122
  $GOTMLS_scanfiles = array();
123
  $GOTMLS_skip_dirs = array(".", "..");
124
+
125
  if (isset($_GET['img']) && substr(strtolower($_SERVER["SCRIPT_FILENAME"]), -15) == "/admin-ajax.php" && !in_array(GOTMLS_get_ext($_GET['img']), $GLOBALS["GOTMLS"]["tmp"]["skip_ext"]))
126
  include(dirname(__FILE__)."/../safe-load/index.php");
127
+ if (!(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"]) && count($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"]) == 4))
128
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"] = array('80px', '40px', '400px', '600px');
129
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["menu_group"]))
130
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["menu_group"] = 0;
131
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"]))
132
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"] = 2;
133
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"]))
134
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"] = -1;
135
+ if (!(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"])))
136
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"] = $GLOBALS["GOTMLS"]["tmp"]["skip_ext"];
137
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]))
138
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"] = "";
139
+ if (!(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]['exclude_dir']) && is_array($GLOBALS["GOTMLS"]["tmp"]["settings_array"]['exclude_dir'])))
140
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"] = array();
141
  $GOTMLS_total_percent = 0;
142
  $GOTMLS_HeadersError = "";
143
  function GOTMLS_admin_notices() {
188
  if (!is_numeric($linenum))
189
  $linenum = __("unknown",'gotmls');
190
  $GOTMLS_HeadersError = '<div class="error">'.sprintf(__('<b>Headers already sent</b> in %1$s on line %2$s.<br />This is not a good sign, it may just be a poorly written plugin but Headers should not have been sent at this point.<br />Check the code in the above mentioned file to fix this problem.','gotmls'), $filename, $linenum).'</div>';
191
+ }
192
+ elseif (!session_id() && isset($_GET["SESSION"])) @session_start();
193
+ if (session_id() && isset($_GET["SESSION"]) && !isset($_SESSION["GOTMLS_debug"])) $_SESSION["GOTMLS_debug"]=array();
194
  }
195
 
196
  if (!function_exists("add_action")) {
241
  $GOTMLS_threats_found = array();
242
  if (is_array($check_threats)) {
243
  foreach ($check_threats as $threat_name=>$threat_definitions) {
244
+ if (isset($_SESSION["GOTMLS_debug"])) {
245
+ $_SESSION["GOTMLS_debug"]["threat_name"] = $threat_name;
246
+ $_SESSION["GOTMLS_debug"]["last"]["threat_name"] = microtime(true);
247
+ }
248
  if (is_array($threat_definitions) && count($threat_definitions) > 1 && strlen(array_shift($threat_definitions)) == 5) {
249
  while ($threat_definition = array_shift($threat_definitions)) {
250
  if ($found = @preg_match_all($threat_definition, $GOTMLS_file_contents, $threats_found)) {
255
  }
256
  }
257
  }
258
+ if (isset($_SESSION["GOTMLS_debug"])) {
259
+ $file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["threat_name"], 5);
260
+ if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["total"]))
261
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["total"] += $file_time;
262
+ else
263
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["total"] = $file_time;
264
+ if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["count"]))
265
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["count"] ++;
266
+ else
267
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["count"] = 1;
268
+ if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["least"]) || $file_time < $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["least"])
269
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["least"] = $file_time;
270
+ if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["most"]) || $file_time > $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["most"])
271
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_name"]]["most"] = $file_time;
272
+ }
273
  }
274
  } elseif (strlen($check_threats) && isset($_GET['eli']) && substr($check_threats, 0, 1) == '/' && ($found = preg_match_all($check_threats, $GOTMLS_file_contents, $threats_found))) {
275
  foreach ($threats_found[0] as $find) {
277
  $GOTMLS_new_contents = str_replace($find, "", $GOTMLS_new_contents);
278
  }
279
  }
280
+ if (isset($_SESSION["GOTMLS_debug"])) {
281
+ $file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["threat_level"], 5);
282
+ if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["total"]))
283
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["total"] += $file_time;
284
+ else
285
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["total"] = $file_time;
286
+ if (isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["count"]))
287
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["count"] ++;
288
+ else
289
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["count"] = 1;
290
+ if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["least"]) || $file_time < $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["least"])
291
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["least"] = $file_time;
292
+ if (!isset($_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["most"]) || $file_time > $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["most"])
293
+ $_SESSION["GOTMLS_debug"][$_SESSION["GOTMLS_debug"]["threat_level"]]["most"] = $file_time;
294
+ }
295
  return count($GOTMLS_threats_found);
296
  }
297
 
298
  function GOTMLS_scanfile($file) {
299
+ global $GOTMLS_core_files, $wp_version, $GOTMLS_threat_levels, $GOTMLS_threat_files, $GOTMLS_definitions_array, $GOTMLS_threats_found, $GOTMLS_chmod_file, $GOTMLS_chmod_dir, $GOTMLS_file_contents, $GOTMLS_new_contents;
300
  $GOTMLS_threats_found = array();
301
  $found = false;
302
  $threat_link = "";
328
  if (isset($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"]) && strlen($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"]) && isset($_GET['eli']) && substr($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"], 0, 1) == '/' && ($found = GOTMLS_check_threat($GLOBALS["GOTMLS"]["log"]["settings"]["check_custom"])))
329
  $className = "known";
330
  else {
331
+ if (isset($_SESSION["GOTMLS_debug"])) {
332
+ $_SESSION["GOTMLS_debug"]["file"] = $file;
333
+ $_SESSION["GOTMLS_debug"]["last"]["total"] = microtime(true);
334
+ }
335
  foreach ($GOTMLS_threat_levels as $threat_level) {
336
+ if (isset($_SESSION["GOTMLS_debug"])) {
337
+ $_SESSION["GOTMLS_debug"]["threat_level"] = $threat_level;
338
+ $_SESSION["GOTMLS_debug"]["last"]["threat_level"] = microtime(true);
339
+ }
340
  if (in_array($threat_level, $GLOBALS["GOTMLS"]["log"]["settings"]["check"]) && !$found && isset($GOTMLS_definitions_array[$threat_level]) && (!array_key_exists($threat_level,$GOTMLS_core_files) || (substr($file."e", (-1 * strlen($GOTMLS_core_files[$threat_level]."e"))) == $GOTMLS_core_files[$threat_level]."e")) && (!array_key_exists($threat_level,$GOTMLS_threat_files) || ((GOTMLS_get_ext($file) == "gotmls" && isset($_GET["eli"]) && $_GET["eli"] == "quarantine")?(substr(GOTMLS_decode(array_pop(explode(".", '.'.substr($file, strlen(dirname($file))+1, -7))))."e", (-1 * strlen($GOTMLS_threat_files[$threat_level]."e"))) == $GOTMLS_threat_files[$threat_level]."e"):(substr($file."e", (-1 * strlen($GOTMLS_threat_files[$threat_level]."e"))) == $GOTMLS_threat_files[$threat_level]."e"))) && ($found = GOTMLS_check_threat($GOTMLS_definitions_array[$threat_level],$file)))
341
  $className = $threat_level;
342
  }
343
+ if (isset($_SESSION["GOTMLS_debug"])) {
344
+ $file_time = round(microtime(true) - $_SESSION["GOTMLS_debug"]["last"]["total"], 5);
345
+ if (isset($_SESSION["GOTMLS_debug"]["total"]["total"]))
346
+ $_SESSION["GOTMLS_debug"]["total"]["total"] += $file_time;
347
+ else
348
+ $_SESSION["GOTMLS_debug"]["total"]["total"] = $file_time;
349
+ if (isset($_SESSION["GOTMLS_debug"]["total"]["count"]))
350
+ $_SESSION["GOTMLS_debug"]["total"]["count"] ++;
351
+ else
352
+ $_SESSION["GOTMLS_debug"]["total"]["count"] = 1;
353
+ if (!isset($_SESSION["GOTMLS_debug"]["total"]["least"]) || $file_time < $_SESSION["GOTMLS_debug"]["total"]["least"])
354
+ $_SESSION["GOTMLS_debug"]["total"]["least"] = $file_time;
355
+ if (!isset($_SESSION["GOTMLS_debug"]["total"]["most"]) || $file_time > $_SESSION["GOTMLS_debug"]["total"]["most"])
356
+ $_SESSION["GOTMLS_debug"]["total"]["most"] = $file_time;
357
+ }
358
  }
359
  } else {
360
  $GOTMLS_file_contents = (filesize($file)?__("Failed to read file contents!",'gotmls').' '.(is_readable($file)?'(file_is_readable)':(file_exists($file)?(isset($_GET["eli"])?(@chmod($file, $GOTMLS_chmod_file)?'chmod':'read-only'):'(file_not_readable)'):'(does_not_exist)')):__("Empty file!",'gotmls'));
465
  return $files;
466
  }
467
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  function GOTMLS_decodeBase64($encoded_string) {
469
  if (function_exists("base64_decode"))
470
  $unencoded_string = base64_decode($encoded_string);
514
  return explode(GOTMLS_slash($dir), $dir);
515
  }
516
 
517
+ function GOTMLS_quarantine($file = __FILE__) {
518
+ if (!(isset($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) && is_dir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]))) {
519
  $upload = wp_upload_dir();
520
  $err403 = '<html><head><title>403 Forbidden</title></head><body><h1>Forbidden</h1><p>You don\'t have permission to access this directory.</p></body></html>';
521
+ $recoveryPHP = '<'.'?php
522
+ if ((isset($_SERVER["SCRIPT_FILENAME"]) && strlen($_SERVER["SCRIPT_FILENAME"]) > strlen(basename(__FILE__)) && substr(__FILE__, -1 * strlen($_SERVER["SCRIPT_FILENAME"])) == substr($_SERVER["SCRIPT_FILENAME"], -1 * strlen(__FILE__))) || !defined("GOTMLS_plugin_path"))
523
+ die("'.$err403.'");
524
+ ?'.'>';
525
+ $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"] = str_replace("/", GOTMLS_slash(), GOTMLS_trailingslashit($upload['basedir'])).'quarantine';
526
  if (!is_dir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]) && !@mkdir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]))
527
+ $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"] = str_replace("/", GOTMLS_slash(), $upload['basedir']);
528
  if (is_file(GOTMLS_trailingslashit($upload['basedir']).'.htaccess') && file_get_contents(GOTMLS_trailingslashit($upload['basedir']).'.htaccess') == 'Options -Indexes')
529
  if (!@unlink(GOTMLS_trailingslashit($upload['basedir']).'.htaccess'))
530
  @GOTMLS_file_put_contents(GOTMLS_trailingslashit($upload['basedir']).'.htaccess', '');
532
  @GOTMLS_file_put_contents(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'.htaccess', 'Options -Indexes');
533
  if (!is_file(GOTMLS_trailingslashit($upload['basedir']).'index.php'))
534
  @GOTMLS_file_put_contents(GOTMLS_trailingslashit($upload['basedir']).'index.php', $err403);
535
+ if (!is_file(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'index.php') || (@file_get_contents(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'index.php') != $recoveryPHP))
536
+ @GOTMLS_file_put_contents(GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'index.php', $recoveryPHP);
537
  }
538
+ return GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).(is_file($file)?GOTMLS_sexagesimal(date("y-m-d-H-i", filectime($file))).'.'.GOTMLS_sexagesimal(date("y-m-d-H-i", filemtime($file))):GOTMLS_sexagesimal(date("y-m-d-H-i", time()))).'.'.GOTMLS_encode($file?$file:__FILE__).'.GOTMLS';
539
  }
540
 
541
  function GOTMLS_update_status($status, $percent = -1) {
548
 
549
  function GOTMLS_flush($tag = "") {
550
  $output = "";
551
+ if (!(isset($_GET["eli"]) && $_GET["eli"] == "debug") && ($output = @ob_get_contents())) {
552
  @ob_clean();
553
  $output = preg_replace('/\/\*\<\!--\*\/(.*?)\/\*--\>\*\//s', "", "$output/*-->*"."/");
554
  }
625
 
626
  function GOTMLS_sexagesimal($timestamp = 0) {
627
  if (!is_numeric($timestamp) && strlen($timestamp) == 5) {
628
+ $delim = array("=", "-", "-", " ", ":");
629
  foreach (str_split($timestamp) as $bit)
630
+ $timestamp .= array_shift($delim).substr("00".(ord($bit)>96?ord($bit)-61:(ord($bit)>64?ord($bit)-55:ord($bit)-48)), -2);
631
+ return "20".substr($timestamp, -14);
632
  } else {
633
+ $match = '/^(20)?([0-5][0-9])[\-: \/]*(0*[1-9]|1[0-2])[\-: \/]*(0*[1-9]|[12][0-9]|3[01])[\-: \/]*([0-5][0-9])[\-: \/]*([0-5][0-9])$/';
634
+ if (preg_match($match, $timestamp))
635
+ $date = preg_replace($match, "\\2-\\3-\\4-\\5-\\6", $timestamp);
636
+ elseif ($timestamp && strtotime($timestamp))
637
+ $date = date("y-m-d-H-i", strtotime($timestamp));
638
  else
639
  $date = date("y-m-d-H-i", time());
640
  foreach (explode("-", $date) as $bit)
654
 
655
  function GOTMLS_error_link($errorTXT, $file = "", $class = "errors") {
656
  if ($file)
657
+ $onclick = 'loadIframe(\''.str_replace("\"", "&quot;", '<div style="float: left; white-space: nowrap;">'.__("Examine File",'gotmls').' ... </div><div style="overflow: hidden; position: relative; height: 20px;"><div style="position: absolute; right: 0px; text-align: right; width: 9000px;">'.GOTMLS_strip4java($file)).'</div></div>\');" href="'.GOTMLS_script_URI.'&GOTMLS_scan='.GOTMLS_encode($file);
658
  else
659
+ $onclick = 'return false;';
660
+ return "<a title=\"$errorTXT\" target=\"GOTMLS_iFrame\" onclick=\"$onclick\" class=\"GOTMLS_plugin $class\">";
661
  }
662
 
663
  function GOTMLS_check_file($file) {
740
  }
741
 
742
  function GOTMLS_reset_settings($item, $key) {
 
743
  $key_parts = explode("_", $key."_");
744
  if (strlen($key_parts[0]) != 4 && $key_parts[0] != "exclude")
745
+ unset($GLOBALS["GOTMLS"]["tmp"]["settings_array"][$key]);
746
  }
747
 
748
  $GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"] = dirname(GOTMLS_quarantine(__FILE__));
749
  $GLOBALS["GOTMLS"]["tmp"]["default_ext"] .= "com";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
750
  $GOTMLS_plugin_home = $GLOBALS["GOTMLS"]["tmp"]["protocol"].'//wordpress.'.$GLOBALS["GOTMLS"]["tmp"]["default_ext"];
751
  $GOTMLS_update_home = $GLOBALS["GOTMLS"]["tmp"]["protocol"]."//gotmls.net/";
752
  $definition_version = "A0000";
791
  }
792
 
793
  function GOTMLS_get_URL($URL) {
 
 
 
 
 
 
 
 
 
 
794
  $ReadFile = '';
795
  if (function_exists('curl_init')) {
796
  $curl_hndl = curl_init();
index.php CHANGED
@@ -8,8 +8,12 @@ Author URI: http://wordpress.ieonly.com/category/my-plugins/anti-malware/
8
  Contributors: scheeeli, gotmls
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
10
  Description: This Anti-Virus/Anti-Malware plugin searches for Malware and other Virus like threats and vulnerabilities on your server and helps you remove them. It's always growing and changing to adapt to new threats so let me know if it's not working for you.
11
- Version: 4.14.52
12
  */
 
 
 
 
13
  /* ___
14
  * / /\ GOTMLS Main Plugin File
15
  * / /:/ @package GOTMLS
@@ -31,10 +35,6 @@ Version: 4.14.52
31
  * \ \::/ with this program; if not, write to the Free Software Foundation,
32
  * \__\/ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
33
 
34
- if (isset($_SERVER["SCRIPT_FILENAME"]) && substr(__FILE__, -1 * strlen($_SERVER["SCRIPT_FILENAME"])) == substr($_SERVER["SCRIPT_FILENAME"], -1 * strlen(__FILE__)))
35
- include(dirname(__FILE__)."/safe-load/index.php");
36
-
37
- define("GOTMLS_plugin_path", dirname(__FILE__).'/');
38
  load_plugin_textdomain('gotmls', false, basename(GOTMLS_plugin_path).'/languages');
39
  require_once(GOTMLS_plugin_path.'images/index.php');
40
 
@@ -46,45 +46,43 @@ function GOTMLS_install() {
46
  register_activation_hook(__FILE__, "GOTMLS_install");
47
 
48
  function GOTMLS_menu() {
49
- global $GOTMLS_settings_array;
50
- if ($GOTMLS_settings_array["menu_group"] > 2 && is_multisite()) {
51
  $_POST["GOTMLS_menu_group"] = 1;
52
- $GOTMLS_settings_array["user_can"] = "manage_network";
53
- } elseif (!isset($GOTMLS_settings_array["user_can"]))
54
- $GOTMLS_settings_array["user_can"] = "activate_plugins";
55
  if (isset($_POST["GOTMLS_menu_group"]) && is_numeric($_POST["GOTMLS_menu_group"])) {
56
- $GOTMLS_settings_array["menu_group"] = $_POST["GOTMLS_menu_group"];
57
  $capabilities = array();
58
- if (current_user_can($GOTMLS_settings_array["user_can"]))
59
  foreach (get_editable_roles() as $role)
60
  $capabilities = array_merge($capabilities, $role["capabilities"]);
61
  if (isset($_POST["GOTMLS_user_can"]) && in_array($_POST["GOTMLS_user_can"], $capabilities))
62
- $GOTMLS_settings_array["user_can"] = $_POST["GOTMLS_user_can"];
63
- update_option('GOTMLS_settings_array', $GOTMLS_settings_array);
64
  }
65
  $GOTMLS_Full_plugin_logo_URL = GOTMLS_images_path.'GOTMLS-16x16.gif';
66
  $base_page = "GOTMLS-settings";
67
  $base_function = "GOTMLS_settings";
68
  $pluginTitle = "Anti-Malware";
69
  $pageTitle = "$pluginTitle ".GOTMLS_Scan_Settings_LANGUAGE;
70
- if (!function_exists("add_object_page") || $GOTMLS_settings_array["menu_group"])
71
- $my_admin_page = add_menu_page($pageTitle, $pluginTitle, $GOTMLS_settings_array["user_can"], $base_page, $base_function, $GOTMLS_Full_plugin_logo_URL);
72
  else
73
- $my_admin_page = add_object_page($pageTitle, $pluginTitle, $GOTMLS_settings_array["user_can"], $base_page, $base_function, $GOTMLS_Full_plugin_logo_URL);
74
  add_action('load-'.$my_admin_page, 'GOTMLS_admin_add_help_tab');
75
- add_submenu_page($base_page, "$pluginTitle ".GOTMLS_Scan_Settings_LANGUAGE, GOTMLS_Scan_Settings_LANGUAGE, $GOTMLS_settings_array["user_can"], $base_page, $base_function);
76
- add_submenu_page($base_page, "$pluginTitle ".GOTMLS_Run_Quick_Scan_LANGUAGE, GOTMLS_Run_Quick_Scan_LANGUAGE, $GOTMLS_settings_array["user_can"], "$base_page&scan_type=Quick+Scan", $base_function);
77
- add_submenu_page($base_page, "$pluginTitle ".GOTMLS_View_Quarantine_LANGUAGE, GOTMLS_View_Quarantine_LANGUAGE, $GOTMLS_settings_array["user_can"], "GOTMLS-View-Quarantine", "GOTMLS_View_Quarantine");
78
  }
79
 
80
  function GOTMLS_admin_add_help_tab() {
81
- global $GOTMLS_settings_array;
82
  $GOTMLS_menu_groups = array(__("Main Menu Item placed below <b>Comments</b> and above <b>Appearance</b>",'gotmls'),__("Main Menu Item placed below <b>Settings</b>",'gotmls'));
83
  if (is_multisite() && current_user_can("manage_network"))
84
  $GOTMLS_menu_groups[] = __("ONLY SHOW for <b>Network Admins</b>",'gotmls');
85
  $menu_opts = '<h5>'.__("Menu Item Placement Options",'gotmls').'</h5>';
86
  foreach ($GOTMLS_menu_groups as $mg => $GOTMLS_menu_group)
87
- $menu_opts .= '<div style="padding: 4px;" id="menu_group_div_'.$mg.'"><input type="radio" name="GOTMLS_menu_group" value="'.$mg.'"'.($GOTMLS_settings_array["menu_group"]==$mg?' checked':'').' onchange="document.GOTMLS_menu_Form.submit();" />'.$GOTMLS_menu_group.'</div>';
88
  $screen = get_current_screen();
89
  $screen->add_help_tab(array(
90
  'id' => "GOTMLS_Getting_Started",
@@ -107,11 +105,11 @@ function GOTMLS_admin_add_help_tab() {
107
  }
108
 
109
  function GOTMLS_display_header($optional_box = "") {
110
- global $GOTMLS_onLoad, $GOTMLS_loop_execution_time, $GOTMLS_update_home, $GOTMLS_plugin_home, $GOTMLS_definitions_versions, $wp_version, $current_user, $GOTMLS_settings_array;
111
  get_currentuserinfo();
112
  $GOTMLS_url_parts = explode('/', GOTMLS_siteurl);
113
  if (isset($_GET["check_site"]) && $_GET["check_site"] == 1)
114
- echo '<div class="updated" id="check_site" style="z-index: 1234567;"><img src="'.GOTMLS_images_path.'checked.gif" height=16 width=16 alt="&#x2714;"> '.GOTMLS_Tested_your_site_LANGUAGE.' ;-)</div><script type="text/javascript">window.parent.document.getElementById("check_site_warning").style.backgroundColor=\'#0C0\';</script><li>Please <a target="_blank" href="https://wordpress.org/plugins/gotmls/stats/?compatibility%5Bversion%5D='.$wp_version.'&compatibility%5Btopic_version%5D='.GOTMLS_Version.'&compatibility%5Bcompatible%5D=1#compatibility-works">Vote "Works"</a> or <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/gotmls#postform">write a "Five-Star" Reviews</a> on WordPress.org if you like this plugin.</li><style>#footer, #GOTMLS-metabox-container, #GOTMLS-right-sidebar, #admin-page-container, #wpadminbar, #adminmenuback, #adminmenuwrap, #adminmenu {display: none !important;} #wpbody-content {padding-bottom: 0;} #wpbody {padding-top: 0 !important;} #wpcontent, #footer {margin-left: 5px !important;} html.wp-toolbar {padding-top: 0 !important;}';
115
  else
116
  echo '<style>#GOTMLS-right-sidebar {float: right; margin-right: 0px;}';
117
  $ver_info = GOTMLS_Version.'&p='.strtoupper(GOTMLS_plugin_dir).'&wp='.$wp_version.'&ts='.date("YmdHis").'&key='.GOTMLS_installation_key.'&d='.ur1encode(GOTMLS_siteurl);
@@ -165,7 +163,7 @@ function GOTMLS_display_header($optional_box = "") {
165
  vertical-align: middle;
166
  }
167
  </style>
168
- <div id="div_file" class="shadowed-box rounded-corners sidebar-box" style="padding: 0; display: none; position: fixed; top: '.$GOTMLS_settings_array["msg_position"][1].'; left: '.$GOTMLS_settings_array["msg_position"][0].'; width: '.$GOTMLS_settings_array["msg_position"][3].'; height: '.$GOTMLS_settings_array["msg_position"][2].'; border: solid #c00; z-index: 112358;"><table style="width: 100%; height: 100%;" cellspacing="0" cellpadding="0"><tr><td style="border-bottom: 1px solid #EEEEEE;" colspan="2"><a class="rounded-corners" name="link_file" style="float: right; padding: 0 4px; margin: 6px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;" href="#found_top" onclick="showhide(\'div_file\');">X</a><h3 onmousedown="grabDiv();" onmouseup="releaseDiv();" id="windowTitle" style="cursor: move; border-bottom: 0px none; z-index: 2345677; position: absolute; left: 0px; top: 0px; margin: 0px; padding: 6px; width: 90%; height: 20px;">'.GOTMLS_Loading_LANGUAGE.'</h3></td></tr><tr><td colspan="2" style="height: 100%"><div style="width: 100%; height: 100%; position: relative; padding: 0; margin: 0;" class="inside"><br /><br /><center><img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="..."> '.GOTMLS_Loading_LANGUAGE.'<br /><br /><input type="button" onclick="showhide(\'GOTMLS_iFrame\', true);" value="'.GOTMLS_too_long_LANGUAGE.'" class="button-primary" /></center><iframe id="GOTMLS_iFrame" name="GOTMLS_iFrame" style="top: 0px; left: 0px; position: absolute; width: 100%; height: 100%; background-color: #CCC;"></iframe></td></tr><tr><td style="height: 20px;"><iframe id="GOTMLS_statusFrame" name="GOTMLS_statusFrame" style="width: 100%; height: 20px; background-color: #CCC;"></iframe></div></td><td style="height: 20px; width: 20px;"><h3 id="cornerGrab" onmousedown="grabCorner();" onmouseup="releaseCorner();" style="cursor: move; height: 24px; width: 24px; margin: 0; padding: 0; z-index: 2345678; position: absolute; right: 0px; bottom: 0px;">&#8690;</h3></td></tr></table></div>
169
  <script type="text/javascript">
170
  function showhide(id) {
171
  divx = document.getElementById(id);
@@ -214,28 +212,36 @@ function loadIframe(title) {
214
  showhide("GOTMLS_iFrame", true);
215
  showhide("GOTMLS_iFrame");
216
  document.getElementById("windowTitle").innerHTML = title;
217
- windowW = getWindowWidth(200);
218
- windowH = getWindowHeight(200);
219
- if (windowW > 200)
220
- windowW -= 20;
221
- if (windowH > 200)
222
- windowH -= 20;
223
- if (px2num("'.$GOTMLS_settings_array["msg_position"][3].'") > windowW) {
224
- curDiv.style.width = windowW + "px";
225
- curDiv.style.left = "0px";
226
- } else if ((px2num("'.$GOTMLS_settings_array["msg_position"][0].'") + px2num("'.$GOTMLS_settings_array["msg_position"][3].'")) > windowW) {
227
- curDiv.style.left = (windowW - px2num("'.$GOTMLS_settings_array["msg_position"][3].'")) + "px";
228
- }
229
- if (px2num("'.$GOTMLS_settings_array["msg_position"][2].'") > windowH) {
230
- curDiv.style.height = windowH + "px";
231
- curDiv.style.top = "0px";
232
- } else if ((px2num("'.$GOTMLS_settings_array["msg_position"][1].'") + px2num("'.$GOTMLS_settings_array["msg_position"][2].'")) > windowH) {
233
- curDiv.style.top = (windowH - px2num("'.$GOTMLS_settings_array["msg_position"][2].'")) + "px";
 
 
 
 
 
 
234
  }
235
  showhide("div_file", true);
 
 
236
  }
237
  function cancelserver(divid) {
238
- document.getElementById(divid).innerHTML = "<div class=\'updated\'>'.GOTMLS_Could_not_find_server_LANGUAGE.'</div>";
239
  }
240
  function checkupdateserver(server, divid) {
241
  var updatescript = document.createElement("script");
@@ -279,9 +285,14 @@ function px2num(px) {
279
  return parseInt(px.substring(0, px.length - 2), 10);
280
  }
281
  function setDiv(DivID) {
282
- curDiv=document.getElementById(DivID);
283
- if (IE && curDiv)
284
- DivID.style.position = "absolute";
 
 
 
 
 
285
  }
286
  function grabDiv() {
287
  corner = document.getElementById("windowTitle");
@@ -326,8 +337,8 @@ setDiv("div_file");
326
  <div id="main-page-title"><h1 style="vertical-align: middle;">Anti-Malware from&nbsp;GOTMLS.NET</h1></div>
327
  <div id="admin-page-container">
328
  <div id="GOTMLS-right-sidebar" style="width: 300px;" class="metabox-holder">
329
- '.GOTMLS_box(GOTMLS_Plugin_Updates_LANGUAGE.' '.$wp_version, '<div id="findUpdates"><center>'.GOTMLS_Searching_updates_LANGUAGE.'<br /><img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="Wait..." /><br /><input type="button" value="Cancel" onclick="cancelserver(\'findUpdates\');" /></center></div>'.$Update_Link, "stuffbox").'
330
- '.GOTMLS_box(GOTMLS_Definition_Updates_LANGUAGE.' ('.$definition_version.')', '
331
  <form id="updateform" method="post" name="updateform" action="'.GOTMLS_script_URI.'">
332
  <img style="display: none; float: right; margin-right: 14px;" src="'.GOTMLS_images_path.'checked.gif" height=16 width=16 alt="definitions file updated" id="autoUpdateDownload" onclick="downloadUpdates(\'UpdateDownload\');">
333
  <div id="Definition_Updates"><center>'.__("Searching for updates ...",'gotmls').'<br /><img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="Wait..." /><br /><input type="button" value="Cancel" onclick="cancelserver(\'Definition_Updates\');" /></center></div>
@@ -361,8 +372,8 @@ setDiv("div_file");
361
  }
362
  function check_for_donation(chk) {
363
  if (document.getElementById("autoUpdateDownload").src.replace(/^.+\?/,"")=="0") {
364
- alert(chk+"\\n\\n'.GOTMLS_Please_donate_LANGUAGE.'");
365
- if ('.str_replace("-", "", GOTMLS_sexagesimal($definition_version)).'0 > 10000000001 && chk.substr(0, 8) == "Changed " && chk.substr(8, 1) != "0")
366
  window.open("'.$GOTMLS_update_home.GOTMLS_installation_key.'/donate/?donation-source="+chk, "_blank");
367
  } else
368
  alert(chk);
@@ -458,7 +469,7 @@ setDiv("div_file");
458
  </div>
459
  </form>
460
  <a target="_blank" href="http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site='.urlencode(GOTMLS_siteurl).'">Google Safe Browsing Diagnostic</a>', "stuffbox").'
461
- '.GOTMLS_box(GOTMLS_Last_Scan_Status_LANGUAGE, GOTMLS_scan_log(), "stuffbox").'
462
  '.$optional_box.'
463
  </div>';
464
  if (isset($GLOBALS["GOTMLS"]["tmp"]["stuffbox"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["stuffbox"])) {
@@ -512,10 +523,11 @@ function GOTMLS_box($bTitle, $bContents, $bType = "postbox") {
512
  }
513
 
514
  function GOTMLS_View_Quarantine() {
515
- global $GOTMLS_settings_array;
516
  $entries = GOTMLS_getfiles($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]);
517
  GOTMLS_display_header();
518
- $Q_Page = '
 
 
519
  <form method="POST" target="GOTMLS_iFrame" name="GOTMLS_Form_clean"><input type="hidden" id="GOTMLS_fixing" name="GOTMLS_fixing" value="1">';
520
  if (is_array($entries) && ($key = array_search(".htaccess", $entries)))
521
  unset($entries[$key]);
@@ -523,20 +535,24 @@ function GOTMLS_View_Quarantine() {
523
  unset($entries[$key]);
524
  if (is_array($entries) && count($entries)) {
525
  $Q_Page .= '<p id="fix_button" style="display: none; float: right;"><input id="repair_button" type="submit" value="'.__("Restore SELECTED files from Quarantine",'gotmls').'" class="button-primary" onclick="if (confirm(\''.__("Are you sure you want to overwrite the previously cleaned files with the selected files in the Quarantine?",'gotmls').'\')) { setvalAllFiles(1); loadIframe(\'File Restoration Results\'); } else return false;" /><br /><input id="delete_button" type="submit" class="button-primary" value="'.__("Delete SELECTED files from Quarantine",'gotmls').'" style="background-color: #C33; color: #FFF; background-image: linear-gradient(to bottom, #C22, #933); border-color: #933 #933 #900; box-shadow: 0 1px 0 rgba(230, 120, 120, 0.5) inset; text-decoration: none; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); margin-top: 10px;" onclick="if (confirm(\''.__("Are you sure you want to permanently delete the selected files in the Quarantine?",'gotmls').'\')) { setvalAllFiles(2); loadIframe(\'File Deletion Results\'); } else return false;" /></p><p><b>'.__("The following items have been found to contain malicious code, they have been cleaned, and the original infected file contents have been saved here in the Quarantine. The code is safe here and you do not need to do anything further with these files.",'gotmls').'</b></p><p>'.sprintf(__("FYI - these files are found in: %s",'gotmls'), ' '.$GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'</p>
526
- <ul name="found_Quarantine" id="found_Quarantine" class="GOTMLS_plugin known" style="background-color: #ccc; padding: 0;"><h3>'.(count($entries)>1?'<input type="checkbox" onchange="checkAllFiles(this.checked); document.getElementById(\'fix_button\').style.display = \'block\';"> '.sprintf(__("Check all %d",'gotmls'),count($entries)):"").__(" Items in Quarantine",'gotmls').'<span style="float: right;">Date Quarantined</span></h3>';
527
  sort($entries);
528
- $root_path = implode(GOTMLS_slash(), array_slice(GOTMLS_explode_dir(__file__), 0, (2 + intval($GOTMLS_settings_array["scan_level"])) * -1));
529
  foreach ($entries as $entry) {
530
  $file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).$entry;
531
- $date = explode("-", date("y-m-d-H-i",filemtime($file)));
532
- $Q_Page .= "\n<li style='margin: 4px 12px;'><span style='float: right; white-space: nowrap;'>(20$date[0]-$date[1]-$date[2] at $date[3]:$date[4])</span>".'<input type="checkbox" name="GOTMLS_fix[]" value="'.GOTMLS_encode($file).'" id="check_'.GOTMLS_encode($file).'" onchange="document.getElementById(\'fix_button\').style.display = \'block\';" />';
 
 
533
  if (is_file($file) && GOTMLS_get_ext($entry) == "gotmls") {
534
  $file_date = explode(".", $entry);
535
- if (count($file_date) > 2 && strlen($file_date[0]) == 5)
536
- $date = GOTMLS_sexagesimal($file_date[0]);
537
- elseif (@rename($file, GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).GOTMLS_sexagesimal(implode("-", $date)).".$entry"))
538
- $file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).GOTMLS_sexagesimal($date).".$entry";
539
- $Q_Page .= '<img src="'.GOTMLS_images_path.'blocked.gif" height=16 width=16 alt="Q">'.GOTMLS_error_link(__("View Quarantined File",'gotmls'), $file).str_replace($root_path, "...", GOTMLS_decode($file_date[count($file_date)-2]));
 
 
540
  } else
541
  $Q_Page .= '<img src="'.GOTMLS_images_path.'threat.gif" height=16 width=16 alt="?">'.GOTMLS_error_link(__("Foreign File in Quarantine",'gotmls'), $file).$entry;
542
  $Q_Page .= "</a></li>";
@@ -547,56 +563,60 @@ function GOTMLS_View_Quarantine() {
547
  }
548
 
549
  function GOTMLS_settings() {
550
- global $current_user, $wp_version, $GOTMLS_definitions_array, $GOTMLS_threat_levels, $GOTMLS_scanfiles, $GOTMLS_loop_execution_time, $GOTMLS_skip_dirs, $GOTMLS_settings_array, $GOTMLS_dirs_at_depth, $GOTMLS_dir_at_depth;
551
  $GOTMLS_scan_groups = array();
552
  $dirs = GOTMLS_explode_dir(__file__);
553
- for ($SL=0;$SL<intval($GOTMLS_settings_array["scan_level"]);$SL++)
554
  $GOTMLS_scan_groups[] = '<b>'.implode(GOTMLS_slash(), array_slice($dirs, -1 * (3 + $SL), 1)).'</b>';
555
  if (isset($_POST["check"]))
556
- $GOTMLS_settings_array["check"] = $_POST["check"];
557
  if (isset($_POST["exclude_ext"])) {
558
  if (strlen(trim(str_replace(",","",$_POST["exclude_ext"]).' ')) > 0)
559
- $GOTMLS_settings_array["exclude_ext"] = preg_split('/[\s]*([,]+[\s]*)+/', trim(str_replace('.', ',', $_POST["exclude_ext"])), -1, PREG_SPLIT_NO_EMPTY);
560
  else
561
- $GOTMLS_settings_array["exclude_ext"] = array();
562
  }
563
- if (isset($_GET['eli']) && $_GET['eli']=='quarantine')
564
- $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = $GOTMLS_settings_array["exclude_ext"];
565
  else
566
- $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = array_merge($GOTMLS_settings_array["exclude_ext"], array("gotmls"));
567
  if (isset($_POST["exclude_dir"])) {
568
  if (strlen(trim(str_replace(",","",$_POST["exclude_dir"]).' ')) > 0)
569
- $GOTMLS_settings_array["exclude_dir"] = preg_split('/[\s]*([,]+[\s]*)+/', trim($_POST["exclude_dir"]), -1, PREG_SPLIT_NO_EMPTY);
570
  else
571
- $GOTMLS_settings_array["exclude_dir"] = array();
572
- for ($d=0; $d<count($GOTMLS_settings_array["exclude_dir"]); $d++)
573
- if (dirname($GOTMLS_settings_array["exclude_dir"][$d]) != ".")
574
- $GOTMLS_settings_array["exclude_dir"][$d] = str_replace("\\", "", str_replace("/", "", str_replace(dirname($GOTMLS_settings_array["exclude_dir"][$d]), "", $GOTMLS_settings_array["exclude_dir"][$d])));
575
  }
576
- $GOTMLS_skip_dirs = array_merge($GOTMLS_settings_array["exclude_dir"], $GOTMLS_skip_dirs);
577
- if (isset($_POST["scan_what"]) && is_numeric($_POST["scan_what"]) && $_POST["scan_what"] != $GOTMLS_settings_array["scan_what"])
578
- $GOTMLS_settings_array["scan_what"] = $_POST["scan_what"];
579
- if (isset($_POST["check_custom"]) && $_POST["check_custom"] != $GOTMLS_settings_array["check_custom"])
580
- $GOTMLS_settings_array["check_custom"] = stripslashes($_POST["check_custom"]);
581
- if (isset($_POST["scan_depth"]) && is_numeric($_POST["scan_depth"]) && $_POST["scan_depth"] != $GOTMLS_settings_array["scan_depth"])
582
- $GOTMLS_settings_array["scan_depth"] = $_POST["scan_depth"];
583
- if (isset($_POST['check_htaccess']) && is_numeric($_POST['check_htaccess']) && $_POST['check_htaccess'] != $GOTMLS_settings_array['check_htaccess'])
584
- $GOTMLS_settings_array['check_htaccess'] = $_POST['check_htaccess'];
585
- if (isset($_POST['check_timthumb']) && is_numeric($_POST['check_timthumb']) && $_POST['check_timthumb'] != $GOTMLS_settings_array['check_timthumb'])
586
- $GOTMLS_settings_array['check_timthumb'] = $_POST['check_timthumb'];
587
- if (isset($_POST['check_wp_login']) && is_numeric($_POST['check_wp_login']) && $_POST['check_wp_login'] != $GOTMLS_settings_array['check_wp_login'])
588
- $GOTMLS_settings_array['check_wp_login'] = $_POST['check_wp_login'];
589
- if (isset($_POST['check_known']) && is_numeric($_POST['check_known']) && $_POST['check_known'] != $GOTMLS_settings_array['check_known'])
590
- $GOTMLS_settings_array['check_known'] = $_POST['check_known'];
591
- if (isset($_POST['check_potential']) && is_numeric($_POST['check_potential']) && $_POST['check_potential'] != $GOTMLS_settings_array['check_potential'])
592
- $GOTMLS_settings_array['check_potential'] = $_POST['check_potential'];
593
- GOTMLS_update_scan_log(array("settings" => $GOTMLS_settings_array));
 
 
 
 
594
  $scan_opts = '';
595
  $scan_optjs = "\n<script type=\"text/javascript\">\nfunction showOnly(what) {\n";
596
  foreach ($GOTMLS_scan_groups as $mg => $GOTMLS_scan_group) {
597
  $scan_optjs .= "document.getElementById('only$mg').style.display = 'none';\n";
598
  $scan_opts .= '
599
- <div style="position: relative; float: right; padding: 2px 0px 4px 30px;" id="scan_group_div_'.$mg.'"><input type="radio" name="scan_what" id="not-only'.$mg.'" value="'.$mg.'"'.($GOTMLS_settings_array["scan_what"]==$mg?' checked':'').' /><a style="text-decoration: none;" href="#scan_what" onclick="showOnly(\''.$mg.'\');document.getElementById(\'not-only'.$mg.'\').checked=true;">'.$GOTMLS_scan_group.'</a><br />
600
  <div class="rounded-corners" style="position: absolute; display: none; background-color: #CCF; padding: 10px; z-index: 10;" id="only'.$mg.'"><div style="position: relative; padding: 0 40px 0 0;"><a class="rounded-corners" style="position: absolute; right: 0; margin: 0; padding: 0 4px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;" href="#scan_what" onclick="showhide(\'only'.$mg.'\');">X</a><b>'.str_replace(" ", "&nbsp;", __("Only Scan These Folders:",'gotmls')).'</b></div>';
601
  $dir = implode(GOTMLS_slash(), array_slice($dirs, 0, -1 * (2 + $mg)));
602
  $files = GOTMLS_getfiles($dir);
@@ -616,7 +636,7 @@ function GOTMLS_settings() {
616
  <div style="float: left;">'.$scan_opts.$scan_optjs.'</div>
617
  <div style="float: left;" id="scanwhatfolder"></div><br style="clear: left;" />
618
  <p><b>'.__("Scan Depth:",'gotmls').'</b> ('.__("how far do you want to drill down from your starting directory?",'gotmls').')</p>
619
- <div style="padding: 0 30px;"><input type="text" value="'.$GOTMLS_settings_array["scan_depth"].'" name="scan_depth"> ('.__("-1 is infinite depth",'gotmls').')</div><p><b>'.__("What to look for:",'gotmls').'</b></p>
620
  <div style="padding: 0 30px;">';
621
  foreach ($GOTMLS_threat_levels as $threat_level_name=>$threat_level) {
622
  $scan_opts .= '
@@ -627,37 +647,42 @@ function GOTMLS_settings() {
627
  else
628
  $scan_opts .= '
629
  <a title="'.__("Download Definition Updates to Use this feature",'gotmls').'"><img src="'.GOTMLS_images_path.'blocked.gif" height=16 width=16 alt="X">';
630
- $scan_opts .= (isset($_GET['eli']) && isset($_SESSION['GOTMLS_'.$_GET['eli']][$threat_level])?print_r($_SESSION['GOTMLS_'.$_GET['eli']][$threat_level],1):"")."<b>$threat_level_name</b></a>";
631
  if (!isset($GOTMLS_definitions_array[$threat_level]))
632
  $scan_opts .= '<br />
633
  <div style="padding: 14px;" id="check_'.$threat_level.'_div_NA">'.__("Registration of your Installation Key is required for this feature",'gotmls').'</div>';
634
- elseif (isset($_GET['eli'])) {
635
  $scan_opts .= '
636
  <div style="padding: 0 20px; position: relative; top: -18px; display: none;" id="dont_check_'.$threat_level.'"><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.'\');">X</a>';
637
  foreach ($GOTMLS_definitions_array[$threat_level] as $threat_name => $threat_regex)
638
  $scan_opts .= '<br />
639
- <input type="checkbox" name="dont_check[]" value="'.htmlspecialchars($threat_name).'"'.(in_array($threat_name, $GOTMLS_settings_array["dont_check"])?' checked /><script>showhide("dont_check_'.$threat_level.'", true);</script>':' />').(isset($_GET['eli']) && isset($_SESSION['GOTMLS_'.$_GET['eli']][$threat_name])?print_r($_SESSION['GOTMLS_'.$_GET['eli']][$threat_name],1):"").$threat_name;
640
  $scan_opts .= '
641
  </div>';
642
  }
643
  $scan_opts .= '
644
  </div>';
645
  }
646
- if (isset($_GET['eli'])) { if (isset($_SESSION['GOTMLS_'.$_GET['eli']]['total'])) {$scan_opts .=print_r($_SESSION['GOTMLS_'.$_GET['eli']]['total'],1); unset($_SESSION['GOTMLS_'.$_GET['eli']]);} $scan_opts .= '
647
- <div style="padding: 10px;"><b>'.__("Custom RegExp:",'gotmls').'</b> ('.__("For very advanced users only. Do not use this without talking to Eli first. If used incorrectly you could easily break your site.",'gotmls').')<br /><input type="text" name="check_custom" style="width: 100%;" value="'.htmlspecialchars($GOTMLS_settings_array["check_custom"]).'" /></div>';}//still testing this option
 
 
 
648
  $scan_opts .= '
649
  </div>
650
  <p>'.__("<b>Skip files with the following extentions:</b> (a comma separated list of file extentions to be excluded from the scan)",'gotmls').'</p>
651
- <div style="padding: 0 30px;"><input type="text" name="exclude_ext" value="'.implode(",", $GOTMLS_settings_array["exclude_ext"]).'" style="width: 100%;" /></div>
652
  <p>'.__("<b>Skip directories with the following names:</b> (a comma separated list of folders to be excluded from the scan)",'gotmls').'</p>
653
- <div style="padding: 0 30px;"><input type="text" name="exclude_dir" value="'.implode(",", $GOTMLS_settings_array["exclude_dir"]).'" style="width: 100%;" /></div>
654
- <p style="text-align: right;"><input type="submit" id="complete_scan" value="'.GOTMLS_Run_Complete_Scan_LANGUAGE.'" class="button-primary" /></p>
655
- </form>';
656
  @ob_start();
657
  $OB_default_handlers = array("default output handler", "zlib output compression");
658
- foreach (ob_list_handlers() as $OB_last_handler)
659
- if (!in_array($OB_last_handler, $OB_default_handlers))
660
- echo '<div class="error">'.sprintf(__("Another Plugin or Theme is using '%s' to handle output buffers. <br />This prevents actively outputing the buffer on-the-fly and will severely degrade the performance of this (and many other) Plugins. <br />Consider disabling caching and compression plugins (at least during the scanning process).",'gotmls'), $OB_last_handler).'</div>';
 
 
661
  GOTMLS_display_header();
662
  $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",__("Read/Write Errors",'gotmls')=>"errors",__("Quarantined Files",'gotmls')=>"bad"), $GOTMLS_threat_levels);
663
  echo '<script type="text/javascript">
@@ -740,7 +765,7 @@ function update_status(title, time) {
740
  foreach ($scan_groups as $scan_name => $scan_group) {
741
  $vars .= ", $scan_group=0";
742
  if ($MAX++ == 6) {
743
- echo "/*-->*"."/\n\tif ($scan_group > 0)\n\t\tscan_state = ' potential'; \n\telse\n\t\tscan_state = '';\n\tdivHTML += '</ul><ul style=\"text-align: left;\"><li class=\"GOTMLS_li\"><a href=\"admin.php?page=GOTMLS-View-Quarantine\" title=\"".GOTMLS_View_Quarantine_LANGUAGE."\" class=\"GOTMLS_plugin'+scan_state+'\">'+$scan_group+'&nbsp;'+($scan_group==1?('$scan_name').slice(0,-1):'$scan_name')+'</a></li>';\n/*<!--*"."/";
744
  $found = "Found ";
745
  $fix_button_js = "\n\t\tdis='block';";
746
  } else {
@@ -767,7 +792,7 @@ var startTime = 0;
767
  if (isset($_REQUEST["scan_what"]) && is_numeric($_REQUEST["scan_what"]) && ($_REQUEST["scan_what"] > -1)) {
768
  if (!isset($_REQUEST["scan_type"]))
769
  $_REQUEST["scan_type"] = "Complete Scan";
770
- update_option('GOTMLS_settings_array', $GOTMLS_settings_array);
771
  foreach ($_POST as $name => $value) {
772
  if (substr($name, 0, 10) != 'GOTMLS_fix') {
773
  if (is_array($value)) {
@@ -787,10 +812,24 @@ var startTime = 0;
787
  $scan_groups_UL .= "\n<ul name=\"found_$scan_group\" id=\"found_$scan_group\" class=\"GOTMLS_plugin $scan_group\" style=\"background-color: #ccc; display: none; padding: 0;\"><a class=\"rounded-corners\" name=\"link_$scan_group\" style=\"float: right; padding: 0 4px; margin: 5px 5px 0 30px; line-height: 16px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;\" href=\"#found_top\" onclick=\"showhide('found_$scan_group');\">X</a><h3>$scan_name</h3>\n".($scan_group=='potential'?'<p> &nbsp; * '.__("NOTE: These are probably not malicious scripts (but it's a good place to start looking <u>IF</u> your site is infected and no Known Threats were found).",'gotmls').'</p>':($scan_group=='wp_login'?'<p> &nbsp; * '.__("NOTE: 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. For more information on brute force attack prevention and the WordPress wp-login-php file ",'gotmls').' <a target="_blank" href="http://gotmls.net/tag/wp-login-php/">'.__("read my blog",'gotmls').'</a>.</p>':'<br />')).'</ul>';
788
  if (!($dir = implode(GOTMLS_slash(), array_slice($dirs, 0, -1 * (2 + $_REQUEST["scan_what"]))))) $dir = "/";
789
  GOTMLS_update_scan_log(array("scan" => array("dir" => $dir, "start" => time(), "type" => $_REQUEST["scan_type"])));
790
- echo GOTMLS_box('<div style="float: right;">&nbsp;('.$GLOBALS["GOTMLS"]["log"]["scan"]["dir"].')&nbsp;</div>'.GOTMLS_Scan_Details_LANGUAGE, $scan_groups_UL);
791
- while (in_array($OB_last_handler, $OB_default_handlers) && @ob_end_flush())
792
- foreach (ob_list_handlers() as $OB_handler)
793
- $OB_last_handler = $OB_handler;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
794
  @ob_start();
795
  if ($_REQUEST["scan_type"] == "Quick Scan")
796
  $li_js = "\nfunction testComplete() {\n\tif (percent != 100)\n\t\talert('".__("The Quick Scan was unable to finish because of a shortage of memory or a problem accessing a file. Please try using the Complete Scan, it is slower but it will handle these errors better and continue scanning the rest of the files.",'gotmls')."');\n}\nwindow.onload=testComplete;\n</script>\n<script type=\"text/javascript\">";
@@ -798,7 +837,7 @@ var startTime = 0;
798
  if (is_dir($dir)) {
799
  $GOTMLS_dirs_at_depth[0] = 1;
800
  $GOTMLS_dir_at_depth[0] = 0;
801
- if (!(isset($_GET["eli"]) && $_GET["eli"] == "NOQ")) {
802
  $GOTMLS_dirs_at_depth[0]++;
803
  GOTMLS_readdir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]);
804
  }
@@ -865,7 +904,6 @@ showhide("pause_button", true);'."\n/*<!--*"."/";
865
  }
866
  echo "/*-->*"."/\n</script>";
867
  } else {
868
- $head = "<?php if (file_exists(dirname(__FILE__).'/wp-content/plugins/gotmls/safe-load/wp-login.php')) require(dirname(__FILE__).'/wp-content/plugins/gotmls/safe-load/wp-login.php'); // Load Security Patch by GOTMLS.NET before the WordPress bootstrap. ?>";
869
  $patch_attr = array(
870
  array(
871
  "icon" => "blocked",
@@ -887,34 +925,50 @@ showhide("pause_button", true);'."\n/*<!--*"."/";
887
  )
888
  );
889
  $patch_status = 0;
 
890
  $patch_action = "";
891
- if (file_exists(dirname(__FILE__).'/../../../wp-config.php') && ($config = @file_get_contents(dirname(__FILE__).'/../../../wp-config.php')) && strlen($config) && ($head == substr($config, 0, strlen($head)))) {
892
- if (isset($_POST["GOTMLS_patching"]) && @file_put_contents(dirname(__FILE__).'/../../../wp-config.php', str_replace($head, "", $config)))
893
- $patch_action .= '<div class="error">'.__("Removed Brute-Force Protection",'gotmls').'</div>';
894
- else
895
- $patch_status = 1;
896
- } elseif (isset($_POST["GOTMLS_patching"]) && strlen($config) && ($head != substr($config, 0, strlen($head))) && @file_put_contents(dirname(__FILE__).'/../../../wp-config.php', $head.$config)) {
 
 
 
 
 
 
 
 
 
 
897
  $patch_action .= '<div class="updated">'.__("Installed Brute-Force Protection",'gotmls').'</div>';
898
  $patch_status = 1;
899
  }
900
- if (file_exists(dirname(__FILE__).'/../../../wp-login.php') && ($GOTMLS_file_contents = @file_get_contents(dirname(__FILE__).'/../../../wp-login.php')) && strlen($GOTMLS_file_contents) && (preg_match('/if \(file_exists\(.+?(\/plugins\/gotmls\/safe-load\.php\')[\)\s]+require\(.+?\1\);/i', $GOTMLS_file_contents))) {
901
- if (isset($_POST["GOTMLS_patching"]) && ($source = wp_remote_get("http://core.svn.wordpress.org/tags/".$wp_version.'/wp-login.php')) && is_array($source) && isset($source["body"]) && (strlen($source["body"]) > 500) && @file_put_contents(dirname(__FILE__).'/../../../wp-login.php', $source["body"]))
902
  $patch_action .= '<div class="updated">'.__("Removed Old Brute-Force Login Patch",'gotmls').'</div>';
903
  else
904
  $patch_status = 2;
905
  }
 
906
  $sec_opts = '
907
  <p><img src="'.GOTMLS_images_path.'checked.gif"><b>Revolution Slider Exploit Protection (Automatically Enabled)</b></p><div style="padding: 0 30px;"> &nbsp; * '.__("NOTE: This Protection in automatically activated with this plugin because of the widespread attack on WordPress that are affecting so many site right now. It is still recommended that you make sure to upgrade and older versions of the Revolution Slider plugin, especially those included in some themes that will not update automatically. Even if you do not have Revolution Slider on your site it still can't hurt to have this protection installed.",'gotmls').'</div><hr />
908
  '.$patch_action.'
909
- <form method="POST" name="GOTMLS_Form_patch"><p><img src="'.GOTMLS_images_path.$patch_attr[$patch_status]["icon"].'.gif"><b>Brute-force Protection '.$patch_attr[$patch_status]["status"].'</b></p><p style="float: right;"><input type="submit" value="'.$patch_attr[$patch_status]["action"].'"><input type="hidden" name="GOTMLS_patching" value="1"></p><div style="padding: 0 30px;"> &nbsp; * '.$patch_attr[$patch_status]["language"].__(" For more information on Brute-Force attack prevention and the WordPress wp-login-php file ",'gotmls').' <a target="_blank" href="http://gotmls.net/tag/wp-login-php/">'.__("read my blog",'gotmls').'</a>.</div>';
 
 
 
 
910
  $admin_notice = "";
911
  if ($current_user->user_login == "admin") {
912
- $admin_notice .= '</form><hr />
913
- <form method="POST" name="GOTMLS_Form_admin"><p><img src="'.GOTMLS_images_path.'threat.gif"><b>Admin Notice</b></p><div style="padding: 0 30px;">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.</div>';
914
  }
915
- echo GOTMLS_box("Aditional Security Options", $sec_opts.$admin_notice);
916
  }
917
- echo "\n</form>\n</div></div></div>";
918
  }
919
 
920
  function GOTMLS_set_plugin_action_links($links_array, $plugin_file) {
@@ -930,34 +984,34 @@ function GOTMLS_set_plugin_row_meta($links_array, $plugin_file) {
930
  }
931
 
932
  function GOTMLS_init() {
933
- global $GOTMLS_update_home, $GOTMLS_settings_array, $GOTMLS_onLoad, $GOTMLS_threat_levels, $wpdb, $GOTMLS_threats_found, $GOTMLS_settings_array, $GOTMLS_definitions_versions, $GOTMLS_definitions_array, $GOTMLS_file_contents;
934
- if (!isset($GOTMLS_settings_array["scan_what"]))
935
- $GOTMLS_settings_array["scan_what"] = 2;
936
- if (!isset($GOTMLS_settings_array["scan_depth"]))
937
- $GOTMLS_settings_array["scan_depth"] = -1;
938
  if (isset($_REQUEST["scan_type"]) && $_REQUEST["scan_type"] == "Quick Scan") {
939
  if (!isset($_REQUEST["scan_what"])) $_REQUEST["scan_what"] = 2;
940
  if (!isset($_REQUEST["scan_depth"]))
941
  $_REQUEST["scan_depth"] = 2;
942
  if (!(isset($_POST["scan_only"]) && is_array($_POST["scan_only"])))
943
  $_POST["scan_only"] = array("","wp-content/plugins","wp-content/themes");
944
- }//$GOTMLS_settings_array["check_custom"] = stripslashes($_POST["check_custom"]);
945
- if (!isset($GOTMLS_settings_array["check_custom"]))
946
- $GOTMLS_settings_array["check_custom"] = "";
947
- if (isset($GOTMLS_settings_array["scan_level"]) && is_numeric($GOTMLS_settings_array["scan_level"]))
948
- $scan_level = intval($GOTMLS_settings_array["scan_level"]);
949
  else
950
  $scan_level = count(explode('/', trailingslashit(get_option("siteurl")))) - 1;
951
- if (!(isset($GOTMLS_settings_array["dont_check"]) && is_array($GOTMLS_settings_array["dont_check"])))
952
- $GOTMLS_settings_array["dont_check"] = array();
953
  if (isset($_REQUEST["dont_check"]) && is_array($_REQUEST["dont_check"]) && count($_REQUEST["dont_check"]))
954
- $GOTMLS_settings_array["dont_check"] = $_REQUEST["dont_check"];
955
  if ($array = get_option('GOTMLS_definitions_array')) {
956
  if (is_array($array))
957
  $GOTMLS_definitions_array = $array;
958
  } else {
959
  $wpdb->query("DELETE FROM $wpdb->options WHERE `option_name` LIKE 'GOTMLS_known_%' OR `option_name` LIKE 'GOTMLS_definitions_array_%'");
960
- array_walk($GOTMLS_settings_array, "GOTMLS_reset_settings");
961
  }
962
  foreach ($GOTMLS_definitions_array as $threat_level=>$definition_names)
963
  foreach ($definition_names as $definition_name=>$definition_version)
@@ -974,8 +1028,8 @@ function GOTMLS_init() {
974
  $GOTMLS_definitions_array = GOTMLS_array_replace_recursive($GOTMLS_definitions_array, $GOTnew_definitions);
975
  if (file_exists(GOTMLS_plugin_path.'definitions_update.txt'))
976
  @unlink(GOTMLS_plugin_path.'definitions_update.txt');
977
- if (isset($GOTMLS_settings_array["check"]))
978
- unset($GOTMLS_settings_array["check"]);
979
  update_option('GOTMLS_definitions_array', $GOTMLS_definitions_array);
980
  foreach ($GOTMLS_definitions_array as $threat_level=>$definition_names)
981
  foreach ($definition_names as $definition_name=>$definition_version)
@@ -985,24 +1039,24 @@ function GOTMLS_init() {
985
  }
986
  asort($GOTMLS_definitions_versions);
987
  if (isset($_REQUEST["check"]) && is_array($_REQUEST["check"]))
988
- $GOTMLS_settings_array["check"] = $_REQUEST["check"];
989
  /* $threat_names = array_keys($GOTMLS_definitions_array["known"]);
990
  foreach ($threat_names as $threat_name) {
991
  if (isset($GOTMLS_definitions_array["known"][$threat_name]) && is_array($GOTMLS_definitions_array["known"][$threat_name]) && count($GOTMLS_definitions_array["known"][$threat_name]) > 1) {
992
  if ($GOTMLS_definitions_array["known"][$threat_name][0] > $GOTMLS_definitions_version)
993
  $GOTMLS_definitions_version = $GOTMLS_definitions_array["known"][$threat_name][0];
994
- if (!(count($GOTMLS_settings_array["dont_check"]) && in_array($threat_name, $GOTMLS_settings_array["dont_check"]))) {
995
  $GOTMLS_threat_levels[$threat_name] = count($GOTMLS_definitions_array["known"][$threat_name]);
996
- if (!isset($GOTMLS_settings_array["check"]) && $GOTMLS_threat_levels[$threat_name] > 2)
997
- $GOTMLS_settings_array["check"] = "known";
998
  }
999
  }
1000
  }*/
1001
- if (!isset($GOTMLS_settings_array["check"]))
1002
- $GOTMLS_settings_array["check"] = $GOTMLS_threat_levels;
1003
  if (isset($_POST["GOTMLS_fix"]) && !is_array($_POST["GOTMLS_fix"]))
1004
  $_POST["GOTMLS_fix"] = array($_POST["GOTMLS_fix"]);
1005
- GOTMLS_update_scan_log(array("settings" => $GOTMLS_settings_array));
1006
  if (isset($_POST['GOTMLS_whitelist']) && isset($_POST['GOTMLS_chksum'])) {
1007
  $file = GOTMLS_decode($_POST['GOTMLS_whitelist']);
1008
  $chksum = explode("O", $_POST['GOTMLS_chksum']."O");
@@ -1022,8 +1076,8 @@ function GOTMLS_init() {
1022
  if (is_dir($file)) {
1023
  @error_reporting(0);
1024
  @header("Content-type: text/javascript");
1025
- if (isset($GOTMLS_settings_array["exclude_ext"]) && is_array($GOTMLS_settings_array["exclude_ext"]))
1026
- $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = $GOTMLS_settings_array["exclude_ext"];
1027
  @ob_start();
1028
  echo GOTMLS_scandir($file);
1029
  if (@ob_get_level()) {
@@ -1085,7 +1139,7 @@ function select_text_range(ta_id, start, end) {
1085
  }
1086
  }
1087
  window.parent.showhide("GOTMLS_iFrame", true);
1088
- </script><table style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;"><tr><td style="width: 100%"><form style="margin: 0;" method="post"'.(is_file($clean_file)?' onsubmit="return confirm(\''.__("Are you sure this file is not infected and you want to ignore it in future scans?",'gotmls').'\');"><input type="hidden" name="GOTMLS_whitelist" value="'.GOTMLS_encode($clean_file).'"><input type="hidden" name="GOTMLS_chksum" value="'.md5($GOTMLS_file_contents).'O'.GOTMLS_installation_key.'"><input type="submit" value="Whitelist this file" style="float: right;">':(is_file(GOTMLS_quarantine($clean_file))?' >':'>')).'</form><div id="fileperms" class="shadowed-box rounded-corners" style="display: none; position: absolute; left: 8px; top: 29px; background-color: #ccc; border: medium solid #C00; box-shadow: -3px 3px 3px #666; border-radius: 10px; padding: 10px;"><b>File Details</b><br />permissions:'.GOTMLS_fileperms($file).'<br />modified:'.date(" Y-m-d H:i:s ", filemtime($file)).'<br />changed:'.date(" Y-m-d H:i:s ", filectime($file)).'</div><div style="overflow: auto;"><span onmouseover="document.getElementById(\'fileperms\').style.display=\'block\';" onmouseout="document.getElementById(\'fileperms\').style.display=\'none\';">'.__("Potential threats in file:",'gotmls').'</span> ('.$fa.' )</div></td></tr><tr><td style="height: 100%"><textarea id="ta_file" style="width: 100%; height: 100%">'.htmlentities(str_replace("\r", "", $GOTMLS_file_contents)).'</textarea></td></tr></table>');
1089
  }
1090
  }
1091
  } elseif (isset($_POST['GOTMLS_fix']) && is_array($_POST['GOTMLS_fix'])) {
@@ -1105,24 +1159,23 @@ window.parent.showhide("GOTMLS_iFrame", true);
1105
  if (isset($_POST["scan_level"]) && is_numeric($_POST["scan_level"]))
1106
  $scan_level = intval($_POST["scan_level"]);
1107
  if (isset($scan_level) && is_numeric($scan_level))
1108
- $GOTMLS_settings_array["scan_level"] = intval($scan_level);
1109
  else
1110
- $GOTMLS_settings_array["scan_level"] = count(explode('/', trailingslashit(get_option("siteurl")))) - 1;
1111
  if (isset($_GET["GOTMLS_x"]) || isset($_GET["GOTMLS_y"]) || isset($_GET["GOTMLS_h"]) || isset($_GET["GOTMLS_w"])) {
1112
  if (isset($_GET["GOTMLS_x"]))
1113
- $GOTMLS_settings_array["msg_position"][0] = $_GET["GOTMLS_x"];
1114
  if (isset($_GET["GOTMLS_y"]))
1115
- $GOTMLS_settings_array["msg_position"][1] = $_GET["GOTMLS_y"];
1116
  if (isset($_GET["GOTMLS_h"]))
1117
- $GOTMLS_settings_array["msg_position"][2] = $_GET["GOTMLS_h"];
1118
  if (isset($_GET["GOTMLS_w"]))
1119
- $GOTMLS_settings_array["msg_position"][3] = $_GET["GOTMLS_w"];
1120
- $_GET["GOTMLS_msg"] = "New window position saved. ";//.print_r($GOTMLS_settings_array["msg_position"], true);
1121
  }
1122
- update_option('GOTMLS_settings_array', $GOTMLS_settings_array);
1123
  if (isset($_GET["GOTMLS_msg"]))
1124
  die('<body style="margin: 0; padding: 0;">'.$_GET["GOTMLS_msg"].'</body>');
1125
- add_contextual_help('GOTMLS-settings', __("<p>This is a help text for 'GOTMLS-settings' page.</p>", 'gotmls'));
1126
  }
1127
 
1128
  if (function_exists("is_admin") && is_admin() && ((isset($_POST['GOTMLS_whitelist']) && isset($_POST['GOTMLS_chksum'])) || (isset($_GET["GOTMLS_scan"]) && is_dir(GOTMLS_decode($_GET["GOTMLS_scan"]))))) {
8
  Contributors: scheeeli, gotmls
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
10
  Description: This Anti-Virus/Anti-Malware plugin searches for Malware and other Virus like threats and vulnerabilities on your server and helps you remove them. It's always growing and changing to adapt to new threats so let me know if it's not working for you.
11
+ Version: 4.14.53
12
  */
13
+ if (isset($_SERVER["SCRIPT_FILENAME"]) && strlen($_SERVER["SCRIPT_FILENAME"]) > strlen(basename(__FILE__)) && substr(__FILE__, -1 * strlen($_SERVER["SCRIPT_FILENAME"])) == substr($_SERVER["SCRIPT_FILENAME"], -1 * strlen(__FILE__)))
14
+ include(dirname(__FILE__)."/safe-load/index.php");
15
+ else
16
+ require_once(dirname(__FILE__)."/images/index.php");
17
  /* ___
18
  * / /\ GOTMLS Main Plugin File
19
  * / /:/ @package GOTMLS
35
  * \ \::/ with this program; if not, write to the Free Software Foundation,
36
  * \__\/ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
37
 
 
 
 
 
38
  load_plugin_textdomain('gotmls', false, basename(GOTMLS_plugin_path).'/languages');
39
  require_once(GOTMLS_plugin_path.'images/index.php');
40
 
46
  register_activation_hook(__FILE__, "GOTMLS_install");
47
 
48
  function GOTMLS_menu() {
49
+ if ($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["menu_group"] > 2 && is_multisite()) {
 
50
  $_POST["GOTMLS_menu_group"] = 1;
51
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"] = "manage_network";
52
+ } elseif (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"]))
53
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"] = "activate_plugins";
54
  if (isset($_POST["GOTMLS_menu_group"]) && is_numeric($_POST["GOTMLS_menu_group"])) {
55
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["menu_group"] = $_POST["GOTMLS_menu_group"];
56
  $capabilities = array();
57
+ if (current_user_can($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"]))
58
  foreach (get_editable_roles() as $role)
59
  $capabilities = array_merge($capabilities, $role["capabilities"]);
60
  if (isset($_POST["GOTMLS_user_can"]) && in_array($_POST["GOTMLS_user_can"], $capabilities))
61
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"] = $_POST["GOTMLS_user_can"];
62
+ update_option('GOTMLS_settings_array', $GLOBALS["GOTMLS"]["tmp"]["settings_array"]);
63
  }
64
  $GOTMLS_Full_plugin_logo_URL = GOTMLS_images_path.'GOTMLS-16x16.gif';
65
  $base_page = "GOTMLS-settings";
66
  $base_function = "GOTMLS_settings";
67
  $pluginTitle = "Anti-Malware";
68
  $pageTitle = "$pluginTitle ".GOTMLS_Scan_Settings_LANGUAGE;
69
+ if (!function_exists("add_object_page") || $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["menu_group"])
70
+ $my_admin_page = add_menu_page($pageTitle, $pluginTitle, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], $base_page, $base_function, $GOTMLS_Full_plugin_logo_URL);
71
  else
72
+ $my_admin_page = add_object_page($pageTitle, $pluginTitle, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], $base_page, $base_function, $GOTMLS_Full_plugin_logo_URL);
73
  add_action('load-'.$my_admin_page, 'GOTMLS_admin_add_help_tab');
74
+ add_submenu_page($base_page, "$pluginTitle ".GOTMLS_Scan_Settings_LANGUAGE, GOTMLS_Scan_Settings_LANGUAGE, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], $base_page, $base_function);
75
+ add_submenu_page($base_page, "$pluginTitle ".GOTMLS_Run_Quick_Scan_LANGUAGE, GOTMLS_Run_Quick_Scan_LANGUAGE, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], "$base_page&scan_type=Quick+Scan", $base_function);
76
+ add_submenu_page($base_page, "$pluginTitle ".GOTMLS_View_Quarantine_LANGUAGE, GOTMLS_View_Quarantine_LANGUAGE, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["user_can"], "GOTMLS-View-Quarantine", "GOTMLS_View_Quarantine");
77
  }
78
 
79
  function GOTMLS_admin_add_help_tab() {
 
80
  $GOTMLS_menu_groups = array(__("Main Menu Item placed below <b>Comments</b> and above <b>Appearance</b>",'gotmls'),__("Main Menu Item placed below <b>Settings</b>",'gotmls'));
81
  if (is_multisite() && current_user_can("manage_network"))
82
  $GOTMLS_menu_groups[] = __("ONLY SHOW for <b>Network Admins</b>",'gotmls');
83
  $menu_opts = '<h5>'.__("Menu Item Placement Options",'gotmls').'</h5>';
84
  foreach ($GOTMLS_menu_groups as $mg => $GOTMLS_menu_group)
85
+ $menu_opts .= '<div style="padding: 4px;" id="menu_group_div_'.$mg.'"><input type="radio" name="GOTMLS_menu_group" value="'.$mg.'"'.($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["menu_group"]==$mg?' checked':'').' onchange="document.GOTMLS_menu_Form.submit();" />'.$GOTMLS_menu_group.'</div>';
86
  $screen = get_current_screen();
87
  $screen->add_help_tab(array(
88
  'id' => "GOTMLS_Getting_Started",
105
  }
106
 
107
  function GOTMLS_display_header($optional_box = "") {
108
+ global $GOTMLS_onLoad, $GOTMLS_loop_execution_time, $GOTMLS_update_home, $GOTMLS_plugin_home, $GOTMLS_definitions_versions, $wp_version, $current_user;
109
  get_currentuserinfo();
110
  $GOTMLS_url_parts = explode('/', GOTMLS_siteurl);
111
  if (isset($_GET["check_site"]) && $_GET["check_site"] == 1)
112
+ echo '<div id="check_site" style="z-index: 1234567;"><img src="'.GOTMLS_images_path.'checked.gif" height=16 width=16 alt="&#x2714;"> '.__("Tested your site. It appears we didn't break anything",'gotmls').' ;-)</div><script type="text/javascript">window.parent.document.getElementById("check_site_warning").style.backgroundColor=\'#0C0\';</script><li>Please <a target="_blank" href="https://wordpress.org/plugins/gotmls/stats/?compatibility%5Bversion%5D='.$wp_version.'&compatibility%5Btopic_version%5D='.GOTMLS_Version.'&compatibility%5Bcompatible%5D=1#compatibility-works">Vote "Works"</a> or <a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/gotmls#postform">write a "Five-Star" Reviews</a> on WordPress.org if you like this plugin.</li><style>#footer, #GOTMLS-metabox-container, #GOTMLS-right-sidebar, #admin-page-container, #wpadminbar, #adminmenuback, #adminmenuwrap, #adminmenu, .error, .updated {display: none !important;} #wpbody-content {padding-bottom: 0;} #wpbody, html.wp-toolbar {padding-top: 0 !important;} #wpcontent, #footer {margin-left: 5px !important;}';
113
  else
114
  echo '<style>#GOTMLS-right-sidebar {float: right; margin-right: 0px;}';
115
  $ver_info = GOTMLS_Version.'&p='.strtoupper(GOTMLS_plugin_dir).'&wp='.$wp_version.'&ts='.date("YmdHis").'&key='.GOTMLS_installation_key.'&d='.ur1encode(GOTMLS_siteurl);
163
  vertical-align: middle;
164
  }
165
  </style>
166
+ <div id="div_file" class="shadowed-box rounded-corners sidebar-box" style="padding: 0; display: none; position: fixed; top: '.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][1].'; left: '.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][0].'; width: '.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][3].'; height: '.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][2].'; border: solid #c00; z-index: 112358;"><table style="width: 100%; height: 100%;" cellspacing="0" cellpadding="0"><tr><td style="border-bottom: 1px solid #EEEEEE;" colspan="2"><a class="rounded-corners" name="link_file" style="float: right; padding: 0 4px; margin: 6px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;" href="#found_top" onclick="showhide(\'div_file\');">X</a><h3 onmousedown="grabDiv();" onmouseup="releaseDiv();" id="windowTitle" style="cursor: move; border-bottom: 0px none; z-index: 2345677; position: absolute; left: 0px; top: 0px; margin: 0px; padding: 6px; width: 90%; height: 20px;">'.GOTMLS_Loading_LANGUAGE.'</h3></td></tr><tr><td colspan="2" style="height: 100%"><div style="width: 100%; height: 100%; position: relative; padding: 0; margin: 0;" class="inside"><br /><br /><center><img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="..."> '.GOTMLS_Loading_LANGUAGE.'<br /><br /><input type="button" onclick="showhide(\'GOTMLS_iFrame\', true);" value="'.__("If this is taking too long, click here.",'gotmls').'" class="button-primary" /></center><iframe id="GOTMLS_iFrame" name="GOTMLS_iFrame" style="top: 0px; left: 0px; position: absolute; width: 100%; height: 100%; background-color: #CCC;"></iframe></td></tr><tr><td style="height: 20px;"><iframe id="GOTMLS_statusFrame" name="GOTMLS_statusFrame" style="width: 100%; height: 20px; background-color: #CCC;"></iframe></div></td><td style="height: 20px; width: 20px;"><h3 id="cornerGrab" onmousedown="grabCorner();" onmouseup="releaseCorner();" style="cursor: move; height: 24px; width: 24px; margin: 0; padding: 0; z-index: 2345678; position: absolute; right: 0px; bottom: 0px;">&#8690;</h3></td></tr></table></div>
167
  <script type="text/javascript">
168
  function showhide(id) {
169
  divx = document.getElementById(id);
212
  showhide("GOTMLS_iFrame", true);
213
  showhide("GOTMLS_iFrame");
214
  document.getElementById("windowTitle").innerHTML = title;
215
+ if (curDiv) {
216
+ windowW = getWindowWidth(200);
217
+ windowH = getWindowHeight(200);
218
+ if (windowW > 200)
219
+ windowW -= 30;
220
+ if (windowH > 200)
221
+ windowH -= 20;
222
+ if (px2num(curDiv.style.width) > windowW) {
223
+ curDiv.style.width = windowW + "px";
224
+ curDiv.style.left = "0px";
225
+ } else if ((px2num(curDiv.style.left) + px2num(curDiv.style.width)) > windowW) {
226
+ curDiv.style.left = (windowW - px2num(curDiv.style.width)) + "px";
227
+ }
228
+ if (px2num(curDiv.style.height) > windowH) {
229
+ curDiv.style.height = windowH + "px";
230
+ curDiv.style.top = "0px";
231
+ } else if ((px2num(curDiv.style.top) + px2num(curDiv.style.height)) > windowH) {
232
+ curDiv.style.top = (windowH - px2num(curDiv.style.height)) + "px";
233
+ }
234
+ if (px2num(curDiv.style.left) < 0)
235
+ curDiv.style.left = "0px";
236
+ if (px2num(curDiv.style.top)< 0)
237
+ curDiv.style.top = "0px";
238
  }
239
  showhide("div_file", true);
240
+ if (IE)
241
+ curDiv.scrollIntoView(true);
242
  }
243
  function cancelserver(divid) {
244
+ document.getElementById(divid).innerHTML = "<div class=\'error\'>'. __("No response from server!",'gotmls').'</div>";
245
  }
246
  function checkupdateserver(server, divid) {
247
  var updatescript = document.createElement("script");
285
  return parseInt(px.substring(0, px.length - 2), 10);
286
  }
287
  function setDiv(DivID) {
288
+ if (curDiv = document.getElementById(DivID)) {
289
+ if (IE)
290
+ curDiv.style.position = "absolute";
291
+ curDiv.style.left = "'.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][0].'";
292
+ curDiv.style.top = "'.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][1].'";
293
+ curDiv.style.height = "'.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][2].'";
294
+ curDiv.style.width = "'.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][3].'";
295
+ }
296
  }
297
  function grabDiv() {
298
  corner = document.getElementById("windowTitle");
337
  <div id="main-page-title"><h1 style="vertical-align: middle;">Anti-Malware from&nbsp;GOTMLS.NET</h1></div>
338
  <div id="admin-page-container">
339
  <div id="GOTMLS-right-sidebar" style="width: 300px;" class="metabox-holder">
340
+ '.GOTMLS_box(__("Plugin Updates for WP",'gotmls').' '.$wp_version, '<div id="findUpdates"><center>'.__("Searching for updates ...",'gotmls').'<br /><img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="Wait..." /><br /><input type="button" value="Cancel" onclick="cancelserver(\'findUpdates\');" /></center></div>'.$Update_Link, "stuffbox").'
341
+ '.GOTMLS_box(__("Definition Updates",'gotmls').' ('.$definition_version.')', '
342
  <form id="updateform" method="post" name="updateform" action="'.GOTMLS_script_URI.'">
343
  <img style="display: none; float: right; margin-right: 14px;" src="'.GOTMLS_images_path.'checked.gif" height=16 width=16 alt="definitions file updated" id="autoUpdateDownload" onclick="downloadUpdates(\'UpdateDownload\');">
344
  <div id="Definition_Updates"><center>'.__("Searching for updates ...",'gotmls').'<br /><img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="Wait..." /><br /><input type="button" value="Cancel" onclick="cancelserver(\'Definition_Updates\');" /></center></div>
372
  }
373
  function check_for_donation(chk) {
374
  if (document.getElementById("autoUpdateDownload").src.replace(/^.+\?/,"")=="0") {
375
+ alert(chk+"\\n\\n'.__("Please make a donation for the use of this wonderful feature!",'gotmls').'");
376
+ if ('.preg_replace('/[^0-9]/', "", GOTMLS_sexagesimal($definition_version)).'0 > 2010000000001 && chk.substr(0, 8) == "Changed " && chk.substr(8, 1) != "0")
377
  window.open("'.$GOTMLS_update_home.GOTMLS_installation_key.'/donate/?donation-source="+chk, "_blank");
378
  } else
379
  alert(chk);
469
  </div>
470
  </form>
471
  <a target="_blank" href="http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site='.urlencode(GOTMLS_siteurl).'">Google Safe Browsing Diagnostic</a>', "stuffbox").'
472
+ '.GOTMLS_box(__("Scan Status",'gotmls'), GOTMLS_scan_log(), "stuffbox").'
473
  '.$optional_box.'
474
  </div>';
475
  if (isset($GLOBALS["GOTMLS"]["tmp"]["stuffbox"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["stuffbox"])) {
523
  }
524
 
525
  function GOTMLS_View_Quarantine() {
 
526
  $entries = GOTMLS_getfiles($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]);
527
  GOTMLS_display_header();
528
+ $Q_Page = '<style>
529
+ span.GOTMLS_date {float: right; width: 120px; white-space: nowrap;}
530
+ </style>
531
  <form method="POST" target="GOTMLS_iFrame" name="GOTMLS_Form_clean"><input type="hidden" id="GOTMLS_fixing" name="GOTMLS_fixing" value="1">';
532
  if (is_array($entries) && ($key = array_search(".htaccess", $entries)))
533
  unset($entries[$key]);
535
  unset($entries[$key]);
536
  if (is_array($entries) && count($entries)) {
537
  $Q_Page .= '<p id="fix_button" style="display: none; float: right;"><input id="repair_button" type="submit" value="'.__("Restore SELECTED files from Quarantine",'gotmls').'" class="button-primary" onclick="if (confirm(\''.__("Are you sure you want to overwrite the previously cleaned files with the selected files in the Quarantine?",'gotmls').'\')) { setvalAllFiles(1); loadIframe(\'File Restoration Results\'); } else return false;" /><br /><input id="delete_button" type="submit" class="button-primary" value="'.__("Delete SELECTED files from Quarantine",'gotmls').'" style="background-color: #C33; color: #FFF; background-image: linear-gradient(to bottom, #C22, #933); border-color: #933 #933 #900; box-shadow: 0 1px 0 rgba(230, 120, 120, 0.5) inset; text-decoration: none; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); margin-top: 10px;" onclick="if (confirm(\''.__("Are you sure you want to permanently delete the selected files in the Quarantine?",'gotmls').'\')) { setvalAllFiles(2); loadIframe(\'File Deletion Results\'); } else return false;" /></p><p><b>'.__("The following items have been found to contain malicious code, they have been cleaned, and the original infected file contents have been saved here in the Quarantine. The code is safe here and you do not need to do anything further with these files.",'gotmls').'</b></p><p>'.sprintf(__("FYI - these files are found in: %s",'gotmls'), ' '.$GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).'</p>
538
+ <ul name="found_Quarantine" id="found_Quarantine" class="GOTMLS_plugin known" style="background-color: #ccc; padding: 0;"><h3>'.(count($entries)>1?'<input type="checkbox" onchange="checkAllFiles(this.checked); document.getElementById(\'fix_button\').style.display = \'block\';"> '.sprintf(__("Check all %d",'gotmls'),count($entries)):"").__(" Items in Quarantine",'gotmls').'<span class="GOTMLS_date">Date Quarantined</span><span class="GOTMLS_date">Date Infected</span></h3>';
539
  sort($entries);
540
+ $root_path = implode(GOTMLS_slash(), array_slice(GOTMLS_explode_dir(__file__), 0, (2 + intval($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"])) * -1));
541
  foreach ($entries as $entry) {
542
  $file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).$entry;
543
+ $filetime = date("Y-m-d H:i", filemtime($file));
544
+ $Q_Page .= '
545
+ <li style="margin: 4px 12px;"><span class="GOTMLS_date">'.$filetime.'</span>';
546
+ $infectime = 'Unknown';
547
  if (is_file($file) && GOTMLS_get_ext($entry) == "gotmls") {
548
  $file_date = explode(".", $entry);
549
+ if (count($file_date) > 2 && strlen($file_date[0]) == 5 && ($filetime != GOTMLS_sexagesimal($file_date[0])))
550
+ $infectime = GOTMLS_sexagesimal($file_date[0]);
551
+ elseif (count($file_date) > 3 && strlen($file_date[1]) == 5 && ($filetime != GOTMLS_sexagesimal($file_date[1])))
552
+ $infectime = GOTMLS_sexagesimal($file_date[1]);
553
+ elseif (@rename($file, GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).GOTMLS_sexagesimal($filetime).".$entry"))
554
+ $file = GOTMLS_trailingslashit($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]).GOTMLS_sexagesimal($filetime).".$entry";
555
+ $Q_Page .= '<span class="GOTMLS_date">'.$infectime.'</span><input type="checkbox" name="GOTMLS_fix[]" value="'.GOTMLS_encode($file).'" id="check_'.GOTMLS_encode($file).'" onchange="document.getElementById(\'fix_button\').style.display = \'block\';" /><img src="'.GOTMLS_images_path.'blocked.gif" height=16 width=16 alt="Q">'.preg_replace('/9000px;\&quot;>(.+?)<\/div>/', '9000px;&quot;>\1'.GOTMLS_strip4java(GOTMLS_decode($file_date[count($file_date)-2])).' (Quarantined)</div>', GOTMLS_error_link(__("View Quarantined File",'gotmls'), $file)).str_replace($root_path, "...", GOTMLS_decode($file_date[count($file_date)-2]));
556
  } else
557
  $Q_Page .= '<img src="'.GOTMLS_images_path.'threat.gif" height=16 width=16 alt="?">'.GOTMLS_error_link(__("Foreign File in Quarantine",'gotmls'), $file).$entry;
558
  $Q_Page .= "</a></li>";
563
  }
564
 
565
  function GOTMLS_settings() {
566
+ global $current_user, $wp_version, $GOTMLS_definitions_array, $GOTMLS_threat_levels, $GOTMLS_scanfiles, $GOTMLS_loop_execution_time, $GOTMLS_skip_dirs, $GOTMLS_dirs_at_depth, $GOTMLS_dir_at_depth;
567
  $GOTMLS_scan_groups = array();
568
  $dirs = GOTMLS_explode_dir(__file__);
569
+ for ($SL=0;$SL<intval($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"]);$SL++)
570
  $GOTMLS_scan_groups[] = '<b>'.implode(GOTMLS_slash(), array_slice($dirs, -1 * (3 + $SL), 1)).'</b>';
571
  if (isset($_POST["check"]))
572
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = $_POST["check"];
573
  if (isset($_POST["exclude_ext"])) {
574
  if (strlen(trim(str_replace(",","",$_POST["exclude_ext"]).' ')) > 0)
575
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"] = preg_split('/[\s]*([,]+[\s]*)+/', trim(str_replace('.', ',', $_POST["exclude_ext"])), -1, PREG_SPLIT_NO_EMPTY);
576
  else
577
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"] = array();
578
  }
579
+ if (isset($_GET["eli"]) && $_GET["eli"] == 'quarantine')
580
+ $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"];
581
  else
582
+ $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = array_merge($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"], array("gotmls"));
583
  if (isset($_POST["exclude_dir"])) {
584
  if (strlen(trim(str_replace(",","",$_POST["exclude_dir"]).' ')) > 0)
585
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"] = preg_split('/[\s]*([,]+[\s]*)+/', trim($_POST["exclude_dir"]), -1, PREG_SPLIT_NO_EMPTY);
586
  else
587
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"] = array();
588
+ for ($d=0; $d<count($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"]); $d++)
589
+ if (dirname($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"][$d]) != ".")
590
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"][$d] = str_replace("\\", "", str_replace("/", "", str_replace(dirname($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"][$d]), "", $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"][$d])));
591
  }
592
+ $GOTMLS_skip_dirs = array_merge($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"], $GOTMLS_skip_dirs);
593
+ if (isset($_POST["scan_what"]) && is_numeric($_POST["scan_what"]) && $_POST["scan_what"] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"])
594
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"] = $_POST["scan_what"];
595
+ if (isset($_POST["check_custom"]) && $_POST["check_custom"] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"])
596
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"] = stripslashes($_POST["check_custom"]);
597
+ if (isset($_POST["scan_depth"]) && is_numeric($_POST["scan_depth"]) && $_POST["scan_depth"] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"])
598
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"] = $_POST["scan_depth"];
599
+ if (isset($_POST['check_htaccess']) && is_numeric($_POST['check_htaccess']) && $_POST['check_htaccess'] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_htaccess'])
600
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_htaccess'] = $_POST['check_htaccess'];
601
+ if (isset($_POST['check_timthumb']) && is_numeric($_POST['check_timthumb']) && $_POST['check_timthumb'] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_timthumb'])
602
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_timthumb'] = $_POST['check_timthumb'];
603
+ if (isset($_POST['check_wp_login']) && is_numeric($_POST['check_wp_login']) && $_POST['check_wp_login'] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_wp_login'])
604
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_wp_login'] = $_POST['check_wp_login'];
605
+ if (isset($_POST['check_known']) && is_numeric($_POST['check_known']) && $_POST['check_known'] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_known'])
606
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_known'] = $_POST['check_known'];
607
+ if (isset($_POST['check_potential']) && is_numeric($_POST['check_potential']) && $_POST['check_potential'] != $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_potential'])
608
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['check_potential'] = $_POST['check_potential'];
609
+ if (isset($_POST['skip_quarantine']) && $_POST['skip_quarantine'])
610
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['skip_quarantine'] = $_POST['skip_quarantine'];
611
+ elseif (isset($_POST["exclude_ext"]))
612
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['skip_quarantine'] = 0;
613
+ GOTMLS_update_scan_log(array("settings" => $GLOBALS["GOTMLS"]["tmp"]["settings_array"]));
614
  $scan_opts = '';
615
  $scan_optjs = "\n<script type=\"text/javascript\">\nfunction showOnly(what) {\n";
616
  foreach ($GOTMLS_scan_groups as $mg => $GOTMLS_scan_group) {
617
  $scan_optjs .= "document.getElementById('only$mg').style.display = 'none';\n";
618
  $scan_opts .= '
619
+ <div style="position: relative; float: right; padding: 2px 0px 4px 30px;" id="scan_group_div_'.$mg.'"><input type="radio" name="scan_what" id="not-only'.$mg.'" value="'.$mg.'"'.($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"]==$mg?' checked':'').' /><a style="text-decoration: none;" href="#scan_what" onclick="showOnly(\''.$mg.'\');document.getElementById(\'not-only'.$mg.'\').checked=true;">'.$GOTMLS_scan_group.'</a><br />
620
  <div class="rounded-corners" style="position: absolute; display: none; background-color: #CCF; padding: 10px; z-index: 10;" id="only'.$mg.'"><div style="position: relative; padding: 0 40px 0 0;"><a class="rounded-corners" style="position: absolute; right: 0; margin: 0; padding: 0 4px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;" href="#scan_what" onclick="showhide(\'only'.$mg.'\');">X</a><b>'.str_replace(" ", "&nbsp;", __("Only Scan These Folders:",'gotmls')).'</b></div>';
621
  $dir = implode(GOTMLS_slash(), array_slice($dirs, 0, -1 * (2 + $mg)));
622
  $files = GOTMLS_getfiles($dir);
636
  <div style="float: left;">'.$scan_opts.$scan_optjs.'</div>
637
  <div style="float: left;" id="scanwhatfolder"></div><br style="clear: left;" />
638
  <p><b>'.__("Scan Depth:",'gotmls').'</b> ('.__("how far do you want to drill down from your starting directory?",'gotmls').')</p>
639
+ <div style="padding: 0 30px;"><input type="text" value="'.$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"].'" name="scan_depth"> ('.__("-1 is infinite depth",'gotmls').')</div><p><b>'.__("What to look for:",'gotmls').'</b></p>
640
  <div style="padding: 0 30px;">';
641
  foreach ($GOTMLS_threat_levels as $threat_level_name=>$threat_level) {
642
  $scan_opts .= '
647
  else
648
  $scan_opts .= '
649
  <a title="'.__("Download Definition Updates to Use this feature",'gotmls').'"><img src="'.GOTMLS_images_path.'blocked.gif" height=16 width=16 alt="X">';
650
+ $scan_opts .= (isset($_GET["SESSION"]) && isset($_SESSION["GOTMLS_debug"][$threat_level])?print_r($_SESSION["GOTMLS_debug"][$threat_level],1):"")."<b>$threat_level_name</b></a>";
651
  if (!isset($GOTMLS_definitions_array[$threat_level]))
652
  $scan_opts .= '<br />
653
  <div style="padding: 14px;" id="check_'.$threat_level.'_div_NA">'.__("Registration of your Installation Key is required for this feature",'gotmls').'</div>';
654
+ elseif (isset($_GET["SESSION"])) {
655
  $scan_opts .= '
656
  <div style="padding: 0 20px; position: relative; top: -18px; display: none;" id="dont_check_'.$threat_level.'"><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.'\');">X</a>';
657
  foreach ($GOTMLS_definitions_array[$threat_level] as $threat_name => $threat_regex)
658
  $scan_opts .= '<br />
659
+ <input type="checkbox" name="dont_check[]" value="'.htmlspecialchars($threat_name).'"'.(in_array($threat_name, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"])?' checked /><script>showhide("dont_check_'.$threat_level.'", true);</script>':' />').(isset($_SESSION["GOTMLS_debug"][$threat_name])?print_r($_SESSION["GOTMLS_debug"][$threat_name],1):"").$threat_name;
660
  $scan_opts .= '
661
  </div>';
662
  }
663
  $scan_opts .= '
664
  </div>';
665
  }
666
+ if (isset($_GET["SESSION"]) && isset($_SESSION["GOTMLS_debug"]['total'])) {$scan_opts .= print_r($_SESSION["GOTMLS_debug"]['total'],1); unset($_SESSION["GOTMLS_debug"]);}
667
+ if (isset($_GET["eli"])) {//still testing this option
668
+ $scan_opts .= '
669
+ <div style="padding: 10px;"><b>'.__("Custom RegExp:",'gotmls').'</b> ('.__("For very advanced users only. Do not use this without talking to Eli first. If used incorrectly you could easily break your site.",'gotmls').')<br /><input type="text" name="check_custom" style="width: 100%;" value="'.htmlspecialchars($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]).'" /></div>';
670
+ }
671
  $scan_opts .= '
672
  </div>
673
  <p>'.__("<b>Skip files with the following extentions:</b> (a comma separated list of file extentions to be excluded from the scan)",'gotmls').'</p>
674
+ <div style="padding: 0 30px;"><input type="text" name="exclude_ext" value="'.implode(",", $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"]).'" style="width: 100%;" /></div>
675
  <p>'.__("<b>Skip directories with the following names:</b> (a comma separated list of folders to be excluded from the scan)",'gotmls').'</p>
676
+ <div style="padding: 0 30px;"><input type="text" name="exclude_dir" value="'.implode(",", $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_dir"]).'" style="width: 100%;" /></div>
677
+ <p style="float: right;"><input type="submit" id="complete_scan" value="'.__("Run Complete Scan",'gotmls').'" class="button-primary" /></p>
678
+ <p><b>'.GOTMLS_Skip_Quarantine_LANGUAGE.'</b> <input type="checkbox" name="skip_quarantine" value="1"'.((isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["skip_quarantine"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["skip_quarantine"])?" checked":"").'></p></form>';
679
  @ob_start();
680
  $OB_default_handlers = array("default output handler", "zlib output compression");
681
+ $OB_handlers = @ob_list_handlers();
682
+ if (is_array($OB_handlers) && count($OB_handlers))
683
+ foreach ($OB_handlers as $OB_last_handler)
684
+ if (!in_array($OB_last_handler, $OB_default_handlers))
685
+ echo '<div class="error">'.sprintf(__("Another Plugin or Theme is using '%s' to handle output buffers. <br />This prevents actively outputing the buffer on-the-fly and will severely degrade the performance of this (and many other) Plugins. <br />Consider disabling caching and compression plugins (at least during the scanning process).",'gotmls'), $OB_last_handler).'</div>';
686
  GOTMLS_display_header();
687
  $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",__("Read/Write Errors",'gotmls')=>"errors",__("Quarantined Files",'gotmls')=>"bad"), $GOTMLS_threat_levels);
688
  echo '<script type="text/javascript">
765
  foreach ($scan_groups as $scan_name => $scan_group) {
766
  $vars .= ", $scan_group=0";
767
  if ($MAX++ == 6) {
768
+ echo "/*-->*"."/\n\tif ($scan_group > 0)\n\t\tscan_state = ' potential'; \n\telse\n\t\tscan_state = '';\n\tdivHTML += '</ul><ul style=\"text-align: left;\"><li class=\"GOTMLS_li\"><a href=\"admin.php?page=GOTMLS-View-Quarantine\" class=\"GOTMLS_plugin".((isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["skip_quarantine"]) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["skip_quarantine"])?" potential\" title=\"".GOTMLS_Skip_Quarantine_LANGUAGE:"'+scan_state+'\" title=\"".GOTMLS_View_Quarantine_LANGUAGE)."\">'+$scan_group+'&nbsp;'+($scan_group==1?('$scan_name').slice(0,-1):'$scan_name')+'</a></li>';\n/*<!--*"."/";
769
  $found = "Found ";
770
  $fix_button_js = "\n\t\tdis='block';";
771
  } else {
792
  if (isset($_REQUEST["scan_what"]) && is_numeric($_REQUEST["scan_what"]) && ($_REQUEST["scan_what"] > -1)) {
793
  if (!isset($_REQUEST["scan_type"]))
794
  $_REQUEST["scan_type"] = "Complete Scan";
795
+ update_option('GOTMLS_settings_array', $GLOBALS["GOTMLS"]["tmp"]["settings_array"]);
796
  foreach ($_POST as $name => $value) {
797
  if (substr($name, 0, 10) != 'GOTMLS_fix') {
798
  if (is_array($value)) {
812
  $scan_groups_UL .= "\n<ul name=\"found_$scan_group\" id=\"found_$scan_group\" class=\"GOTMLS_plugin $scan_group\" style=\"background-color: #ccc; display: none; padding: 0;\"><a class=\"rounded-corners\" name=\"link_$scan_group\" style=\"float: right; padding: 0 4px; margin: 5px 5px 0 30px; line-height: 16px; text-decoration: none; color: #C00; background-color: #FCC; border: solid #F00 1px;\" href=\"#found_top\" onclick=\"showhide('found_$scan_group');\">X</a><h3>$scan_name</h3>\n".($scan_group=='potential'?'<p> &nbsp; * '.__("NOTE: These are probably not malicious scripts (but it's a good place to start looking <u>IF</u> your site is infected and no Known Threats were found).",'gotmls').'</p>':($scan_group=='wp_login'?'<p> &nbsp; * '.__("NOTE: 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. For more information on brute force attack prevention and the WordPress wp-login-php file ",'gotmls').' <a target="_blank" href="http://gotmls.net/tag/wp-login-php/">'.__("read my blog",'gotmls').'</a>.</p>':'<br />')).'</ul>';
813
  if (!($dir = implode(GOTMLS_slash(), array_slice($dirs, 0, -1 * (2 + $_REQUEST["scan_what"]))))) $dir = "/";
814
  GOTMLS_update_scan_log(array("scan" => array("dir" => $dir, "start" => time(), "type" => $_REQUEST["scan_type"])));
815
+ echo GOTMLS_box('<div style="float: right;">&nbsp;('.$GLOBALS["GOTMLS"]["log"]["scan"]["dir"].')&nbsp;</div>'.__("Scan Details:",'gotmls'), $scan_groups_UL);
816
+ $no_flush_LANGUAGE = __("Not flushing OB Handlers: %s",'gotmls');
817
+ if (isset($_REQUEST["no_ob_end_flush"]))
818
+ echo '<div class="error">'.sprintf($no_flush_LANGUAGE, print_r(ob_list_handlers(), 1))."</div>\n";
819
+ elseif (is_array($OB_handlers) && count($OB_handlers)) {
820
+ // $GOTMLS_OB_handlers = get_option("GOTMLS_OB_handlers", array());
821
+ foreach (array_reverse($OB_handlers) as $OB_handler) {
822
+ if (isset($GOTMLS_OB_handlers[$OB_handler]) && $GOTMLS_OB_handlers[$OB_handler] == "no_end_flush")
823
+ echo '<div class="error">'.sprintf($no_flush_LANGUAGE, $OB_handler)."</div>\n";
824
+ elseif (in_array($OB_handler, $OB_default_handlers)) {
825
+ // $GOTMLS_OB_handlers[$OB_handler] = "no_end_flush";
826
+ // update_option("GOTMLS_OB_handlers", $GOTMLS_OB_handlers);
827
+ @ob_end_flush();
828
+ // $GOTMLS_OB_handlers[$OB_handler] = "ob_end_flush";
829
+ // update_option("GOTMLS_OB_handlers", $GOTMLS_OB_handlers);
830
+ }
831
+ }
832
+ }
833
  @ob_start();
834
  if ($_REQUEST["scan_type"] == "Quick Scan")
835
  $li_js = "\nfunction testComplete() {\n\tif (percent != 100)\n\t\talert('".__("The Quick Scan was unable to finish because of a shortage of memory or a problem accessing a file. Please try using the Complete Scan, it is slower but it will handle these errors better and continue scanning the rest of the files.",'gotmls')."');\n}\nwindow.onload=testComplete;\n</script>\n<script type=\"text/javascript\">";
837
  if (is_dir($dir)) {
838
  $GOTMLS_dirs_at_depth[0] = 1;
839
  $GOTMLS_dir_at_depth[0] = 0;
840
+ if (!(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]['skip_quarantine']) && $GLOBALS["GOTMLS"]["tmp"]["settings_array"]['skip_quarantine'])) {
841
  $GOTMLS_dirs_at_depth[0]++;
842
  GOTMLS_readdir($GLOBALS["GOTMLS"]["tmp"]["quarantine_dir"]);
843
  }
904
  }
905
  echo "/*-->*"."/\n</script>";
906
  } else {
 
907
  $patch_attr = array(
908
  array(
909
  "icon" => "blocked",
925
  )
926
  );
927
  $patch_status = 0;
928
+ $patch_found = -1;
929
  $patch_action = "";
930
+ $find = "#if\s*\(\s*file_exists\((.+?)(safe-load|wp-login)\.php'\)\)\s*require(_once)?\((.+?)(safe-load|wp-login)\.php'\);#";
931
+ $head = str_replace(array('#', '\\(', '\\)', '(_once)?', ')\\.', '\\s*', '(.+?)(', '|'), array(' ', '(', ')', '_once', '.', ' ', '\''.dirname(__FILE__).'/', '/'), $find);
932
+ if (file_exists(dirname(__FILE__).'/../../../wp-config.php') && ($config = @file_get_contents(dirname(__FILE__).'/../../../wp-config.php')) && strlen($config) && ($patch_found = preg_match($find, $config))) {
933
+ if (strpos($config, $head)) {
934
+ if (isset($_POST["GOTMLS_patching"]) && GOTMLS_file_put_contents(dirname(__FILE__).'/../../../wp-config.php', preg_replace('#<\?[ph\s]+(//.*\s*)*\?>#i', "", preg_replace($find, "", $config))))
935
+ $patch_action .= '<div class="error">'.__("Removed Brute-Force Protection",'gotmls').'</div>';
936
+ else
937
+ $patch_status = 1;
938
+ } else {
939
+ if (isset($_POST["GOTMLS_patching"]) && GOTMLS_file_put_contents(dirname(__FILE__).'/../../../wp-config.php', preg_replace($find, "$head", $config))) {
940
+ $patch_action .= '<div class="updated">'.__("Upgraded Brute-Force Protection",'gotmls').'</div>';
941
+ $patch_status = 1;
942
+ } else
943
+ $patch_status = 2;
944
+ }
945
+ } elseif (isset($_POST["GOTMLS_patching"]) && strlen($config) && ($patch_found == 0) && GOTMLS_file_put_contents(dirname(__FILE__).'/../../../wp-config.php', "<?php$head// Load Brute-Force Protection by GOTMLS.NET before the WordPress bootstrap. ?>$config")) {
946
  $patch_action .= '<div class="updated">'.__("Installed Brute-Force Protection",'gotmls').'</div>';
947
  $patch_status = 1;
948
  }
949
+ if (file_exists(dirname(__FILE__).'/../../../wp-login.php') && ($login = @file_get_contents(dirname(__FILE__).'/../../../wp-login.php')) && strlen($login) && (preg_match($find, $login))) {
950
+ if (isset($_POST["GOTMLS_patching"]) && ($source = wp_remote_get("http://core.svn.wordpress.org/tags/".$wp_version.'/wp-login.php')) && is_array($source) && isset($source["body"]) && (strlen($source["body"]) > 500) && GOTMLS_file_put_contents(dirname(__FILE__).'/../../../wp-login.php', $source["body"]))
951
  $patch_action .= '<div class="updated">'.__("Removed Old Brute-Force Login Patch",'gotmls').'</div>';
952
  else
953
  $patch_status = 2;
954
  }
955
+ $js = urlencode("if(stopSettingSession) clearTimeout(stopSettingSession); if(stopCheckingSession) clearTimeout(stopCheckingSession); showhide('GOTMLS_patch_searching', true); showhide('GOTMLS_patch_searching'); showhide('GOTMLS_patch_button', true);");
956
  $sec_opts = '
957
  <p><img src="'.GOTMLS_images_path.'checked.gif"><b>Revolution Slider Exploit Protection (Automatically Enabled)</b></p><div style="padding: 0 30px;"> &nbsp; * '.__("NOTE: This Protection in automatically activated with this plugin because of the widespread attack on WordPress that are affecting so many site right now. It is still recommended that you make sure to upgrade and older versions of the Revolution Slider plugin, especially those included in some themes that will not update automatically. Even if you do not have Revolution Slider on your site it still can't hurt to have this protection installed.",'gotmls').'</div><hr />
958
  '.$patch_action.'
959
+ <form method="POST" name="GOTMLS_Form_patch"><p style="float: right;"><input type="submit" value="'.$patch_attr[$patch_status]["action"].'" style="'.($patch_status?'">':' display: none;" id="GOTMLS_patch_button"><div id="GOTMLS_patch_searching" style="float: right;">'.__("Checking for session compatability ...",'gotmls').' <img src="'.GOTMLS_images_path.'wait.gif" height=16 width=16 alt="Wait..." /></div>').'<input type="hidden" name="GOTMLS_patching" value="1"></p><p><img src="'.GOTMLS_images_path.$patch_attr[$patch_status]["icon"].'.gif"><b>Brute-force Protection '.$patch_attr[$patch_status]["status"].'</b></p><div style="padding: 0 30px;"> &nbsp; * '.$patch_attr[$patch_status]["language"].__(" For more information on Brute-Force attack prevention and the WordPress wp-login-php file ",'gotmls').' <a target="_blank" href="http://gotmls.net/tag/wp-login-php/">'.__("read my blog",'gotmls').'</a>.</div></form>
960
+ <script type="text/javascript">
961
+ stopSettingSession = checkupdateserver("'.GOTMLS_images_path.'../safe-load/session.php?js='.$js.'", "GOTMLS_patch_button");
962
+ stopCheckingSession = checkupdateserver("'.GOTMLS_images_path.'../safe-load/session.php?js='.$js.'", "GOTMLS_patch_button");
963
+ </script>';
964
  $admin_notice = "";
965
  if ($current_user->user_login == "admin") {
966
+ $admin_notice .= '<hr />
967
+ <form method="POST" name="GOTMLS_Form_admin"><p><img src="'.GOTMLS_images_path.'threat.gif"><b>Admin Notice</b></p><div style="padding: 0 30px;">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.</div></form>';
968
  }
969
+ echo GOTMLS_box("Firewall Options", $sec_opts.$admin_notice);
970
  }
971
+ echo "\n</div></div></div>";
972
  }
973
 
974
  function GOTMLS_set_plugin_action_links($links_array, $plugin_file) {
984
  }
985
 
986
  function GOTMLS_init() {
987
+ global $GOTMLS_update_home, $GOTMLS_onLoad, $GOTMLS_threat_levels, $wpdb, $GOTMLS_threats_found, $GOTMLS_definitions_versions, $GOTMLS_definitions_array, $GOTMLS_file_contents;
988
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"]))
989
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_what"] = 2;
990
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"]))
991
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_depth"] = -1;
992
  if (isset($_REQUEST["scan_type"]) && $_REQUEST["scan_type"] == "Quick Scan") {
993
  if (!isset($_REQUEST["scan_what"])) $_REQUEST["scan_what"] = 2;
994
  if (!isset($_REQUEST["scan_depth"]))
995
  $_REQUEST["scan_depth"] = 2;
996
  if (!(isset($_POST["scan_only"]) && is_array($_POST["scan_only"])))
997
  $_POST["scan_only"] = array("","wp-content/plugins","wp-content/themes");
998
+ }//$GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"] = stripslashes($_POST["check_custom"]);
999
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"]))
1000
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check_custom"] = "";
1001
+ if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"]) && is_numeric($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"]))
1002
+ $scan_level = intval($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"]);
1003
  else
1004
  $scan_level = count(explode('/', trailingslashit(get_option("siteurl")))) - 1;
1005
+ if (!(isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"])))
1006
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"] = array();
1007
  if (isset($_REQUEST["dont_check"]) && is_array($_REQUEST["dont_check"]) && count($_REQUEST["dont_check"]))
1008
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"] = $_REQUEST["dont_check"];
1009
  if ($array = get_option('GOTMLS_definitions_array')) {
1010
  if (is_array($array))
1011
  $GOTMLS_definitions_array = $array;
1012
  } else {
1013
  $wpdb->query("DELETE FROM $wpdb->options WHERE `option_name` LIKE 'GOTMLS_known_%' OR `option_name` LIKE 'GOTMLS_definitions_array_%'");
1014
+ array_walk($GLOBALS["GOTMLS"]["tmp"]["settings_array"], "GOTMLS_reset_settings");
1015
  }
1016
  foreach ($GOTMLS_definitions_array as $threat_level=>$definition_names)
1017
  foreach ($definition_names as $definition_name=>$definition_version)
1028
  $GOTMLS_definitions_array = GOTMLS_array_replace_recursive($GOTMLS_definitions_array, $GOTnew_definitions);
1029
  if (file_exists(GOTMLS_plugin_path.'definitions_update.txt'))
1030
  @unlink(GOTMLS_plugin_path.'definitions_update.txt');
1031
+ if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"]))
1032
+ unset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"]);
1033
  update_option('GOTMLS_definitions_array', $GOTMLS_definitions_array);
1034
  foreach ($GOTMLS_definitions_array as $threat_level=>$definition_names)
1035
  foreach ($definition_names as $definition_name=>$definition_version)
1039
  }
1040
  asort($GOTMLS_definitions_versions);
1041
  if (isset($_REQUEST["check"]) && is_array($_REQUEST["check"]))
1042
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = $_REQUEST["check"];
1043
  /* $threat_names = array_keys($GOTMLS_definitions_array["known"]);
1044
  foreach ($threat_names as $threat_name) {
1045
  if (isset($GOTMLS_definitions_array["known"][$threat_name]) && is_array($GOTMLS_definitions_array["known"][$threat_name]) && count($GOTMLS_definitions_array["known"][$threat_name]) > 1) {
1046
  if ($GOTMLS_definitions_array["known"][$threat_name][0] > $GOTMLS_definitions_version)
1047
  $GOTMLS_definitions_version = $GOTMLS_definitions_array["known"][$threat_name][0];
1048
+ if (!(count($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"]) && in_array($threat_name, $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["dont_check"]))) {
1049
  $GOTMLS_threat_levels[$threat_name] = count($GOTMLS_definitions_array["known"][$threat_name]);
1050
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"]) && $GOTMLS_threat_levels[$threat_name] > 2)
1051
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = "known";
1052
  }
1053
  }
1054
  }*/
1055
+ if (!isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"]))
1056
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["check"] = $GOTMLS_threat_levels;
1057
  if (isset($_POST["GOTMLS_fix"]) && !is_array($_POST["GOTMLS_fix"]))
1058
  $_POST["GOTMLS_fix"] = array($_POST["GOTMLS_fix"]);
1059
+ GOTMLS_update_scan_log(array("settings" => $GLOBALS["GOTMLS"]["tmp"]["settings_array"]));
1060
  if (isset($_POST['GOTMLS_whitelist']) && isset($_POST['GOTMLS_chksum'])) {
1061
  $file = GOTMLS_decode($_POST['GOTMLS_whitelist']);
1062
  $chksum = explode("O", $_POST['GOTMLS_chksum']."O");
1076
  if (is_dir($file)) {
1077
  @error_reporting(0);
1078
  @header("Content-type: text/javascript");
1079
+ if (isset($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"]) && is_array($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"]))
1080
+ $GLOBALS["GOTMLS"]["tmp"]["skip_ext"] = $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["exclude_ext"];
1081
  @ob_start();
1082
  echo GOTMLS_scandir($file);
1083
  if (@ob_get_level()) {
1139
  }
1140
  }
1141
  window.parent.showhide("GOTMLS_iFrame", true);
1142
+ </script><table style="top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;"><tr><td style="width: 100%"><form style="margin: 0;" method="post"'.(is_file($clean_file)?' onsubmit="return confirm(\''.__("Are you sure this file is not infected and you want to ignore it in future scans?",'gotmls').'\');"><input type="hidden" name="GOTMLS_whitelist" value="'.GOTMLS_encode($clean_file).'"><input type="hidden" name="GOTMLS_chksum" value="'.md5($GOTMLS_file_contents).'O'.GOTMLS_installation_key.'"><input type="submit" value="Whitelist this file" style="float: right;">':(is_file(GOTMLS_quarantine($clean_file))?' >':'>')).'</form><div id="fileperms" class="shadowed-box rounded-corners" style="display: none; position: absolute; left: 8px; top: 29px; background-color: #ccc; border: medium solid #C00; box-shadow: -3px 3px 3px #666; border-radius: 10px; padding: 10px;"><b>File Details</b><br />encoding:'.mb_detect_encoding($GOTMLS_file_contents).'<br />permissions:'.GOTMLS_fileperms($file).'<br />modified:'.date(" Y-m-d H:i:s ", filemtime($file)).'<br />changed:'.date(" Y-m-d H:i:s ", filectime($file)).'</div><div style="overflow: auto;"><span onmouseover="document.getElementById(\'fileperms\').style.display=\'block\';" onmouseout="document.getElementById(\'fileperms\').style.display=\'none\';">'.__("Potential threats in file:",'gotmls').'</span> ('.$fa.' )</div></td></tr><tr><td style="height: 100%"><textarea id="ta_file" style="width: 100%; height: 100%">'.htmlentities(str_replace("\r", "", $GOTMLS_file_contents)).'</textarea></td></tr></table>');
1143
  }
1144
  }
1145
  } elseif (isset($_POST['GOTMLS_fix']) && is_array($_POST['GOTMLS_fix'])) {
1159
  if (isset($_POST["scan_level"]) && is_numeric($_POST["scan_level"]))
1160
  $scan_level = intval($_POST["scan_level"]);
1161
  if (isset($scan_level) && is_numeric($scan_level))
1162
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"] = intval($scan_level);
1163
  else
1164
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["scan_level"] = count(explode('/', trailingslashit(get_option("siteurl")))) - 1;
1165
  if (isset($_GET["GOTMLS_x"]) || isset($_GET["GOTMLS_y"]) || isset($_GET["GOTMLS_h"]) || isset($_GET["GOTMLS_w"])) {
1166
  if (isset($_GET["GOTMLS_x"]))
1167
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][0] = $_GET["GOTMLS_x"];
1168
  if (isset($_GET["GOTMLS_y"]))
1169
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][1] = $_GET["GOTMLS_y"];
1170
  if (isset($_GET["GOTMLS_h"]))
1171
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][2] = $_GET["GOTMLS_h"];
1172
  if (isset($_GET["GOTMLS_w"]))
1173
+ $GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"][3] = $_GET["GOTMLS_w"];
1174
+ $_GET["GOTMLS_msg"] = "New window position saved. ";//.print_r($GLOBALS["GOTMLS"]["tmp"]["settings_array"]["msg_position"], true);
1175
  }
1176
+ update_option('GOTMLS_settings_array', $GLOBALS["GOTMLS"]["tmp"]["settings_array"]);
1177
  if (isset($_GET["GOTMLS_msg"]))
1178
  die('<body style="margin: 0; padding: 0;">'.$_GET["GOTMLS_msg"].'</body>');
 
1179
  }
1180
 
1181
  if (function_exists("is_admin") && is_admin() && ((isset($_POST['GOTMLS_whitelist']) && isset($_POST['GOTMLS_chksum'])) || (isset($_GET["GOTMLS_scan"]) && is_dir(GOTMLS_decode($_GET["GOTMLS_scan"]))))) {
languages/gotmls.pot CHANGED
@@ -8,7 +8,7 @@ msgid ""
8
  msgstr ""
9
  "Project-Id-Version: GOTMLS\n"
10
  "Report-Msgid-Bugs-To: eli@gotmls.net\n"
11
- "POT-Creation-Date: 2014-12-20 15:57+0900\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -48,13 +48,28 @@ msgstr ""
48
  msgid "Menu Placement"
49
  msgstr ""
50
 
 
 
 
51
  #, php-format
52
  msgid "Upgrade to %s now!"
53
  msgstr ""
54
 
 
 
 
 
 
 
 
 
 
55
  msgid "Searching for updates ..."
56
  msgstr ""
57
 
 
 
 
58
  msgid "Download new definitions!"
59
  msgstr ""
60
 
@@ -73,6 +88,9 @@ msgstr ""
73
  msgid "Plugin Installation Key:"
74
  msgstr ""
75
 
 
 
 
76
  msgid "First Name is a required field!"
77
  msgstr ""
78
 
@@ -97,6 +115,9 @@ msgstr ""
97
  msgid "Make a Donation with PayPal"
98
  msgstr ""
99
 
 
 
 
100
  msgid "Restore SELECTED files from Quarantine"
101
  msgstr ""
102
 
@@ -171,6 +192,9 @@ msgstr ""
171
  msgid "<b>Skip directories with the following names:</b> (a comma separated list of folders to be excluded from the scan)"
172
  msgstr ""
173
 
 
 
 
174
  #, php-format
175
  msgid "Another Plugin or Theme is using '%s' to handle output buffers. <br />This prevents actively outputing the buffer on-the-fly and will severely degrade the performance of this (and many other) Plugins. <br />Consider disabling caching and compression plugins (at least during the scanning process)."
176
  msgstr ""
@@ -217,6 +241,13 @@ msgstr ""
217
  msgid "read my blog"
218
  msgstr ""
219
 
 
 
 
 
 
 
 
220
  msgid "The Quick Scan was unable to finish because of a shortage of memory or a problem accessing a file. Please try using the Complete Scan, it is slower but it will handle these errors better and continue scanning the rest of the files."
221
  msgstr ""
222
 
@@ -238,6 +269,9 @@ msgstr ""
238
  msgid "Removed Brute-Force Protection"
239
  msgstr ""
240
 
 
 
 
241
  msgid "Installed Brute-Force Protection"
242
  msgstr ""
243
 
@@ -247,6 +281,9 @@ msgstr ""
247
  msgid "NOTE: This Protection in automatically activated with this plugin because of the widespread attack on WordPress that are affecting so many site right now. It is still recommended that you make sure to upgrade and older versions of the Revolution Slider plugin, especially those included in some themes that will not update automatically. Even if you do not have Revolution Slider on your site it still can't hurt to have this protection installed."
248
  msgstr ""
249
 
 
 
 
250
  msgid " For more information on Brute-Force attack prevention and the WordPress wp-login-php file "
251
  msgstr ""
252
 
@@ -280,24 +317,18 @@ msgstr ""
280
  msgid "Done!"
281
  msgstr ""
282
 
283
- msgid "<p>This is a help text for 'GOTMLS-settings' page.</p>"
284
  msgstr ""
285
 
286
  msgid "Failed to list files in directory!"
287
  msgstr ""
288
 
289
- msgid "Run Complete Scan"
290
- msgstr ""
291
-
292
  msgid "Run Quick Scan"
293
  msgstr ""
294
 
295
  msgid "View Quarantine"
296
  msgstr ""
297
 
298
- msgid "Tested your site. It appears we didn't break anything"
299
- msgstr ""
300
-
301
  #, php-format
302
  msgid "This Plugin requires WordPress version %s or higher"
303
  msgstr ""
@@ -308,30 +339,9 @@ msgstr ""
308
  msgid "Loading, Please Wait ..."
309
  msgstr ""
310
 
311
- msgid "If this is taking too long, click here."
312
- msgstr ""
313
-
314
- msgid "Could not find server!"
315
- msgstr ""
316
-
317
- msgid "Plugin Updates for WP"
318
- msgstr ""
319
-
320
- msgid "Definition Updates"
321
- msgstr ""
322
-
323
- msgid "Please make a donation for the use of this wonderful feature!"
324
- msgstr ""
325
-
326
  msgid "Automatically Fix SELECTED Files Now"
327
  msgstr ""
328
 
329
- msgid "Scan Details:"
330
- msgstr ""
331
-
332
- msgid "Scan Status"
333
- msgstr ""
334
-
335
  msgid "htaccess Threats"
336
  msgstr ""
337
 
@@ -384,6 +394,9 @@ msgstr ""
384
  msgid "Scanned %s"
385
  msgstr ""
386
 
 
 
 
387
  msgid "Skipped because of file extention!"
388
  msgstr ""
389
 
8
  msgstr ""
9
  "Project-Id-Version: GOTMLS\n"
10
  "Report-Msgid-Bugs-To: eli@gotmls.net\n"
11
+ "POT-Creation-Date: 2014-12-30 18:56+0900\n"
12
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
48
  msgid "Menu Placement"
49
  msgstr ""
50
 
51
+ msgid "Tested your site. It appears we didn't break anything"
52
+ msgstr ""
53
+
54
  #, php-format
55
  msgid "Upgrade to %s now!"
56
  msgstr ""
57
 
58
+ msgid "If this is taking too long, click here."
59
+ msgstr ""
60
+
61
+ msgid "No response from server!"
62
+ msgstr ""
63
+
64
+ msgid "Plugin Updates for WP"
65
+ msgstr ""
66
+
67
  msgid "Searching for updates ..."
68
  msgstr ""
69
 
70
+ msgid "Definition Updates"
71
+ msgstr ""
72
+
73
  msgid "Download new definitions!"
74
  msgstr ""
75
 
88
  msgid "Plugin Installation Key:"
89
  msgstr ""
90
 
91
+ msgid "Please make a donation for the use of this wonderful feature!"
92
+ msgstr ""
93
+
94
  msgid "First Name is a required field!"
95
  msgstr ""
96
 
115
  msgid "Make a Donation with PayPal"
116
  msgstr ""
117
 
118
+ msgid "Scan Status"
119
+ msgstr ""
120
+
121
  msgid "Restore SELECTED files from Quarantine"
122
  msgstr ""
123
 
192
  msgid "<b>Skip directories with the following names:</b> (a comma separated list of folders to be excluded from the scan)"
193
  msgstr ""
194
 
195
+ msgid "Run Complete Scan"
196
+ msgstr ""
197
+
198
  #, php-format
199
  msgid "Another Plugin or Theme is using '%s' to handle output buffers. <br />This prevents actively outputing the buffer on-the-fly and will severely degrade the performance of this (and many other) Plugins. <br />Consider disabling caching and compression plugins (at least during the scanning process)."
200
  msgstr ""
241
  msgid "read my blog"
242
  msgstr ""
243
 
244
+ msgid "Scan Details:"
245
+ msgstr ""
246
+
247
+ #, php-format
248
+ msgid "Not flushing OB Handlers: %s"
249
+ msgstr ""
250
+
251
  msgid "The Quick Scan was unable to finish because of a shortage of memory or a problem accessing a file. Please try using the Complete Scan, it is slower but it will handle these errors better and continue scanning the rest of the files."
252
  msgstr ""
253
 
269
  msgid "Removed Brute-Force Protection"
270
  msgstr ""
271
 
272
+ msgid "Upgraded Brute-Force Protection"
273
+ msgstr ""
274
+
275
  msgid "Installed Brute-Force Protection"
276
  msgstr ""
277
 
281
  msgid "NOTE: This Protection in automatically activated with this plugin because of the widespread attack on WordPress that are affecting so many site right now. It is still recommended that you make sure to upgrade and older versions of the Revolution Slider plugin, especially those included in some themes that will not update automatically. Even if you do not have Revolution Slider on your site it still can't hurt to have this protection installed."
282
  msgstr ""
283
 
284
+ msgid "Checking for session compatability ..."
285
+ msgstr ""
286
+
287
  msgid " For more information on Brute-Force attack prevention and the WordPress wp-login-php file "
288
  msgstr ""
289
 
317
  msgid "Done!"
318
  msgstr ""
319
 
320
+ msgid "Skip scanning the Quarantine:"
321
  msgstr ""
322
 
323
  msgid "Failed to list files in directory!"
324
  msgstr ""
325
 
 
 
 
326
  msgid "Run Quick Scan"
327
  msgstr ""
328
 
329
  msgid "View Quarantine"
330
  msgstr ""
331
 
 
 
 
332
  #, php-format
333
  msgid "This Plugin requires WordPress version %s or higher"
334
  msgstr ""
339
  msgid "Loading, Please Wait ..."
340
  msgstr ""
341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  msgid "Automatically Fix SELECTED Files Now"
343
  msgstr ""
344
 
 
 
 
 
 
 
345
  msgid "htaccess Threats"
346
  msgstr ""
347
 
394
  msgid "Scanned %s"
395
  msgstr ""
396
 
397
+ msgid "Examine File"
398
+ msgstr ""
399
+
400
  msgid "Skipped because of file extention!"
401
  msgstr ""
402
 
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author URI: http://wordpress.ieonly.com/category/my-plugins/anti-malware/
5
  Contributors: scheeeli, gotmls
6
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
7
  Tags: anti-malware, security, plugin, scan, automatic, repair, remove, malware, virus, threat, hacked, malicious, scripts, infection, timthumb, exploit, block, brute-force, wp-login, patch, antimalware, revslider, Revolution Slider
8
- Version: 4.14.52
9
- Stable tag: 4.14.52
10
  Requires at least: 3.3
11
  Tested up to: 4.1
12
 
@@ -24,7 +24,7 @@ This Anti-Malware plugin searches for Malware and other Virus like threats and s
24
  * Run a Complete Scan from the Settings Page.
25
  * Download Definition Updates to protect against new threats.
26
 
27
- Updated December 20th
28
 
29
  Register this plugin at [GOTMLS.NET](http://gotmls.net/) and get access to new definitions of "Known Threats" and added features like Automatic Removal, plus patches for specific security vulnerabilities like old versions of timthumb. Updated definition files can be downloaded automatically within the admin once your Key is registered. Otherwise, this plugin just scans for "Potential Threats" and leaves it up to you to identify and remove the malicious ones.
30
 
@@ -89,6 +89,11 @@ sucuri.net caches their scan results and will not refresh the scan until you cli
89
 
90
  == Changelog ==
91
 
 
 
 
 
 
92
  = 4.14.52 =
93
  * Added exception for the social.png files to the skip files by extension list.
94
  * Fixed removal of Known Threats from files in the Quarantine directory.
@@ -277,6 +282,9 @@ sucuri.net caches their scan results and will not refresh the scan until you cli
277
 
278
  == Upgrade Notice ==
279
 
 
 
 
280
  = 4.14.52 =
281
  Added exception for the social.png files to the skip files by extension list, and fixed removal of Known Threats from files in the Quarantine directory.
282
 
5
  Contributors: scheeeli, gotmls
6
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZHD8QHZ2E7PE
7
  Tags: anti-malware, security, plugin, scan, automatic, repair, remove, malware, virus, threat, hacked, malicious, scripts, infection, timthumb, exploit, block, brute-force, wp-login, patch, antimalware, revslider, Revolution Slider
8
+ Version: 4.14.53
9
+ Stable tag: 4.14.53
10
  Requires at least: 3.3
11
  Tested up to: 4.1
12
 
24
  * Run a Complete Scan from the Settings Page.
25
  * Download Definition Updates to protect against new threats.
26
 
27
+ Updated December 30th
28
 
29
  Register this plugin at [GOTMLS.NET](http://gotmls.net/) and get access to new definitions of "Known Threats" and added features like Automatic Removal, plus patches for specific security vulnerabilities like old versions of timthumb. Updated definition files can be downloaded automatically within the admin once your Key is registered. Otherwise, this plugin just scans for "Potential Threats" and leaves it up to you to identify and remove the malicious ones.
30
 
89
 
90
  == Changelog ==
91
 
92
+ = 4.14.53 =
93
+ * Added option to skip scanning the Quaratined files.
94
+ * Updated Brute-Force patch to fix the problem of being included more that once.
95
+ * Fixed a few minor bugs (better window positioning and css, cleaner results page, updated new help tab, etc.).
96
+
97
  = 4.14.52 =
98
  * Added exception for the social.png files to the skip files by extension list.
99
  * Fixed removal of Known Threats from files in the Quarantine directory.
282
 
283
  == Upgrade Notice ==
284
 
285
+ = 4.14.53 =
286
+ Added option to skip scanning the Quaratine, updated Brute-Force patch, and fixed a few minor bugs.
287
+
288
  = 4.14.52 =
289
  Added exception for the social.png files to the skip files by extension list, and fixed removal of Known Threats from files in the Quarantine directory.
290
 
safe-load/index.php CHANGED
@@ -4,11 +4,13 @@
4
  * @package GOTMLS
5
  */
6
 
7
- if (!(isset($_SESSION["GOTMLS_detected_attacks"]) && $_SESSION["GOTMLS_detected_attacks"]))
8
- $_SESSION["GOTMLS_detected_attacks"] = '&attack[]='.strtolower($_SERVER["SCRIPT_FILENAME"]);
 
 
9
  foreach (array("REMOTE_ADDR", "HTTP_HOST", "REQUEST_URI", "HTTP_REFERER", "HTTP_USER_AGENT") as $var)
10
  $_SESSION["GOTMLS_detected_attacks"] .= (isset($_SERVER[$var])?"&SERVER_$var=".urlencode($_SERVER[$var]):"");
11
  foreach (array("log") as $var)
12
  $_SESSION["GOTMLS_detected_attacks"] .= (isset($_POST[$var])?"&POST_$var=".urlencode($_POST[$var]):"");
13
- header("location: http://safe-load.gotmls.net/report.php?ver=4.14.52".$_SESSION["GOTMLS_detected_attacks"]);
14
  die();
4
  * @package GOTMLS
5
  */
6
 
7
+ if (!(isset($_SESSION["GOTMLS_detected_attacks"]) && $_SESSION["GOTMLS_detected_attacks"])) {
8
+ $file = (isset($_SERVER["SCRIPT_FILENAME"])?$_SERVER["SCRIPT_FILENAME"]:__FILE__);
9
+ $_SESSION["GOTMLS_detected_attacks"] = '&attack[]='.strtolower((isset($_SERVER["DOCUMENT_ROOT"]) && strlen($_SERVER["DOCUMENT_ROOT"]) < strlen($file))?substr($file, strlen($_SERVER["DOCUMENT_ROOT"])):basename($file));
10
+ }
11
  foreach (array("REMOTE_ADDR", "HTTP_HOST", "REQUEST_URI", "HTTP_REFERER", "HTTP_USER_AGENT") as $var)
12
  $_SESSION["GOTMLS_detected_attacks"] .= (isset($_SERVER[$var])?"&SERVER_$var=".urlencode($_SERVER[$var]):"");
13
  foreach (array("log") as $var)
14
  $_SESSION["GOTMLS_detected_attacks"] .= (isset($_POST[$var])?"&POST_$var=".urlencode($_POST[$var]):"");
15
+ header("location: http://safe-load.gotmls.net/report.php?ver=4.14.53".$_SESSION["GOTMLS_detected_attacks"]);
16
  die();
safe-load/session.php CHANGED
@@ -12,4 +12,14 @@ if (isset($_SESSION["GOTMLS_SESSION_TIME"]))
12
  $_SESSION["GOTMLS_SESSION_LAST"] = $_SESSION["GOTMLS_SESSION_TIME"];
13
  else
14
  $_SESSION["GOTMLS_SESSION_LAST"] = 0;
15
- $_SESSION["GOTMLS_SESSION_TIME"] = GOTMLS_SESSION_TIME;
 
 
 
 
 
 
 
 
 
 
12
  $_SESSION["GOTMLS_SESSION_LAST"] = $_SESSION["GOTMLS_SESSION_TIME"];
13
  else
14
  $_SESSION["GOTMLS_SESSION_LAST"] = 0;
15
+ $_SESSION["GOTMLS_SESSION_TIME"] = GOTMLS_SESSION_TIME;
16
+ if (isset($_SERVER["SCRIPT_FILENAME"]) && strlen($_SERVER["SCRIPT_FILENAME"]) > strlen(basename(__FILE__)) && substr(__FILE__, -1 * strlen($_SERVER["SCRIPT_FILENAME"])) == substr($_SERVER["SCRIPT_FILENAME"], -1 * strlen(__FILE__)) && isset($_GET) && is_array($_GET) && count($_GET) == 1) {
17
+ foreach ($_GET as $key => $val) {
18
+ if (isset($_SESSION["$key"]))
19
+ echo $_SESSION["$key"];
20
+ if (get_magic_quotes_gpc())
21
+ $_SESSION["$key"] = stripslashes($val);
22
+ else
23
+ $_SESSION["$key"] = $val;
24
+ }
25
+ }
safe-load/wp-login.php CHANGED
@@ -7,37 +7,39 @@
7
  include(dirname(__FILE__)."/session.php");
8
  if (!defined(GOTMLS_REQUEST_METHOD))
9
  define("GOTMLS_REQUEST_METHOD", (isset($_SERVER["REQUEST_METHOD"])?strtoupper($_SERVER["REQUEST_METHOD"]):"none"));
10
- function GOTMLS_update_log_file($dont_force_write = true) {
11
- if (!defined(GOTMLS_SESSION_FILE))
12
- define("GOTMLS_SESSION_FILE", dirname(__FILE__)."/_SESSION/index.php");
13
- if (is_file(GOTMLS_SESSION_FILE))
14
- include(GOTMLS_SESSION_FILE);
15
- else {
16
- if (!is_dir(dirname(GOTMLS_SESSION_FILE)))
17
- @mkdir(dirname(GOTMLS_SESSION_FILE));
18
- if (is_dir(dirname(GOTMLS_SESSION_FILE)))
19
- if (!is_file(GOTMLS_SESSION_FILE))
20
- if (file_put_contents(GOTMLS_SESSION_FILE, "<?php if (!defined(GOTMLS_INSTALL_TIME)) define('GOTMLS_INSTALL_TIME', '".GOTMLS_SESSION_TIME."');"))
21
- include(GOTMLS_SESSION_FILE);
22
- }
23
- if (!defined(GOTMLS_INSTALL_TIME))
24
- return false;
25
- else {
26
- $GOTMLS_LOGIN_ARRAY = array("ADDR"=>(isset($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:"REMOTE_ADDR"), "AGENT"=>(isset($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:"HTTP_USER_AGENT"), "TIME"=>GOTMLS_INSTALL_TIME);
27
- $GOTMLS_LOGIN_KEY = md5(maybe_serialize($GOTMLS_LOGIN_ARRAY));
28
- if (!defined(GOTMLS_LOG_FILE))
29
- define("GOTMLS_LOG_FILE", dirname(GOTMLS_SESSION_FILE)."/.GOTMLS.$GOTMLS_LOGIN_KEY.php");
30
- if (is_file(GOTMLS_LOG_FILE))
31
- include(GOTMLS_LOG_FILE);
32
- if (GOTMLS_REQUEST_METHOD == "POST")
33
- $GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY][GOTMLS_REQUEST_METHOD][GOTMLS_INSTALL_TIME] = $GOTMLS_LOGIN_ARRAY;
34
- else
35
- $GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY][GOTMLS_REQUEST_METHOD] = GOTMLS_INSTALL_TIME;
36
- @file_put_contents(GOTMLS_LOG_FILE, '<?php $GLOBALS["GOTMLS"]["logins"]["'.$GOTMLS_LOGIN_KEY.'"]=maybe_unserialize(base64_decode("'.base64_encode(maybe_serialize($GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY])).'"));');
37
- if (isset($GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY]) && is_array($GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY]))
38
- return $GOTMLS_LOGIN_KEY;
39
- else
40
- return 0;
 
 
41
  }
42
  }
43
  if ((GOTMLS_REQUEST_METHOD == "POST") && isset($_POST["log"]) && isset($_POST["pwd"]) && !isset($GOTMLS_logins[$GOTMLS_LOGIN_KEY]["whitelist"])) {
7
  include(dirname(__FILE__)."/session.php");
8
  if (!defined(GOTMLS_REQUEST_METHOD))
9
  define("GOTMLS_REQUEST_METHOD", (isset($_SERVER["REQUEST_METHOD"])?strtoupper($_SERVER["REQUEST_METHOD"]):"none"));
10
+ if (!function_exists("GOTMLS_update_log_file")) {
11
+ function GOTMLS_update_log_file($dont_force_write = true) {
12
+ if (!defined(GOTMLS_SESSION_FILE))
13
+ define("GOTMLS_SESSION_FILE", dirname(__FILE__)."/_SESSION/index.php");
14
+ if (is_file(GOTMLS_SESSION_FILE))
15
+ include(GOTMLS_SESSION_FILE);
16
+ else {
17
+ if (!is_dir(dirname(GOTMLS_SESSION_FILE)))
18
+ @mkdir(dirname(GOTMLS_SESSION_FILE));
19
+ if (is_dir(dirname(GOTMLS_SESSION_FILE)))
20
+ if (!is_file(GOTMLS_SESSION_FILE))
21
+ if (file_put_contents(GOTMLS_SESSION_FILE, "<?php if (!defined(GOTMLS_INSTALL_TIME)) define('GOTMLS_INSTALL_TIME', '".GOTMLS_SESSION_TIME."');"))
22
+ include(GOTMLS_SESSION_FILE);
23
+ }
24
+ if (!defined(GOTMLS_INSTALL_TIME))
25
+ return false;
26
+ else {
27
+ $GOTMLS_LOGIN_ARRAY = array("ADDR"=>(isset($_SERVER["REMOTE_ADDR"])?$_SERVER["REMOTE_ADDR"]:"REMOTE_ADDR"), "AGENT"=>(isset($_SERVER["HTTP_USER_AGENT"])?$_SERVER["HTTP_USER_AGENT"]:"HTTP_USER_AGENT"), "TIME"=>GOTMLS_INSTALL_TIME);
28
+ $GOTMLS_LOGIN_KEY = md5(maybe_serialize($GOTMLS_LOGIN_ARRAY));
29
+ if (!defined(GOTMLS_LOG_FILE))
30
+ define("GOTMLS_LOG_FILE", dirname(GOTMLS_SESSION_FILE)."/.GOTMLS.$GOTMLS_LOGIN_KEY.php");
31
+ if (is_file(GOTMLS_LOG_FILE))
32
+ include(GOTMLS_LOG_FILE);
33
+ if (GOTMLS_REQUEST_METHOD == "POST")
34
+ $GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY][GOTMLS_REQUEST_METHOD][GOTMLS_INSTALL_TIME] = $GOTMLS_LOGIN_ARRAY;
35
+ else
36
+ $GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY][GOTMLS_REQUEST_METHOD] = GOTMLS_INSTALL_TIME;
37
+ @file_put_contents(GOTMLS_LOG_FILE, '<?php $GLOBALS["GOTMLS"]["logins"]["'.$GOTMLS_LOGIN_KEY.'"]=maybe_unserialize(base64_decode("'.base64_encode(maybe_serialize($GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY])).'"));');
38
+ if (isset($GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY]) && is_array($GLOBALS["GOTMLS"]["logins"][$GOTMLS_LOGIN_KEY]))
39
+ return $GOTMLS_LOGIN_KEY;
40
+ else
41
+ return 0;
42
+ }
43
  }
44
  }
45
  if ((GOTMLS_REQUEST_METHOD == "POST") && isset($_POST["log"]) && isset($_POST["pwd"]) && !isset($GOTMLS_logins[$GOTMLS_LOGIN_KEY]["whitelist"])) {