MySQL <> login with any password
#5

pawn Код:
format(query, 128, "SELECT md5(`Password`) FROM `Accounts` WHERE `Name` = '%s'", Name);
That is an incorrect statement. You're fetching data in the column name. This is how it should be done:

pawn Код:
format(query, 128, "SELECT Password FROM `Accounts` WHERE `Name` = '%s'", Name);
You already save the password into the database anyway, here is a far better way of doing what you're doing.

pawn Код:
stock mysql_ReturnPasswort(Name[], password[]) //Put inputtext as password
{
    new query[130];
    mysql_real_escape_string(Name, Name);
    format(query, 128, "SELECT Password FROM `Accounts` WHERE `Name` = '%s' AND Password = MD5('%s')", Name, password);
    mysql_query(query);
    mysql_store_result();
    new return = mysql_num_rows();
    mysql_free_result();
    if(return != 0) return 1;
    return 0;
}
Lastly, MD5 is probably the worst algorithm you could use. Most MD5 passwords can be cracked easily with websites online that offer this function.
Reply


Messages In This Thread
MySQL <> login with any password - by s3rserii - 12.09.2012, 14:48
AW: MySQL <> login with any password - by s3rserii - 12.09.2012, 17:32
Re: MySQL <> login with any password - by [MG]Dimi - 12.09.2012, 18:22
AW: Re: MySQL <> login with any password - by s3rserii - 12.09.2012, 18:24
Re: MySQL <> login with any password - by [HiC]TheKiller - 13.09.2012, 05:27
AW: MySQL <> login with any password - by s3rserii - 13.09.2012, 07:18
Re: AW: MySQL <> login with any password - by [HiC]TheKiller - 13.09.2012, 07:25
AW: MySQL <> login with any password - by s3rserii - 13.09.2012, 07:31
Re: MySQL <> login with any password - by [HiC]TheKiller - 13.09.2012, 07:39
AW: MySQL <> login with any password - by s3rserii - 13.09.2012, 08:12

Forum Jump:


Users browsing this thread: 5 Guest(s)