Exploit database

GH-7feacea856188eafd49a6762828c436f

chocapikk/cve-2023-35885

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2023-35885

4 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files43
chocapikk/cve-2023-35885Revision 78ece7c3f53e

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

src/Command/DoSnapshotCreateCommand.php

PHP · 8,660 bytes
<?php
 namespace App\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; use App\Command\Command as BaseCommand; use App\CloudPanel\Environment as CloudPanelEnvironment; use App\Entity\Notification; use App\Notification\NotificationQueue; class DoSnapshotCreateCommand extends BaseCommand { protected function configure() : void { goto A7dc4; A7dc4: $this->setName("\144\157\72\163\x6e\x61\160\163\x68\157\164\72\x63\162\x65\x61\x74\x65"); goto D50ce; B6e5d: $this->addOption("\x66\x72\x65\161\x75\145\x6e\143\171", null, InputOption::VALUE_REQUIRED); goto Bf5fb; D50ce: $this->setDescription("\x63\x6c\160\143\x74\154\x20\144\x6f\x3a\163\x6e\141\160\163\x68\x6f\164\x3a\143\162\x65\141\164\145\40\55\55\x66\162\x65\161\165\145\156\143\171\75\63"); goto B6e5d; Bf5fb: } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto fdaaf; D6a60: return BaseCommand::SUCCESS; goto ac6a0; B85be: if (!(CloudPanelEnvironment::CLOUD_PROVIDER_DO == $cloud && true === $automaticSnapshots && false === empty($accessToken) && $snapshotsFrequency == $frequency)) { goto D57d2; } goto ae9e1; D8a5c: $accessToken = $this->getConfigValue("\x64\157\x5f\141\x63\143\145\163\163\x5f\164\x6f\153\145\x6e"); goto D53f8; cba75: if (!(true === $snapshotsCreated)) { goto A1bfb; } goto de57c; de57c: $this->cleanSnapshots(); goto ba1d6; F2750: D57d2: goto D6a60; fdaaf: $this->validateInput($input); goto Be195; ba1d6: A1bfb: goto F2750; C918b: $automaticSnapshots = (bool) $this->getConfigValue("\x64\157\137\x61\x75\164\x6f\x6d\x61\164\151\x63\x5f\163\x6e\141\x70\x73\x68\157\164\x73"); goto D8a5c; D53f8: $snapshotsFrequency = (int) $this->getConfigValue("\x64\157\137\x73\x6e\x61\160\x73\x68\x6f\x74\163\137\146\162\145\x71\165\145\156\143\171"); goto B85be; ae9e1: $snapshotsCreated = $this->createSnapshots(); goto cba75; a13d1: $cloud = $this->getConfigValue("\143\x6c\x6f\165\x64"); goto C918b; Be195: $frequency = (int) $input->getOption("\x66\162\x65\x71\165\145\x6e\x63\x79"); goto a13d1; ac6a0: } catch (\Exception $e) { goto ebf0d; ebf0d: $errorMessage = $e->getMessage(); goto bd46c; F2420: return BaseCommand::FAILURE; goto eab05; bd46c: $output->writeln(sprintf("\x3c\x65\x72\x72\157\x72\76\x25\163\x3c\57\x65\x72\x72\x6f\x72\x3e", $errorMessage)); goto F2420; eab05: } } private function createSnapshots() { goto c31b3; bfa44: return $snapshotsCreated; goto Df4b2; c31b3: $snapshotsCreated = $this->createDropletSnapshot(); goto fa5f8; fa5f8: if (!(true === $snapshotsCreated)) { goto bb3ea; } goto c8258; B61f2: bb3ea: goto bfa44; c8258: $snapshotsCreated = $this->createDropletVolumeSnapshots(); goto B61f2; Df4b2: } private function createDropletSnapshot() : bool { try { goto Fb541; aa631: $doClient->createDropletSnapshot($snapshotName); goto Fa5f5; a4fb9: $snapshotName = sprintf("\45\x73\x2d\45\163\x2d\143\154\x70", $droplet->getName(), $dateTime->getTimestamp()); goto aa631; B7318: $dateTime = new \DateTime(); goto a4fb9; cf348: $doClient = $instance->getDoClient(); goto B55e4; Fa5f5: return true; goto f2f04; Fb541: $instance = $this->getInstance(); goto cf348; B55e4: $droplet = $doClient->getDroplet(); goto B7318; f2f04: } catch (\Exception $e) { $errorMessage = $e->getMessage(); $this->addNotification("\x43\x72\x65\x61\x74\151\156\147\x20\x61\x20\x53\156\141\x70\163\150\157\164\40\146\x61\x69\154\x65\x64", $errorMessage); } return false; } private function createDropletVolumeSnapshots() : bool { try { goto dd5ca; F66b5: $doClient = $instance->getDoClient(); goto c11d2; C6edc: if (!(false === empty($dropletVolumeIds))) { goto c04db; } goto bed91; db547: return true; goto B57d0; dd5ca: $instance = $this->getInstance(); goto F66b5; bed91: foreach ($dropletVolumeIds as $volumeId) { $doClient->createVolumeSnapshot($volumeId); C09c1: } goto Dacab; ea80d: $dropletVolumeIds = $droplet->getVolumeIds(); goto C6edc; c11d2: $droplet = $doClient->getDroplet(); goto ea80d; C5b56: c04db: goto db547; Dacab: Ca720: goto C5b56; B57d0: } catch (\Exception $e) { $errorMessage = $e->getMessage(); $this->addNotification("\103\x72\145\141\x74\x69\156\x67\x20\x44\162\x6f\160\154\145\x74\40\x56\x6f\154\x75\155\x65\40\x53\x6e\x61\x70\163\150\157\164\163\40\x66\x61\151\x6c\x65\144", $errorMessage); } return false; } private function cleanSnapshots() { goto f2864; acf4c: if (!(true === $dropletSnapshotsCleaned)) { goto A6ecd; } goto F209c; Ba912: A6ecd: goto F8ee9; F209c: $this->cleanDropletVolumeSnapshots(); goto Ba912; f2864: $dropletSnapshotsCleaned = $this->cleanDropletSnapshots(); goto acf4c; F8ee9: } private function cleanDropletSnapshots() : bool { try { goto Ad9b3; D50dd: return true; goto e4ffe; Eec6f: $dateTime = new \DateTime(); goto c5dec; Bcc2b: F3530: goto D50dd; b64d3: $snapshotDeleteDateTime->setTimezone(new \DateTimeZone("\x55\x54\103")); goto De2bf; Ad9b3: $instance = $this->getInstance(); goto F13f9; De2bf: $snapshots = $doClient->getSnapshotsForDroplet(); goto Efb33; c2fe9: $snapshotDeleteDateTime->modify(sprintf("\55\45\x73\x20\144\141\x79\163", $doBackupRetentionPeriod)); goto b64d3; Efb33: foreach ($snapshots as $snapshot) { goto b4ba7; Cce23: if (!($snapshotCreatedAt < $snapshotDeleteDateTime)) { goto F0762; } goto Ccdef; E8a33: $doClient->deleteDropletSnapshot($snapshotId); goto eb2bf; b4ba7: $snapshotCreatedAt = $snapshot->getCreatedAt(); goto Cce23; Ccdef: $snapshotId = $snapshot->getId(); goto E8a33; eb2bf: F0762: goto b7a3c; b7a3c: eb989: goto d1fa9; d1fa9: } goto Bcc2b; d6c34: $doBackupRetentionPeriod = (int) $this->getConfigValue("\144\x6f\137\x73\156\x61\x70\163\x68\x6f\164\x73\137\162\x65\164\145\x6e\164\x69\x6f\156\x5f\x70\145\x72\x69\x6f\x64"); goto Eec6f; F13f9: $doClient = $instance->getDoClient(); goto d6c34; c5dec: $snapshotDeleteDateTime = clone $dateTime; goto c2fe9; e4ffe: } catch (\Exception $e) { $errorMessage = $e->getMessage(); $this->addNotification("\x43\154\145\x61\156\x69\x6e\147\40\104\x72\157\x70\x6c\145\164\x20\x53\x6e\x61\160\x73\x68\x6f\x74\x73\x20\146\x61\x69\x6c\x65\x64", $errorMessage); } return false; } private function cleanDropletVolumeSnapshots() : void { try { goto Ae754; A34f0: $doBackupRetentionPeriod = (int) $this->getConfigValue("\144\157\137\163\x6e\141\x70\163\x68\x6f\164\x73\x5f\x72\x65\x74\145\156\164\x69\x6f\156\137\160\x65\162\151\157\x64"); goto c433f; ca425: $snapshotDeleteDateTime->modify(sprintf("\55\x25\x73\x20\x64\141\171\x73", $doBackupRetentionPeriod)); goto e4c80; Ed715: $dateTime = new \DateTime(); goto C5c85; e4c80: $snapshotDeleteDateTime->modify("\53\65\40\x6d\x69\156\165\x74\145\x73"); goto b6817; Ec4cb: $doClient = $instance->getDoClient(); goto B6c0f; D2ae2: d4752: goto C2305; bcf30: d12a6: goto D2ae2; C5c85: $snapshotDeleteDateTime = clone $dateTime; goto ca425; Ae754: $instance = $this->getInstance(); goto Ec4cb; Ec041: if (!(false === empty($dropletVolumeIds))) { goto d4752; } goto Ed715; c433f: $dropletVolumeIds = $droplet->getVolumeIds(); goto Ec041; b6817: $snapshotDeleteDateTime->setTimezone(new \DateTimeZone("\x55\124\103")); goto d307d; d307d: foreach ($dropletVolumeIds as $volumeId) { goto c1be7; D6e0c: Acd4c: goto ae349; c1be7: $volumeSnapshots = $doClient->getVolumeSnapshots($volumeId); goto d1b48; c7419: A5080: goto D6e0c; Dee9e: foreach ($volumeSnapshots as $volumeSnapshot) { goto e6061; c2301: de776: goto B0c23; B6908: c248d: goto c2301; A6b1c: if (!($volumeSnapshotCreatedAt < $snapshotDeleteDateTime)) { goto c248d; } goto B5a00; B5a00: $doClient->deleteVolumeSnapshot($volumeSnapshotId); goto B6908; e6061: $volumeSnapshotId = $volumeSnapshot->getId(); goto E9e1c; E9e1c: $volumeSnapshotCreatedAt = $volumeSnapshot->getCreatedAt(); goto A6b1c; B0c23: } goto c7419; ae349: c32b9: goto f9b77; d1b48: if (!(false === empty($volumeSnapshots))) { goto Acd4c; } goto Dee9e; f9b77: } goto bcf30; B6c0f: $droplet = $doClient->getDroplet(); goto A34f0; C2305: } catch (\Exception $e) { $errorMessage = $e->getMessage(); $this->addNotification("\103\x6c\145\141\156\x69\x6e\x67\40\104\x72\x6f\x70\x6c\x65\164\x20\126\157\x6c\165\155\145\x20\x53\x6e\141\160\163\x68\157\164\163\40\146\141\x69\154\145\x64", $errorMessage); } } private function addNotification(string $subject, string $errorMessage) : void { goto Bee71; db679: $notification->setSubject($subject); goto Fc2a6; Fc2a6: $notification->setMessage($errorMessage); goto e429a; Bee71: $notification = new Notification(); goto db679; e429a: $notification->setSeverity(Notification::SEVERITY_CRITICAL); goto f8989; f8989: NotificationQueue::addNotification($notification); goto b0cbf; b0cbf: } }