请求帮忙修复or漏洞!!急!!
login.asp代码如下:<%@ Language=VBScript %><!--#include file="..\inc\conn.asp"-->
<%
if request.Form("submit")<>"" then
if request.Form("userid")="" or request.Form("password")="" then
response.Write("<script language=javascript>alert('用户名或者密码不能为空!');history.back();</script>")
response.end
end if
set rs=conn.execute("select * from gly where uid='"&trim(request.form("userid"))&"' and pwd='"&trim(request.form("password"))&"'")
if rs.eof then
response.Write("<script language=javascript>alert('用户名或者密码验证失败!');history.back();</script>")
response.End()
else
if rs("IsSuper")=1 then
session(strSession&"uid")="s"
session(strSession&"uidn")=rs("id")
session(strSession&"user")=rs("uid")
else
session(strSession&"uid")="n"
session(strSession&"uidn")=rs("id")
session(strSession&"user")=rs("uid")
end if
response.Redirect("index.asp")
response.End()
end if
rs.close
set rs=nothing
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body{font-size: 12px;}
td{font-size: 12px;}
input{font-size: 12px;}
select{font-size: 12px;}
.style6 {color: #993300; font-weight: bold; font-size: 12px; }
.style7 {color: #666666}
.style9 {color: #FF0000}
.STYLE11 {
font-size: 14px;
font-weight: bold;
}
-->
</style>
<p> </p>
<table width="400" height="300" border="0" align="center" cellpadding="0" cellspacing="0" background="images/login.gif">
<tr>
<td align="center" valign="middle"><table width="200" border="0" cellspacing="0" cellpadding="0">
<form action="login.asp" name="login" id="login" method="post">
<tr>
<td width="60" height="30" align="center"><span class="STYLE11">用户名</span></td>
<td align="center"><input name="userid" type="text" id="userid" style="width:120px;"/></td>
</tr>
<tr>
<td width="60" height="30" align="center"><span class="STYLE11">密 码</span></td>
<td align="center"><input name="password" type="password" id="password" style="width:120px;" /></td>
</tr>
<tr>
<td height="30" colspan="2" align="center"><label>
<input type="submit" name="Submit" value=" 提 交 " />
</label></td>
</tr>
</form>
</table></td>
</tr>
</table>
小弟先谢过了! 把一些 o ' = 等符号屏障了就行了
<%
user=request.from("UserID")
pass=request.from("password")
for i=1 to len(UserID)
cl=mid(UserID,i,1)
if cl="" or us="%" or us="<" or us=">" then
response.redirect "jzpu.com"
response.end
end if
next
%> 还有,把数据库的ADMIN表改为很独特的表名,这样可以防注入 谢谢各位了!已经修复好了!
页:
[1]