<![CDATA[Messages posted by "minhtien001"]]> /hvaonline/posts/listByUser/104807.html JForum - http://www.jforum.net Vấn đề thông báo virus khi truy cấp HVA
Cảm ơn !]]>
/hvaonline/posts/preList/45676/280838.html#280838 /hvaonline/posts/preList/45676/280838.html#280838 GMT
Password bị mã hoá dạng decrypt password /hvaonline/posts/preList/40701/250592.html#250592 /hvaonline/posts/preList/40701/250592.html#250592 GMT Password bị mã hoá dạng decrypt password Code:
<?php
/*----------------------------------------
| CLASS FOR CRYPT AND ENCRYPT
----------------------------------------*/
// Check for Security
if ( !defined('HCR') )
{
	print "<h1>Incorrect Access</h1>";
	exit();
}

class crypter
{
	private $secu_code_arr = array(
										"start" => "a",
										"end" => "z",
									);
	private $pass_min_length = 6;				
	private $key_length = 32;
	private $encode_key = "e9c495f4b4271113dc1e546cbf04224b";	//Not change
	private $encode_arr = array(								//Not change
							" ", "0", "1", "2", "3",
							"4", "5", "6", "7", "8",
							"9", "a", "b", "c", "d",
							"e", "f", "g", "h", "i",
							"j", "k", "l", "m", "n",
							"o", "p", "q", "r", "s",
							"t", "u", "v", "w", "x",
							"y", "z", "A", "B", "C",
							"D", "E", "F", "G", "H",
							"I", "J", "K", "L", "M",
							"N", "O", "P", "Q", "R",
							"S", "T", "U", "V", "W",
							"X", "Y", "Z", "@",
						);
						
	/*-----------------------------------------------------
	| CREATE RANDOM KEY
	+ ---------------------------------------------------*/
	function random_key($number)
	{
		$arr_sum = array();
		$arr_num = array();
		$arr_char = array();
		
		$arr_num = range("0", "9");
		$arr_char = range($this->secu_code_arr['start'], $this->secu_code_arr['end']);
		
		$arr_sum = array_merge($arr_num, $arr_char);

		$rand = '';
		for($i = 0; $i < $number; $i++)
		{
			$key = array_rand($arr_sum);
			$rand .= $arr_sum[$key];
		}
		
		return $rand;
	}
	
	/*-----------------------------------------------------
	| CREATE A SECURITY CODE
	+ ---------------------------------------------------*/
	function security_code($number)
	{
		// Lay ngau nhien tu 0-9, A-Z
		$this->secu_code_arr['start'] = "A";
		$this->secu_code_arr['end'] = "Z";
		
		return $this->random_key($number);
	}
	
	/*-----------------------------------------------------
	| COMPILE A SECURITY CODE TO PRINT IN SCREEN
	+ ---------------------------------------------------*/
	function print_screen($code)
	{
		$str_print = "";
		for($i = 0; $i < strlen($code); $i++)
		{
			$str = substr($code, $i,1);
			$str_print .= $str.'';
		}
		
		return $str_print;
	}
	
	/*-----------------------------------------------------
	| CREATE KEY FOR CRYPT A PASSWORD
	+ ---------------------------------------------------*/
	function set_key()
	{
		// Lay ngau nhien tu 0-9, a-z
		$this->secu_code_arr['start'] = "a";
		$this->secu_code_arr['end'] = "z";
		
		return $this->random_key($this->key_length);
	}
	
