Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


Show other level

namespace Bitrix\Main\Security\W;
$GLOBALS['____1920086702']= array(base64_decode('dGltZQ=='),base64_decode('dGltZQ=='),base64_decode('anNvbl9kZWNvZGU='),base64_decode('YXJyYXlfbWVyZ2U='),base64_decode('am9pbg=='),base64_decode('am9pbg=='),base64_decode('am9pbg=='),base64_decode('YXJyYXlfcG9w'),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfbWVyZ2U='),base64_decode('aXNfYXJyYXk='),base64_decode('YXJyYXlfbWVyZ2U='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('dGltZQ=='),base64_decode('dGltZQ=='),base64_decode('YXJyYXlfbWFw'),base64_decode('Z2V0X2xvYWRlZF9leHRlbnNpb25z'),base64_decode('anNvbl9lbmNvZGU='),base64_decode('anNvbl9lbmNvZGU='),base64_decode('cGhwdmVyc2lvbg=='),base64_decode('anNvbl9lbmNvZGU='),base64_decode('am9pbg=='));
	if(!function_exists(__NAMESPACE__.'\\___219781823')){
		function ___219781823($_503648935){
		static $_196389161= false;
		 if($_196389161 == false) $_196389161=array('V1dBTExfTE9DSw==','c2VjdXJpdHk=','REFUQQ==','eyI=','V1dBTExfTE9DSw==','c2VjdXJpdHk=','U0VDVVJJVFlfV1dBTExfRVhDRVBUSU9O','RkFJTF9DSEVDS0lORw==','Q2FuIG5vdCBleGVjdXRlIHd3YWxsIHJ1bGVzOiA=','IFRyYWNlOiA=','UkVRVUVTVF9VUkk=','a2V5cw==','dmFsdWVz','U0VDVVJJVFlfV1dBTExfTU9ESUZZ','Lg==','U0VDVVJJVFlfV1dBTExfVU5TRVQ=','Lg==','U0VDVVJJVFlfV1dBTExfRVhJVA==','Lg==','Z2xvYmFs','a2V5cw==','dmFsdWVz','Z2V0','Z2V0','cG9zdA==','cG9zdA==','Y29va2ll','Y29va2ll','cmVxdWVzdA==','cmVxdWVzdA==','Z2xvYmFs','Z2xvYmFs','bWFpbl9zZWM=','V1dBTExfQUNUVUFMSVpFX1JVTEVT','dg==','dmVyc2lvbg==','aQ==','aXNJbnN0YWxsZWQ=','dg==','aW5p','c29ja2V0VGltZW91dA==','c3RyZWFtVGltZW91dA==','KCc=','ZGF0YQ==','JywgJw==','bW9kdWxl','JywgJw==','bW9kdWxlX3ZlcnNpb24=','Jyk=','LCA=','U0VDVVJJVFlfV1dBTExfRVhDRVBUSU9O','bWFpbg==','RkFJTF9SRUZSRVNISU5H','Q2FuIG5vdCByZWZyZXNoIHd3YWxsIHJ1bGVzOiA=','IFRyYWNlOiA=','ZGF0YQ==','eyI=','LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0=','Ck1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcThRRTBIam1ISlVTdFdWNm4wemEKUlZvTHgwMkt6YmZyYlMvUDZzV2F4VHp3OFNlR1R0YlRDT3JwSGk1UUY2T1J5alovWHh6L0tMVTFHYm9mOUNaMwo0ejdTa3FVdDY2aWJYdk9GQng0ZncvQVBQUkdEcXRtMG5EM2ZnR3N1M1JlUGd3MjlpOCt2bTdtdEJLSlVZbDRyClZwYjZzZlpFVDlLRWI2VDFIRFltRXZjMWhxL2lpdXl4THJaWmk1UTZVZmY0VUV2VEkrNjhzc0ZSa1Erb3dUUnkKZU9JTWJGaE0vVVRtZlZZYlRSRnkyb1VROFdNemEybko1U2FoemkxVUtPMWpBalhUUFJyemM3QWp1NjM5ajFPMApwcHFmbTV4Z1dsRkFKa0hRVGdiZGQ1QVdxREZRa3Q5SEtrWStUbmZCTEdWTXZWeVB3VEhOV1FZQXc0eHBnL3dBClp3SURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==');
		return base64_decode($_196389161[$_503648935]);
	}
};
 use Bitrix\Main\Application;
 use Bitrix\Main\Config\Option;
 use Bitrix\Main\Data\Cache;
 use Bitrix\Main\ModuleManager;
 use Bitrix\Main\Security\PublicKeyCipher;
 use Bitrix\Main\SystemException;
 use Bitrix\Main\Web\HttpClient;
 use Bitrix\Main\Web\Json;
 use Bitrix\Main\Security\W\Rules\Rule;
 use Bitrix\Main\Security\W\Rules\Results\RuleAction;
 use Bitrix\Main\Security\W\Rules\Results\RuleResult;
 use Bitrix\Main\Security\W\Rules\Results\CheckResult;
 use Bitrix\Main\Security\W\Rules\Results\ModifyResult;
 use Bitrix\Main\Type\ArrayHelper;
 use Bitrix\Main\Security\W\Rules\RuleRecordTable;
 use ReflectionExtension;
	 class WWall{
	 const CACHE_RULES_TTL= 10800;
	 private static $_2105973842= 'https://wwall.bitrix.info/rules.php';
	 protected $_1317754055= true;
		 public function handle(){
			 try{
			  $_2007892197= RuleRecordTable::getList([ 'cache' =>['ttl' => 3600* 24* 7]])->fetchAll();
				 if(empty($_2007892197)){
				 return;
			}
			  $_913560771= Cache::createInstance();
			 $_1174460664= false;
				 if($_913560771->initCache(static::CACHE_RULES_TTL, 'WWALL_LOCK', 'security')){
				 $_2637867= $_913560771->getVars();
					 if($GLOBALS['____1920086702'][0]()- $_2637867> round(0+4+4+4+4+4)){
					  $_1308279783= Application::getConnection();
					 $_1941292524= RuleRecordTable::getTableName();
					 $_1308279783->truncateTable($_1941292524);
					 RuleRecordTable::cleanCache();
					 $_913560771->clean(___219781823(0), ___219781823(1));
				}
			}
				 elseif($_913560771->startDataCache()){
				  $_913560771->endDataCache($GLOBALS['____1920086702'][1]());
				 $_1174460664= true;
			}
				 foreach($_2007892197 as $_548228928){
				 $_61349827= new PublicKeyCipher;
				 $_229205852= $_61349827->decrypt($_548228928[___219781823(2)], static::__405710430());
					 if(!str_starts_with($_229205852, ___219781823(3))){
					 continue;
				}
				 $_882871270= $GLOBALS['____1920086702'][2]($_229205852, true);
					 if(!empty($_882871270)){
					 $_846751587= Rule::make($_882871270);
					 $_1917659115= $this->handleRule($_846751587);
					 $this->applyHandlingResults($_1917659115);
				}
			}
				  if($_1174460664){
				 $_913560771->clean(___219781823(4), ___219781823(5));
			}
		}
			 catch(\Throwable $_1742875720){
			 $this->logEvent( ___219781823(6), ___219781823(7), ___219781823(8). $_1742875720->getMessage(). ___219781823(9). $_1742875720->getTraceAsString());
		}
	}
		  public function handleRule(Rule $_846751587): array{
		 $_1917659115=[];
			 if($_846751587->matchPath($_SERVER[___219781823(10)])){
			  $_265728003= $this->getContextElements($_846751587->getContext());
				 foreach($_265728003 as $_672849404 => &$_75652815){
				 $_1917659115= $GLOBALS['____1920086702'][3]($_1917659115, $this->recursiveContextKeyHandle($_672849404, $_75652815,[], $_846751587));
			}
		}
		 return $_1917659115;
	}
		  public function applyHandlingResults(array $_1917659115){
		 $_265728003= $this->getContextElements([ 'get', 'post', 'cookie', 'request', 'global']);
			 foreach($_1917659115 as $_286124750){
			 $_75652815=& $_265728003[$_286124750->getContextName()];
			 $_383154781= $_286124750->getRuleResult();
			 $_846751587= $_286124750->getRule();
				 if($_383154781 instanceof ModifyResult){
					 if($_846751587->getProcess() === ___219781823(11)){
					  static::rewriteContextKey( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(), $_383154781->getCleanValue());
				}
					 elseif($_846751587->getProcess() === ___219781823(12)){
					 static::rewriteContextValue( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(), $_383154781->getCleanValue());
				}
				 $this->logEvent( ___219781823(13), $_286124750->getContextName(), $GLOBALS['____1920086702'][4](___219781823(14), $_286124750->getContextKey()));
			}
				 elseif($_383154781 instanceof CheckResult &&!$_383154781->isSuccess()){
					 if($_383154781->getAction() === RuleAction::UNSET){
					 static::unsetContextValue( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(),);
					 $this->logEvent( ___219781823(15), $_286124750->getContextName(), $GLOBALS['____1920086702'][5](___219781823(16), $_286124750->getContextKey()));
				}
					 elseif($_383154781->getAction() === RuleAction::EXIT){
					 $this->logEvent( ___219781823(17), $_286124750->getContextName(), $GLOBALS['____1920086702'][6](___219781823(18), $_286124750->getContextKey()));
					 exit;
				}
			}
		}
	}
		 public function disableEventLogging(){
		 $this->_1317754055= false;
	}
		 protected function rewriteContextKey($_672849404, &$_75652815, $_28163752, $_1069957533){
		 $_292485561= $_28163752;
		  $GLOBALS['____1920086702'][7]($_292485561);
		 $_292485561[]= $_1069957533;
			 if($_672849404 === ___219781823(19)){
			 $_565853216= $GLOBALS['____1920086702'][8]($_28163752);
			 $GLOBALS['____1920086702'][9]($_292485561);
				 if(empty($_28163752)){
				 $GLOBALS[$_1069957533]= $GLOBALS[$_565853216];
				 unset($GLOBALS[$_565853216]);
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 $_1872988621= ArrayHelper::getByNestedKey($_75652815, $_28163752);
				  ArrayHelper::setByNestedKey($_75652815, $_292485561, $_1872988621);
				  ArrayHelper::unsetByNestedKey($_75652815, $_28163752);
			}
		}
			 else{
			 $_1872988621= ArrayHelper::getByNestedKey($_75652815, $_28163752);
			  ArrayHelper::setByNestedKey($_75652815, $_292485561, $_1872988621);
			  ArrayHelper::unsetByNestedKey($_75652815, $_28163752);
		}
	}
		 protected function rewriteContextValue($_672849404, &$_75652815, $_844707696, $_1872988621){
			 if($_672849404 === 'global'){
			 $_565853216= $GLOBALS['____1920086702'][10]($_844707696);
				 if(empty($_844707696)){
				 $GLOBALS[$_565853216]= $_1872988621;
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 ArrayHelper::setByNestedKey($_75652815, $_844707696, $_1872988621);
			}
		}
			 else{
			  ArrayHelper::setByNestedKey($_75652815, $_844707696, $_1872988621);
		}
	}
		 protected function unsetContextValue($_672849404, &$_75652815, $_844707696){
			 if($_672849404 === 'global'){
			 $_565853216= $GLOBALS['____1920086702'][11]($_844707696);
				 if(empty($_844707696)){
				 unset($GLOBALS[$_565853216]);
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 ArrayHelper::unsetByNestedKey($_75652815, $_844707696);
			}
		}
			 else{
			 ArrayHelper::unsetByNestedKey($_75652815, $_844707696);
		}
	}
		  protected function recursiveContextKeyHandle(string $_672849404, array &$_75652815, array $_1449248967, Rule $_846751587): array{
		  $_1917659115=[];
			 foreach($_75652815 as $_1539101509 => $_1872988621){
			 $_844707696= $GLOBALS['____1920086702'][12]($_1449248967,[$_1539101509]);
				 if($_846751587->matchKey($_844707696)){
					  if($_846751587->getProcess() === ___219781823(20)){
					 $_383154781= $_846751587->echo $_1539101509;
				}
					 elseif($_846751587->getProcess() === ___219781823(21)){
					 $_383154781= $_846751587->evaluateValue($_1872988621);
				}
					  if(!empty($_383154781) && $_383154781 instanceof RuleResult){
					 $_1917659115[]= new HandlingResult($_672849404, $_844707696, $_383154781, $_846751587);
				}
			}
				  if($GLOBALS['____1920086702'][13]($_1872988621)){
				 $_1917659115= $GLOBALS['____1920086702'][14]($_1917659115, $this->recursiveContextKeyHandle( $_672849404, $_75652815[$_1539101509], $_844707696, $_846751587));
			}
		}
		 return $_1917659115;
	}
		 protected function getContextElements(array $_1743017129){
		 $_2087431358=[];
			 if($GLOBALS['____1920086702'][15](___219781823(22), $_1743017129, true)){
			 $_2087431358[___219781823(23)]= &$_GET;
		}
			 if($GLOBALS['____1920086702'][16](___219781823(24), $_1743017129, true)){
			 $_2087431358[___219781823(25)]= &$_POST;
		}
			 if($GLOBALS['____1920086702'][17](___219781823(26), $_1743017129, true)){
			 $_2087431358[___219781823(27)]= &$_COOKIE;
		}
			 if($GLOBALS['____1920086702'][18](___219781823(28), $_1743017129, true)){
			 $_2087431358[___219781823(29)]= &$_REQUEST;
		}
			 if($GLOBALS['____1920086702'][19](___219781823(30), $_1743017129, true)){
			 $_2087431358[___219781823(31)]= $GLOBALS;
		}
		 return $_2087431358;
	}
		 public static function refreshRules(){
			 try{
			 $_1783403519= Option::get('main_sec', 'WWALL_ACTUALIZE_RULES', 0);
				 if(($GLOBALS['____1920086702'][20]()- $_1783403519)< static::CACHE_RULES_TTL){
				 return;
			}
			 Option::set(___219781823(32), ___219781823(33), $GLOBALS['____1920086702'][21]());
			 $_2102798847= null;
				  $_2037947563= $GLOBALS['____1920086702'][22](function($_21726568){
				 return[___219781823(34) => $_21726568[___219781823(35)], ___219781823(36) => (int) $_21726568[___219781823(37)]];
			}
			, ModuleManager::getModulesFromDisk());
			  $_956371149=[];
				 foreach($GLOBALS['____1920086702'][23]() as $_1147223498){
				 $_1741974295= new ReflectionExtension($_1147223498);
				 $_956371149[$_1147223498]=[ ___219781823(38) => $_1741974295->getVersion(), ___219781823(39) => $_1741974295->getINIEntries()];
			}
			  $_1338294894= new HttpClient([ ___219781823(40) => round(0+1.6666666666667+1.6666666666667+1.6666666666667), ___219781823(41) => round(0+1.6666666666667+1.6666666666667+1.6666666666667)]);
			 $_342956625= $_1338294894->post( static::$_2105973842,[ 'modules' => $GLOBALS['____1920086702'][24]($_2037947563), 'license' => Application::getInstance()->getLicense()->getHashLicenseKey(), 'php' => $GLOBALS['____1920086702'][25]([ 'v' => $GLOBALS['____1920086702'][26](), 'ext' => $_956371149]),]);
				 if($_1338294894->getStatus() == round(0+200) &&!empty($_342956625)){
				 $_2102798847= Json::decode($_342956625);
			}
				  if($_2102798847 !== null){
				 $_1308279783= Application::getConnection();
				 $_1941292524= RuleRecordTable::getTableName();
					 if(!empty($_2102798847)){
						 foreach($_2102798847 as $_990920816){
							 if(!static::checkRuleSign($_990920816)){
							 throw new SystemException('Invalid sign for rule '.$GLOBALS['____1920086702'][27]($_990920816));
						}
					}
				}
				  $_1308279783->truncateTable($_1941292524);
					  if(!empty($_2102798847)){
					 $_909110892=[];
						 foreach($_2102798847 as $_990920816){
						 $_909110892[]= ___219781823(42). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(43)]). ___219781823(44). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(45)]). ___219781823(46). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(47)]). ___219781823(48);
					}
					 $_2087559515= $GLOBALS['____1920086702'][28](___219781823(49), $_909110892);
						  $_1308279783->query("INSERT INTO {
						$_1941292524
					}
						 (DATA, MODULE, MODULE_VERSION) VALUES {
						$_2087559515
					}
					");
					  RuleRecordTable::cleanCache();
				}
			}
		}
			 catch(\Throwable $_1742875720){
			 \CEventLog::log( \CEventLog::SEVERITY_SECURITY, ___219781823(50), ___219781823(51), ___219781823(52), ___219781823(53). $_1742875720->getMessage(). ___219781823(54). $_1742875720->getTraceAsString());
		}
	}
		 protected static function checkRuleSign($_846751587){
		 $_61349827= new PublicKeyCipher;
		 $_882871270= $_61349827->decrypt($_846751587[___219781823(55)], static::__405710430());
		 return str_starts_with($_882871270, ___219781823(56));
	}
		 private static function __405710430(){
		 $_1750429056= '';
		 $_1750429056 .= ___219781823(57);
		 $_1750429056 .= ___219781823(58);
		 return $_1750429056;
	}
		 protected function logEvent($_733249938, $_255577756, $_1598273523){
			 if($this->_1317754055){
			 \CEventLog::log( \CEventLog::SEVERITY_SECURITY, $_733249938, 'main', $_255577756, $_1598273523);
		}
	}
}

