Exploit databaseDownload repository ZIP
GH-7feacea856188eafd49a6762828c436f
chocapikk/cve-2023-35885
Sources for CVE-2023-35885
4 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files5
chocapikk/cve-2023-35885Revision 78ece7c3f53e
- ↑..Parent directory
- DashboardController.php
- LoginController.php
- NewSiteController.php
- SitesController.php
- UserController.php
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/Controller/Frontend/DashboardController.php
PHP · 15,477 bytes<?php
namespace App\Controller\Frontend; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Contracts\Translation\TranslatorInterface; use App\Controller\Controller; use App\Entity\Manager\InstanceCpuManager as InstanceCpuEntityManager; use App\Entity\Manager\InstanceMemoryManager as InstanceMemoryEntityManager; use App\Entity\Manager\InstanceDiskUsageManager as InstanceDiskUsageEntityManager; use App\Entity\Manager\InstanceLoadAverageManager as InstanceLoadAverageEntityManager; use App\System\CommandExecutor; use App\System\Command\MemoryInformationCommand; use App\System\Command\ProcessorCoresCommand; use App\Entity\InstanceDiskUsage as InstanceDiskUsageEntity; use App\Entity\InstanceLoadAverage as InstanceLoadAverageEntity; use App\Monitoring\Chart; use App\Monitoring\LoadAverageChart; use App\Util\HumanFileSize as HumanFileSizeUtil; use App\Util\Time as TimeUtil; use App\Service\Logger; use App\Entity\User; class DashboardController extends Controller { public const TIME_RANGE_LAST_THIRTY_MINUTES = 1; public const TIME_RANGE_LAST_HOUR = 2; public const TIME_RANGE_LAST_THREE_HOURS = 3; public const TIME_RANGE_LAST_SIX_HOURS = 4; public const TIME_RANGE_LAST_TWELVE_HOURS = 5; private static array $timeRanges = [self::TIME_RANGE_LAST_THIRTY_MINUTES, self::TIME_RANGE_LAST_HOUR, self::TIME_RANGE_LAST_THREE_HOURS, self::TIME_RANGE_LAST_SIX_HOURS, self::TIME_RANGE_LAST_TWELVE_HOURS]; private InstanceCpuEntityManager $instanceCpuEntityManager; private InstanceMemoryEntityManager $instanceMemoryEntityManager; private InstanceDiskUsageEntityManager $instanceDiskUsageEntityManager; private InstanceLoadAverageEntityManager $instanceLoadAverageEntityManager; public function __construct(InstanceCpuEntityManager $instanceCpuEntityManager, InstanceMemoryEntityManager $instanceMemoryEntityManager, InstanceDiskUsageEntityManager $instanceDiskUsageEntityManager, InstanceLoadAverageEntityManager $instanceLoadAverageEntityManager, TranslatorInterface $translator, Logger $logger) { goto d726d; d726d: $this->instanceCpuEntityManager = $instanceCpuEntityManager; goto d5263; Cc31d: parent::__construct($translator, $logger); goto a0bf1; d5263: $this->instanceMemoryEntityManager = $instanceMemoryEntityManager; goto E7b89; Ba650: $this->instanceLoadAverageEntityManager = $instanceLoadAverageEntityManager; goto Cc31d; E7b89: $this->instanceDiskUsageEntityManager = $instanceDiskUsageEntityManager; goto Ba650; a0bf1: } public function index(Request $request) : Response { goto A2d4f; faf22: $endTime = TimeUtil::roundToNearestMinuteInterval($dateTime, 5); goto ccb49; F256f: goto B6f3e; goto Ed144; D3615: $memoryChart->setInformation($totalMemory); goto Bcfff; Cfcfa: if ($homeDiskSize != $rootDiskSize) { goto Cc5db; } goto Ca0e7; eef6e: $response = $this->render("\106\162\157\x6e\x74\x65\x6e\x64\57\x44\x61\163\x68\x62\x6f\141\162\x64\x2f\x69\156\144\x65\x78\56\150\x74\155\154\x2e\164\x77\x69\147", ["\x63\154\x6f\x75\144" => $cloud, "\x69\x6e\163\x74\x61\156\x63\x65" => $instance, "\x75\163\145\162" => $user, "\x74\x69\x6d\x65\122\141\156\x67\x65" => $timeRange, "\143\x70\x75\103\150\141\x72\164" => $cpuChart, "\x6d\x65\x6d\157\162\171\x43\x68\x61\162\164" => $memoryChart, "\x64\151\x73\153\x43\x68\x61\162\164" => $diskChart, "\x6c\x6f\141\x64\x41\x76\x65\x72\141\x67\x65\x43\150\x61\162\x74" => $loadAverageChart]); goto d53a6; a9885: $rootDiskSize = HumanFileSizeUtil::convert($rootDiskSizeInBytes, "\107\102", 0); goto cbcd5; F8c1c: $categories = $this->getCategoriesForTimeRange($user, $startTime, $endTime, $minuteInterval); goto ceb1b; A67c1: $diskData = [["\x6e\141\155\145" => sprintf("\57\40\50\45\x73\x29", $rootDiskSize), "\143\157\x6c\157\x72" => "\x23\x37\x33\x62\x66\64\x63", "\144\141\x74\x61" => $diskData["\x72\157\x6f\x74"] ?: []], ["\x6e\141\155\145" => sprintf("\x2f\150\157\x6d\x65\x20\x28\x25\x73\x29", $homeDiskSize), "\143\157\154\x6f\162" => "\x23\146\x33\142\146\60\60", "\x64\x61\164\141" => $diskData["\150\157\155\145"] ?: []]]; goto Cddef; f5058: $cloud = $environment->getCloudProvider(); goto F3b7d; A43ac: C82d7: goto Bf68e; cc0d6: try { goto E9db1; Ed037: $numberOfProcessorCores = $processorCoresCommand->getNumberOfProcessorCores(); goto d8854; ea33e: $processorCoresCommand = new ProcessorCoresCommand(); goto d43e7; E9db1: $commandExecutor = new CommandExecutor(); goto bc864; e591f: $totalMemoryInBytes = $memoryInformationCommand->getTotalMemoryInBytes(); goto c47a2; ab768: $commandExecutor->execute($memoryInformationCommand); goto e591f; d43e7: $commandExecutor->execute($processorCoresCommand); goto Ed037; c47a2: $totalMemory = HumanFileSizeUtil::convert($totalMemoryInBytes, "\107\102", 0); goto ea33e; bc864: $memoryInformationCommand = new MemoryInformationCommand(); goto ab768; d8854: } catch (\Exception $e) { $this->logger->exception($e); } goto Da910; Bc3a7: $memoryChart->setCategories($categories); goto Bfaa6; A2d4f: $user = $this->getUser(); goto e5bb7; bf991: $cpuChart->setData($cpuData); goto e1b9a; Ca215: $loadAverageData = [["\x6e\x61\x6d\145" => $this->translator->trans("\61\40\x4d\x69\156\165\164\x65"), "\143\157\154\x6f\162" => "\43\x37\x37\64\x61\141\x34", "\144\x61\164\x61" => $loadAverageRawData[InstanceLoadAverageEntity::PERIOD_ONE_MINUTE] ?? []], ["\x6e\x61\x6d\145" => $this->translator->trans("\x35\x20\x4d\x69\156\x75\x74\145\x73"), "\143\x6f\154\157\x72" => "\43\145\x62\65\x38\66\x63", "\144\x61\164\141" => $loadAverageRawData[InstanceLoadAverageEntity::PERIOD_FIVE_MINUTES] ?? []], ["\x6e\141\x6d\x65" => $this->translator->trans("\61\65\x20\x4d\151\156\x75\164\145\x73"), "\x63\157\154\157\x72" => "\x23\x30\x30\67\70\x64\64", "\144\x61\164\x61" => $loadAverageRawData[InstanceLoadAverageEntity::PERIOD_FIVETEEN_MINUTES] ?? []]]; goto fdceb; Bf68e: b5f97: goto F8c1c; Ed144: Cc5db: goto A67c1; ddcd7: $timeRange = true === is_null($timeRange) ? self::TIME_RANGE_LAST_THIRTY_MINUTES : (true === in_array($timeRange, self::$timeRanges) ? $timeRange : self::TIME_RANGE_LAST_THIRTY_MINUTES); goto a5a18; E3266: $memoryData = $this->getMemoryDataForTimeRange($startTime, $endTime, $minuteInterval); goto Df10d; e1b9a: $cpuChart->setCategories($categories); goto db436; fdceb: $cpuInformation = sprintf("\x25\x73\x20\x25\x73", $numberOfProcessorCores, $this->translator->trans("\x43\x50\x55")); goto Caf2f; c77ac: $loadAverageChart->setInformation($loadAverageChartInformation); goto ad18f; ed7d5: $loadAverageChartInformation = sprintf("\45\x73\x20\45\x73", $numberOfProcessorCores, $this->translator->trans("\103\x50\125")); goto B4ac5; c1cca: $numberOfProcessorCores = 0; goto cc0d6; F3b7d: $timeRange = $request->get("\164\151\x6d\145\122\x61\x6e\147\145"); goto ddcd7; cbcd5: $homeDiskSizeInBytes = disk_total_space(InstanceDiskUsageEntity::DISK_HOME); goto Ce563; db436: $memoryChart = new Chart("\115\145\x6d\157\162\171\40\125\x73\141\147\145"); goto D3615; Ee451: $diskChart->setCategories($categories); goto ed7d5; B4ac5: $loadAverageChart = new LoadAverageChart("\114\x6f\x61\144\x20\101\166\x65\162\x61\147\x65"); goto c77ac; Ca0e7: $diskData = [["\x6e\141\155\x65" => sprintf("\57\40\50\x25\163\51", $rootDiskSize), "\143\x6f\154\157\x72" => "\x23\67\63\142\x66\x34\x63", "\x64\x61\164\x61" => $diskData["\162\157\x6f\x74"] ?: []]]; goto F256f; aabf1: $dateTime = new \DateTime(); goto faf22; d53a6: return $response; goto f07a1; fbb3f: $loadAverageRawData = $this->getLoadAverageDataForTimeRange($startTime, $endTime, $minuteInterval); goto Ca215; e5bb7: $instance = $request->attributes->get("\151\x6e\x73\x74\x61\156\x63\x65"); goto B1b10; Df10d: $diskData = $this->getDiskDataForTimeRange($startTime, $endTime, $minuteInterval); goto Cfcfa; Ce563: $homeDiskSize = HumanFileSizeUtil::convert($homeDiskSizeInBytes, "\x47\102", 0); goto aabf1; B1b10: $environment = $instance->getEnvironment(); goto f5058; f5cca: $loadAverageChart->setCategories($categories); goto eef6e; Cddef: B6f3e: goto fbb3f; ccb49: switch ($timeRange) { case self::TIME_RANGE_LAST_THIRTY_MINUTES: goto B051c; f71f5: $startTime = (clone $endTime)->modify("\x2d\63\60\40\155\151\x6e\165\x74\145\163"); goto dfa27; dfa27: goto b5f97; goto B1faa; B051c: $minuteInterval = 5; goto f71f5; B1faa: case self::TIME_RANGE_LAST_HOUR: goto A25a3; A25a3: $minuteInterval = 10; goto dfde9; dfde9: $startTime = (clone $endTime)->modify("\55\61\x20\150\x6f\165\162"); goto f054b; f054b: goto b5f97; goto fe9eb; fe9eb: case self::TIME_RANGE_LAST_THREE_HOURS: goto Bb946; Bb946: $minuteInterval = 30; goto B3d87; F01d9: goto b5f97; goto ec0e4; B3d87: $startTime = (clone $dateTime)->modify("\55\x33\x20\x68\x6f\x75\x72\x73"); goto F01d9; ec0e4: case self::TIME_RANGE_LAST_SIX_HOURS: goto B15a1; dfe54: $startTime = (clone $dateTime)->modify("\x2d\66\40\x68\157\x75\x72\x73"); goto aa23f; B15a1: $minuteInterval = 60; goto dfe54; aa23f: goto b5f97; goto cf1df; cf1df: case self::TIME_RANGE_LAST_TWELVE_HOURS: goto E851f; cb906: goto b5f97; goto a86e9; F69b4: $startTime = (clone $dateTime)->modify("\55\x31\x32\40\150\157\165\162\x73"); goto cb906; E851f: $minuteInterval = 120; goto F69b4; a86e9: } goto A43ac; ad18f: $loadAverageChart->setData($loadAverageData); goto f5cca; D3e15: $diskChart->setData($diskData); goto Ee451; Da910: $rootDiskSizeInBytes = disk_total_space(InstanceDiskUsageEntity::DISK_ROOT); goto a9885; Bfaa6: $diskChart = new Chart("\104\151\163\153\40\125\163\141\x67\145"); goto D3e15; Caf2f: $cpuChart = new Chart("\x43\x50\125\x20\x55\x73\141\x67\145"); goto D3a5b; a5a18: $totalMemory = ''; goto c1cca; D3a5b: $cpuChart->setInformation($cpuInformation); goto bf991; ceb1b: $cpuData = $this->getCpuDataForTimeRange($startTime, $endTime, $minuteInterval); goto E3266; Bcfff: $memoryChart->setData($memoryData); goto Bc3a7; f07a1: } private function getCategoriesForTimeRange(User $user, \DateTimeInterface $startTime, \DateTimeInterface $endTime, $minuteInterval) : array { goto A72e9; a40ee: return $categories; goto a65ea; F7d28: $startDataDate->modify(sprintf("\53\45\60\x35\x64\40\155\151\x6e\165\x74\x65\x73", $minuteInterval)); goto Cc23e; Ff786: $categoryDateTime->setTimezone(new \DateTimeZone($user->getTimezone())); goto A958a; Cc23e: $endDataDate->modify(sprintf("\53\x25\x30\x35\144\40\x6d\x69\156\x75\x74\145\163", $minuteInterval)); goto e624e; ec38b: $endDataDate = clone $startTime; goto B5a50; Bcc16: f7121: goto a40ee; baa8c: $startDataDate = (clone $startTime)->modify(sprintf("\55\45\x30\65\x64\40\x6d\151\x6e\x75\x74\x65\x73", $minuteInterval)); goto ec38b; Ffe8d: $categoryDateTime = clone $endDataDate; goto Ff786; B5a50: C0d8b: goto Fec4b; Fec4b: if (!($endDataDate <= $endTime)) { goto f7121; } goto Ffe8d; A72e9: $categories = []; goto baa8c; A958a: $categories[] = $categoryDateTime->format("\110\72\x69"); goto F7d28; e624e: goto C0d8b; goto Bcc16; a65ea: } private function getCpuDataForTimeRange(\DateTimeInterface $startTime, \DateTimeInterface $endTime, $minuteInterval) : array { goto af54d; C7215: fb34d: goto a78c8; Edb34: goto fb34d; goto bef96; Ec95f: $startDataDate = (clone $startTime)->modify(sprintf("\55\45\60\65\x64\40\155\151\x6e\165\x74\x65\x73", $minuteInterval)); goto C6648; af54d: $cpuData = []; goto Ec95f; C70aa: $endDataDate->modify(sprintf("\x2b\x25\60\x35\x64\x20\x6d\151\x6e\165\164\145\163", $minuteInterval)); goto Edb34; eac9d: $averageCpuValue = $this->instanceCpuEntityManager->getAverageCpuValue($startDataDate, $endDataDate); goto bbec3; bef96: Ba08f: goto fd75e; bbec3: $cpuData[] = $averageCpuValue; goto b579b; a78c8: if (!($endDataDate <= $endTime)) { goto Ba08f; } goto eac9d; fd75e: return $cpuData; goto C62d5; b579b: $startDataDate->modify(sprintf("\x2b\45\60\x35\x64\x20\155\x69\x6e\x75\x74\145\163", $minuteInterval)); goto C70aa; C6648: $endDataDate = clone $startTime; goto C7215; C62d5: } private function getMemoryDataForTimeRange(\DateTimeInterface $startTime, \DateTimeInterface $endTime, $minuteInterval) : array { goto A546b; e88be: fe41d: goto ac451; Ef792: $endDataDate = clone $startTime; goto e4174; ac451: return $memoryData; goto ceb77; bc1e1: $endDataDate->modify(sprintf("\x2b\x25\60\x35\144\40\155\x69\x6e\x75\x74\x65\x73", $minuteInterval)); goto E025d; F37f1: $averageMemoryValue = $this->instanceMemoryEntityManager->getAverageMemoryValue($startDataDate, $endDataDate); goto A7810; A6abb: $startDataDate = (clone $startTime)->modify(sprintf("\55\45\60\x35\144\x20\x6d\x69\156\165\164\x65\x73", $minuteInterval)); goto Ef792; c602f: if (!($endDataDate <= $endTime)) { goto fe41d; } goto F37f1; c24b6: $startDataDate->modify(sprintf("\x2b\x25\60\x35\x64\x20\x6d\x69\156\x75\164\x65\163", $minuteInterval)); goto bc1e1; e4174: cd065: goto c602f; A7810: $memoryData[] = (int) $averageMemoryValue; goto c24b6; A546b: $memoryData = []; goto A6abb; E025d: goto cd065; goto e88be; ceb77: } private function getDiskDataForTimeRange($startTime, $endTime, $minuteInterval) : array { goto E7ab6; c6d02: return $diskData; goto ad9ea; B362a: A726a: goto c6d02; E7ab6: $diskData = []; goto c59e0; c59e0: $startDataDate = (clone $startTime)->modify(sprintf("\x2d\45\x30\x35\x64\x20\x6d\x69\x6e\x75\x74\x65\163", $minuteInterval)); goto f1a8c; C39c1: goto A50ed; goto B362a; cfb9c: foreach (["\x2f", "\x2f\x68\157\x6d\x65"] as $disk) { goto b3c7b; Ed52b: fbe30: goto Afd0b; F3765: $diskData["\150\x6f\x6d\145"][] = (int) $averageDiskSizeValue; goto A00b0; b3c7b: $averageDiskSizeValue = (int) $this->instanceDiskUsageEntityManager->getAverageDiskSizeValue($disk, $startDataDate, $endDataDate); goto d27a9; d27a9: if ("\x2f" == $disk) { goto dd171; } goto F3765; C98ec: dd171: goto F2131; A00b0: goto fbe30; goto C98ec; Afd0b: f5f21: goto e2374; F2131: $diskData["\x72\x6f\x6f\x74"][] = (int) $averageDiskSizeValue; goto Ed52b; e2374: } goto eb2ee; b824e: $endDataDate->modify(sprintf("\53\45\x30\x35\144\40\155\x69\156\x75\x74\145\x73", $minuteInterval)); goto C39c1; a05ba: A50ed: goto e5476; b2200: $startDataDate->modify(sprintf("\x2b\45\60\x35\x64\40\x6d\x69\x6e\x75\x74\x65\x73", $minuteInterval)); goto b824e; eb2ee: Dd9bf: goto b2200; f1a8c: $endDataDate = clone $startTime; goto a05ba; e5476: if (!($endDataDate <= $endTime)) { goto A726a; } goto cfb9c; ad9ea: } private function getLoadAverageDataForTimeRange($startTime, $endTime, $minuteInterval) : array { goto f95d1; a71fd: $endDataDate->modify(sprintf("\53\45\x30\x35\x64\x20\155\x69\156\x75\164\x65\163", $minuteInterval)); goto A40d8; D1605: return $loadAverageData; goto A913d; E0943: $endDataDate = clone $startTime; goto c3f56; A40d8: goto dff68; goto A3a8f; Ba10b: D2a79: goto d25b2; c3f56: dff68: goto fd366; ddb97: foreach ([InstanceLoadAverageEntity::PERIOD_ONE_MINUTE, InstanceLoadAverageEntity::PERIOD_FIVE_MINUTES, InstanceLoadAverageEntity::PERIOD_FIVETEEN_MINUTES] as $period) { goto d9528; d9528: $loadAverageValue = $this->instanceLoadAverageEntityManager->getLoadAverageValue($period, $startDataDate, $endDataDate); goto e2270; e2270: $loadAverageData[$period][] = round($loadAverageValue, 2); goto fcca0; fcca0: aeb4a: goto E70f2; E70f2: } goto Ba10b; Ad4f3: $startDataDate = (clone $startTime)->modify(sprintf("\x2d\45\x30\65\144\40\155\151\156\x75\x74\145\163", $minuteInterval)); goto E0943; d25b2: $startDataDate->modify(sprintf("\53\45\x30\x35\x64\x20\155\x69\156\x75\164\x65\163", $minuteInterval)); goto a71fd; A3a8f: C5922: goto D1605; fd366: if (!($endDataDate <= $endTime)) { goto C5922; } goto ddb97; f95d1: $loadAverageData = []; goto Ad4f3; A913d: } }