一、password=md5($pass,true)绕过这个是只能用于基于MySQL数据库进行的登录判断SQL注入绕过。这个问题的发生是在这个场景下。场景:$pass = md5($_POST['pass'],true); $sql = "SELECT * FROM admin where pass='$pass'"; $result = $conn->query($sql); if ($result->num_rows != 0) { echo "success"; //后续操作 } else { echo "password error or user not found!"; }这个场景看上去很安全是吧?直接将用户提交的密码字符串经过MD5加密后直接拼接在SQL语句中,按照常规思想确实没有办法进行SQL注入,但是这里我们可以构造一个十分巧妙的输入来使where子句永真。md5($pass, true)函数这个函数会返回$pass的MD5原始16字符二进制格式。这也是我们这次绕过的原理。
Equinox
一个乐于分享的网安人