One Hat Cyber Team
Your IP :
216.73.217.126
Server IP :
185.33.55.30
Server :
Linux cl30.webspacecontrol.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.1.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
cxs2
/
app
/
libs
/
Discover
/
CMS
/
View File Name :
Joomla.php
<?php /** * Joomla * * @copyright Copyright (c) 2007 DotRoll Kft. (http://www.dotroll.com) * @author Zoltán Istvanovszki <zoltan.istvanovszki@dotroll.com> * @since 2019-06-14 * @package CXS_2.0 */ namespace Discover\CMS; class Joomla extends CommonComponent { /** * Init */ public function onConstruct() { $this->type = \substr(__CLASS__, \strrpos(__CLASS__, '\\') + 1); } /** * Look for any intallations * * @param string $hash cPanel username * @param string $brace Used brace from depth checking * @return array */ public function get(string $hash, string $brace): array { $this->hash = $hash; $this->printPercentage(); $joomla = []; $found = \array_merge( \glob("/home/$hash/$brace/includes/joomla/version.php", \GLOB_BRACE), \glob("/home/$hash/$brace/libraries/joomla/version.php", \GLOB_BRACE), \glob("/home/$hash/$brace/libraries/cms/version/version.php", \GLOB_BRACE), \glob("/home/$hash/$brace/libraries/src/Version.php", \GLOB_BRACE) ); $GLOBALS['maxInstance'] = \count($found); $GLOBALS['iInstance'] = 0; foreach ($found as $file) { $GLOBALS['iInstance']++; if (\strpos($file, "/home/$hash/www/") === 0) { continue; } if ($version = \exec(\PHP_BINARY . ' -c ' . \APP_PATH . 'config/php.ini ' . \APP_PATH . "libs/Discover/CMS/version/{$this->type}.php $file")) { if (\substr($file, -26) == '/libraries/src/Version.php') { $dir = \substr($file, 0, -26); } elseif (\substr($file, -28) == '/includes/joomla/version.php') { $dir = \substr($file, 0, -28); } elseif (\substr($file, -29) == '/libraries/joomla/version.php') { $dir = \substr($file, 0, -29); } else { $dir = \substr($file, 0, -34); } $this->printStr("[Joomla]"); $joomla[$dir] = [ 'type' => $this->type, 'dir' => $dir, 'version' => $version, // 'latest' => $this->getLatestVersion(), 'plugins' => $this->getPlugins($dir), ]; } } $this->cleanLine(); return $joomla; } /** * Get plugins * * @param string $dir Docroot * @return array */ private function getPlugins(string $dir): array { $plugins = []; foreach (\glob("$dir/modules/mod_*/mod_*.xml") as $pluginfile) { $xml = \simplexml_load_file($pluginfile); $name = null; if (isset($xml->name)) { $name = (string) $xml->name; } $version = null; if (isset($xml->version)) { $version = (string) $xml->version; } if (empty($name) || empty($version)) { continue; } $slug = \substr(\basename(\dirname($pluginfile)), 4); $plugins[$slug] = [ 'name' => $name, 'slug' => $slug, 'version' => $version, // 'latest' => $this->getLatestPluginVersion($slug), ]; } \ksort($plugins); return $plugins; } /** * Get latest plugin version * * @param string $slug Plugin slug * @return string|null */ private function getLatestPluginVersion(string $slug): ?string { return null; if (isset($this->pluginsVersion[$slug])) { return $this->pluginsVersion[$slug]; } $redisKey = $this->type . "|$slug:" . __FUNCTION__; if (!$this->cache->exists($redisKey)) { echo '.'; $dom = new \DOMDocument(); \libxml_use_internal_errors(true); $dom->loadHTMLFile("https://extensions.joomla.org/extension/$slug/"); $this->pluginsVersion[$slug] = null; $next = false; foreach ((new \DOMXPath($dom))->query('//*[@id="extension-meta"]/dl/*') as $query) { if ($query->tagName == 'dt' && $query->nodeValue == 'Version:') { $next = true; } elseif ($next === true && $query->tagName == 'dd') { $this->pluginsVersion[$slug] = $query->nodeValue; break; } } $this->cache->save($redisKey, $this->pluginsVersion[$slug]); } return $this->cache->get($redisKey); } /** * Get latest version * * @return string|null */ private function getLatestVersion(): ?string { if (isset($this->version)) { return $this->version; } $redisKey = $this->type . ':' . __FUNCTION__; if (!$this->cache->exists($redisKey)) { $this->version = null; foreach (\simplexml_load_file('http://update.joomla.org/core/list.xml')->extension as $ext) { $this->version = (string) $ext['version']; } $this->cache->save($redisKey, $this->version); return $this->version; } return $this->cache->get($redisKey); } }