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 :
WordPress.php
<?php /** * Wordpress * * @copyright Copyright (c) 2007 DotRoll Kft. (http://www.dotroll.com) * @author Zoltán Istvanovszki <zoltan.istvanovszki@dotroll.com> * @since 2019-06-13 * @package CXS_2.0 */ namespace Discover\CMS; //use Discover\CommonComponent; class Wordpress extends CommonComponent { /** * Plugins version * * @var array */ protected $pluginsVersion = []; /** * Version * * @var string */ protected $version; /** * Init */ public function onConstruct() { } /** * Look for any WordPress 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(); $wordpress = []; $files = []; foreach (\glob("/home/$hash/$brace/wp-includes/version.php", \GLOB_BRACE) as $file) { $readlink = \trim(\exec("/usr/bin/readlink -f $file")); $files[$readlink] = $readlink; } foreach ($files as $file) { // echo '.'; if ($version = \ZebraZ::getVariableFromFile($file, 'wp_version')) { $dir = \substr($file, 0, -24); $this->printStr("[WordPress]"); $wordpress[$dir] = [ 'type' => 'WordPress', 'dir' => $dir, 'version' => $version, 'latest' => $this->getLatestVersion(), 'plugins' => $this->getPlugins($dir), ]; } } return $wordpress; } /** * Get plugins * * @param string $dir Wordpress docroot * @return array */ private function getPlugins(string $dir): array { // wp --allow-root --format=json --path=/home/muhqntxu/domains/nevet.extra.hu/public_html plugin list $plugins = []; foreach (\glob("$dir/wp-content/plugins/{*/*.php,*.php}", \GLOB_BRACE) as $pluginfile) { // echo '.'; $slug = \str_replace('.php', '', \basename($pluginfile)); if (isset($plugins[$slug])) { continue; } $pluginfileR = \fopen($pluginfile, 'r'); while (!\feof($pluginfileR)) { $line = \fgets($pluginfileR); if (\strpos($line, 'Plugin Name:') !== false) { $lineArray = \array_map('trim', \explode('Plugin Name:', $line)); if (!empty($lineArray[1])) { $plugins[$slug] = [ 'name' => $lineArray[1], 'slug' => $slug, 'version' => $this->getVersionFromFile($pluginfile), 'latest' => $this->getLatestPluginVersion($slug), ]; } } } \fclose($pluginfileR); } \ksort($plugins); return $plugins; } /** * Get latest plugin version * * @param string $slug Plugin slug * @return string|null */ public function getLatestPluginVersion(string $slug): ?string { if (!isset($this->pluginsVersion[$slug])) { $json = \json_decode(@\file_get_contents("https://api.wordpress.org/plugins/info/1.0/$slug.json")); if (isset($json->version)) { $this->pluginsVersion[$slug] = $json->version; } else { $this->pluginsVersion[$slug] = null; } } return $this->pluginsVersion[$slug]; } /** * Get latest version * * @return string|null */ public function getLatestVersion(): ?string { if (!isset($this->version)) { $json = \json_decode(\file_get_contents('https://api.wordpress.org/core/version-check/1.7/')); if (isset($json->offers[0]->version)) { $this->version = $json->offers[0]->version; } else { $this->version = null; } } return $this->version; } /** * Get plugin version from file * * @param string $file File full path * @return string|null */ public function getVersionFromFile(string $file): ?string { $pluginfileR = \fopen($file, 'r'); while (!\feof($pluginfileR)) { $line = \fgets($pluginfileR); if (\strpos($line, 'Version:') !== false) { $lineArray = \array_map('trim', \explode('Version:', $line)); if (!empty($lineArray[1])) { \fclose($pluginfileR); return $lineArray[1]; } break; } } \fclose($pluginfileR); return null; } }