A site I made recently got hacked and defaced. They got into a self-made CMS for administering the website. They were able to retrieve my username and the hashed version of the password and posted it on facebook.
Now my question is, how did they enter the site using the hashed password? Don't they need to decrypt it first? Why didn't they post the decrypted version of the password on their facebook account (when I see a lot of other sites posted there with their human readable passwords displayed).
This is my authentication code:
SELECT * FROM Admin WHERE Username = '$_POST[Username]' // This finds the username
if ($row[Password] == md5($_POST[Password])) {
Save Sessions here
}
Although I've added mysql_real_escape_string now to the SQL query because this might have been the vulnerability.
Any thoughts?