به وسیله این هک، وقتی کاربر ایمیل رو در مشخصات کاربری خود تغییر میده، سیستم با ارسال ایمیلی به کاربر، از کاربر میخواهد که ایمیل رو تایید کند تا اگر آدرس درست و معتبر بود، ایمیل جدید در مشخصات وی ثبت شود.
نحوه نصب :
فایل Profile.php را از مسیر Engine/Modules بازکنید:
کد زیر رو پیدا کنید:
include_once ENGINE_DIR. '/classes/parse.class.php'; '/ Classes / parse.class.php';
کد زیر رو بعدش قرار بدهید:
if ($doaction == 'validating' AND $is_logged)
{ {
$parse = new ParseFilter( ); $Parse = new ParseFilter ();
$validating = ( isset( $_REQUEST['id'] ) ) ? $Validating = (isset ($_REQUEST ['id']))? strval( $_REQUEST['id'] ) : ''; strval ($_REQUEST ['id']):'';
$validating = explode( '||', @base64_decode( @rawurldecode( $validating ) ) ); $Validating = explode ('||', @ base64_decode (@ rawurldecode ($validating)));
if ( sizeof( $validating ) != 4 ) die( 'ID not valid!' ); if (sizeof ($validating)! = 4) die ('ID not valid!');
$validating[0] = intval( $validating[0] ); $Validating [0] = intval ($validating [0]);
$validating[1] = trim( $db->safesql( $parse->process( $validating[1] ) ) ); $Validating [1] = trim ($db-> safesql ($parse-> process ($validating [1])));
$validating[2] = trim( $db->safesql( $parse->process( $validating[2] ) ) ); $Validating [2] = trim ($db-> safesql ($parse-> process ($validating [2])));
if ( md5( md5( md5( $member_id['name'] . $validating[2] . DBHOST . DBNAME . $config['key'] ) ) ) != md5( $validating[3] ) ) die( 'ID not valid!' ); if (md5 (md5 (md5 ($member_id ['name']. $validating [2]. DBHOST. DBNAME. $config ['key'])))! = md5 ($validating [3])) die (' ID not valid! ');
if ( $member_id['user_id'] == $validating[0] AND $validating[1] == $member_id['email'] ) if ($member_id ['user_id'] == $validating [0] AND $validating [1] == $member_id ['email'])
{ {
$db->query( "UPDATE " . USERPREFIX . "_users set email='{$validating[2]}' WHERE user_id='{$member_id['user_id']}'" ); $Db-> query ("UPDATE". USERPREFIX. "_users Set email = '{$validating [2]}' WHERE user_id = '{$member_id [' user_id']}'");
msgbox( $lang['all_info'], 'E-Mail activated!' ); msgbox ($lang ['all_info'], 'E-Mail activated');
} else die( 'data not valid!' ); } Else die ('data not valid!');
} }
{ {
$parse = new ParseFilter( ); $Parse = new ParseFilter ();
$validating = ( isset( $_REQUEST['id'] ) ) ? $Validating = (isset ($_REQUEST ['id']))? strval( $_REQUEST['id'] ) : ''; strval ($_REQUEST ['id']):'';
$validating = explode( '||', @base64_decode( @rawurldecode( $validating ) ) ); $Validating = explode ('||', @ base64_decode (@ rawurldecode ($validating)));
if ( sizeof( $validating ) != 4 ) die( 'ID not valid!' ); if (sizeof ($validating)! = 4) die ('ID not valid!');
$validating[0] = intval( $validating[0] ); $Validating [0] = intval ($validating [0]);
$validating[1] = trim( $db->safesql( $parse->process( $validating[1] ) ) ); $Validating [1] = trim ($db-> safesql ($parse-> process ($validating [1])));
$validating[2] = trim( $db->safesql( $parse->process( $validating[2] ) ) ); $Validating [2] = trim ($db-> safesql ($parse-> process ($validating [2])));
if ( md5( md5( md5( $member_id['name'] . $validating[2] . DBHOST . DBNAME . $config['key'] ) ) ) != md5( $validating[3] ) ) die( 'ID not valid!' ); if (md5 (md5 (md5 ($member_id ['name']. $validating [2]. DBHOST. DBNAME. $config ['key'])))! = md5 ($validating [3])) die (' ID not valid! ');
if ( $member_id['user_id'] == $validating[0] AND $validating[1] == $member_id['email'] ) if ($member_id ['user_id'] == $validating [0] AND $validating [1] == $member_id ['email'])
{ {
$db->query( "UPDATE " . USERPREFIX . "_users set email='{$validating[2]}' WHERE user_id='{$member_id['user_id']}'" ); $Db-> query ("UPDATE". USERPREFIX. "_users Set email = '{$validating [2]}' WHERE user_id = '{$member_id [' user_id']}'");
msgbox( $lang['all_info'], 'E-Mail activated!' ); msgbox ($lang ['all_info'], 'E-Mail activated');
} else die( 'data not valid!' ); } Else die ('data not valid!');
} }
کد زیر رو پیدا کنید:
$filecontents = ''; $Filecontents ='';
کد زیر رو بعدش قرار بدهید:
if ($email! = $member_id ['email'] AND $config ['registration_type'])
{ {
include_once ENGINE_DIR . include_once ENGINE_DIR. '/classes/mail.class.php'; '/ Classes / mail.class.php';
$mail = new dle_mail( $config ); $Mail = new dle_mail ($config);
$row = $db->super_query( "SELECT template FROM " . PREFIX . "_email where name='reg_mail' LIMIT 0,1" ); $Row = $db-> super_query ("SELECT template FROM". PREFIX. "_email Where name = 'reg_mail' LIMIT 0,1");
$row['template'] = stripslashes( $row['template'] ); $Row ['template'] = stripslashes ($row ['template']);
$idlink = rawurlencode( base64_encode( $member_id['user_id'] . '||' . $member_id['email'] . '||' . $email . '||' . md5( md5( $member_id['name'] . $email . DBHOST . DBNAME . $config['key'] ) ) ) ); $Idlink = rawurlencode (base64_encode ($member_id ['user_id']. '| |'. $Member_id ['email']. '| |'. $Email. '| |'. Md5 (md5 ($member_id ['name ']. $email. DBHOST. DBNAME. $config [' key ']))));
$row['template'] = str_replace( "{%username%}", $member_id['name'], $row['template'] ); $Row ['template'] = str_replace ("{% username%}", $member_id ['name'], $row ['template']);
$row['template'] = str_replace( "{%validationlink%}", $config['http_home_url'] . 'index.php?subaction=userinfo&user=' . urlencode( $member_id['name'] ) . '&doaction=validating&id=' . $idlink, $row['template'] ); $Row ['template'] = str_replace ("{% validationlink%}", $config ['http_home_url']. 'Index.php? Subaction = userinfo & user ='. Urlencode ($member_id ['name']). '& Doaction = validating & id = '. $idlink, $row [' template ']);
$row['template'] = str_replace( "{%password%}", 'Засекречен', $row['template'] ); $Row ['template'] = str_replace ("{% password%}", 'secretive', $row ['template']);
$mail->send( $email, $lang['reg_subj'], $row['template'] ); $Mail-> send ($email, $lang ['reg_subj'], $row ['template']);
if ( $mail->send_error ) msgbox( $lang['all_info'], $mail->smtp_msg ); if ($mail-> send_error) msgbox ($lang ['all_info'], $mail-> smtp_msg);
msgbox( $lang['all_info'], 'That would change the E-Mail, it is necessary to confirm' ); msgbox ($lang ['all_info'], 'What would change E-Mail, it is necessary to confirm');
$email = $member_id['email']; $Email = $member_id ['email'];
} }
{ {
include_once ENGINE_DIR . include_once ENGINE_DIR. '/classes/mail.class.php'; '/ Classes / mail.class.php';
$mail = new dle_mail( $config ); $Mail = new dle_mail ($config);
$row = $db->super_query( "SELECT template FROM " . PREFIX . "_email where name='reg_mail' LIMIT 0,1" ); $Row = $db-> super_query ("SELECT template FROM". PREFIX. "_email Where name = 'reg_mail' LIMIT 0,1");
$row['template'] = stripslashes( $row['template'] ); $Row ['template'] = stripslashes ($row ['template']);
$idlink = rawurlencode( base64_encode( $member_id['user_id'] . '||' . $member_id['email'] . '||' . $email . '||' . md5( md5( $member_id['name'] . $email . DBHOST . DBNAME . $config['key'] ) ) ) ); $Idlink = rawurlencode (base64_encode ($member_id ['user_id']. '| |'. $Member_id ['email']. '| |'. $Email. '| |'. Md5 (md5 ($member_id ['name ']. $email. DBHOST. DBNAME. $config [' key ']))));
$row['template'] = str_replace( "{%username%}", $member_id['name'], $row['template'] ); $Row ['template'] = str_replace ("{% username%}", $member_id ['name'], $row ['template']);
$row['template'] = str_replace( "{%validationlink%}", $config['http_home_url'] . 'index.php?subaction=userinfo&user=' . urlencode( $member_id['name'] ) . '&doaction=validating&id=' . $idlink, $row['template'] ); $Row ['template'] = str_replace ("{% validationlink%}", $config ['http_home_url']. 'Index.php? Subaction = userinfo & user ='. Urlencode ($member_id ['name']). '& Doaction = validating & id = '. $idlink, $row [' template ']);
$row['template'] = str_replace( "{%password%}", 'Засекречен', $row['template'] ); $Row ['template'] = str_replace ("{% password%}", 'secretive', $row ['template']);
$mail->send( $email, $lang['reg_subj'], $row['template'] ); $Mail-> send ($email, $lang ['reg_subj'], $row ['template']);
if ( $mail->send_error ) msgbox( $lang['all_info'], $mail->smtp_msg ); if ($mail-> send_error) msgbox ($lang ['all_info'], $mail-> smtp_msg);
msgbox( $lang['all_info'], 'That would change the E-Mail, it is necessary to confirm' ); msgbox ($lang ['all_info'], 'What would change E-Mail, it is necessary to confirm');
$email = $member_id['email']; $Email = $member_id ['email'];
} }