namespace Bitrix\Main\Security\W;
$GLOBALS['____1920086702']= array(base64_decode('dGltZQ=='),base64_decode('dGltZQ=='),base64_decode('anNvbl9kZWNvZGU='),base64_decode('YXJyYXlfbWVyZ2U='),base64_decode('am9pbg=='),base64_decode('am9pbg=='),base64_decode('am9pbg=='),base64_decode('YXJyYXlfcG9w'),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfc2hpZnQ='),base64_decode('YXJyYXlfbWVyZ2U='),base64_decode('aXNfYXJyYXk='),base64_decode('YXJyYXlfbWVyZ2U='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('aW5fYXJyYXk='),base64_decode('dGltZQ=='),base64_decode('dGltZQ=='),base64_decode('YXJyYXlfbWFw'),base64_decode('Z2V0X2xvYWRlZF9leHRlbnNpb25z'),base64_decode('anNvbl9lbmNvZGU='),base64_decode('anNvbl9lbmNvZGU='),base64_decode('cGhwdmVyc2lvbg=='),base64_decode('anNvbl9lbmNvZGU='),base64_decode('am9pbg=='));
	if(!function_exists(__NAMESPACE__.'\\___219781823')){
		function ___219781823($_503648935){
		static $_196389161= false;
		 if($_196389161 == false) $_196389161=array('V1dBTExfTE9DSw==','c2VjdXJpdHk=','REFUQQ==','eyI=','V1dBTExfTE9DSw==','c2VjdXJpdHk=','U0VDVVJJVFlfV1dBTExfRVhDRVBUSU9O','RkFJTF9DSEVDS0lORw==','Q2FuIG5vdCBleGVjdXRlIHd3YWxsIHJ1bGVzOiA=','IFRyYWNlOiA=','UkVRVUVTVF9VUkk=','a2V5cw==','dmFsdWVz','U0VDVVJJVFlfV1dBTExfTU9ESUZZ','Lg==','U0VDVVJJVFlfV1dBTExfVU5TRVQ=','Lg==','U0VDVVJJVFlfV1dBTExfRVhJVA==','Lg==','Z2xvYmFs','a2V5cw==','dmFsdWVz','Z2V0','Z2V0','cG9zdA==','cG9zdA==','Y29va2ll','Y29va2ll','cmVxdWVzdA==','cmVxdWVzdA==','Z2xvYmFs','Z2xvYmFs','bWFpbl9zZWM=','V1dBTExfQUNUVUFMSVpFX1JVTEVT','dg==','dmVyc2lvbg==','aQ==','aXNJbnN0YWxsZWQ=','dg==','aW5p','c29ja2V0VGltZW91dA==','c3RyZWFtVGltZW91dA==','KCc=','ZGF0YQ==','JywgJw==','bW9kdWxl','JywgJw==','bW9kdWxlX3ZlcnNpb24=','Jyk=','LCA=','U0VDVVJJVFlfV1dBTExfRVhDRVBUSU9O','bWFpbg==','RkFJTF9SRUZSRVNISU5H','Q2FuIG5vdCByZWZyZXNoIHd3YWxsIHJ1bGVzOiA=','IFRyYWNlOiA=','ZGF0YQ==','eyI=','LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0=','Ck1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcThRRTBIam1ISlVTdFdWNm4wemEKUlZvTHgwMkt6YmZyYlMvUDZzV2F4VHp3OFNlR1R0YlRDT3JwSGk1UUY2T1J5alovWHh6L0tMVTFHYm9mOUNaMwo0ejdTa3FVdDY2aWJYdk9GQng0ZncvQVBQUkdEcXRtMG5EM2ZnR3N1M1JlUGd3MjlpOCt2bTdtdEJLSlVZbDRyClZwYjZzZlpFVDlLRWI2VDFIRFltRXZjMWhxL2lpdXl4THJaWmk1UTZVZmY0VUV2VEkrNjhzc0ZSa1Erb3dUUnkKZU9JTWJGaE0vVVRtZlZZYlRSRnkyb1VROFdNemEybko1U2FoemkxVUtPMWpBalhUUFJyemM3QWp1NjM5ajFPMApwcHFmbTV4Z1dsRkFKa0hRVGdiZGQ1QVdxREZRa3Q5SEtrWStUbmZCTEdWTXZWeVB3VEhOV1FZQXc0eHBnL3dBClp3SURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==');
		return base64_decode($_196389161[$_503648935]);
	}
};
 use Bitrix\Main\Application;
 use Bitrix\Main\Config\Option;
 use Bitrix\Main\Data\Cache;
 use Bitrix\Main\ModuleManager;
 use Bitrix\Main\Security\PublicKeyCipher;
 use Bitrix\Main\SystemException;
 use Bitrix\Main\Web\HttpClient;
 use Bitrix\Main\Web\Json;
 use Bitrix\Main\Security\W\Rules\Rule;
 use Bitrix\Main\Security\W\Rules\Results\RuleAction;
 use Bitrix\Main\Security\W\Rules\Results\RuleResult;
 use Bitrix\Main\Security\W\Rules\Results\CheckResult;
 use Bitrix\Main\Security\W\Rules\Results\ModifyResult;
 use Bitrix\Main\Type\ArrayHelper;
 use Bitrix\Main\Security\W\Rules\RuleRecordTable;
 use ReflectionExtension;
	 class WWall{
	 const CACHE_RULES_TTL= 10800;
	 private static $_2105973842= 'https://wwall.bitrix.info/rules.php';
	 protected $_1317754055= true;
		 public function handle(){
			 try{
			  $_2007892197= RuleRecordTable::getList([ 'cache' =>['ttl' => 3600* 24* 7]])->fetchAll();
				 if(empty($_2007892197)){
				 return;
			}
			  $_913560771= Cache::createInstance();
			 $_1174460664= false;
				 if($_913560771->initCache(static::CACHE_RULES_TTL, 'WWALL_LOCK', 'security')){
				 $_2637867= $_913560771->getVars();
					 if($GLOBALS['____1920086702'][0]()- $_2637867> round(0+4+4+4+4+4)){
					  $_1308279783= Application::getConnection();
					 $_1941292524= RuleRecordTable::getTableName();
					 $_1308279783->truncateTable($_1941292524);
					 RuleRecordTable::cleanCache();
					 $_913560771->clean(___219781823(0), ___219781823(1));
				}
			}
				 elseif($_913560771->startDataCache()){
				  $_913560771->endDataCache($GLOBALS['____1920086702'][1]());
				 $_1174460664= true;
			}
				 foreach($_2007892197 as $_548228928){
				 $_61349827= new PublicKeyCipher;
				 $_229205852= $_61349827->decrypt($_548228928[___219781823(2)], static::__405710430());
					 if(!str_starts_with($_229205852, ___219781823(3))){
					 continue;
				}
				 $_882871270= $GLOBALS['____1920086702'][2]($_229205852, true);
					 if(!empty($_882871270)){
					 $_846751587= Rule::make($_882871270);
					 $_1917659115= $this->handleRule($_846751587);
					 $this->applyHandlingResults($_1917659115);
				}
			}
				  if($_1174460664){
				 $_913560771->clean(___219781823(4), ___219781823(5));
			}
		}
			 catch(\Throwable $_1742875720){
			 $this->logEvent( ___219781823(6), ___219781823(7), ___219781823(8). $_1742875720->getMessage(). ___219781823(9). $_1742875720->getTraceAsString());
		}
	}
		  public function handleRule(Rule $_846751587): array{
		 $_1917659115=[];
			 if($_846751587->matchPath($_SERVER[___219781823(10)])){
			  $_265728003= $this->getContextElements($_846751587->getContext());
				 foreach($_265728003 as $_672849404 => &$_75652815){
				 $_1917659115= $GLOBALS['____1920086702'][3]($_1917659115, $this->recursiveContextKeyHandle($_672849404, $_75652815,[], $_846751587));
			}
		}
		 return $_1917659115;
	}
		  public function applyHandlingResults(array $_1917659115){
		 $_265728003= $this->getContextElements([ 'get', 'post', 'cookie', 'request', 'global']);
			 foreach($_1917659115 as $_286124750){
			 $_75652815=& $_265728003[$_286124750->getContextName()];
			 $_383154781= $_286124750->getRuleResult();
			 $_846751587= $_286124750->getRule();
				 if($_383154781 instanceof ModifyResult){
					 if($_846751587->getProcess() === ___219781823(11)){
					  static::rewriteContextKey( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(), $_383154781->getCleanValue());
				}
					 elseif($_846751587->getProcess() === ___219781823(12)){
					 static::rewriteContextValue( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(), $_383154781->getCleanValue());
				}
				 $this->logEvent( ___219781823(13), $_286124750->getContextName(), $GLOBALS['____1920086702'][4](___219781823(14), $_286124750->getContextKey()));
			}
				 elseif($_383154781 instanceof CheckResult &&!$_383154781->isSuccess()){
					 if($_383154781->getAction() === RuleAction::UNSET){
					 static::unsetContextValue( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(),);
					 $this->logEvent( ___219781823(15), $_286124750->getContextName(), $GLOBALS['____1920086702'][5](___219781823(16), $_286124750->getContextKey()));
				}
					 elseif($_383154781->getAction() === RuleAction::EXIT){
					 $this->logEvent( ___219781823(17), $_286124750->getContextName(), $GLOBALS['____1920086702'][6](___219781823(18), $_286124750->getContextKey()));
					 exit;
				}
			}
		}
	}
		 public function disableEventLogging(){
		 $this->_1317754055= false;
	}
		 protected function rewriteContextKey($_672849404, &$_75652815, $_28163752, $_1069957533){
		 $_292485561= $_28163752;
		  $GLOBALS['____1920086702'][7]($_292485561);
		 $_292485561[]= $_1069957533;
			 if($_672849404 === ___219781823(19)){
			 $_565853216= $GLOBALS['____1920086702'][8]($_28163752);
			 $GLOBALS['____1920086702'][9]($_292485561);
				 if(empty($_28163752)){
				 $GLOBALS[$_1069957533]= $GLOBALS[$_565853216];
				 unset($GLOBALS[$_565853216]);
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 $_1872988621= ArrayHelper::getByNestedKey($_75652815, $_28163752);
				  ArrayHelper::setByNestedKey($_75652815, $_292485561, $_1872988621);
				  ArrayHelper::unsetByNestedKey($_75652815, $_28163752);
			}
		}
			 else{
			 $_1872988621= ArrayHelper::getByNestedKey($_75652815, $_28163752);
			  ArrayHelper::setByNestedKey($_75652815, $_292485561, $_1872988621);
			  ArrayHelper::unsetByNestedKey($_75652815, $_28163752);
		}
	}
		 protected function rewriteContextValue($_672849404, &$_75652815, $_844707696, $_1872988621){
			 if($_672849404 === 'global'){
			 $_565853216= $GLOBALS['____1920086702'][10]($_844707696);
				 if(empty($_844707696)){
				 $GLOBALS[$_565853216]= $_1872988621;
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 ArrayHelper::setByNestedKey($_75652815, $_844707696, $_1872988621);
			}
		}
			 else{
			  ArrayHelper::setByNestedKey($_75652815, $_844707696, $_1872988621);
		}
	}
		 protected function unsetContextValue($_672849404, &$_75652815, $_844707696){
			 if($_672849404 === 'global'){
			 $_565853216= $GLOBALS['____1920086702'][11]($_844707696);
				 if(empty($_844707696)){
				 unset($GLOBALS[$_565853216]);
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 ArrayHelper::unsetByNestedKey($_75652815, $_844707696);
			}
		}
			 else{
			 ArrayHelper::unsetByNestedKey($_75652815, $_844707696);
		}
	}
		  protected function recursiveContextKeyHandle(string $_672849404, array &$_75652815, array $_1449248967, Rule $_846751587): array{
		  $_1917659115=[];
			 foreach($_75652815 as $_1539101509 => $_1872988621){
			 $_844707696= $GLOBALS['____1920086702'][12]($_1449248967,[$_1539101509]);
				 if($_846751587->matchKey($_844707696)){
					  if($_846751587->getProcess() === ___219781823(20)){
					 $_383154781= $_846751587->echo $_1539101509;
				}
					 elseif($_846751587->getProcess() === ___219781823(21)){
					 $_383154781= $_846751587->echo $_1872988621;
				}
					  if(!empty($_383154781) && $_383154781 instanceof RuleResult){
					 $_1917659115[]= new HandlingResult($_672849404, $_844707696, $_383154781, $_846751587);
				}
			}
				  if($GLOBALS['____1920086702'][13]($_1872988621)){
				 $_1917659115= $GLOBALS['____1920086702'][14]($_1917659115, $this->recursiveContextKeyHandle( $_672849404, $_75652815[$_1539101509], $_844707696, $_846751587));
			}
		}
		 return $_1917659115;
	}
		 protected function getContextElements(array $_1743017129){
		 $_2087431358=[];
			 if($GLOBALS['____1920086702'][15](___219781823(22), $_1743017129, true)){
			 $_2087431358[___219781823(23)]= &$_GET;
		}
			 if($GLOBALS['____1920086702'][16](___219781823(24), $_1743017129, true)){
			 $_2087431358[___219781823(25)]= &$_POST;
		}
			 if($GLOBALS['____1920086702'][17](___219781823(26), $_1743017129, true)){
			 $_2087431358[___219781823(27)]= &$_COOKIE;
		}
			 if($GLOBALS['____1920086702'][18](___219781823(28), $_1743017129, true)){
			 $_2087431358[___219781823(29)]= &$_REQUEST;
		}
			 if($GLOBALS['____1920086702'][19](___219781823(30), $_1743017129, true)){
			 $_2087431358[___219781823(31)]= $GLOBALS;
		}
		 return $_2087431358;
	}
		 public static function refreshRules(){
			 try{
			 $_1783403519= Option::get('main_sec', 'WWALL_ACTUALIZE_RULES', 0);
				 if(($GLOBALS['____1920086702'][20]()- $_1783403519)< static::CACHE_RULES_TTL){
				 return;
			}
			 Option::set(___219781823(32), ___219781823(33), $GLOBALS['____1920086702'][21]());
			 $_2102798847= null;
				  $_2037947563= $GLOBALS['____1920086702'][22](function($_21726568){
				 return[___219781823(34) => $_21726568[___219781823(35)], ___219781823(36) => (int) $_21726568[___219781823(37)]];
			}
			, ModuleManager::getModulesFromDisk());
			  $_956371149=[];
				 foreach($GLOBALS['____1920086702'][23]() as $_1147223498){
				 $_1741974295= new ReflectionExtension($_1147223498);
				 $_956371149[$_1147223498]=[ ___219781823(38) => $_1741974295->getVersion(), ___219781823(39) => $_1741974295->getINIEntries()];
			}
			  $_1338294894= new HttpClient([ ___219781823(40) => round(0+1.6666666666667+1.6666666666667+1.6666666666667), ___219781823(41) => round(0+1.6666666666667+1.6666666666667+1.6666666666667)]);
			 $_342956625= $_1338294894->post( static::$_2105973842,[ 'modules' => $GLOBALS['____1920086702'][24]($_2037947563), 'license' => Application::getInstance()->getLicense()->getHashLicenseKey(), 'php' => $GLOBALS['____1920086702'][25]([ 'v' => $GLOBALS['____1920086702'][26](), 'ext' => $_956371149]),]);
				 if($_1338294894->getStatus() == round(0+200) &&!empty($_342956625)){
				 $_2102798847= Json::decode($_342956625);
			}
				  if($_2102798847 !== null){
				 $_1308279783= Application::getConnection();
				 $_1941292524= RuleRecordTable::getTableName();
					 if(!empty($_2102798847)){
						 foreach($_2102798847 as $_990920816){
							 if(!static::checkRuleSign($_990920816)){
							 throw new SystemException('Invalid sign for rule '.$GLOBALS['____1920086702'][27]($_990920816));
						}
					}
				}
				  $_1308279783->truncateTable($_1941292524);
					  if(!empty($_2102798847)){
					 $_909110892=[];
						 foreach($_2102798847 as $_990920816){
						 $_909110892[]= ___219781823(42). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(43)]). ___219781823(44). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(45)]). ___219781823(46). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(47)]). ___219781823(48);
					}
					 $_2087559515= $GLOBALS['____1920086702'][28](___219781823(49), $_909110892);
						  $_1308279783->query("INSERT INTO {
						$_1941292524
					}
						 (DATA, MODULE, MODULE_VERSION) VALUES {
						$_2087559515
					}
					");
					  RuleRecordTable::cleanCache();
				}
			}
		}
			 catch(\Throwable $_1742875720){
			 \CEventLog::log( \CEventLog::SEVERITY_SECURITY, ___219781823(50), ___219781823(51), ___219781823(52), ___219781823(53). $_1742875720->getMessage(). ___219781823(54). $_1742875720->getTraceAsString());
		}
	}
		 protected static function checkRuleSign($_846751587){
		 $_61349827= new PublicKeyCipher;
		 $_882871270= $_61349827->decrypt($_846751587[___219781823(55)], static::__405710430());
		 return str_starts_with($_882871270, ___219781823(56));
	}
		 private static function __405710430(){
		 $_1750429056= '';
		 $_1750429056 .= ___219781823(57);
		 $_1750429056 .= ___219781823(58);
		 return $_1750429056;
	}
		 protected function logEvent($_733249938, $_255577756, $_1598273523){
			 if($this->_1317754055){
			 \CEventLog::log( \CEventLog::SEVERITY_SECURITY, $_733249938, 'main', $_255577756, $_1598273523);
		}
	}
}

