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\DatabaseServ..
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 = "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; } } ?>
Function Calls
None |
Stats
MD5 | 493bc44cbb094c73910b61b6b3a6b7c9 |
Eval Count | 0 |
Decode Time | 63 ms |