shell bypass 403
Cubjrnet7 Shell
: /home/eklavya/backups/joomla3oldsite/administrator/components/com_migrateme4/classes/ [ drwxr-xr-x ]
<?php /* ------------------------------------------- Component: com_migrateMe4 Author: Barnaby V. Dixon Email: [email protected] Copywrite: Copywrite (C) 2015 Barnaby Dixon. All Rights Reserved. License: http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL ---------------------------------------------*/ defined('_JEXEC') or die('Restricted access'); spl_autoload_register(function ($class) { $namespace = 'stg'; if (substr($class, 0, strlen($namespace)) === $namespace) { $file = $class . '.class.php'; $xfile = JPATH_ADMINISTRATOR . '/components/com_migrateme4/classes/'. $file; if (file_exists($xfile)) require_once ($xfile); } }); class migrateMe4 { private static $params = array( 'speed' => 1, 'accel' => 1, 'optimize' => 1, 'backup' => 1, 'safe' => 1, 'filetime' => 0, 'tables' => array(), 'folders' => array(), 'target' => '4.3.2', 'oldversion' => '3.0.0' ); private static $params_file = '/components/com_migrateme4/params.php'; private static $prechecks = array( 'space' => '0', 'memory' => '128', //128Mb 'timeout' => '30', 'files' => 99, 'version' => '5.3.10', 'config' => 1, 'ajcheck' => 0 ); private static $sysinfo = array( 'space' => array('Available Disk Space', 'Available Disk Space', 'Your system does not have enough disk space to clone your current system - or your available disk space cannot be determined. Please check you have enough space available before continuing.'), 'memory' => array('Available Memory', 'Available Memory', 'Your system does not have enough memory available to reliably clone your current system. Please add some memory and try again.'), 'timeout' => array('PHP Timeout', 'PHP Timeout', 'Your PHP timeout is too low to reliably clone your system. Please increase your PHP timeout and try again.'), 'files' => array('File Permissions OK', 'Incorrect File Permissions', 'Your system needs to have the correct file permissions set. Please ensure the server can both read and write files on your Joomla system. The best way to do this is to run PHP in Fast CGI mode, which is the most secure and efficient way of resolving any permissions issues. Alternatively you will need to give 0777 permissions to your entire system while you use this extension.\n\nPlease see the documentation for more information.\n\nError message: '), 'version' => array('PHP Version', 'PHP Version', 'MigrateMe 4 (and Joomla 3.x) need PHP 5.3.10 or above to work well... please update PHP to 7.x or higher to migrate.'),//'Some versions of Joomla 3.x work best with PHP 7.4 and below. MigrateMe 4 works well with PHP 8.x... but if you experience any issues, it might be to do with Joomla 3.x and PHP 8, so roll back (temporarily) to PHP 7.x during migration and it might help. Once you\re on Joomla 4, switch back to PHP 8.x'), 'config' => array('PHP Config OK', 'Incorrect PHP Configuration', 'Please check your PHP configuration for issues - for more guidance contact support at PHP Web Design'), 'ajcheck' => array('Checking AJAX...', 'Checking AJAX...', ''), 'package' => array('Checking package availability...', 'Checking package availability...', ''), ); private static $coreFolders = array( 'administrator', 'bin', 'cache', 'cli', 'components', 'images', 'includes', 'language', 'layouts', 'logs', 'libraries', 'media', 'modules', 'plugins', 'templates', 'tmp' ); private static $coreFiles = array( '.htaccess', 'htaccess.txt', 'configuration.php', 'index.php', 'joomla.xml', 'LICENSE.txt', 'README.txt', 'robots.txt', 'robots.txt.dist', 'web.config.txt' ); private static $ignoreDirs = array( 'administrator/cache/', 'cache/', 'logs/', 'tmp/' ); private static $ignoreDb = array( 'session', 'finder_links', 'finder_links_terms0', 'finder_links_terms1', 'finder_links_terms2', 'finder_links_terms3', 'finder_links_terms4', 'finder_links_terms5', 'finder_links_terms6', 'finder_links_terms7', 'finder_links_terms8', 'finder_links_terms9', 'finder_links_termsa', 'finder_links_termsb', 'finder_links_termsc', 'finder_links_termsd', 'finder_links_termse', 'finder_links_termsf', ); private static $stgprefix = 'mm4_'; private static $stgfolder = 'mm4/'; private static $backfolder = 'backups/'; public static function _checkBackup() { $oldversion = vbMParams::_getParam('oldversion'); $dirs = vbMFiles::_getDir(self::_getBackFolder(),1); natsort($dirs); $dirs = array_reverse($dirs); if(count($dirs)>0) foreach($dirs as $f) { if(!file_exists($f.'/sql.sql.gz') && !file_exists($f.'/sql.sql')) continue; foreach(array('joomla.xml','administrator/manifests/files/joomla.xml') as $a) { $jxml = $f.'/'.$a; if(file_exists($jxml)) { $xml = simplexml_load_file($jxml); if(version_compare($oldversion, $xml->version) === 0) { return $f; } } } } return FALSE; } public static function _initParams() { $file = JPATH_ADMINISTRATOR.self::$params_file; vbMParams::_init(self::$params, $file); } public static function _getIgnoreDirs() { return self::$ignoreDirs; } public static function _getIgnoreDb() { return self::$ignoreDb; } public static function _getDbPrefix($live=0) { require_once(JPATH_CONFIGURATION.'/configuration.php'); $CONFIG = new JConfig(); $prefix = $CONFIG->dbprefix; switch($live) { case 1: $prefix = str_replace(self::_getStgPrefix(),'',$prefix); break; case 2: $prefix = self::_getStgPrefix(); break; case 3: $prefix = self::_getStgPrefix().$prefix; break; } return $prefix; } public static function _getDbName() { require_once(JPATH_CONFIGURATION.'/configuration.php'); $CONFIG = new JConfig(); return $CONFIG->db; } public static function _getCoreFolders($files=0) { $core = self::$coreFolders; return $core; } public static function _getCoreFiles() { $core = self::$coreFiles; return $core; } public static function _getStgPrefix() { return self::$stgprefix; } public static function _getStgFolder() { return self::$stgfolder; } public static function _getBackFolder() { $folder = self::$backfolder; $folder = (self::_isLive()) ? '../'.$folder : '../../'.$folder; return $folder; } public static function _getDataTables($live = 0) { $dbname = self::_getDbName(); $prefix = self::_getDbPrefix($live); return vbMDb::_showTables($dbname,$prefix); } private function getSubFolders($dir) { if(substr($dir,-1) !== '/') $dir .= '/'; $folders = scandir($dir); $ret = array(); foreach($folders as $folder){ if($folder != '.' && $folder != '..'){ if(is_dir($dir.$folder)) { $ret[] = array($dir.$folder, 'subdir' => $this->getSubFolders($dir.$folder)); } } } return $ret; } public static function _showMsg($msg='') { if(strlen($msg)>0) JFactory::getApplication()->enqueueMessage($msg); } public static function _isAdmin() { $object = JFactory::getApplication(); if(method_exists($object,'isAdmin')) return JFactory::getApplication()->isAdmin(); else return $app = JFactory::getApplication()->isClient('administrator'); } public static function _isLive() { $dir = (self::_isAdmin()) ? basename(dirname(getcwd())) : basename(getcwd()); if($dir.'/' === self::_getStgFolder()) return FALSE; return TRUE; } public static function _stageUp() { $folder = self::_getStgFolder(); $folder = (self::_isLive()) ? '../'.$folder : '../../'.$folder; $testfile = $folder.'index.php'; if(file_exists($testfile)) return TRUE; return FALSE; } public static function _saveParams() { $x = vbMAssist::_checkPostSize(); if($x === 1) { die('ERROR: Your configuration could not be saved. Please increase POST Max Size in your PHP configuration to at least '.$mysize.'b'); } elseif($x === 2) { die('ERROR: Your configuration could not be saved. Please increase Max Input Vars in your PHP configuration to at least '.$myvars); } $myparams = self::$params; $vars = array(); foreach($myparams as $field => $value) { if(isset($_POST[$field])) { if(is_array($_POST[$field])) { $temp = array(); foreach($_POST[$field] as $f=>$v) { $temp[$f] = trim($v); } $value = $temp; } else if(strlen(trim($_POST[$field]))>0) { $value = trim($_POST[$field]); } } $vars[$field] = $value; } return vbMParams::_saveParams($vars); } public static function _prechecks($showerror=0) { $wkdir = (self::_isLive()) ? '../' : '../../'; $source = (self::_isLive()) ? $wkdir : $wkdir.self::_getStgFolder(); $target = (self::_isLive()) ? $wkdir.self::_getStgFolder() : $wkdir; $checks = array( 'space' => vbMAssist::_checkDiskSpace(), 'memory' => vbMAssist::_checkMemory(), 'timeout' => vbMAssist::_checkTimeout(), 'files' => vbMAssist::_checkFile('LICENSE.txt',$source,$target), 'version' => vbMAssist::_checkVersion(), 'config' => vbMAssist::_checkConfig(), 'ajcheck' => '', 'package' => false, ); $sysinfo = self::$sysinfo; $error = ''; $string = "<div id='sysinfo'><h5>Your System Information</h5><ul id='checks'>"; foreach($checks as $check=>$value) { $add = $info = ''; $popup = $sysinfo[$check][2]; switch($check) { case 'space': $space = $checks['space']; if(!$space) $add = "<li class='{$check} status-2' onclick='alert(\"{$popup}\")'>Unable to determine available disk space</li>"; else $info = ': '.vbMAssist::_returnMegaBytes($space); break; case 'memory': $info = ': '.$checks['memory'].'Mb'; break; case 'timeout': $info = ': '.$checks['timeout']; break; case 'files': $popup .= ' '.$value; break; case 'version': $info = ': '.$value; if(version_compare($value,self::$prechecks['version']) < 0) {// || version_compare($value,'7.99.99') > 0) $add = "<li class='{$check} status-2' onclick='alert(\"{$sysinfo[$check][2]}\")'>{$sysinfo[$check][1]}{$info}</li>"; } break; case 'ajcheck': $add = "<li class='{$check} status-2' onclick='window.open(\"index.php?option=com_migrateme4&task=checkAjax&format=raw\");'>{$sysinfo[$check][0]}</li>"; break; case 'package': $add = "<li class='{$check} status-2'>{$sysinfo[$check][0]}</li>"; break; } if($add === '') { if ($value < self::$prechecks[$check]) { $add = "<li class='{$check} status-2' onclick='alert(\"{$popup}\")'>{$sysinfo[$check][1]}{$info}</li>"; $error = $popup; } else { $add = "<li class='{$check} status-1'>{$sysinfo[$check][0]}{$info}</li>"; } } $string .= $add; } $string .= "</ul></div>"; if($showerror === 1) return $error; return $string; } }