Requirements: When the user logs in successfully, the Discuz program will write the login credentials to the cookie in a responsive manner, if the cookie is known, how to decrypt the user ID of the current logged-in person in the cookie?
First, you need to log in to the server and view/config/config_global.phpThere are 2 configurations in the following configuration:
Cookie prefixes:$_config['cookie']['cookiepre'] Encryption and Decryption Key:$_config['security']['authkey']
Take this site as an example: $_config['cookie']['cookiepre'] = 'Mqd1_'; , so look at the values of :Mqd1_2132_saltkey and Mqd1_2132_auth in the cookie.
The principle is as follows:
$authkey = "*********"; This is the secret key. $_config['security']['authkey'] = '*******' in the config/config_global.php file; This is it, you look at what you own is what is. $salt = $_COOKIE['Mqd1_2132_saltkey']; This is the random number generated by discuz $key = md5($authkey.$salt); Decryption key $info = uc_authcode($_COOKIE['Mqd1_2132_auth'], 'DECODE',$key);
Then print out $info and get a result similar to this:
bf6b7e1ddd3da431342f550eb8ce19e5 1
We found that there is a 1 or other number at the end, which represents your user ID, so that we can obtain the user information, and then obtain the user information of ucenter based on this ID. Once you know how to decrypt it, the C# code looks like this:
Enter the corresponding information in the program, and the execution result is as follows:
Program download:
Tourists, if you want to see the hidden content of this post, please Reply
|