	/*-----------------------------------------------------
	| FILL IN MISSING CHAR BY RANDOM CHAR
	|
	| This help Vernam encrypt be true
	+ ---------------------------------------------------*/
	function get_true_vernam($text)
	{
		// Just encrypt chars in encode_arr
		$text_arr = str_split($text);
		$text = "";
		foreach ($text_arr as $k => $v)
		{
			$yes = false;
			foreach ($this->encode_arr as $value)
			{
				if ($v == $ $value)
				{
					$yes = true;
					break;
				}
			}
			
			if ($yes) $text .= $text_arr[$k];
		}
		
		// strlen($key) = strlen($password) = key_length
		if ( strlen($text) < $this->key_length)
		{
			$text .= "@";
			
			while ( strlen($text) < $this->key_length) $text .= $this->random_key(1);
			
			if ( strlen($text) > $this->key_length) $text = substr($text,0,$this->key_length);
		}
		
		return $text;
	}
	
	/*-----------------------------------------------------
	| ENCODE TEXT USING VERNAM ALGORITHM
	+ ---------------------------------------------------*/
	function vernam($text, $key)
	{
		// Be sure $text and $key are valid
		$text = $this->get_true_vernam($text);
		$key = $this->get_true_vernam($key);
		
		$text_arr = str_split($text);
		$key_arr = str_split($key);
		
		$code_text = "";
		
		
		for ($i = 0; $i < $this->key_length; $i++)
		{
			$text_int = 0;
			while ( ($text_arr[$i] != $this->encode_arr[$text_int]) && ($text_int < count($this->encode_arr)) ) $text_int++;
			
			$key_int = 0;
			while ( ($key_arr[$i] != $this->encode_arr[$key_int]) && ($key_int < count($this->encode_arr)) ) $key_int++;
			
	
			$code_int =  $text_int + $key_int;
			
			if ( $code_int > count($this->encode_arr) ) $code_int -= count($this->encode_arr);
			
			$code_text .= $this->encode_arr[$code_int];
		}
		
		return $code_text;
	}
	
	/*-----------------------------------------------------
	| DECODE TEXT HAD BEEN ENCODE WITH VERNAM ALGORITHM
	+ ---------------------------------------------------*/
	function devernam($text, $key)
	{
		
		$text = $this->get_true_vernam($text);
		$key = $this->get_true_vernam($key);
		
		$text_arr = str_split($text);
		$key_arr = str_split($key);
		
		$code_text = "";
		
		
		for ($i = 0; $i < $this->key_length; $i++) 
		{			
			$text_int = 0;
			while ( ($text_arr[$i] != $this->encode_arr[$text_int]) && ($text_int < count($this->encode_arr)) ) $text_int++;
			
			
			$key_int = 0;
			while ( ($key_arr[$i] != $this->encode_arr[$key_int]) && ($key_int < count($this->encode_arr)) ) $key_int++;
			
			
			$code_int =  $text_int - $key_int;
			
			if ( $code_int < 0 ) $code_int += count($this->encode_arr);
			
			$code_text .= $this->encode_arr[$code_int];
		}
		
		return $code_text;
	}
	
	/*-----------------------------------------------------
	| ENCODE PASSWORD BY VERNAM ALGORITHM
	+ ---------------------------------------------------*/
	function crypt_password($password, $key)
	{
		// Encode keyword
		$key = $this->vernam($key, $this->encode_key);
		
		// Encode password
		return $this->vernam($password, $key);
	}
	
	/*-----------------------------------------------------
	| DECODE PASSWORD HAD BEEN ENCODE BY VERNAM
	+ ---------------------------------------------------*/
	function decrypt_password($password, $key)
	{
		$key = $this->vernam($key, $this->encode_key);		
		$text = $this->devernam($password, $key);		
		$password_arr = explode("@", $text);
		return $password_arr[0];
	}
}
?>
]]>
/hvaonline/posts/preList/40701/250567.html#250567 /hvaonline/posts/preList/40701/250567.html#250567 GMT
Password bị mã hoá dạng decrypt password Code:
<?php
/*------------------------------------
| LOGIN TO ADMIN PANEL
 ------------------------------------*/
 
// Check for Security
if ( !defined('HCR') )
{
	print "<h1>Incorrect Access</h1>";
	exit();
}

$cnt = new content;

