I just noticed something:
matt6805 wrote:
query = "select * from $GLOBALS[tablePrefix]users where id=$_SESSION[userid] and password=md5(\"G8,rMzw6BrBApLU9z$current\")";
and
matt6805 wrote:
$query = "update $GLOBALS[tablePrefix]users set `password`=md5(\"G8,rMzw6BrBApLU9$new_pass\") where email=$email";
$result = mysql_query($query)||die(mysql_error());
Look at the part that says : G8,rMzw6BrBApLU9z
Now look at the 2nd string: G8,rMzw6BrBApLU9
Do you notice how one is missing the "z" ?
That junk before hand is almost like an encryption salt, as there are websites out there which have large dictionaries already hashed in md5 that people can post the 'encrypted' (using this term loosely) and get the result.
With that being said, it is my thought that the string before the $new_pass, etc has to be exact!
make sure that you check the original script's code to see if there is actually a difference in that string (as you have pasted here) in this case, that one letter off will cause a completely different hash (or 'encryption').
otherwise, I recommend grabbing the user ID from the email, rather than updating BY email.
$query = "SELECT id FROM ".$GLOBALS[tablePrefix]users." WHERE `email` = '$email' ORDER BY id LIMIT 1";
This will grab the FIRST ID for the person with that e-mail. There may be other qualifying code like active/inactive if there is any chance of repeat e-mails.
Then take the "ID" response, and update using virtually same code (with the exception that it will be a grabbed it, verses a session) that the original author used.
Also try encasing the $email in single quotes, like:
$query = "update $GLOBALS[tablePrefix]users set `password`=md5(\"G8,rMzw6BrBApLU9$new_pass\") where `email`='$email'";
$result = mysql_query($query)||die(mysql_error());
matt6805 wrote:
The passwords are generated using MD5, and from what I've read it would be impossible to decrypt this.
This is true, as it is not encryption it is actually a hash, however there are databases out there which have run md5 on various language dictionaries which they can make a comparison with.
This is why the script has that "extra" stuff before the actual password, it is being used almost like an encryption salt, rendering these sites pretty much useless.