如何突破通过判断字符串相等的系统实现用户登录?

WBOY
Release: 2016-06-06 20:39:11
Original
921 people have browsed it

检测用户登录是账号密码是否匹配,可以通过判断字符串是否相等的方式。那如何突破这样的登录限制?

<code>php</code><code><?php $pw = "password";
$get = "password";
if($pw <> $get) {
    echo "login fail.";
} else {
    echo "login succeed.";
}
</code>
Copy after login
Copy after login

回复内容:

检测用户登录是账号密码是否匹配,可以通过判断字符串是否相等的方式。那如何突破这样的登录限制?

<code>php</code><code><?php $pw = "password";
$get = "password";
if($pw <> $get) {
    echo "login fail.";
} else {
    echo "login succeed.";
}
</code>
Copy after login
Copy after login

除非去暴力破解,或者侵入数据库直接修改数据。

通過記錄判斷相等所需要的時間,可以逐位確定密碼。

所以,下次請改用常數時間的相等比較算法。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template