class content
{
	public $text = "";
	public $title = "WEBSITE CONTROL PANEL";	
	private $process = "";
	private $frmValue = array(
								'password' => '',
								'username' => '',
						  	 );
	private $error = array(
								'username' => 0,
								'password' => 0,
							);
	private $warning = "";
	
	
	function __construct()
	{
		global $str, $sess, $lang, $panel;		
		if ($sess->member_id) $sess->destroy();		
		$this->get_input();
		$check_input = $this->check_input( $this->frmValue );
		
		if ( $this->process == "login" )
		{
			if ($check_input)
			{
				 if ($this->login($this->frmValue))
				 {
				  	  $str->goto_url('admp.php');
				 }
				 else
				 {
					  $this->warning = " <span class='span_err'>". $lang['login_notmatch'] ."</span><br/><br/>";
				 }
			}
			else
			{
				$this->warning = "<span class='span_err'>". $lang['login_error'] ."</span><br/><br/>";
			}
		}else
		{
			//Reset Error Array
			$this->error['username'] = 0;
			$this->error['password'] = 0;
		}
		
		$this->text = $this->warning ? "<div id='warning'><b><u>Lỗi nhập liệu</u></b> : " . $this->warning . "</div>" . $this->box_login() : $this->box_login();
	}
	
	
	/*---------------------------------------------
	 | GET INPUT DATA	
	+----------------------------------------------*/
	function get_input()
	{
		global $str;		
		$this->process = isset($_POST['process']) ? $str->input($_POST['process']) : "";		
		$this->frmValue['username'] = isset($_POST['username']) ? $str->input($_POST['username']) : "";
		$this->frmValue['password'] = isset($_POST['password']) ? $_POST['password'] : "";
	 }
	
	
	/*--------------------------------------------------
	 | CHECK INPUT DATA
	+--------------------------------------------------*/
	function check_input($frmValue)
	{
		global $frm, $main, $sess, $db, $str;		
		$no_error = true;		
		if ( !$frm->check_username($frmValue['username'], 3) )
		{
			$this->error['username'] = 1;
			$no_error = false;
		}
		
		if ( !$frm->check_password($frmValue['password'], 6, 32) )
		{
			$this->error['password'] = 1;
			$no_error = false;
		}
		
		return $no_error;
	}
	
	
	/*-------------------------------------------
	  | CHECK INFOS AND AUTHENTICATE FOR LOGIN
	+--------------------------------------------*/
	function login($frmValue)
	{
		global $str, $frm, $db, $sess, $lang, $crypt, $main;
		
		if ( $sess->member_id ) $sess->destroy();
		
		$tmp_username = stripslashes($frmValue['username']);
		$tmp_password = stripslashes($frmValue['password']);
				
		
		$query = $db->simple_select("username, password, login_key, id, groups", "adm_members", "username = '". mysql_real_escape_string($tmp_username) ."' AND active = 1");
		$result = $db->query($query);
		$row = $db->fetch_array($result);
		
		if ( !$row['password'] ) return false;		
		$password = $crypt->decrypt_password($row['password'], $row['login_key'], 32);						
		if ($password != $tmp_password) return false;
		if (strcmp($row['username'], $tmp_username) <> 0 ) return false;
		
		// Update to session
		$sess->member_id = $row['id'];
		$sess->username = $frmValue['username'];
		$sess->groups_id = $row['groups'];
				
		$arr = array( 
						'username' => $sess->username,
						'member_id' => $sess->member_id,
						'groups_id' => $sess->groups_id,
					);
		$db->do_update("session", $arr, "id = '". $sess->sess_id ."'");
						
		// Update last visit
		$arr = array( 'last_visit'  => $sess->now );
		$db->do_update("adm_members", $arr, "id = ". $sess->member_id);
		
		return true;
	}
	
