/
home
/
vianto5
/
.trash
/
cititower.mx
/
wp-content
/
plugins
/
wordfence
/
lib
/
/home/vianto5/.trash/cititower.mx/wp-content/plugins/wordfence/lib
mkdir
upload
Name
Size
Mode
Actions
dashboard/
-
0755
rm
Diff/
-
0755
rm
rest-api/
-
0755
rm
.htaccess
354
0644
edit
dl
rm
compat.php
425
0644
edit
dl
rm
Diff.php
5762
0644
edit
dl
rm
diffResult.php
2869
0644
edit
dl
rm
email_genericAlert.php
1422
0644
edit
dl
rm
email_newIssues.php
9035
0644
edit
dl
rm
email_unlockRequest.php
2397
0644
edit
dl
rm
email_unsubscribeRequest.php
1077
0644
edit
dl
rm
flags.php
6779
0644
edit
dl
rm
GeoLite2-Country.mmdb
6511625
0644
edit
dl
rm
IPTraf.php
1190
0644
edit
dl
rm
IPTrafList.php
3054
0644
edit
dl
rm
live_activity.php
580
0644
edit
dl
rm
menu_dashboard.php
28671
0644
edit
dl
rm
menu_dashboard_options.php
15577
0644
edit
dl
rm
menu_firewall.php
2167
0644
edit
dl
rm
menu_firewall_blocking.php
10495
0644
edit
dl
rm
menu_firewall_blocking_options.php
4737
0644
edit
dl
rm
menu_firewall_waf.php
20443
0644
edit
dl
rm
menu_firewall_waf_options.php
11357
0644
edit
dl
rm
menu_install.php
1767
0644
edit
dl
rm
menu_options.php
24631
0644
edit
dl
rm
menu_scanner.php
22047
0644
edit
dl
rm
menu_scanner_credentials.php
2774
0644
edit
dl
rm
menu_scanner_options.php
8615
0644
edit
dl
rm
menu_support.php
18194
0644
edit
dl
rm
menu_tools.php
1438
0644
edit
dl
rm
menu_tools_diagnostic.php
50481
0644
edit
dl
rm
menu_tools_importExport.php
1310
0644
edit
dl
rm
menu_tools_livetraffic.php
40381
0644
edit
dl
rm
menu_tools_twoFactor.php
20070
0644
edit
dl
rm
menu_tools_whois.php
4722
0644
edit
dl
rm
menu_wordfence_central.php
9889
0644
edit
dl
rm
noc1.key
1683
0644
edit
dl
rm
sodium_compat_fast.php
185
0644
edit
dl
rm
sysinfo.php
1496
0644
edit
dl
rm
viewFullActivityLog.php
1501
0644
edit
dl
rm
wf503.php
9860
0644
edit
dl
rm
wfActivityReport.php
20945
0644
edit
dl
rm
wfAdminNoticeQueue.php
5323
0644
edit
dl
rm
wfAlerts.php
7549
0644
edit
dl
rm
wfAPI.php
9889
0644
edit
dl
rm
wfArray.php
1816
0644
edit
dl
rm
wfBrowscap.php
3996
0644
edit
dl
rm
wfBrowscapCache.php
262994
0644
edit
dl
rm
wfBulkCountries.php
10002
0644
edit
dl
rm
wfCache.php
6166
0644
edit
dl
rm
wfCentralAPI.php
25502
0644
edit
dl
rm
wfConfig.php
90755
0644
edit
dl
rm
wfCrawl.php
6722
0644
edit
dl
rm
wfCredentialsController.php
5284
0644
edit
dl
rm
wfCrypt.php
4146
0644
edit
dl
rm
wfCurlInterceptor.php
1047
0644
edit
dl
rm
wfDashboard.php
8399
0644
edit
dl
rm
wfDateLocalization.php
360582
0644
edit
dl
rm
wfDB.php
11764
0644
edit
dl
rm
wfDeactivationOption.php
2184
0644
edit
dl
rm
wfDiagnostic.php
67805
0644
edit
dl
rm
wfDict.php
738
0644
edit
dl
rm
wfDirectoryIterator.php
1937
0644
edit
dl
rm
wfFileUtils.php
2784
0644
edit
dl
rm
wfHelperBin.php
2015
0644
edit
dl
rm
wfHelperString.php
2180
0644
edit
dl
rm
wfImportExportController.php
3306
0644
edit
dl
rm
wfInaccessibleDirectoryException.php
303
0644
edit
dl
rm
wfInvalidPathException.php
266
0644
edit
dl
rm
wfIpLocation.php
1768
0644
edit
dl
rm
wfIpLocator.php
2810
0644
edit
dl
rm
wfIPWhitelist.php
1596
0644
edit
dl
rm
wfIssues.php
27917
0644
edit
dl
rm
wfJWT.php
5455
0644
edit
dl
rm
wfLicense.php
10682
0644
edit
dl
rm
wfLockedOut.php
9959
0644
edit
dl
rm
wfLog.php
58396
0644
edit
dl
rm
WFLSPHP52Compatability.php
1303
0644
edit
dl
rm
wfMD5BloomFilter.php
5327
0644
edit
dl
rm
wfModuleController.php
754
0644
edit
dl
rm
wfNotification.php
6564
0644
edit
dl
rm
wfOnboardingController.php
8421
0644
edit
dl
rm
wfPersistenceController.php
798
0644
edit
dl
rm
wfRESTAPI.php
377
0644
edit
dl
rm
wfScan.php
16300
0644
edit
dl
rm
wfScanEngine.php
136195
0644
edit
dl
rm
wfScanEntrypoint.php
1070
0644
edit
dl
rm
wfScanFile.php
1037
0644
edit
dl
rm
wfScanFileLink.php
403
0644
edit
dl
rm
wfScanFileListItem.php
408
0644
edit
dl
rm
wfScanFileProperties.php
1095
0644
edit
dl
rm
wfScanMonitor.php
4152
0644
edit
dl
rm
wfScanPath.php
1817
0644
edit
dl
rm
wfSchema.php
10744
0644
edit
dl
rm
wfStyle.php
285
0644
edit
dl
rm
wfSupportController.php
24552
0644
edit
dl
rm
wfUnlockMsg.php
1163
0644
edit
dl
rm
wfUpdateCheck.php
27888
0644
edit
dl
rm
wfUtils.php
112786
0644
edit
dl
rm
wfVersionCheckController.php
19729
0644
edit
dl
rm
wfVersionSupport.php
447
0644
edit
dl
rm
wfView.php
2269
0644
edit
dl
rm
wfViewResult.php
1450
0644
edit
dl
rm
wfWebsite.php
1792
0644
edit
dl
rm
wordfenceClass.php
451606
0644
edit
dl
rm
wordfenceConstants.php
3216
0644
edit
dl
rm
wordfenceHash.php
43726
0644
edit
dl
rm
wordfenceScanner.php
31200
0644
edit
dl
rm
wordfenceURLHoover.php
18804
0644
edit
dl
rm
Edit:
/home/vianto5/.trash/cititower.mx/wp-content/plugins/wordfence/lib/wfScan.php
(16300B)
<?php class wfScan { public static $debugMode = false; public static $errorHandlingOn = true; public static $peakMemAtStart = 0; /** * Returns the stored cronkey or false if not set. If $expired is provided, will set to <timestamp>/false based * on whether or not the cronkey is expired. * * @param null $expired * @return bool|string */ private static function storedCronKey(&$expired = null) { $currentCronKey = wfConfig::get('currentCronKey', false); if (empty($currentCronKey)) { if ($expired !== null) { $expired = false; } return false; } $savedKey = explode(',',$currentCronKey); if (time() - $savedKey[0] > 86400) { if ($expired !== null) { $expired = $savedKey[0]; } return $savedKey[1]; } if ($expired !== null) { $expired = false; } return $savedKey[1]; } public static function wfScanMain(){ self::$peakMemAtStart = memory_get_peak_usage(true); $db = new wfDB(); if($db->errorMsg){ self::errorExit(sprintf(/* translators: Error message. */ __("Could not connect to database to start scan: %s", 'wordfence'), $db->errorMsg)); } if(! wordfence::wfSchemaExists()){ self::errorExit(__("Looks like the Wordfence database tables have been deleted. You can fix this by de-activating and re-activating the Wordfence plugin from your Plugins menu.", 'wordfence')); } if( isset( $_GET['test'] ) && $_GET['test'] == '1'){ echo "WFCRONTESTOK:" . wfConfig::get('cronTestID'); self::status(4, 'info', __("Cron test received and message printed", 'wordfence')); exit(); } self::status(4, 'info', __("Scan engine received request.", 'wordfence')); /* ----------Starting signature check -------- */ self::status(4, 'info', __("Verifying start request signature.", 'wordfence')); if (!isset($_GET['signature']) || !wfScanEngine::verifyStartSignature($_GET['signature'], isset($_GET['isFork']) ? wfUtils::truthyToBoolean($_GET['isFork']) : false, isset($_GET['scanMode']) ? $_GET['scanMode'] : '', isset($_GET['cronKey']) ? $_GET['cronKey'] : '', isset($_GET['remote']) ? wfUtils::truthyToBoolean($_GET['remote']) : false)) { self::errorExit(__('The signature on the request to start a scan is invalid. Please try again.', 'wordfence')); } /* ----------Starting cronkey check -------- */ self::status(4, 'info', __("Fetching stored cronkey for comparison.", 'wordfence')); $expired = false; $storedCronKey = self::storedCronKey($expired); $displayCronKey_received = (isset($_GET['cronKey']) ? (preg_match('/^[a-f0-9]+$/i', $_GET['cronKey']) && strlen($_GET['cronKey']) == 32 ? $_GET['cronKey'] : __('[invalid]', 'wordfence')) : __('[none]', 'wordfence')); $displayCronKey_stored = (!empty($storedCronKey) && !$expired ? $storedCronKey : __('[none]', 'wordfence')); self::status(4, 'info', sprintf(/* translators: 1. WordPress nonce. 2. WordPress nonce. */ __('Checking cronkey: %1$s (expecting %2$s)', 'wordfence'), $displayCronKey_received, $displayCronKey_stored)); if (empty($_GET['cronKey'])) { self::status(4, 'error', __("Wordfence scan script accessed directly, or WF did not receive a cronkey.", 'wordfence')); echo "If you see this message it means Wordfence is working correctly. You should not access this URL directly. It is part of the Wordfence security plugin and is designed for internal use only."; exit(); } if ($expired) { self::errorExit(sprintf( /* translators: 1. Unix timestamp. 2. WordPress nonce. 3. Unix timestamp. */ __('The key used to start a scan expired. The value is: %1$s and split is: %2$s and time is: %3$d', 'wordfence'), $expired, $storedCronKey, time())); } //keys only last 60 seconds and are used within milliseconds of creation if (!$storedCronKey) { wordfence::status(4, 'error', __("Wordfence could not find a saved cron key to start the scan so assuming it started and exiting.", 'wordfence')); exit(); } self::status(4, 'info', __("Checking saved cronkey against cronkey param", 'wordfence')); if (!hash_equals($storedCronKey, $_GET['cronKey'])) { self::errorExit( sprintf( /* translators: 1. WordPress nonce (used for debugging). 2. WordPress nonce (used for debugging). 3. WordPress nonce (used for debugging). */ __('Wordfence could not start a scan because the cron key does not match the saved key. Saved: %1$s Sent: %2$s Current unexploded: %3$s', 'wordfence'), $storedCronKey, $_GET['cronKey'], wfConfig::get('currentCronKey', false) ) ); } wfConfig::set('currentCronKey', ''); /* --------- end cronkey check ---------- */ wfScanMonitor::logLastSuccess(); $scanMode = wfScanner::SCAN_TYPE_STANDARD; if (isset($_GET['scanMode']) && wfScanner::isValidScanType($_GET['scanMode'])) { $scanMode = $_GET['scanMode']; } $scanController = new wfScanner($scanMode); wfConfig::remove('scanStartAttempt'); $isFork = ($_GET['isFork'] == '1' ? true : false); wfScanMonitor::handleStageStart($isFork); if(! $isFork){ self::status(4, 'info', __("Checking if scan is already running", 'wordfence')); if(! wfUtils::getScanLock()){ self::errorExit(__("There is already a scan running.", 'wordfence')); } wfIssues::updateScanStillRunning(); wfConfig::set('wfPeakMemory', 0, wfConfig::DONT_AUTOLOAD); wfConfig::set('wfScanStartVersion', wfUtils::getWPVersion()); wfConfig::set('lowResourceScanWaitStep', false); if ($scanController->useLowResourceScanning()) { self::status(1, 'info', __("Using low resource scanning", 'wordfence')); } } self::status(4, 'info', __("Requesting max memory", 'wordfence')); wfUtils::requestMaxMemory(); self::status(4, 'info', __("Setting up error handling environment", 'wordfence')); set_error_handler('wfScan::error_handler', E_ALL); register_shutdown_function('wfScan::shutdown'); if(! self::$debugMode){ ob_start('wfScan::obHandler'); } @error_reporting(E_ALL); wfUtils::iniSet('display_errors','On'); self::status(4, 'info', __("Setting up scanRunning and starting scan", 'wordfence')); try { if ($isFork) { $scan = wfConfig::get_ser('wfsd_engine', false, false); if ($scan) { self::status(4, 'info', sprintf(/* translators: Error message (used for debugging). */ __("Got a true deserialized value back from 'wfsd_engine' with type: %s", 'wordfence'), gettype($scan))); wfConfig::set('wfsd_engine', '', wfConfig::DONT_AUTOLOAD); } else { self::status(2, 'error', sprintf(/* translators: Error message (used for debugging). */ __("Scan can't continue - stored data not found after a fork. Got type: %s", 'wordfence'), gettype($scan))); wfConfig::set('wfsd_engine', '', wfConfig::DONT_AUTOLOAD); wfConfig::set('lastScanCompleted', __('Scan can\'t continue - stored data not found after a fork.', 'wordfence')); wfConfig::set('lastScanFailureType', wfIssues::SCAN_FAILED_FORK_FAILED); wfUtils::clearScanLock(); self::status(2, 'error', "Scan terminated with error: " . __('Scan can\'t continue - stored data not found after a fork.', 'wordfence')); self::status(10, 'info', "SUM_KILLED:" . __('Previous scan terminated with an error. See below.', 'wordfence')); exit(); } } else { $delay = -1; $isScheduled = false; $originalScanStart = wfConfig::get('originalScheduledScanStart', 0); $lastScanStart = wfConfig::get('lastScheduledScanStart', 0); $minimumFrequency = ($scanController->schedulingMode() == wfScanner::SCAN_SCHEDULING_MODE_MANUAL ? 1800 : 43200); if ($lastScanStart && (time() - $lastScanStart) < $minimumFrequency) { $isScheduled = true; if ($originalScanStart > 0) { $delay = max($lastScanStart - $originalScanStart, 0); } } wfIssues::statusPrep(); //Re-initializes all status counters $scanController->resetStages(); $scanController->resetSummaryItems(); if ($scanMode != wfScanner::SCAN_TYPE_QUICK) { wordfence::status(1, 'info', __("Contacting Wordfence to initiate scan", 'wordfence')); $wp_version = wfUtils::getWPVersion(); $apiKey = wfConfig::get('apiKey'); $api = new wfAPI($apiKey, $wp_version); $response = $api->call('log_scan', array(), array('delay' => $delay, 'scheduled' => (int) $isScheduled, 'mode' => wfConfig::get('schedMode')/*, 'forcedefer' => 1*/)); if ($scanController->schedulingMode() == wfScanner::SCAN_SCHEDULING_MODE_AUTOMATIC && $isScheduled) { if (isset($response['defer'])) { $defer = (int) $response['defer']; wordfence::status(2, 'info', sprintf(/* translators: Time until. */ __("Deferring scheduled scan by %s", 'wordfence'), wfUtils::makeDuration($defer))); wfConfig::set('lastScheduledScanStart', 0); wfConfig::set('lastScanCompleted', 'ok'); wfConfig::set('lastScanFailureType', false); wfConfig::set_ser('wfStatusStartMsgs', array()); $scanController->recordLastScanTime(); $i = new wfIssues(); wfScanEngine::refreshScanNotification($i); wfScanner::shared()->scheduleSingleScan(time() + $defer, $originalScanStart); wfUtils::clearScanLock(); exit(); } } $malwarePrefixesHash = (isset($response['malwarePrefixes']) ? $response['malwarePrefixes'] : ''); $coreHashesHash = (isset($response['coreHashes']) ? $response['coreHashes'] : ''); $scan = new wfScanEngine($malwarePrefixesHash, $coreHashesHash, $scanMode); $scan->deleteNewIssues(); } else { wordfence::status(1, 'info', __("Initiating quick scan", 'wordfence')); $scan = new wfScanEngine('', '', $scanMode); } } $scan->go(); } catch (wfScanEngineDurationLimitException $e) { //User error set in wfScanEngine wfUtils::clearScanLock(); $peakMemory = self::logPeakMemory(); self::status(2, 'info', sprintf( __('Wordfence used %1$s of memory for scan. Server peak memory usage was: %2$s', 'wordfence'), wfUtils::formatBytes($peakMemory - self::$peakMemAtStart), wfUtils::formatBytes($peakMemory) )); self::status(2, 'error', sprintf(__("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); exit(); } catch (wfScanEngineCoreVersionChangeException $e) { //User error set in wfScanEngine wfUtils::clearScanLock(); $peakMemory = self::logPeakMemory(); self::status(2, 'info', sprintf( /* translators: 1. Bytes of memory. 2. Bytes of memory. */ __('Wordfence used %1$s of memory for scan. Server peak memory usage was: %2$s', 'wordfence'), wfUtils::formatBytes($peakMemory - self::$peakMemAtStart), wfUtils::formatBytes($peakMemory) )); self::status(2, 'error', sprintf(/* translators: Error message. */ __("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); $nextScheduledScan = wfScanner::shared()->nextScheduledScanTime(); if ($nextScheduledScan !== false && $nextScheduledScan - time() > 21600 /* 6 hours */) { $nextScheduledScan = time() + 3600; wfScanner::shared()->scheduleSingleScan($nextScheduledScan); } self::status(2, 'error', wordfence::getNextScanStartTime($nextScheduledScan)); exit(); } catch (wfAPICallSSLUnavailableException $e) { wfConfig::set('lastScanCompleted', $e->getMessage()); wfConfig::set('lastScanFailureType', wfIssues::SCAN_FAILED_API_SSL_UNAVAILABLE); wfUtils::clearScanLock(); $peakMemory = self::logPeakMemory(); self::status(2, 'info', sprintf( /* translators: 1. Bytes of memory. 2. Bytes of memory. */ __('Wordfence used %1$s of memory for scan. Server peak memory usage was: %2$s', 'wordfence'), wfUtils::formatBytes($peakMemory - self::$peakMemAtStart), wfUtils::formatBytes($peakMemory) )); self::status(2, 'error', sprintf(/* translators: Error message. */__("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); exit(); } catch (wfAPICallFailedException $e) { wfConfig::set('lastScanCompleted', $e->getMessage()); wfConfig::set('lastScanFailureType', wfIssues::SCAN_FAILED_API_CALL_FAILED); wfUtils::clearScanLock(); $peakMemory = self::logPeakMemory(); self::status(2, 'info', sprintf( /* translators: 1. Bytes of memory. 2. Bytes of memory. */ __('Wordfence used %1$s of memory for scan. Server peak memory usage was: %2$s', 'wordfence'), wfUtils::formatBytes($peakMemory - self::$peakMemAtStart), wfUtils::formatBytes($peakMemory) )); self::status(2, 'error', sprintf(/* translators: Error message. */ __("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); exit(); } catch (wfAPICallInvalidResponseException $e) { wfConfig::set('lastScanCompleted', $e->getMessage()); wfConfig::set('lastScanFailureType', wfIssues::SCAN_FAILED_API_INVALID_RESPONSE); wfUtils::clearScanLock(); $peakMemory = self::logPeakMemory(); self::status(2, 'info', sprintf( /* translators: 1. Bytes of memory. 2. Bytes of memory. */ __('Wordfence used %1$s of memory for scan. Server peak memory usage was: %2$s', 'wordfence'), wfUtils::formatBytes($peakMemory - self::$peakMemAtStart), wfUtils::formatBytes($peakMemory) )); self::status(2, 'error', sprintf(/* translators: Error message. */ __("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); exit(); } catch (wfAPICallErrorResponseException $e) { wfConfig::set('lastScanCompleted', $e->getMessage()); wfConfig::set('lastScanFailureType', wfIssues::SCAN_FAILED_API_ERROR_RESPONSE); wfUtils::clearScanLock(); $peakMemory = self::logPeakMemory(); self::status(2, 'info', sprintf( /* translators: 1. Bytes of memory. 2. Bytes of memory. */ __('Wordfence used %1$s of memory for scan. Server peak memory usage was: %2$s', 'wordfence'), wfUtils::formatBytes($peakMemory - self::$peakMemAtStart), wfUtils::formatBytes($peakMemory) )); self::status(2, 'error', sprintf(/* translators: Error message. */ __("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); if (preg_match('/The Wordfence API key you\'re using is already being used by: (\S*?) /', $e->getMessage(), $matches)) { wordfence::alert(__('Wordfence scan failed because of license site URL conflict', 'wordfence'), sprintf( /* translators: Site URL. */ __(<<<MSG The Wordfence scan has failed because the Wordfence API key you're using is already being used by: %s If you have changed your blog URL, please sign-in to Wordfence, purchase a new key or reset an existing key, and then enter that key on this site's Wordfence Options page. MSG , 'wordfence'), $matches[1]), false); } exit(); } catch (Exception $e) { wfUtils::clearScanLock(); self::status(2, 'error', sprintf(/* translators: Error message. */ __("Scan terminated with error: %s", 'wordfence'), $e->getMessage())); self::status(10, 'info', "SUM_KILLED:" . __('Previous scan terminated with an error. See below.', 'wordfence')); exit(); } wfUtils::clearScanLock(); } public static function logPeakMemory(){ $oldPeak = wfConfig::get('wfPeakMemory', 0, false); $peak = memory_get_peak_usage(true); if ($peak > $oldPeak) { wfConfig::set('wfPeakMemory', $peak, wfConfig::DONT_AUTOLOAD); return $peak; } return $oldPeak; } public static function obHandler($buf){ if(strlen($buf) > 1000){ $buf = substr($buf, 0, 255); } if(empty($buf) === false && preg_match('/[a-zA-Z0-9]+/', $buf)){ self::status(1, 'error', $buf); } } public static function error_handler($errno, $errstr, $errfile, $errline){ if(self::$errorHandlingOn && error_reporting() > 0){ if(preg_match('/wordfence\//', $errfile)){ $level = 1; //It's one of our files, so level 1 } else { $level = 4; //It's someone elses plugin so only show if debug is enabled } self::status($level, 'error', "$errstr ($errno) File: $errfile Line: $errline"); } return false; } public static function shutdown(){ self::logPeakMemory(); } private static function errorExit($msg){ wordfence::status(1, 'error', sprintf(/* translators: Error message. */ __('Scan Engine Error: %s', 'wordfence'), $msg)); exit(); } private static function status($level, $type, $msg){ wordfence::status($level, $type, $msg); } }
Save
cmd:
run