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 files43
chocapikk/cve-2023-35885Revision 78ece7c3f53e
- ↑..Parent directory
- AnnouncementCheckCommand.php
- AppGetConfigValueCommand.php
- AppSetConfigValueCommand.php
- AwsImageCreateCommand.php
- CloudPanelDeleteSitesCommand.php
- CloudPanelDisableBasicAuthCommand.php
- CloudPanelEnableBasicAuthCommand.php
- CloudPanelSetReleaseChannelCommand.php
- CloudflareUpdateIpsCommand.php
- Command.php
- DatabaseAddCommand.php
- DatabaseBackupCommand.php
- DatabaseDeleteCommand.php
- DatabaseExportCommand.php
- DatabaseImportCommand.php
- DatabaseShowMasterCredentialsCommand.php
- DoSnapshotCreateCommand.php
- GceSnapshotCreateCommand.php
- HetznerSnapshotCreateCommand.php
- LetsEncryptInstallCertificateCommand.php
- LetsEncryptRenewCertificatesCommand.php
- LetsEncryptRenewCustomDomainCertificateCommand.php
- ListCommand.php
- MonitoringDataCleanCommand.php
- RemoteBackupCreateCommand.php
- SiteAddNodejsCommand.php
- SiteAddPhpCommand.php
- SiteAddPythonCommand.php
- SiteAddReverseProxyCommand.php
- SiteAddStaticCommand.php
- SiteCommand.php
- SiteDeleteCommand.php
- SystemPermissionsResetCommand.php
- TestCommand.php
- UserDisableMfaCommand.php
- UserResetPasswordCommand.php
- VarnishCachePurgeCommand.php
- VhostTemplateAddCommand.php
- VhostTemplateDeleteCommand.php
- VhostTemplateViewCommand.php
- VhostTemplatesImportCommand.php
- VhostTemplatesListCommand.php
- VultrSnapshotCreateCommand.php
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/Command/SiteAddPythonCommand.php
PHP · 10,519 bytes<?php
namespace App\Command; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Validator\ConstraintViolationList; use App\Command\SiteCommand as SiteCommand; use App\Entity\Site as SiteEntity; use App\Entity\Certificate as CertificateEntity; use App\Entity\PythonSettings as PythonSettingsEntity; use App\Site\PythonSite; use App\Site\Ssl\DistinguishedName; use App\Site\Ssl\Generator\RsaKeyGenerator; use App\Site\Ssl\Generator\CsrGenerator; use App\Site\Ssl\Util\Openssl; use App\Site\Nginx\Vhost\PythonTemplate as PythonVhostTemplate; use App\Site\Creator\PythonSite as PythonSiteCreator; use App\Site\Nginx\Vhost\Processor\ServerName as ServerNameProcessor; use App\Site\Nginx\Vhost\Processor\RedirectServerName as RedirectServerNameProcessor; use App\Site\Nginx\Vhost\Processor\RedirectDomain as RedirectDomainProcessor; class SiteAddPythonCommand extends SiteCommand { private const VHOST_TEMPLATE_NAME = "\120\171\164\x68\x6f\156"; protected function configure() : void { goto C8a11; B7747: $this->addOption("\x64\157\155\141\x69\x6e\116\x61\x6d\145", null, InputOption::VALUE_REQUIRED); goto aa294; E041a: $this->setComment("\x41\x64\144\151\x6e\x67\x20\141\x20\120\171\x74\x68\x6f\x6e\40\x53\151\164\x65"); goto B7747; f7cfb: $this->setDescription("\x63\x6c\160\x63\x74\x6c\x20\163\151\164\x65\72\141\144\144\72\160\x79\164\x68\x6f\156\x20\55\x2d\x64\x6f\x6d\x61\151\156\116\141\155\145\x3d\x77\167\x77\x2e\144\157\x6d\141\151\x6e\56\x63\157\155\40\x2d\x2d\160\171\x74\150\157\156\x56\x65\162\x73\151\x6f\x6e\x3d\x33\x2e\71\40\55\x2d\141\160\160\x50\x6f\x72\164\75\70\x30\x38\60\x20\55\x2d\163\x69\x74\x65\x55\x73\145\162\75\152\x6f\x68\156\40\x2d\55\x73\151\164\x65\125\163\x65\x72\x50\x61\163\x73\167\157\162\144\75\47\x21\163\x65\143\x72\x65\164\120\141\163\x73\x77\x6f\162\144\x21\x27"); goto E041a; a231c: $this->addOption("\141\160\160\120\x6f\162\x74", null, InputOption::VALUE_REQUIRED); goto bdc8d; bdc8d: $this->addOption("\163\x69\164\x65\x55\163\x65\162", null, InputOption::VALUE_REQUIRED); goto c4c15; c4c15: $this->addOption("\x73\x69\164\145\x55\163\x65\x72\x50\x61\163\163\167\x6f\x72\x64", null, InputOption::VALUE_REQUIRED); goto ac5dd; C8a11: $this->setName("\x73\151\164\145\x3a\141\x64\144\x3a\x70\171\164\x68\157\x6e"); goto f7cfb; aa294: $this->addOption("\x70\171\164\x68\x6f\156\126\x65\162\x73\x69\x6f\x6e", null, InputOption::VALUE_REQUIRED); goto a231c; ac5dd: } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto a70b0; e36d0: $siteEntity->setRootDirectory($rootDirectory); goto Eb67b; C74ab: $pythonSettingsEntity->setPort($appPort); goto fd823; e16f5: e3e75: goto b52b6; E0dd5: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto ea50f; fd823: $pythonSettingsEntity->setSite($siteEntity); goto f3253; eb8a2: $siteEntity->setPythonSettings($pythonSettingsEntity); goto c21ae; Bc920: facdf: goto Ac7c6; Fcbe1: $pythonSiteCreator->createRootDirectory(); goto Eb33c; dafa6: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto Adbec; Ea6a9: $certificateEntity->setSite($siteEntity); goto c8d1e; C62cc: $pythonSiteCreator = new PythonSiteCreator($pythonSite); goto A02a0; Ede53: return SiteCommand::SUCCESS; goto c7722; f3253: $siteConstraints = $this->validator->validate($siteEntity); goto e85b3; e6005: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto E0dd5; F6d8b: $pythonSite->setCertificate($certificateEntity); goto C6657; Fec7c: $rootDirectory = $domainName; goto affb2; D1cb3: $siteEntity->setDomainName($domainName); goto e36d0; a78be: $certificateEntity->setCsr($csr); goto c8e4f; fc3ab: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto B5521; aa2bd: $vhostTemplateEntity = $this->vhostTemplateEntityManager->findOneByName($vhostTemplate); goto Dfa15; F4f16: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto a78be; bd825: if (!(true === is_null($subdomain) || "\167\x77\x77" == $subdomain)) { goto facdf; } goto Bf863; de62f: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto C16a6; C6657: $pythonSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto C62cc; a7b5a: $subjectAlternativeNames[] = sprintf("\167\x77\167\56\45\x73", $domainName); goto a54a6; Eb67b: $siteEntity->setUser($siteUser); goto f8190; b9c3f: $domainName = trim($input->getOption("\144\x6f\155\141\x69\156\116\x61\155\145")); goto De644; c55e5: $pythonSiteCreator->reloadNginxService(); goto Fd3f4; a54a6: B1c63: goto E2597; C66ff: $pythonSite->setRegistrableDomain($registrableDomain); goto C4120; E4d5f: $pythonSite->setRootDirectory($siteEntity->getRootDirectory()); goto B390b; Fd3f4: $pythonSiteCreator->resetPermissions(); goto Acf62; f8190: $siteEntity->setUserPassword($siteUserPassword); goto bd825; A8bbc: $vhostTemplate = sprintf("\45\x73\x25\x73", $redirectionVhostTemplate, $vhostTemplate); goto Ca350; b1484: $pythonSite->setDomainName($domainName); goto C66ff; fdc59: goto e3e75; goto f168f; c8e4f: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto Aa8d1; cc20c: $pythonSite->setUserPassword($siteEntity->getUserPassword()); goto b1484; Ca350: C637c: goto Bc920; Adbec: if (!(false === empty($redirectionVhostTemplate))) { goto C637c; } goto A8bbc; Cf0e7: $siteUserPassword = trim($input->getOption("\x73\151\164\x65\125\x73\145\x72\x50\141\163\x73\167\x6f\x72\144")); goto fd76d; De644: $vhostTemplate = self::VHOST_TEMPLATE_NAME; goto Fec7c; a70b0: $this->validateInput($input); goto b9c3f; c8d1e: $rsaKeyGenerator = new RsaKeyGenerator(); goto d58f0; F7f98: $vhostTemplate->build(); goto B013a; b531e: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto d4095; A4cf2: B7e0c: goto de62f; d58f0: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto d9f0e; Fa820: Cc9a0: goto F752a; cd19c: $pythonSettingsEntity = new PythonSettingsEntity(); goto eb8a2; b5630: $siteEntity->setType(SiteEntity::TYPE_PYTHON); goto D1cb3; Ff1ef: $siteEntity->setCertificate($certificateEntity); goto bbb7d; F79f7: $this->siteEntityManager->updateEntity($siteEntity); goto daafc; A348b: $constraints->addAll($siteConstraints); goto Fab65; affb2: $pythonVersion = $input->getOption("\160\171\164\x68\157\156\126\145\x72\163\151\157\156"); goto e262b; ea50f: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto F7f98; Ac7c6: $siteEntity->setVhostTemplate($vhostTemplate); goto cd19c; F50f1: $subdomain = $resolvedDomainName->subDomain()->toString(); goto B460e; Ec704: $pythonSiteCreator->writePythonVersionFile(); goto Ab686; Ab686: $pythonSiteCreator->createPrivateKeyAndCertificate(); goto Ce1fe; bbb7d: $pythonSite = new PythonSite(); goto Fbec2; F752a: $certificateEntity = $this->certificateEntityManager->createEntity(); goto Ea6a9; bdf87: goto f74cf; goto Fa820; C16a6: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto dcef8; C4120: $pythonSite->setSubdomain($subdomain); goto E4d5f; da46e: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto f973e; A70d9: if (0 == count($siteConstraints) && 0 == count($pythonSettingsConstraints)) { goto Cc9a0; } goto ec468; f973e: $vhostTemplate->resetProcessors(); goto e6005; c7722: f74cf: goto e16f5; E2597: if (!(false === is_null($subdomain) && "\x77\x77\167" == $subdomain)) { goto B7e0c; } goto e4fc1; Fab65: $constraints->addAll($pythonSettingsConstraints); goto c5d1c; c21ae: $pythonSettingsEntity->setPythonVersion($pythonVersion); goto C74ab; f2863: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto F79f7; Bf863: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\x2f\56\x2e\57\56\x2e\x2f\162\145\163\x6f\x75\162\143\x65\x73\57\x6e\x67\151\156\170\57\x76\x68\157\x73\164\137\164\145\x6d\x70\154\141\x74\145\57\162\145\x64\x69\162\x65\x63\x74"); goto dafa6; e262b: $appPort = (int) $input->getOption("\141\160\x70\120\x6f\x72\x74"); goto be194; fd76d: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto b34bc; Aa8d1: $certificateEntity->setCertificate($selfSignedCertificate); goto Ff1ef; daafc: $output->writeln(sprintf("\x3c\151\156\x66\157\76\x53\x69\x74\x65\74\x2f\x69\156\x66\157\x3e\40\x3c\x63\x6f\155\x6d\145\x6e\x74\76\x25\163\x3c\x2f\143\x6f\x6d\155\x65\156\164\76\x20\x3c\x69\156\146\157\x3e\x68\141\x73\x20\x62\145\145\x6e\40\141\144\x64\x65\144\x2e\74\x2f\151\156\x66\x6f\x3e", $domainName)); goto Ede53; cada2: if (!(true === is_null($subdomain))) { goto B1c63; } goto a7b5a; c5d1c: return $this->renderConstraints($constraints, $output); goto bdf87; e85b3: $pythonSettingsConstraints = $this->validator->validate($pythonSettingsEntity); goto A70d9; B460e: $subdomain = false === empty($subdomain) ? $subdomain : null; goto aa2bd; Fbec2: $pythonSite->setUser($siteEntity->getUser()); goto cc20c; be194: $siteUser = trim($input->getOption("\x73\151\164\x65\x55\163\x65\x72")); goto Cf0e7; f168f: f5dce: goto b531e; d4095: $siteEntity = $this->siteEntityManager->createEntity(); goto b5630; dcef8: $csr = $csrGenerator->generate(); goto fc3ab; B390b: $pythonSite->setPythonSettings($pythonSettingsEntity); goto F6d8b; Eb33c: $pythonSiteCreator->createLogrotateFile(); goto Ec704; A02a0: $pythonSiteCreator->createUser(); goto Fcbe1; B013a: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto f2863; Dfa15: if (false === is_null($vhostTemplateEntity)) { goto f5dce; } goto Ac9f2; Ac9f2: throw new \Exception(sprintf("\x56\x68\157\163\164\x20\124\x65\x6d\160\154\x61\x74\145\x20\42\45\163\42\x20\144\x6f\145\x73\x20\156\x6f\x74\40\145\x78\151\x73\164\56", $vhostTemplate)); goto fdc59; B5521: $certificateEntity->setDefaultCertificate(true); goto F4f16; Ce1fe: $pythonSiteCreator->createNginxVhost(); goto c55e5; Acf62: $vhostTemplate = new PythonVhostTemplate($pythonSite); goto da46e; e4fc1: $subjectAlternativeNames[] = $registrableDomain; goto A4cf2; d9f0e: $subjectAlternativeNames = []; goto cada2; b34bc: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto F50f1; ec468: $constraints = new ConstraintViolationList(); goto A348b; b52b6: } catch (\Exception $e) { goto C6313; ef87b: return SiteCommand::FAILURE; goto F2e77; D04fc: $output->writeln(sprintf("\74\145\x72\162\x6f\x72\x3e\x25\x73\74\x2f\x65\x72\x72\x6f\x72\76", $errorMessage)); goto ef87b; C6313: $errorMessage = $e->getMessage(); goto D04fc; F2e77: } } }