	/*------------------------------------------------
	 | SHOW LOGIN BOX
	--------------------------------------------------*/
	function box_login()
	{
		global $lang, $frm, $dsp;
		
		$text  = $frm->draw_form("", "", 2, "POST");
		$text .= $frm->draw_hidden("process", "login");
			$text .= "<center><fieldset style='border:#0066FF solid 1px; width:300px;'>
<legend style='font-weight:bold; font-size:0.9em; color:#333333'><img src='". ADMIN_IMG ."lock.png' align='absmiddle' width='20' /> Đăng nhập hệ thống</legend>";
			$text .= "<table border='0' width='300'>";
				$text .= "<tr><td height='5' colspan='2'></td></tr>";
				$text .= "<tr>";
					$text .= "<td width='70'>" . $lang['login_user'] . "</td>";
					$text .= "<td align='left'>" . $frm->draw_textfield("username", "", "field", "", "32") . "</td>";
				$text .= "</tr>";
				$text .= "<tr><td height='2' colspan='2'></td></tr>";
				$text .= "<tr>";
					$text .= "<td>" . $lang['login_pass'] . "</td>";
					$text .= "<td align='left'>" . $frm->draw_password("password", "field", "", "32") . "</td>";
				$text .= "</td></tr>";
				$text .= "<tr><td height='5' colspan='2'></td></tr>";
				$text .= "<tr><td colspan='2' align='center'>";
					$text .= "<input type='submit' value='Đăng nhập' style='background-color:#0F4B5D; color:#FFFFFF; border:#CCC solid 1x;' />";
				$text .= "</td></tr>";
				$text .= "<tr><td height='5' colspan='2'></td></tr>";
			$text .= "</table></fieldset></center>";
		$text .= '</form>';
		
		return $text;
	}
}

?>
]]>
/hvaonline/posts/preList/40701/250564.html#250564 /hvaonline/posts/preList/40701/250564.html#250564 GMT
Password bị mã hoá dạng decrypt password Code:
if ( !$row['password'] ) return false;		
		$password = $crypt->decrypt_password($row['password'], $row['login_key'], 32);						
		if ($password != $tmp_password) return false;
		if (strcmp($row['username'], $tmp_username) <> 0 ) return false;
