[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.147.195.28: ~ $
<?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);
	}
}

Filemanager

Name Type Size Permission Actions
Diff Folder 0755
audit-log Folder 0755
dashboard Folder 0755
rest-api Folder 0755
.htaccess File 354 B 0644
Diff.php File 5.63 KB 0644
GeoLite2-Country.mmdb File 6.21 MB 0644
IPTraf.php File 1.16 KB 0644
IPTrafList.php File 2.98 KB 0644
WFLSPHP52Compatability.php File 1.27 KB 0644
compat.php File 425 B 0644
diffResult.php File 2.8 KB 0644
email_genericAlert.php File 1.39 KB 0644
email_newIssues.php File 8.82 KB 0644
email_unlockRequest.php File 2.34 KB 0644
email_unsubscribeRequest.php File 1.05 KB 0644
flags.php File 6.62 KB 0644
live_activity.php File 580 B 0644
menu_dashboard.php File 28 KB 0644
menu_dashboard_options.php File 15.21 KB 0644
menu_firewall.php File 2.12 KB 0644
menu_firewall_blocking.php File 10.25 KB 0644
menu_firewall_blocking_options.php File 4.63 KB 0644
menu_firewall_waf.php File 19.96 KB 0644
menu_firewall_waf_options.php File 11.09 KB 0644
menu_install.php File 1.73 KB 0644
menu_options.php File 24.7 KB 0644
menu_scanner.php File 21.53 KB 0644
menu_scanner_credentials.php File 2.71 KB 0644
menu_scanner_options.php File 8.41 KB 0644
menu_support.php File 17.77 KB 0644
menu_tools.php File 1.49 KB 0644
menu_tools_auditlog.php File 16.35 KB 0644
menu_tools_diagnostic.php File 49.3 KB 0644
menu_tools_importExport.php File 1.28 KB 0644
menu_tools_livetraffic.php File 39.43 KB 0644
menu_tools_twoFactor.php File 19.6 KB 0644
menu_tools_whois.php File 4.61 KB 0644
menu_wordfence_central.php File 9.66 KB 0644
noc1.key File 1.64 KB 0644
sodium_compat_fast.php File 185 B 0644
sysinfo.php File 1.46 KB 0644
viewFullActivityLog.php File 1.47 KB 0644
wf503.php File 9.63 KB 0644
wfAPI.php File 9.66 KB 0644
wfActivityReport.php File 20.45 KB 0644
wfAdminNoticeQueue.php File 5.2 KB 0644
wfAlerts.php File 7.37 KB 0644
wfArray.php File 1.77 KB 0644
wfAuditLog.php File 44.34 KB 0644
wfBrowscap.php File 3.9 KB 0644
wfBrowscapCache.php File 256.83 KB 0644
wfBulkCountries.php File 9.77 KB 0644
wfCache.php File 6.02 KB 0644
wfCentralAPI.php File 25.71 KB 0644
wfConfig.php File 122.33 KB 0644
wfCrawl.php File 6.56 KB 0644
wfCredentialsController.php File 5.16 KB 0644
wfCrypt.php File 4.05 KB 0644
wfCurlInterceptor.php File 1.02 KB 0644
wfDB.php File 11.49 KB 0644
wfDashboard.php File 8.2 KB 0644
wfDateLocalization.php File 352.13 KB 0644
wfDeactivationOption.php File 2.13 KB 0644
wfDiagnostic.php File 66.5 KB 0644
wfDict.php File 738 B 0644
wfDirectoryIterator.php File 1.89 KB 0644
wfFileUtils.php File 2.72 KB 0644
wfHelperBin.php File 1.97 KB 0644
wfHelperString.php File 2.13 KB 0644
wfIPWhitelist.php File 1.56 KB 0644
wfImportExportController.php File 3.23 KB 0644
wfInaccessibleDirectoryException.php File 303 B 0644
wfInvalidPathException.php File 266 B 0644
wfIpLocation.php File 1.73 KB 0644
wfIpLocator.php File 2.74 KB 0644
wfIssues.php File 27.26 KB 0644
wfJWT.php File 5.33 KB 0644
wfLicense.php File 10.43 KB 0644
wfLockedOut.php File 9.73 KB 0644
wfLog.php File 57.03 KB 0644
wfMD5BloomFilter.php File 5.2 KB 0644
wfModuleController.php File 754 B 0644
wfNotification.php File 6.41 KB 0644
wfOnboardingController.php File 9.18 KB 0644
wfPersistenceController.php File 819 B 0644
wfRESTAPI.php File 377 B 0644
wfScan.php File 15.92 KB 0644
wfScanEngine.php File 133 KB 0644
wfScanEntrypoint.php File 1.04 KB 0644
wfScanFile.php File 1.01 KB 0644
wfScanFileLink.php File 403 B 0644
wfScanFileListItem.php File 408 B 0644
wfScanFileProperties.php File 1.07 KB 0644
wfScanMonitor.php File 4.05 KB 0644
wfScanPath.php File 1.77 KB 0644
wfSchema.php File 10.91 KB 0644
wfStyle.php File 1.21 KB 0644
wfSupportController.php File 24.18 KB 0644
wfUnlockMsg.php File 1.14 KB 0644
wfUpdateCheck.php File 27.23 KB 0644
wfUtils.php File 121.16 KB 0644
wfVersionCheckController.php File 19.27 KB 0644
wfVersionSupport.php File 535 B 0644
wfView.php File 2.22 KB 0644
wfViewResult.php File 1.42 KB 0644
wfWebsite.php File 1.75 KB 0644
wordfenceClass.php File 435.67 KB 0644
wordfenceConstants.php File 3.14 KB 0644
wordfenceHash.php File 42.7 KB 0644
wordfenceScanner.php File 30.47 KB 0644
wordfenceURLHoover.php File 18.36 KB 0644