This article is a mirror article of machine translation, please click here to jump to the original article.

View: 5499|Reply: 2

[Source] 【Practice】The C# program decrypts the current user information of Discuz through cookies

[Copy link]
Posted on 10/23/2022 10:02:39 PM | | | |
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, pleaseReply






Previous:【Practical Combat】Build Thunder Download and DLNA Services for Home Media Docker
Next:VDI Product Comparison: VMware Horizon vs. Citrix
Posted on 10/24/2022 12:24:43 PM |
Learn it
Posted on 10/25/2022 10:13:44 AM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com