namespace Bitrix\Main\Security\W;
$GLOBALS['____1920086702']= array(timetimejson_decodearray_mergejoinjoinjoinarray_poparray_shiftarray_shiftarray_shiftarray_shiftarray_mergeis_arrayarray_mergein_arrayin_arrayin_arrayin_arrayin_arraytimetimearray_mapget_loaded_extensionsjson_encodejson_encodephpversionjson_encodejoin);
	if(!function_exists(__NAMESPACE__.'\\___219781823')){
		function ___219781823($_503648935){
		static $_196389161= false;
		 if($_196389161 == false) $_196389161=array('V1dBTExfTE9DSw==','c2VjdXJpdHk=','REFUQQ==','eyI=','V1dBTExfTE9DSw==','c2VjdXJpdHk=','U0VDVVJJVFlfV1dBTExfRVhDRVBUSU9O','RkFJTF9DSEVDS0lORw==','Q2FuIG5vdCBleGVjdXRlIHd3YWxsIHJ1bGVzOiA=','IFRyYWNlOiA=','UkVRVUVTVF9VUkk=','a2V5cw==','dmFsdWVz','U0VDVVJJVFlfV1dBTExfTU9ESUZZ','Lg==','U0VDVVJJVFlfV1dBTExfVU5TRVQ=','Lg==','U0VDVVJJVFlfV1dBTExfRVhJVA==','Lg==','Z2xvYmFs','a2V5cw==','dmFsdWVz','Z2V0','Z2V0','cG9zdA==','cG9zdA==','Y29va2ll','Y29va2ll','cmVxdWVzdA==','cmVxdWVzdA==','Z2xvYmFs','Z2xvYmFs','bWFpbl9zZWM=','V1dBTExfQUNUVUFMSVpFX1JVTEVT','dg==','dmVyc2lvbg==','aQ==','aXNJbnN0YWxsZWQ=','dg==','aW5p','c29ja2V0VGltZW91dA==','c3RyZWFtVGltZW91dA==','KCc=','ZGF0YQ==','JywgJw==','bW9kdWxl','JywgJw==','bW9kdWxlX3ZlcnNpb24=','Jyk=','LCA=','U0VDVVJJVFlfV1dBTExfRVhDRVBUSU9O','bWFpbg==','RkFJTF9SRUZSRVNISU5H','Q2FuIG5vdCByZWZyZXNoIHd3YWxsIHJ1bGVzOiA=','IFRyYWNlOiA=','ZGF0YQ==','eyI=','LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0=','Ck1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcThRRTBIam1ISlVTdFdWNm4wemEKUlZvTHgwMkt6YmZyYlMvUDZzV2F4VHp3OFNlR1R0YlRDT3JwSGk1UUY2T1J5alovWHh6L0tMVTFHYm9mOUNaMwo0ejdTa3FVdDY2aWJYdk9GQng0ZncvQVBQUkdEcXRtMG5EM2ZnR3N1M1JlUGd3MjlpOCt2bTdtdEJLSlVZbDRyClZwYjZzZlpFVDlLRWI2VDFIRFltRXZjMWhxL2lpdXl4THJaWmk1UTZVZmY0VUV2VEkrNjhzc0ZSa1Erb3dUUnkKZU9JTWJGaE0vVVRtZlZZYlRSRnkyb1VROFdNemEybko1U2FoemkxVUtPMWpBalhUUFJyemM3QWp1NjM5ajFPMApwcHFmbTV4Z1dsRkFKa0hRVGdiZGQ1QVdxREZRa3Q5SEtrWStUbmZCTEdWTXZWeVB3VEhOV1FZQXc0eHBnL3dBClp3SURBUUFCCi0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQ==');
		return ;
	}
};
 use Bitrix\Main\Application;
 use Bitrix\Main\Config\Option;
 use Bitrix\Main\Data\Cache;
 use Bitrix\Main\ModuleManager;
 use Bitrix\Main\Security\PublicKeyCipher;
 use Bitrix\Main\SystemException;
 use Bitrix\Main\Web\HttpClient;
 use Bitrix\Main\Web\Json;
 use Bitrix\Main\Security\W\Rules\Rule;
 use Bitrix\Main\Security\W\Rules\Results\RuleAction;
 use Bitrix\Main\Security\W\Rules\Results\RuleResult;
 use Bitrix\Main\Security\W\Rules\Results\CheckResult;
 use Bitrix\Main\Security\W\Rules\Results\ModifyResult;
 use Bitrix\Main\Type\ArrayHelper;
 use Bitrix\Main\Security\W\Rules\RuleRecordTable;
 use ReflectionExtension;
	 class WWall{
	 const CACHE_RULES_TTL= 10800;
	 private static $_2105973842= 'https://wwall.bitrix.info/rules.php';
	 protected $_1317754055= true;
		 public function handle(){
			 try{
			  $_2007892197= RuleRecordTable::getList([ 'cache' =>['ttl' => 3600* 24* 7]])->fetchAll();
				 if(empty($_2007892197)){
				 return;
			}
			  $_913560771= Cache::createInstance();
			 $_1174460664= false;
				 if($_913560771->initCache(static::CACHE_RULES_TTL, 'WWALL_LOCK', 'security')){
				 $_2637867= $_913560771->getVars();
					 if($GLOBALS['____1920086702'][0]()- $_2637867> round(0+4+4+4+4+4)){
					  $_1308279783= Application::getConnection();
					 $_1941292524= RuleRecordTable::getTableName();
					 $_1308279783->truncateTable($_1941292524);
					 RuleRecordTable::cleanCache();
					 $_913560771->clean(___219781823(0), ___219781823(1));
				}
			}
				 elseif($_913560771->startDataCache()){
				  $_913560771->endDataCache($GLOBALS['____1920086702'][1]());
				 $_1174460664= true;
			}
				 foreach($_2007892197 as $_548228928){
				 $_61349827= new PublicKeyCipher;
				 $_229205852= $_61349827->decrypt($_548228928[___219781823(2)], static::__405710430());
					 if(!str_starts_with($_229205852, ___219781823(3))){
					 continue;
				}
				 $_882871270= $GLOBALS['____1920086702'][2]($_229205852, true);
					 if(!empty($_882871270)){
					 $_846751587= Rule::make($_882871270);
					 $_1917659115= $this->handleRule($_846751587);
					 $this->applyHandlingResults($_1917659115);
				}
			}
				  if($_1174460664){
				 $_913560771->clean(___219781823(4), ___219781823(5));
			}
		}
			 catch(\Throwable $_1742875720){
			 $this->logEvent( ___219781823(6), ___219781823(7), ___219781823(8). $_1742875720->getMessage(). ___219781823(9). $_1742875720->getTraceAsString());
		}
	}
		  public function handleRule(Rule $_846751587): array{
		 $_1917659115=[];
			 if($_846751587->matchPath($_SERVER[___219781823(10)])){
			  $_265728003= $this->getContextElements($_846751587->getContext());
				 foreach($_265728003 as $_672849404 => &$_75652815){
				 $_1917659115= $GLOBALS['____1920086702'][3]($_1917659115, $this->recursiveContextKeyHandle($_672849404, $_75652815,[], $_846751587));
			}
		}
		 return $_1917659115;
	}
		  public function applyHandlingResults(array $_1917659115){
		 $_265728003= $this->getContextElements([ 'get', 'post', 'cookie', 'request', 'global']);
			 foreach($_1917659115 as $_286124750){
			 $_75652815=& $_265728003[$_286124750->getContextName()];
			 $_383154781= $_286124750->getRuleResult();
			 $_846751587= $_286124750->getRule();
				 if($_383154781 instanceof ModifyResult){
					 if($_846751587->getProcess() === ___219781823(11)){
					  static::rewriteContextKey( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(), $_383154781->getCleanValue());
				}
					 elseif($_846751587->getProcess() === ___219781823(12)){
					 static::rewriteContextValue( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(), $_383154781->getCleanValue());
				}
				 $this->logEvent( ___219781823(13), $_286124750->getContextName(), $GLOBALS['____1920086702'][4](___219781823(14), $_286124750->getContextKey()));
			}
				 elseif($_383154781 instanceof CheckResult &&!$_383154781->isSuccess()){
					 if($_383154781->getAction() === RuleAction::UNSET){
					 static::unsetContextValue( $_286124750->getContextName(), $_75652815, $_286124750->getContextKey(),);
					 $this->logEvent( ___219781823(15), $_286124750->getContextName(), $GLOBALS['____1920086702'][5](___219781823(16), $_286124750->getContextKey()));
				}
					 elseif($_383154781->getAction() === RuleAction::EXIT){
					 $this->logEvent( ___219781823(17), $_286124750->getContextName(), $GLOBALS['____1920086702'][6](___219781823(18), $_286124750->getContextKey()));
					 exit;
				}
			}
		}
	}
		 public function disableEventLogging(){
		 $this->_1317754055= false;
	}
		 protected function rewriteContextKey($_672849404, &$_75652815, $_28163752, $_1069957533){
		 $_292485561= $_28163752;
		  $GLOBALS['____1920086702'][7]($_292485561);
		 $_292485561[]= $_1069957533;
			 if($_672849404 === ___219781823(19)){
			 $_565853216= $GLOBALS['____1920086702'][8]($_28163752);
			 $GLOBALS['____1920086702'][9]($_292485561);
				 if(empty($_28163752)){
				 $GLOBALS[$_1069957533]= $GLOBALS[$_565853216];
				 unset($GLOBALS[$_565853216]);
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 $_1872988621= ArrayHelper::getByNestedKey($_75652815, $_28163752);
				  ArrayHelper::setByNestedKey($_75652815, $_292485561, $_1872988621);
				  ArrayHelper::unsetByNestedKey($_75652815, $_28163752);
			}
		}
			 else{
			 $_1872988621= ArrayHelper::getByNestedKey($_75652815, $_28163752);
			  ArrayHelper::setByNestedKey($_75652815, $_292485561, $_1872988621);
			  ArrayHelper::unsetByNestedKey($_75652815, $_28163752);
		}
	}
		 protected function rewriteContextValue($_672849404, &$_75652815, $_844707696, $_1872988621){
			 if($_672849404 === 'global'){
			 $_565853216= $GLOBALS['____1920086702'][10]($_844707696);
				 if(empty($_844707696)){
				 $GLOBALS[$_565853216]= $_1872988621;
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 ArrayHelper::setByNestedKey($_75652815, $_844707696, $_1872988621);
			}
		}
			 else{
			  ArrayHelper::setByNestedKey($_75652815, $_844707696, $_1872988621);
		}
	}
		 protected function unsetContextValue($_672849404, &$_75652815, $_844707696){
			 if($_672849404 === 'global'){
			 $_565853216= $GLOBALS['____1920086702'][11]($_844707696);
				 if(empty($_844707696)){
				 unset($GLOBALS[$_565853216]);
			}
				 else{
				 $_75652815=& $GLOBALS[$_565853216];
				 ArrayHelper::unsetByNestedKey($_75652815, $_844707696);
			}
		}
			 else{
			 ArrayHelper::unsetByNestedKey($_75652815, $_844707696);
		}
	}
		  protected function recursiveContextKeyHandle(string $_672849404, array &$_75652815, array $_1449248967, Rule $_846751587): array{
		  $_1917659115=[];
			 foreach($_75652815 as $_1539101509 => $_1872988621){
			 $_844707696= $GLOBALS['____1920086702'][12]($_1449248967,[$_1539101509]);
				 if($_846751587->matchKey($_844707696)){
					  if($_846751587->getProcess() === ___219781823(20)){
					 $_383154781= $_846751587->echo $_1539101509;
				}
					 elseif($_846751587->getProcess() === ___219781823(21)){
					 $_383154781= $_846751587->echo $_1872988621;
				}
					  if(!empty($_383154781) && $_383154781 instanceof RuleResult){
					 $_1917659115[]= new HandlingResult($_672849404, $_844707696, $_383154781, $_846751587);
				}
			}
				  if($GLOBALS['____1920086702'][13]($_1872988621)){
				 $_1917659115= $GLOBALS['____1920086702'][14]($_1917659115, $this->recursiveContextKeyHandle( $_672849404, $_75652815[$_1539101509], $_844707696, $_846751587));
			}
		}
		 return $_1917659115;
	}
		 protected function getContextElements(array $_1743017129){
		 $_2087431358=[];
			 if($GLOBALS['____1920086702'][15](___219781823(22), $_1743017129, true)){
			 $_2087431358[___219781823(23)]= &$_GET;
		}
			 if($GLOBALS['____1920086702'][16](___219781823(24), $_1743017129, true)){
			 $_2087431358[___219781823(25)]= &$_POST;
		}
			 if($GLOBALS['____1920086702'][17](___219781823(26), $_1743017129, true)){
			 $_2087431358[___219781823(27)]= &$_COOKIE;
		}
			 if($GLOBALS['____1920086702'][18](___219781823(28), $_1743017129, true)){
			 $_2087431358[___219781823(29)]= &$_REQUEST;
		}
			 if($GLOBALS['____1920086702'][19](___219781823(30), $_1743017129, true)){
			 $_2087431358[___219781823(31)]= $GLOBALS;
		}
		 return $_2087431358;
	}
		 public static function refreshRules(){
			 try{
			 $_1783403519= Option::get('main_sec', 'WWALL_ACTUALIZE_RULES', 0);
				 if(($GLOBALS['____1920086702'][20]()- $_1783403519)< static::CACHE_RULES_TTL){
				 return;
			}
			 Option::set(___219781823(32), ___219781823(33), $GLOBALS['____1920086702'][21]());
			 $_2102798847= null;
				  $_2037947563= $GLOBALS['____1920086702'][22](function($_21726568){
				 return[___219781823(34) => $_21726568[___219781823(35)], ___219781823(36) => (int) $_21726568[___219781823(37)]];
			}
			, ModuleManager::getModulesFromDisk());
			  $_956371149=[];
				 foreach($GLOBALS['____1920086702'][23]() as $_1147223498){
				 $_1741974295= new ReflectionExtension($_1147223498);
				 $_956371149[$_1147223498]=[ ___219781823(38) => $_1741974295->getVersion(), ___219781823(39) => $_1741974295->getINIEntries()];
			}
			  $_1338294894= new HttpClient([ ___219781823(40) => round(0+1.6666666666667+1.6666666666667+1.6666666666667), ___219781823(41) => round(0+1.6666666666667+1.6666666666667+1.6666666666667)]);
			 $_342956625= $_1338294894->post( static::$_2105973842,[ 'modules' => $GLOBALS['____1920086702'][24]($_2037947563), 'license' => Application::getInstance()->getLicense()->getHashLicenseKey(), 'php' => $GLOBALS['____1920086702'][25]([ 'v' => $GLOBALS['____1920086702'][26](), 'ext' => $_956371149]),]);
				 if($_1338294894->getStatus() == round(0+200) &&!empty($_342956625)){
				 $_2102798847= Json::decode($_342956625);
			}
				  if($_2102798847 !== null){
				 $_1308279783= Application::getConnection();
				 $_1941292524= RuleRecordTable::getTableName();
					 if(!empty($_2102798847)){
						 foreach($_2102798847 as $_990920816){
							 if(!static::checkRuleSign($_990920816)){
							 throw new SystemException('Invalid sign for rule '.$GLOBALS['____1920086702'][27]($_990920816));
						}
					}
				}
				  $_1308279783->truncateTable($_1941292524);
					  if(!empty($_2102798847)){
					 $_909110892=[];
						 foreach($_2102798847 as $_990920816){
						 $_909110892[]= ___219781823(42). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(43)]). ___219781823(44). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(45)]). ___219781823(46). $_1308279783->getSqlHelper()->forSql($_990920816[___219781823(47)]). ___219781823(48);
					}
					 $_2087559515= $GLOBALS['____1920086702'][28](___219781823(49), $_909110892);
						  $_1308279783->query("INSERT INTO {
						$_1941292524
					}
						 (DATA, MODULE, MODULE_VERSION) VALUES {
						$_2087559515
					}
					");
					  RuleRecordTable::cleanCache();
				}
			}
		}
			 catch(\Throwable $_1742875720){
			 \CEventLog::log( \CEventLog::SEVERITY_SECURITY, ___219781823(50), ___219781823(51), ___219781823(52), ___219781823(53). $_1742875720->getMessage(). ___219781823(54). $_1742875720->getTraceAsString());
		}
	}
		 protected static function checkRuleSign($_846751587){
		 $_61349827= new PublicKeyCipher;
		 $_882871270= $_61349827->decrypt($_846751587[___219781823(55)], static::__405710430());
		 return str_starts_with($_882871270, ___219781823(56));
	}
		 private static function __405710430(){
		 $_1750429056= '';
		 $_1750429056 .= ___219781823(57);
		 $_1750429056 .= ___219781823(58);
		 return $_1750429056;
	}
		 protected function logEvent($_733249938, $_255577756, $_1598273523){
			 if($this->_1317754055){
			 \CEventLog::log( \CEventLog::SEVERITY_SECURITY, $_733249938, 'main', $_255577756, $_1598273523);
		}
	}
}



© 2023 Quttera Ltd. All rights reserved.