Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace App\System\Command; use App\System\Command; use App\Entity\DatabaseServe..
Decoded Output download
<?php
namespace App\System\Command; use App\System\Command; use App\Entity\DatabaseServer; class ChangeDatabaseUserPasswordCommand extends Command { const USER_NAME_ROOT = "root"; private ?string $userName = null; private ?string $newPassword = null; private $alterUserCommandTmpFile = null; private $clientCredentialsTmpFile = null; private ?DatabaseServer $databaseServer = null; public function getCommand() : string { goto f0b02; Caee7: $newPassword = $this->getNewPassword(); goto Fc864; Fbc5c: F570a: goto F8e9f; A6b47: $clientCredentialsCommand = "[client]
user={{userName}}\xapassword={{password}}\xahost={{host}}\xaport={{port}}"; goto f18d6; c40de: E5bb2: goto fe2ea; a4e94: $alterUserCommandTmpFile = stream_get_meta_data($this->alterUserCommandTmpFile)["uri"]; goto ac0ad; ac0ad: file_put_contents($alterUserCommandTmpFile, $updateUserPasswordCommand); goto Cdf2e; b3649: file_put_contents($clientCredentialsTmpFile, $clientCredentialsCommand); goto Fa9da; d85d5: $updateUserPasswordCommand .= "Flush Privileges;"; goto C86e5; B4e06: if (self::USER_NAME_ROOT == $userName) { goto F570a; } goto Aba90; df100: $databaseServer = $this->getDatabaseServer(); goto E8f4d; Fa9da: $this->command = sprintf("/usr/bin/sudo /usr/bin/mysql --defaults-extra-file=%s < %s", $clientCredentialsTmpFile, $alterUserCommandTmpFile); goto c40de; C86e5: $updateUserPasswordCommand = str_replace(["{{userName}}", "{{password}}"], [$userName, addslashes($newPassword)], $updateUserPasswordCommand); goto A6b47; B5751: $this->clientCredentialsTmpFile = tmpfile(); goto Ce14e; B8d58: $databaseServerPort = $databaseServer->getPort(); goto Caee7; f0b02: if ($this->command) { goto E5bb2; } goto df100; fe2ea: return $this->command; goto c281e; D60e7: goto fc7c4; goto Fbc5c; f18d6: $this->alterUserCommandTmpFile = tmpfile(); goto a4e94; A6aa0: fc7c4: goto d85d5; C3f32: $databaseServerPassword = $databaseServer->getPassword(); goto B8d58; Ce14e: $clientCredentialsTmpFile = stream_get_meta_data($this->clientCredentialsTmpFile)["uri"]; goto b3649; Cdf2e: $clientCredentialsCommand = str_replace(["{{userName}}", "{{password}}", "{{host}}", "{{port}}"], [$databaseServerUserName, $databaseServerPassword, $databaseServerHost, $databaseServerPort], $clientCredentialsCommand); goto B5751; E8f4d: $databaseServerHost = $databaseServer->getHost(); goto D56f3; Fc864: $userName = $this->getUserName(); goto B4e06; F8e9f: $updateUserPasswordCommand = "ALTER USER '{{userName}}'@'127.0.0.1' IDENTIFIED BY '{{password}}';" . PHP_EOL; goto A6aa0; Aba90: $updateUserPasswordCommand = "ALTER USER '{{userName}}'@'%' IDENTIFIED BY '{{password}}';" . PHP_EOL; goto D60e7; D56f3: $databaseServerUserName = $databaseServer->getUserName(); goto C3f32; c281e: } public function isSuccessful() : bool { $output = $this->getOutput(); return true; } public function setDatabaseServer(DatabaseServer $databaseServer) { $this->databaseServer = $databaseServer; } public function getDatabaseServer() { return $this->databaseServer; } public function setUserName($userName) { $this->userName = $userName; } public function getUserName() { return $this->userName; } public function setNewPassword($newPassword) { $this->newPassword = $newPassword; } public function getNewPassword() { return $this->newPassword; } } ?>
Did this file decode correctly?
Original Code
<?php
namespace App\System\Command; use App\System\Command; use App\Entity\DatabaseServer; class ChangeDatabaseUserPasswordCommand extends Command { const USER_NAME_ROOT = "\x72\157\x6f\x74"; private ?string $userName = null; private ?string $newPassword = null; private $alterUserCommandTmpFile = null; private $clientCredentialsTmpFile = null; private ?DatabaseServer $databaseServer = null; public function getCommand() : string { goto f0b02; Caee7: $newPassword = $this->getNewPassword(); goto Fc864; Fbc5c: F570a: goto F8e9f; A6b47: $clientCredentialsCommand = "\x5b\143\154\151\145\x6e\164\x5d\12\165\163\145\x72\75\173\x7b\x75\163\x65\162\x4e\141\155\x65\x7d\x7d\xa\x70\141\163\x73\x77\157\162\x64\x3d\x7b\x7b\160\141\163\163\x77\157\x72\144\x7d\x7d\xa\150\157\x73\x74\x3d\173\173\x68\x6f\163\x74\x7d\175\xa\160\157\162\x74\x3d\173\x7b\160\157\162\164\175\x7d"; goto f18d6; c40de: E5bb2: goto fe2ea; a4e94: $alterUserCommandTmpFile = stream_get_meta_data($this->alterUserCommandTmpFile)["\165\x72\x69"]; goto ac0ad; ac0ad: file_put_contents($alterUserCommandTmpFile, $updateUserPasswordCommand); goto Cdf2e; b3649: file_put_contents($clientCredentialsTmpFile, $clientCredentialsCommand); goto Fa9da; d85d5: $updateUserPasswordCommand .= "\x46\x6c\165\163\x68\40\120\162\x69\166\x69\154\145\x67\145\163\x3b"; goto C86e5; B4e06: if (self::USER_NAME_ROOT == $userName) { goto F570a; } goto Aba90; df100: $databaseServer = $this->getDatabaseServer(); goto E8f4d; Fa9da: $this->command = sprintf("\x2f\165\163\162\57\x62\151\156\x2f\163\x75\144\157\x20\57\x75\x73\x72\57\142\151\x6e\57\x6d\171\163\x71\154\40\x2d\x2d\x64\x65\x66\141\x75\x6c\164\163\55\x65\170\164\x72\141\x2d\x66\151\x6c\x65\75\x25\x73\40\x3c\40\45\x73", $clientCredentialsTmpFile, $alterUserCommandTmpFile); goto c40de; C86e5: $updateUserPasswordCommand = str_replace(["\173\173\165\163\145\x72\x4e\141\155\x65\x7d\175", "\x7b\173\160\141\x73\163\x77\x6f\162\x64\175\x7d"], [$userName, addslashes($newPassword)], $updateUserPasswordCommand); goto A6b47; B5751: $this->clientCredentialsTmpFile = tmpfile(); goto Ce14e; B8d58: $databaseServerPort = $databaseServer->getPort(); goto Caee7; f0b02: if ($this->command) { goto E5bb2; } goto df100; fe2ea: return $this->command; goto c281e; D60e7: goto fc7c4; goto Fbc5c; f18d6: $this->alterUserCommandTmpFile = tmpfile(); goto a4e94; A6aa0: fc7c4: goto d85d5; C3f32: $databaseServerPassword = $databaseServer->getPassword(); goto B8d58; Ce14e: $clientCredentialsTmpFile = stream_get_meta_data($this->clientCredentialsTmpFile)["\x75\x72\x69"]; goto b3649; Cdf2e: $clientCredentialsCommand = str_replace(["\x7b\173\x75\x73\x65\162\116\x61\x6d\145\x7d\175", "\x7b\173\x70\x61\163\x73\x77\157\162\x64\175\x7d", "\x7b\x7b\150\x6f\x73\164\x7d\175", "\173\173\160\157\162\164\x7d\x7d"], [$databaseServerUserName, $databaseServerPassword, $databaseServerHost, $databaseServerPort], $clientCredentialsCommand); goto B5751; E8f4d: $databaseServerHost = $databaseServer->getHost(); goto D56f3; Fc864: $userName = $this->getUserName(); goto B4e06; F8e9f: $updateUserPasswordCommand = "\x41\x4c\124\105\122\x20\x55\123\105\122\40\47\173\173\x75\x73\x65\x72\x4e\141\x6d\145\175\175\x27\x40\47\x31\62\67\x2e\x30\x2e\x30\x2e\61\47\x20\111\104\105\x4e\x54\111\106\111\x45\x44\40\x42\131\40\47\x7b\x7b\x70\x61\163\163\167\x6f\162\144\175\x7d\47\73" . PHP_EOL; goto A6aa0; Aba90: $updateUserPasswordCommand = "\101\x4c\124\105\x52\40\x55\123\105\x52\40\x27\173\x7b\x75\x73\x65\x72\116\141\x6d\x65\x7d\175\x27\100\47\x25\47\x20\111\x44\105\x4e\x54\x49\x46\111\105\104\40\x42\131\40\47\x7b\x7b\x70\x61\163\163\x77\x6f\x72\x64\175\x7d\x27\x3b" . PHP_EOL; goto D60e7; D56f3: $databaseServerUserName = $databaseServer->getUserName(); goto C3f32; c281e: } public function isSuccessful() : bool { $output = $this->getOutput(); return true; } public function setDatabaseServer(DatabaseServer $databaseServer) { $this->databaseServer = $databaseServer; } public function getDatabaseServer() { return $this->databaseServer; } public function setUserName($userName) { $this->userName = $userName; } public function getUserName() { return $this->userName; } public function setNewPassword($newPassword) { $this->newPassword = $newPassword; } public function getNewPassword() { return $this->newPassword; } }
Function Calls
None |
Stats
MD5 | 8b1cb56c84b07bd41f482d9a04852e72 |
Eval Count | 0 |
Decode Time | 44 ms |