Japanese English

PHP deobfuscation, decryption, reconstruction tool

De-obfuscate PHP malware/viruses and tampering code on Wordpress to original readable code.

*Please note that not all obfuscation codes can be decoded.

Decoded the code below.

<?php namespace Mgt\Varnish\Model\Cache; class Config { protected $config; protected $deploymentConfigWriter; protected $deploymentConfigReader; protected $configFactory; protected $storeManager; public function __construct(\Magento\Framework\App\DeploymentConfig\Writer $deploymentConfigWriter, \...



Obfuscated php code

<?php
 namespace Mgt\Varnish\Model\Cache; class Config { protected $config; protected $deploymentConfigWriter; protected $deploymentConfigReader; protected $configFactory; protected $storeManager; public function __construct(\Magento\Framework\App\DeploymentConfig\Writer $deploymentConfigWriter, \Magento\Framework\App\DeploymentConfig\Reader $deploymentConfigReader, \Magento\Framework\App\Config $config, \Magento\Config\Model\Config\Factory $configFactory, \Magento\Store\Model\StoreManagerInterface $storeManager) { goto c1c80; Bb5bb: $this->storeManager = $storeManager; goto c4364; Df9a1: $this->configFactory = $configFactory; goto Bb5bb; Ca870: $this->config = $config; goto Df9a1; c1c80: $this->deploymentConfigWriter = $deploymentConfigWriter; goto fb236; fb236: $this->deploymentConfigReader = $deploymentConfigReader; goto Ca870; c4364: } public function isEnabled($store = null) { $isEnabled = (bool) $this->getConfigValue("\155\x67\x74\137\x76\x61\162\156\x69\163\x68\x2f\155\157\144\x75\154\145\57\x69\x73\x5f\x65\x6e\141\x62\154\x65\x64", $store); return $isEnabled; } public function getServerList($store = null) { $serverList = array_map("\164\162\x69\x6d", explode("\54", (string) $this->getConfigValue("\x6d\x67\x74\137\166\x61\162\x6e\151\x73\x68\57\155\x6f\144\165\154\145\x2f\163\x65\162\166\x65\x72\137\154\x69\x73\164", $store))); return $serverList; } public function getExcludedRoutes($store = null) { $excludedRoutes = explode("\12", trim((string) $this->getConfigValue("\x6d\147\x74\137\x76\141\x72\x6e\151\163\x68\x2f\155\157\144\x75\154\x65\x2f\145\170\x63\154\165\144\x65\144\x5f\x72\x6f\165\164\x65\x73", $store))); return $excludedRoutes; } public function getExcludedUrls($store = null) { $excludedUrls = explode("\12", trim((string) $this->getConfigValue("\155\147\x74\x5f\166\141\162\x6e\x69\x73\150\57\155\x6f\x64\x75\x6c\x65\57\145\170\143\x6c\x75\x64\x65\144\x5f\x75\162\x6c\x73", $store))); return $excludedUrls; } public function getExcludedParams($store = null) { $excludedParams = array_map("\x74\162\151\155", explode("\x2c", $this->getConfigValue("\155\147\x74\x5f\x76\x61\x72\156\x69\x73\150\x2f\x6d\x6f\x64\x75\154\145\x2f\x65\x78\143\154\x75\x64\x65\144\x5f\x70\x61\162\141\x6d\x73", $store))); return $excludedParams; } public function getDefaultCacheLifetime($store = null) { $defaultCacheLifetime = (int) $this->getConfigValue("\x6d\147\x74\x5f\166\x61\162\x6e\151\163\x68\x2f\155\x6f\144\165\154\x65\57\x64\x65\146\141\165\x6c\x74\137\x63\x61\143\x68\145\x5f\154\x69\146\x65\164\151\x6d\145", $store); return $defaultCacheLifetime; } public function isDebugModeEnabled($store = null) { $isDebugModeEnabled = (bool) $this->getConfigValue("\x6d\147\x74\137\x76\x61\x72\x6e\x69\x73\x68\x2f\155\157\x64\165\154\145\x2f\144\145\x62\165\x67\137\155\157\144\x65", $store); return $isDebugModeEnabled; } public function getApiSecretKey($store = null) { $apiSecretKey = trim((string) $this->getConfigValue("\155\x67\164\x5f\x76\x61\x72\156\151\163\150\57\x6d\157\x64\165\x6c\145\x2f\141\160\151\x5f\x73\145\x63\162\145\x74\x5f\153\145\x79", $store)); return $apiSecretKey; } public function getRoutesCacheLifetime($store = null) { goto Dd5e3; F35b4: return $routesCacheLifetime; goto F4b61; efac0: $routesCacheLifetime = (array) $routesCacheLifetime; goto F35b4; Dd5e3: $routesCacheLifetime = trim((string) $this->getConfigValue("\x6d\147\164\x5f\x76\141\162\x6e\151\x73\x68\x2f\155\157\144\x75\154\x65\57\162\x6f\x75\164\x65\163\x5f\143\x61\x63\150\x65\x5f\154\x69\146\145\x74\x69\155\x65", $store)); goto Fa177; Fa177: $routesCacheLifetime = json_decode($routesCacheLifetime, true); goto efac0; F4b61: } public function isCacheWarmerEnabled($store = null) { $isCacheWarmerEnabled = (bool) $this->getConfigValue("\155\x67\x74\137\x76\x61\162\x6e\x69\x73\x68\x2f\x6d\157\144\x75\154\x65\57\143\141\x63\150\145\x5f\x77\x61\x72\x6d\145\x72\x5f\x65\156\141\x62\x6c\x65\x64", $store); return $isCacheWarmerEnabled; } public function getCacheWarmerRoutes($store = null) { $cacheWarmerRoutes = array_map("\x74\162\x69\x6d", explode("\12", trim($this->getConfigValue("\155\147\x74\x5f\x76\x61\x72\x6e\x69\x73\150\57\x6d\157\x64\x75\154\145\x2f\x63\141\143\x68\x65\x5f\x77\141\162\155\145\162\137\x72\x6f\165\x74\x65\163", $store)))); return $cacheWarmerRoutes; } public function getNumberOfCacheWarmerThreads($store = null) { $numberOfCacheWarmerThreads = (int) $this->getConfigValue("\155\x67\x74\137\166\141\x72\156\x69\163\x68\x2f\155\x6f\144\x75\154\x65\57\143\141\x63\x68\145\x5f\167\141\x72\155\145\162\x5f\164\x68\x72\x65\141\144\163", $store); return $numberOfCacheWarmerThreads; } public function getCacheWarmerCpuLimit($store = null) { $cacheWarmerCpuLimit = (int) $this->getConfigValue("\x6d\147\164\x5f\166\141\162\x6e\151\x73\x68\x2f\155\x6f\x64\165\154\x65\57\143\141\143\x68\x65\137\x77\141\162\155\145\x72\x5f\x63\160\x75\x5f\x6c\x69\155\151\164", $store); return $cacheWarmerCpuLimit; } public function isCacheWarmerCpuLimitEnabled($store = null) { $isCacheWarmerCpuLimitEnabled = (bool) $this->getConfigValue("\155\147\164\137\x76\x61\162\156\151\163\150\x2f\155\157\144\x75\x6c\145\x2f\x63\x61\x63\x68\x65\137\167\x61\x72\x6d\145\162\x5f\x63\x70\x75\x5f\x6c\x69\155\151\164\137\x65\x6e\x61\x62\x6c\145\144", $store); return $isCacheWarmerCpuLimitEnabled; } protected function getConfigValue($path, $store = null, $scope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE) { goto a8324; fdad4: return $configValue; goto B8a46; Ed297: $configValue = $this->config->getValue($path, $scope, $store); goto fdad4; a8324: if (!(null === $store)) { goto D9700; } goto Bd96b; Bd96b: $store = $this->storeManager->getStore(); goto f9598; f9598: D9700: goto Ed297; B8a46: } }

Decoded(de-Obfuscated) php code

<?php

namespace Mgt\Varnish\Model\Cache;

class Config
{
    protected $config;
    protected $deploymentConfigWriter;
    protected $deploymentConfigReader;
    protected $configFactory;
    protected $storeManager;
    public function __construct(\Magento\Framework\App\DeploymentConfig\Writer $deploymentConfigWriter, \Magento\Framework\App\DeploymentConfig\Reader $deploymentConfigReader, \Magento\Framework\App\Config $config, \Magento\Config\Model\Config\Factory $configFactory, \Magento\Store\Model\StoreManagerInterface $storeManager)
    {
        $this->deploymentConfigWriter = $deploymentConfigWriter;
        $this->deploymentConfigReader = $deploymentConfigReader;
        $this->config = $config;
        $this->configFactory = $configFactory;
        $this->storeManager = $storeManager;
    }
    public function isEnabled($store = null)
    {
        $isEnabled = (bool) $this->getConfigValue("mgt_varnish/module/is_enabled", $store);
        return $isEnabled;
    }
    public function getServerList($store = null)
    {
        $serverList = array_map("trim", explode(",", (string) $this->getConfigValue("mgt_varnish/module/server_list", $store)));
        return $serverList;
    }
    public function getExcludedRoutes($store = null)
    {
        $excludedRoutes = explode("\n", trim((string) $this->getConfigValue("mgt_varnish/module/excluded_routes", $store)));
        return $excludedRoutes;
    }
    public function getExcludedUrls($store = null)
    {
        $excludedUrls = explode("\n", trim((string) $this->getConfigValue("mgt_varnish/module/excluded_urls", $store)));
        return $excludedUrls;
    }
    public function getExcludedParams($store = null)
    {
        $excludedParams = array_map("trim", explode(",", $this->getConfigValue("mgt_varnish/module/excluded_params", $store)));
        return $excludedParams;
    }
    public function getDefaultCacheLifetime($store = null)
    {
        $defaultCacheLifetime = (int) $this->getConfigValue("mgt_varnish/module/default_cache_lifetime", $store);
        return $defaultCacheLifetime;
    }
    public function isDebugModeEnabled($store = null)
    {
        $isDebugModeEnabled = (bool) $this->getConfigValue("mgt_varnish/module/debug_mode", $store);
        return $isDebugModeEnabled;
    }
    public function getApiSecretKey($store = null)
    {
        $apiSecretKey = trim((string) $this->getConfigValue("mgt_varnish/module/api_secret_key", $store));
        return $apiSecretKey;
    }
    public function getRoutesCacheLifetime($store = null)
    {
        $routesCacheLifetime = trim((string) $this->getConfigValue("mgt_varnish/module/routes_cache_lifetime", $store));
        $routesCacheLifetime = json_decode($routesCacheLifetime, true);
        $routesCacheLifetime = (array) $routesCacheLifetime;
        return $routesCacheLifetime;
    }
    public function isCacheWarmerEnabled($store = null)
    {
        $isCacheWarmerEnabled = (bool) $this->getConfigValue("mgt_varnish/module/cache_warmer_enabled", $store);
        return $isCacheWarmerEnabled;
    }
    public function getCacheWarmerRoutes($store = null)
    {
        $cacheWarmerRoutes = array_map("trim", explode("\n", trim($this->getConfigValue("mgt_varnish/module/cache_warmer_routes", $store))));
        return $cacheWarmerRoutes;
    }
    public function getNumberOfCacheWarmerThreads($store = null)
    {
        $numberOfCacheWarmerThreads = (int) $this->getConfigValue("mgt_varnish/module/cache_warmer_threads", $store);
        return $numberOfCacheWarmerThreads;
    }
    public function getCacheWarmerCpuLimit($store = null)
    {
        $cacheWarmerCpuLimit = (int) $this->getConfigValue("mgt_varnish/module/cache_warmer_cpu_limit", $store);
        return $cacheWarmerCpuLimit;
    }
    public function isCacheWarmerCpuLimitEnabled($store = null)
    {
        $isCacheWarmerCpuLimitEnabled = (bool) $this->getConfigValue("mgt_varnish/module/cache_warmer_cpu_limit_enabled", $store);
        return $isCacheWarmerCpuLimitEnabled;
    }
    protected function getConfigValue($path, $store = null, $scope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE)
    {
        if (!(null === $store)) {
            goto D9700;
        }
        $store = $this->storeManager->getStore();
        D9700:
        $configValue = $this->config->getValue($path, $scope, $store);
        return $configValue;
    }
}


Malware detection & removal plugin for WordPress

(C)2020 Wordpress Doctor All rights reserved.