Qua dòng này: Code:
$password = $crypt->decrypt_password($row['password'], $row['login_key'], 32);
password: qsnoweyMuNFQIyJzPRO2R2pKBspnwC login_key: 9f6eg1jh7aejydlovnzoqzo24qijf5nm Mình không hiểu dạng mã hoá decrypt password và có cách nào để thay đổi mã của nó trong phpmyadmin ko? Chân thành cảm ơn ]]>
/hvaonline/posts/preList/40701/250551.html#250551 /hvaonline/posts/preList/40701/250551.html#250551 GMT
Hỏi: tạo file .htaccess chống ddos ? /hvaonline/posts/preList/40108/247479.html#247479 /hvaonline/posts/preList/40108/247479.html#247479 GMT Hỏi: tạo file .htaccess chống ddos ? /hvaonline/posts/preList/40108/247318.html#247318 /hvaonline/posts/preList/40108/247318.html#247318 GMT Giải mã zend ? http://www.mediafire.com/?bcb4hkag45nzks1 ]]> /hvaonline/posts/preList/37145/228336.html#228336 /hvaonline/posts/preList/37145/228336.html#228336 GMT Lỗi INSERT Database /hvaonline/posts/preList/37047/227686.html#227686 /hvaonline/posts/preList/37047/227686.html#227686 GMT Đăng nhập vô forum VBB không được ? /hvaonline/posts/preList/31199/192579.html#192579 /hvaonline/posts/preList/31199/192579.html#192579 GMT Virus svchost.exe /hvaonline/posts/preList/24737/192572.html#192572 /hvaonline/posts/preList/24737/192572.html#192572 GMT Lỗi này có phải do main không mọi người? /hvaonline/posts/preList/31221/192566.html#192566 /hvaonline/posts/preList/31221/192566.html#192566 GMT Đăng nhập vô forum VBB không được ? /hvaonline/posts/preList/31199/192563.html#192563 /hvaonline/posts/preList/31199/192563.html#192563 GMT Đăng nhập vô forum VBB không được ? /hvaonline/posts/preList/31199/192407.html#192407 /hvaonline/posts/preList/31199/192407.html#192407 GMT Đăng nhập vô forum VBB không được ? /hvaonline/posts/preList/31199/192276.html#192276 /hvaonline/posts/preList/31199/192276.html#192276 GMT Re: Listening for an NIS domain server .... Failed !!! /hvaonline/posts/preList/27247/166883.html#166883 /hvaonline/posts/preList/27247/166883.html#166883 GMT Re: Listening for an NIS domain server .... Failed !!! /hvaonline/posts/preList/27247/166873.html#166873 /hvaonline/posts/preList/27247/166873.html#166873 GMT Re: Listening for an NIS domain server .... Failed !!! /hvaonline/posts/preList/27247/166789.html#166789 /hvaonline/posts/preList/27247/166789.html#166789 GMT Re: Lỗi NIS Falled /hvaonline/posts/preList/27247/166553.html#166553 /hvaonline/posts/preList/27247/166553.html#166553 GMT Listening for an NIS domain server .... Failed !!! Listening for an NIS domain server ... [FAILED] Sử dụng cả máy server linux cùng phiên bản (mình chưa biết là lỗi do máy server hay máy con) nhưng ko hiểu tại sao xảy ra lỗi đó. nguyên nhân do mất điện đột ngột khi khởi động lại máy báo lỗi đó. vào desktop các biểu tượng ở thanh menu tự biến mất và treo máy khi đưa chuột tới. Mình sử dụng linux chưa được thành thạo, có gì xin hướng dẫn cụ thể lý do và cách khắc phục sự cố. Mọi người ai gặp trường hợp này xin chỉ dẫn cho . Thanks.]]> /hvaonline/posts/preList/27247/166396.html#166396 /hvaonline/posts/preList/27247/166396.html#166396 GMT Re: Sư huynh nào rảnh giúp em một chút về web /hvaonline/posts/preList/16747/100409.html#100409 /hvaonline/posts/preList/16747/100409.html#100409 GMT Re: Vbulletin All Hacks & All Skins Collection 2007 /hvaonline/posts/preList/16084/96985.html#96985 /hvaonline/posts/preList/16084/96985.html#96985 GMT Vấn đề chuyển File Word ??? /hvaonline/posts/preList/14462/86271.html#86271 /hvaonline/posts/preList/14462/86271.html#86271 GMT Hỏi chương trình lấy Code trang HTML ? /hvaonline/posts/preList/13329/79706.html#79706 /hvaonline/posts/preList/13329/79706.html#79706 GMT Hỏi chương trình lấy Code trang HTML ? /hvaonline/posts/preList/13329/79280.html#79280 /hvaonline/posts/preList/13329/79280.html#79280 GMT Re: Hỏi cách Up nhạc bằng FTP ! /hvaonline/posts/preList/3823/22663.html#22663 /hvaonline/posts/preList/3823/22663.html#22663 GMT Hỏi cách Up nhạc bằng FTP ! /hvaonline/posts/preList/3823/22658.html#22658 /hvaonline/posts/preList/3823/22658.html#22658 GMT Hỏi cách Up nhạc bằng FPT ! /hvaonline/posts/preList/3823/22334.html#22334 /hvaonline/posts/preList/3823/22334.html#22334 GMT Hỏi cách Up nhạc bằng FTP ! /hvaonline/posts/preList/3823/22331.html#22331 /hvaonline/posts/preList/3823/22331.html#22331 GMT vBulletin 3.6.x Hacks Pack /hvaonline/posts/preList/366/2311.html#2311 /hvaonline/posts/preList/366/2311.html#2311 GMT