- Joined
- Jun 19, 2010
- Messages
- 33
- Reaction score
- 0
Hello people \o
I'm trying to create a login panel to player on the site, but the perfect world uses MD5 + salt to register.
Exploitation of the registration:
Example login system:
I did so, but I'm not getting someone help me?
Thank you.
I'm trying to create a login panel to player on the site, but the perfect world uses MD5 + salt to register.
Exploitation of the registration:
PHP:
$Salt = $Login.$Pass;
$Salt = md5($Salt);
$Salt = "0x".$Salt;
MySQL_Query("call adduser('$Login', $Salt, '0', '0', '0', '0', '$Email', '0', '0', '0', '0', '0', '0', '0', '', '', $Salt)") or die ("Can't execute query.");
mysql_query("INSERT INTO e107_user (user_loginname, user_password, user_email)
VALUES ('$Login', '$Salt', '$email')") or die ("Account <b>".$Login."</b> has been registered.");
echo "Account <b>".$Login."</b> has been registered.";
Example login system:
PHP:
<?php
ob_start();
include "config.php";
function getPost($var)
{
$val = isset($_POST[$var]) ? $_POST[$var] : '';
if ( get_magic_quotes_gpc() )
stripslashes($val);
return $val;
}
$Login = getPost('login');
$Pass = getPost('passwd');
if ( empty($Login) || empty($Pass) )
{
echo "Por favor preencha todos os campos<br>."; exit;
}
//login
$Link = MySQL_Connect($DBHost, $DBUser, $DBPassword) or die ("Can't connect to MySQL");
MySQL_Select_Db($DBName, $Link) or die ("Database ".$DBName." do not exists.");
// Impede o SQL Injection
$Login = mysql_real_escape_string($Login);
$Pass = mysql_real_escape_string($Passwd);
$rs = mysql_query("SELECT * FROM users WHERE name='$Login'") or die (mysql_error());
$row = mysql_fetch_object($rs);
$user_login = $row->name;
$user_passwd = $row->passwd;
$Salt = $Login.$Passwd;
$Salt = md5($Salt);
$Salt = "0x".$Salt;
if ( $user_passwd == $Salt )
{
echo "<font color=\"green\"><b>User Log *-*</b></font>";
setcookie("log-PW", "1", time()+3600*24*7, '/');
header("Location: main.php");
}
else
{
echo "<font color=\"red\"><b>Error Password</b></font>";
header("Location: erro.php");
}
?>
I did so, but I'm not getting someone help me?
Thank you.