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/LetsEncryptRenewCustomDomainCertificateCommand.php
PHP · 7,862 bytes<?php
namespace App\Command; use App\Security\Admin\CustomDomain; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use App\Command\SiteCommand as SiteCommand; use App\System\CommandExecutor; use App\Site\Ssl\CertificateParser; use App\Site\Ssl\Certificate as SslCertificate; use App\Site\Ssl\DistinguishedName; use App\Site\Ssl\Generator\RsaKeyGenerator; use App\Site\Ssl\Generator\CsrGenerator; use App\Site\Ssl\PrivateKey; use App\Site\Ssl\LetsEncryptClient; use App\Site\Ssl\LetsEncrypt\DomainValidationException; use App\Security\Admin\CustomDomain as AdminCustomDomain; use App\System\Command\CheckIfFileExistsCommand; use App\System\Command\CatFileCommand; use App\Notification\NotificationQueue; use App\Entity\Notification; class LetsEncryptRenewCustomDomainCertificateCommand extends SiteCommand { const RENEW_DAYS_BEFORE_EXPIRATION = 7; protected function configure() : void { $this->setName("\154\145\x74\x73\x2d\145\x6e\143\x72\171\x70\x74\72\162\145\x6e\x65\167\x3a\143\165\163\164\157\x6d\x2d\144\157\x6d\141\151\156\x3a\143\145\162\x74\151\x66\151\143\x61\x74\145"); $this->setDescription("\143\154\160\143\x74\154\40\x6c\x65\164\x73\x2d\x65\156\143\x72\171\x70\x74\x3a\162\145\x6e\x65\167\x3a\143\165\163\x74\x6f\155\55\144\157\155\x61\151\156\72\143\145\x72\x74\x69\146\151\143\x61\x74\145"); } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto f8e6b; ce26c: b9948: goto Aa792; Bea3c: if (!(false === empty($domainName))) { goto b9948; } goto e9bff; f8e6b: $configManager = $this->getConfigManager(); goto f72dd; e9bff: $this->renewCertificate($output, $domainName); goto ce26c; Aa792: return SiteCommand::SUCCESS; goto B283a; f72dd: $domainName = $configManager->get("\x63\x75\x73\x74\157\155\137\144\157\x6d\141\x69\156"); goto Bea3c; B283a: } catch (\Exception $e) { goto B76d3; d18ef: $output->writeln(sprintf("\74\x65\x72\162\157\162\76\x25\163\74\x2f\145\x72\162\157\162\x3e", $errorMessage)); goto a011c; B76d3: $errorMessage = $e->getMessage(); goto d18ef; a011c: return SiteCommand::FAILURE; goto A4617; A4617: } } private function renewCertificate(OutputInterface $output, $domainName) { try { goto f8c9a; F4cdd: $certificateContentCommand->setFile(AdminCustomDomain::CERTIFICATE_FILE); goto C225e; d8974: $domains = [$domainName]; goto F31f4; d5829: $certificate = $letsEncryptClient->finalizeOrder($certificateOrder, $privateKey, $csr); goto Cc27e; E1e7e: $validationErrors = $letsEncryptClient->validateDomains($certificateOrder); goto Dba23; E6ab4: $letsEncryptClient = new LetsEncryptClient($privateKey); goto c4bbd; D5446: $domainValidationException = new DomainValidationException("\x44\157\155\141\151\x6e\40\x76\x61\154\151\x64\x61\164\151\157\156\x20\146\141\x69\154\145\x64"); goto D0300; d8389: c995c: goto e69b5; f5a32: C92c4: goto d9121; F3c3f: $vhostTemplate = file_get_contents($vhostTemplateFile); goto Abb6e; dd055: if (!(false === $parsedCertificate->isSelfSigned())) { goto c995c; } goto cd889; a156d: F84ce: goto d8389; Ea776: $output->writeln(sprintf("\74\151\x6e\146\x6f\76\45\x73\x3c\x2f\x69\156\x66\x6f\76", $renewingSuccessMessage)); goto c8b1b; e1ecd: $certificateOrder = $letsEncryptClient->requestOrder($domains); goto e1eb2; C8393: $certificate->setCertificate($certificateContent); goto e9a14; Be7a5: if (!($daysToExpire <= self::RENEW_DAYS_BEFORE_EXPIRATION)) { goto F84ce; } goto d8974; B9c4a: $vhostTemplateFile = realpath(dirname(__FILE__) . "\x2f\56\56\57\56\56\57\x72\x65\163\x6f\165\x72\143\145\163\x2f\156\147\x69\156\x78\57\166\x68\157\163\164\137\164\145\155\x70\154\x61\164\145\x2f\143\x75\x73\164\157\155\55\x64\157\x6d\x61\x69\156"); goto F3c3f; F96ae: $certificateContentCommand = new CatFileCommand(); goto F4cdd; cd889: $now = new \DateTime("\x6e\157\x77"); goto C0370; B6b10: $certificate = new SslCertificate(); goto C8393; Dba28: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto Ee720; c8b1b: F5343: goto a156d; F31f4: $configManager = $this->getConfigManager(); goto B9c4a; b081d: $commonName = array_shift($distinguishedNameDomains); goto f7d80; e1eb2: $adminCustomDomain->deleteLetsEncryptChallengeFiles(); goto Acaba; Dba23: if (true === empty($validationErrors)) { goto C92c4; } goto D5446; d9121: $distinguishedNameDomains = $domains; goto b081d; fc6c0: $renewingSuccessMessage = sprintf("\103\145\x72\164\x69\x66\151\143\x61\164\145\x20\162\145\156\x65\167\x69\156\x67\40\146\157\162\x20\x74\150\x65\40\144\157\155\x61\x69\x6e\x20\x22\x25\163\x22\x20\x77\x61\x73\40\x73\x75\143\143\145\x73\x73\146\x75\154\56", $domainName); goto Ea776; Abb6e: $letsEncryptPrivateKey = $configManager->get("\154\x65\x5f\160\x72\x69\x76\x61\164\145\137\x6b\145\171"); goto C186a; D0654: $adminCustomDomain->writeVhostFile($domainName, $vhostTemplate); goto fd140; Cc27e: $adminCustomDomain->writePrivateKeyAndCertificate($certificate); goto D0654; D0300: $domainValidationException->setValidationErrors($validationErrors); goto d0085; C186a: $privateKey = new PrivateKey($letsEncryptPrivateKey); goto E6ab4; Ca98e: goto F5343; goto f5a32; b76cf: $daysToExpire = round(($expiresAt->getTimestamp() - $now->getTimestamp()) / 86400, 0); goto Be7a5; C0370: $expiresAt = $parsedCertificate->getValidTo(); goto b76cf; C225e: $commandExecutor->execute($certificateContentCommand); goto Fc5d3; E9e19: $rsaKeyGenerator = new RsaKeyGenerator(); goto Dba28; e69b5: b925e: goto Cacf8; De9e7: $csr = $csrGenerator->generate(); goto d5829; f8c9a: $commandExecutor = new CommandExecutor(); goto F96ae; Ee720: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto De9e7; fd140: $adminCustomDomain->reloadNginx(); goto fc6c0; f7d80: $distinguishedName = new DistinguishedName($commonName, $distinguishedNameDomains); goto E9e19; c4bbd: $letsEncryptClient->registerAccount(); goto e1ecd; b458e: if (!(false === empty($certificateContent))) { goto b925e; } goto d4b23; e9a14: $parsedCertificate = $certificateParser->parse($certificate); goto dd055; Acaba: $adminCustomDomain->createLetsEncryptChallengeFiles($certificateOrder); goto E1e7e; d0085: throw $domainValidationException; goto Ca98e; Fc5d3: $certificateContent = $certificateContentCommand->getOutput(); goto c6a92; c6a92: $adminCustomDomain = new AdminCustomDomain(); goto b458e; d4b23: $certificateParser = new CertificateParser(); goto B6b10; Cacf8: } catch (\Exception|DomainValidationException $e) { goto e8b80; D46e6: $subject = sprintf("\x4c\x65\x74\47\163\40\x45\x6e\143\x72\171\x70\164\x20\x43\x65\x72\164\x69\146\x69\143\x61\x74\145\x20\162\x65\156\145\167\40\146\141\151\154\145\144\72\x20\x25\163\56", $domainName); goto a4c03; B51cf: $errorMessage = implode("\x2c\40", $validationErrors); goto Fe06b; a4c03: $this->addNotification($subject, $errorMessage); goto F985a; E4c3d: goto e1456; goto B33dc; f42bb: foreach ($e->getValidationErrors() as $domainName => $validationError) { $validationErrors[] = sprintf("\x25\163\x3a\40\45\163", $domainName, $validationError); F0dd1: } goto fe7f1; Fe06b: e1456: goto D46e6; A38b6: $errorMessage = $e->getMessage(); goto E4c3d; b3e29: $validationErrors = []; goto f42bb; e8b80: if ($e instanceof DomainValidationException) { goto acd27; } goto A38b6; B33dc: acd27: goto b3e29; fe7f1: ecfe5: goto B51cf; F985a: } finally { if (!(true === isset($adminCustomDomain))) { goto E3916; } $adminCustomDomain->deleteLetsEncryptChallengeFiles(); E3916: } } private function addNotification(string $subject, string $errorMessage) : void { goto C96eb; ff140: $notification->setSubject($subject); goto B4dee; B4dee: $notification->setMessage($errorMessage); goto A5e20; A5e20: $notification->setSeverity(Notification::SEVERITY_CRITICAL); goto b942c; b942c: NotificationQueue::addNotification($notification); goto F902b; C96eb: $notification = new Notification(); goto ff140; F902b: } }