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 files6
datackmy/fallingskies-cve-2023-35885Revision cb3449d9acca

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

src/Backup/Rclone.php

PHP · 8,273 bytes
<?php
 namespace App\Backup; use App\System\CommandExecutor; use App\System\Command\ChownCommand; use App\System\Command\FindChmodCommand; use App\System\Command\CreateDirectoryCommand; use App\System\Command\DeleteDirectoryCommand; use App\System\Command\WriteFileCommand; use App\System\Command\DeleteFileCommand; use App\System\Command\RcloneCopyCommand; use App\System\Command\RcloneLsJsonCommand; use App\System\Command\RclonePurgeCommand; class Rclone { private const FREQUENCY_DAILY = "\x64\x61\x69\x6c\171"; private const CONFIG_DIRECTORY = "\57\162\157\157\x74\x2f\x2e\143\x6f\x6e\x66\x69\147\57\x72\x63\x6c\157\156\x65\57"; private const CLP_USER_CONFIG_DIRECTORY = "\x2f\150\157\x6d\145\x2f\x63\x6c\x70\x2f\56\143\x6f\156\x66\x69\x67\x2f"; private const CLP_USER = "\143\154\x70"; public const CREDENTIALS_DIRECTORY = "\57\150\x6f\x6d\145\x2f\143\x6c\x70\x2f\56\143\157\x6e\x66\x69\x67\57\162\143\154\157\x6e\x65\57\143\x72\x65\x64\145\156\x74\x69\141\154\x73\x2f"; private const CONFIG_FILE = "\57\162\x6f\x6f\164\57\56\x63\157\156\x66\x69\x67\57\162\x63\x6c\x6f\156\x65\x2f\x72\143\154\157\x6e\145\x2e\x63\x6f\x6e\x66"; private const CRON_JOB_FILE = "\x2f\145\164\x63\57\x63\x72\x6f\x6e\x2e\144\57\143\154\x70\x2d\162\143\154\x6f\156\145"; private CommandExecutor $commandExecutor; private ?string $configFile = null; private array $flags = []; public function __construct() { $this->commandExecutor = new CommandExecutor(); } public function setConfigFile(string $configFile) : void { $this->configFile = $configFile; } public function getConfigFile() : ?string { goto A84ba; A84ba: if (!(true === is_null($this->configFile))) { goto D13dd; } goto Ac7b5; e32f5: return $this->configFile; goto c8b08; A82ca: D13dd: goto e32f5; Ac7b5: $this->configFile = self::CONFIG_FILE; goto A82ca; c8b08: } public function addFlag(string $flag, string $value) { $this->flags[] = ["\x66\154\141\x67" => $flag, "\x76\x61\154\x75\x65" => $value]; } public function getFlags() : array { return $this->flags; } public function copy(string $source, string $destination) : void { goto de273; de273: $flags = $this->getFlags(); goto A63fd; bcafc: $this->commandExecutor->execute($rcloneCopyCommand, 21600); goto B87e8; Af443: $this->addFlagsToCommand($flags, $rcloneCopyCommand); goto bcafc; A63fd: $configFile = $this->getConfigFile(); goto c9cb8; fe59d: $rcloneCopyCommand->setDestination($destination); goto Af443; Ee439: $rcloneCopyCommand->setConfigFile($configFile); goto Fd674; c9cb8: $rcloneCopyCommand = new RcloneCopyCommand(); goto Ee439; Fd674: $rcloneCopyCommand->setSource($source); goto fe59d; B87e8: } public function lsJson(?string $remotePath = null, $directoriesOnly = false) : array { goto D20b7; a8553: $rcloneLsJsonCommand->setRemotePath($remotePath); goto eed3a; F33b0: return $files; goto D1bc7; abd67: c510f: goto dad7b; F1c5e: $rcloneLsJsonCommand->setConfigFile($configFile); goto a8553; C4f6c: $files = $rcloneLsJsonCommand->getFiles(); goto F33b0; F99f0: $configFile = $this->getConfigFile(); goto a386e; D2063: $this->commandExecutor->execute($rcloneLsJsonCommand, 20); goto C4f6c; eed3a: if (!(true === $directoriesOnly)) { goto c510f; } goto Afc67; Afc67: $rcloneLsJsonCommand->setDirectoriesOnly(true); goto abd67; D20b7: $flags = $this->getFlags(); goto F99f0; a386e: $rcloneLsJsonCommand = new RcloneLsJsonCommand(); goto F1c5e; dad7b: $this->addFlagsToCommand($flags, $rcloneLsJsonCommand); goto D2063; D1bc7: } public function purge(string $remotePath) { goto dfaec; a6c30: $this->commandExecutor->execute($rclonePurgeCommand, 21600); goto Aeb50; dfaec: $flags = $this->getFlags(); goto F8274; Dedfb: $this->addFlagsToCommand($flags, $rclonePurgeCommand); goto a6c30; bba12: $rclonePurgeCommand->setRemotePath($remotePath); goto Dedfb; F8274: $rclonePurgeCommand = new RclonePurgeCommand(); goto bba12; Aeb50: } public function writeConfig(string $config) : void { goto a7fb4; F21a7: $writeConfigFileCommand->setContent($config); goto B3082; B3082: $this->commandExecutor->execute($createConfigDirectoryCommand); goto acf6d; e0cc7: $createConfigDirectoryCommand->setDirectory(self::CONFIG_DIRECTORY); goto deba2; deba2: $writeConfigFileCommand = new WriteFileCommand(); goto B5bf7; acf6d: $this->commandExecutor->execute($writeConfigFileCommand); goto D97b9; a7fb4: $configFile = $this->getConfigFile(); goto d3def; B5bf7: $writeConfigFileCommand->setFile($configFile); goto F21a7; d3def: $createConfigDirectoryCommand = new CreateDirectoryCommand(); goto e0cc7; D97b9: } public function writeCredentialsFile(string $file, string $content) : void { goto F4328; e7ce8: $chmodConfigDirectoryCommand->setFileChmod(770); goto e9345; Aa755: $chownConfigDirectoryCommand->setGroup(self::CLP_USER); goto bccbe; f8150: $chownConfigDirectoryCommand->setFile(self::CLP_USER_CONFIG_DIRECTORY); goto b84ae; e9345: $this->commandExecutor->execute($credentialsDirectoryCommand); goto A73a3; A73a3: $this->commandExecutor->execute($chownConfigDirectoryCommand); goto B70ba; e4b09: file_put_contents($file, $content); goto Eee0d; b84ae: $chownConfigDirectoryCommand->setRecursive(true); goto Eb94a; B70ba: $this->commandExecutor->execute($chmodConfigDirectoryCommand); goto e4b09; E2b2d: $chmodConfigDirectoryCommand->setFile(self::CLP_USER_CONFIG_DIRECTORY); goto Dc3e9; F4328: $credentialsDirectoryCommand = new CreateDirectoryCommand(); goto cae75; Eb94a: $chownConfigDirectoryCommand->setUser(self::CLP_USER); goto Aa755; cbf13: $chownConfigDirectoryCommand = new ChownCommand(); goto f8150; bccbe: $chmodConfigDirectoryCommand = new FindChmodCommand(); goto E2b2d; cae75: $credentialsDirectoryCommand->setDirectory(self::CREDENTIALS_DIRECTORY); goto cbf13; Dc3e9: $chmodConfigDirectoryCommand->setDirectoryChmod(770); goto e7ce8; Eee0d: } public function createCronJob(string $frequency, string $executionTime = null) : void { goto Ecd0e; C9441: if (self::FREQUENCY_DAILY == $frequency) { goto ae3c4; } goto eaaf3; D60ab: $writeCronJobFileCommand = new WriteFileCommand(); goto D247e; c8d4a: goto C76cb; goto eacad; D247e: $writeCronJobFileCommand->setFile(self::CRON_JOB_FILE); goto B3031; B8444: $cronJobContent .= sprintf("\x30\40\x25\x73\40\x2a\40\52\40\x2a\40\143\x6c\x70\40\x2f\x75\163\x72\57\x62\151\x6e\x2f\x62\x61\163\150\40\x2d\x63\40\42\57\x75\x73\x72\x2f\x62\x69\x6e\x2f\x63\154\160\143\164\154\40\x72\145\155\x6f\164\x65\x2d\x62\141\143\x6b\x75\160\x3a\143\x72\145\x61\x74\x65\x20\x2d\x2d\144\x65\154\141\x79\x3d\164\162\x75\145\42\x20\46\76\40\57\x64\145\x76\x2f\x6e\165\x6c\154", $executionTime); goto ccd42; Ecd0e: $cronJobContent = sprintf("\x4d\x41\x49\x4c\x54\117\75\42\42\x25\163", PHP_EOL); goto C9441; eacad: ae3c4: goto B8444; eaaf3: $cronJobContent .= sprintf("\x30\40\52\57\x25\x73\40\52\x20\52\x20\x2a\x20\143\x6c\160\x20\57\165\163\x72\57\142\151\156\57\x62\141\x73\x68\40\x2d\x63\x20\42\x2f\165\163\162\57\x62\x69\156\x2f\x63\x6c\160\x63\164\x6c\40\x72\x65\155\x6f\164\x65\55\142\x61\143\x6b\x75\160\72\x63\162\x65\141\x74\145\40\55\x2d\144\x65\x6c\x61\x79\75\164\x72\165\x65\x22\x20\x26\x3e\x20\57\144\145\x76\x2f\156\x75\x6c\x6c", $frequency); goto c8d4a; Cf575: $this->commandExecutor->execute($writeCronJobFileCommand); goto B1deb; B3031: $writeCronJobFileCommand->setContent($cronJobContent); goto Cf575; ccd42: C76cb: goto D60ab; B1deb: } private function addFlagsToCommand(array $flags, $command) : void { goto c0d3f; a6c2c: foreach ($flags as $flagData) { $command->addFlag($flagData["\146\154\x61\x67"], $flagData["\166\x61\x6c\165\145"]); E498a: } goto C5d5f; A5041: C9d68: goto Fd587; c0d3f: if (!(false === empty($flags))) { goto C9d68; } goto a6c2c; C5d5f: Faed4: goto A5041; Fd587: } public function deleteCronJob() : void { goto efb95; c69d0: $this->commandExecutor->execute($deleteCronJobFileCommand); goto fdf25; efb95: $deleteCronJobFileCommand = new DeleteFileCommand(); goto b2128; b2128: $deleteCronJobFileCommand->setFile(self::CRON_JOB_FILE); goto c69d0; fdf25: } public function deleteCredentials() : void { goto B6ee3; e160e: $this->commandExecutor->execute($deleteCredentialsDirectoryCommand); goto e48d1; B6ee3: $deleteCredentialsDirectoryCommand = new DeleteDirectoryCommand(); goto C5998; C5998: $deleteCredentialsDirectoryCommand->setDirectory(self::CREDENTIALS_DIRECTORY); goto e160e; e48d1: } }