Exploit database

GH-25ed919a3c63ff26fc49a3fe47dc7565

datackmy/fallingskies-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.

Repository files43
datackmy/fallingskies-cve-2023-35885Revision cb3449d9acca

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

src/Command/VhostTemplateAddCommand.php

PHP · 6,306 bytes
<?php
 namespace App\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use App\Command\Command as BaseCommand; use App\Entity\Manager\VhostTemplateManager as VhostTemplateEntityManager; use App\Entity\VhostTemplate as VhostTemplateEntity; class VhostTemplateAddCommand extends BaseCommand { private VhostTemplateEntityManager $vhostTemplateEntityManager; private array $requiredPlaceholders = ["\163\x65\x72\x76\145\162\x5f\156\141\x6d\145", "\x72\x6f\x6f\164"]; public function __construct(VhostTemplateEntityManager $vhostTemplateEntityManager) { $this->vhostTemplateEntityManager = $vhostTemplateEntityManager; parent::__construct(); } protected function configure() : void { goto f74b0; d0798: $this->addOption("\146\x69\x6c\145", null, InputOption::VALUE_REQUIRED); goto A4d37; F74b1: $this->addOption("\156\141\155\145", null, InputOption::VALUE_REQUIRED); goto d0798; F2290: $this->setDescription("\x63\x6c\160\x63\x74\x6c\x20\166\150\x6f\163\164\x2d\164\x65\x6d\160\x6c\141\164\x65\72\141\x64\144\40\55\55\x6e\141\x6d\x65\75\x27\115\171\x20\101\x70\x70\154\151\143\x61\164\151\157\x6e\x27\x20\55\x2d\x66\151\154\x65\75\x2f\x74\x6d\x70\x2f\x74\x65\x6d\160\154\x61\x74\x65\56\x74\160\154"); goto F74b1; f74b0: $this->setName("\166\x68\x6f\163\x74\55\164\145\155\x70\154\x61\164\x65\72\x61\144\144"); goto F2290; A4d37: } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto e238f; B7824: B60ee: goto F7c74; d5f4b: $vhostTemplateEntity = $this->vhostTemplateEntityManager->findOneByName($name); goto Bd391; db8f1: throw new \Exception("\126\x68\x6f\x73\164\40\124\145\155\160\154\x61\164\x65\40\x63\x61\156\156\x6f\x74\x20\x62\x65\40\x65\x6d\160\164\x79\x2e"); goto Acf86; b9328: Cf363: goto B1243; Ab983: $this->validateVhostTemplate($vhostTemplate); goto d5f4b; B1243: f5ef4: goto a9f88; F7c74: try { goto E6cad; F5f4a: $output->writeln(sprintf("\74\x69\x6e\146\x6f\x3e\x56\x68\157\163\x74\x20\x54\x65\x6d\160\x6c\x61\x74\145\x20\x22\45\163\x22\x20\x68\x61\x73\40\142\x65\145\x6e\40\x61\x64\144\145\144\x2e\74\57\x69\156\146\157\x3e", $name)); goto Bfb62; caef7: caa7c: goto C2403; fd56c: $fileObject = new \SplFileObject($tmpFilePath); goto d53ca; D42ab: bf441: goto E6450; Cd2ee: $tmpFilePath = stream_get_meta_data($tmpFile)["\x75\x72\x69"]; goto D92c1; ff49c: $vhostTemplateEntity->setType(VhostTemplateEntity::TYPE_CUSTOM); goto f99fc; f99fc: $this->vhostTemplateEntityManager->updateEntity($vhostTemplateEntity); goto F5f4a; d53ca: $fileObject->seek(0); goto b5a9a; df3b3: $metaData = @json_decode(trim(substr($metaData, 1)), true); goto d0195; Ca883: if (!("\x23" == substr($metaData, 0, 1))) { goto f0351; } goto df3b3; e0879: f0351: goto b9a4a; d0195: if (!(true === is_array($metaData))) { goto D38f4; } goto De383; caad8: $tmpFile = tmpfile(); goto Cd2ee; C2403: if (!(true === isset($metaData["\160\x68\x70\x56\x65\162\x73\x69\x6f\156"]) && false === empty($metaData["\x70\x68\x70\126\145\x72\163\151\157\156"]))) { goto bf441; } goto Ba3ec; De383: if (!(true === isset($metaData["\162\x6f\157\164\x44\x69\162\x65\x63\164\x6f\x72\171"]) && false === empty($metaData["\162\x6f\x6f\x74\104\151\x72\x65\x63\164\x6f\x72\x79"]))) { goto caa7c; } goto b9b2d; C676d: $vhostTemplate = trim($fileObject->fread($fileObject->getSize())); goto e0879; E6cad: $vhostTemplateEntity = $this->vhostTemplateEntityManager->createEntity(); goto bafcf; b9b2d: $rootDirectory = ltrim(rtrim($metaData["\162\x6f\x6f\164\x44\x69\x72\145\143\x74\157\162\171"], "\57"), "\57"); goto F3c4e; E6450: D38f4: goto C676d; Ba3ec: $vhostTemplateEntity->setPhpVersion($metaData["\x70\150\x70\126\x65\162\163\151\157\x6e"]); goto D42ab; F3c4e: $vhostTemplateEntity->setRootDirectory($rootDirectory); goto caef7; b5a9a: $metaData = $fileObject->current(); goto Ca883; bafcf: $vhostTemplateEntity->setName($name); goto caad8; Bfb62: return SiteCommand::SUCCESS; goto cd315; b9a4a: $vhostTemplateEntity->setTemplate($vhostTemplate); goto ff49c; D92c1: file_put_contents($tmpFilePath, $vhostTemplate); goto fd56c; cd315: } catch (\Exception $e) { $errorMessage = $e->getMessage(); throw $e; } finally { if (!(true === isset($tmpFilePath))) { goto Dcf9e; } @unlink($tmpFilePath); Dcf9e: } goto b9328; d3f33: Bbf4e: goto Ab983; Abacf: $vhostTemplate = $this->getVhostTemplate($input); goto cf8c4; Acf86: goto f5ef4; goto d3f33; Bd391: if (true == is_null($vhostTemplateEntity)) { goto B60ee; } goto Fbe15; a9f88: return SiteCommand::FAILURE; goto d7c50; ea175: goto Cf363; goto B7824; e238f: $name = trim($input->getOption("\x6e\x61\155\145")); goto Abacf; cf8c4: if (false === empty($vhostTemplate)) { goto Bbf4e; } goto db8f1; Fbe15: throw new \Exception(sprintf("\126\x68\157\x73\164\x20\124\145\155\x70\154\x61\164\x65\40\42\x25\163\42\40\141\x6c\162\x65\x61\144\x79\40\145\170\151\163\x74\56", $name)); goto ea175; d7c50: } catch (\Exception $e) { goto Fdf12; Fdf12: $errorMessage = $e->getMessage(); goto ec2ab; ec2ab: $output->writeln(sprintf("\74\x65\x72\x72\157\162\76\45\x73\74\x2f\145\162\x72\157\162\76", $errorMessage)); goto D18af; D18af: return SiteCommand::FAILURE; goto Bbeb5; Bbeb5: } } private function getVhostTemplate(InputInterface $input) : string { goto af8bc; b6505: fed58: goto e0912; af8bc: $vhostTemplate = ''; goto E5066; E5066: $file = trim($input->getOption("\x66\151\x6c\145")); goto Ec34d; f3522: $vhostTemplate = trim(file_get_contents($file)); goto b6505; e0912: return $vhostTemplate; goto be4da; Ec34d: if (!(true === file_exists($file) || "\150\x74\164\x70" == substr($file, 0, 4))) { goto fed58; } goto f3522; be4da: } private function validateVhostTemplate(string $vhostTemplate) : void { foreach ($this->requiredPlaceholders as $placeholder) { goto A31db; B4cff: D17a6: goto bb7ae; bbdb0: if (!(false === str_contains($vhostTemplate, $placeholder))) { goto f7a49; } goto F5490; A31db: $placeholder = sprintf("\x7b\173\45\163\x7d\175", $placeholder); goto bbdb0; C9245: f7a49: goto B4cff; F5490: throw new \Exception(sprintf("\x50\154\x61\143\145\x68\157\154\x64\x65\x72\x20\42\45\x73\x22\40\x69\x73\x20\162\145\x71\165\x69\162\145\144\40\x61\156\144\40\155\151\x73\163\151\x6e\x67\56", $placeholder)); goto C9245; bb7ae: } E1166: } }