请看看这段代码是否存在漏洞

yanyanyanyan 2005-05-07 03:11:05
function strLength(str)
dim WINNT_CHINESE
WINNT_CHINESE=(len("例子")=2)
if WINNT_CHINESE then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
if c>255 then
t=t+1
end if
next
strLength=t
else
strLength=len(str)
end if
end function
user=request.form("user")
pass=request("pass")
olduser=user
user=replace(user,"'","''")
error=""

'---------验证是否输入用户名-----------
if user="" then
error=error&"<br>错误:请输入用户名!"
end if

'---------验证是否输入密码-------------
if pass="" then
error=error&"<br>错误:请输入密码!"
end if

if error<>"" then
response.write error
response.end
end if
if isObject(application("chateisldi") then%>
<!-- #include file=database.asp -->
<%
end if
Set rs = Server.CreateObject("ADODB.Recordset")

sql="select * from username where username='"&user&"'"
rs.open sql,application("searchlinkzzz"),1,1
if not rs.eof then
if trim(rs("pass"))<>pass then
response.write "错误密码!"
rs.close
set rs=nothing
response.end
else
session("pass")=trim(rs("pass"))
id=rs("ID")
rs.close
set rs=nothing
response.clear
response.redirect "aa.asp?id="&id
end if
else
response.write "错误:没有找到用户!"
rs.close
end if

set rs=nothing
...全文
149 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanyanyanyan 2005-05-07
  • 打赏
  • 举报
回复
能详细说说吗,用户名不过滤有什么漏洞
mingyuexingguang 2005-05-07
  • 打赏
  • 举报
回复
用户名过滤()"[]%;-

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