abiieez abiieez - 26 days ago 11
PHP Question

How to modify PHP password connection to the database?

I have only access to a source code (

connect.php
) from previous developer as

<?php $_F=__FILE__;$_X='Pz48P3BocA0KNG40X3M1dCgnZDRzcGwxeV81cnIycnMnLCdPZmYnKTsNCiRjMm4gPSBteXNxbF9jMm5uNWN0KCJsMmMxbGgyc3QiLCJyMjJ0IiwibW0xYWFhOSIpOw0KbXlzcWxfczVsNWN0X2RiKCJtNHRyMSIsICRjMm4pOw0KNGYgKCEkYzJuKQ0KICB7DQogIGQ0NSgnSzJuNWtzNCBnMWcxbCAhOiAnIC4gbXlzcWxfNXJyMnIoKSk7DQogIH0NCj8+';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?>


Then I googled there's tool to decode the above
encrypted
text which gives me

?><?php
ini_set('display_errors','Off');
$con = mysql_connect("localhost","root","mma2229");
mysql_select_db("mitra", $con);
if (!$con)
{
die('Koneksi gagal !: ' . mysql_error());
}
?>


All I need is just to change the password (example to "123") but I do not know where to start.

How can I set the my
connect.php
with my new password ?

Answer

Just replace the previous delevopers code:

<?php $_F=__FILE__;$_X='Pz48P3BocA0KNG40X3M1dCgnZDRzcGwxeV81cnIycnMnLCdPZmYnKTsNCiRjMm4gPSBteXNxbF9jMm5uNWN0KCJsMmMxbGgyc3QiLCJyMjJ0IiwibW0xYWFhOSIpOw0KbXlzcWxfczVsNWN0X2RiKCJtNHRyMSIsICRjMm4pOw0KNGYgKCEkYzJuKQ0KICB7DQogIGQ0NSgnSzJuNWtzNCBnMWcxbCAhOiAnIC4gbXlzcWxfNXJyMnIoKSk7DQogIH0NCj8+';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?>

With:

<?php
ini_set('display_errors','Off');
$con = mysql_connect("localhost","root","123"); // put your new password instead of 123
mysql_select_db("mitra", $con);
if (!$con)
  {
  die('Koneksi gagal !: ' . mysql_error());
  }
?>