建站铺's Archiver

gqf68 发表于 2008-6-8 23:53

请求帮忙修复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>&nbsp;</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>




小弟先谢过了!

建站铺 发表于 2008-6-11 10:11

把一些  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
%>

蓝色夏天 发表于 2008-6-13 10:32

还有,把数据库的ADMIN表改为很独特的表名,这样可以防注入

gqf68 发表于 2008-6-18 09:58

谢谢各位了!已经修复好了!

页: [1]
本站资源大多来自网络,如原作不希望在本站显示你的软件(文章)请来信,我们将尽快删除。
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论! 铺子法律顾问:姚文胜律师 熊潇敏律师
本论坛的源码只做研究学习只用,请下载以后24小时内删除,如预时不删除,引起的后果,本论坛不承担任何责任。

Powered by jzpu.com 6.1.0  © 2001-2007 Comsenz Inc.