找回密码
 开放注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

搜索
查看: 822|回复: 3

asp网站 XSS跨站脚本漏洞如何修复

[复制链接]

3

主题

2

回帖

10

牛毛

初生牛犊

积分
10
发表于 2012-12-10 11:54:00 | 显示全部楼层 |阅读模式 来自 陕西省西安市
我的站 www.ehouse2008.com 扫描发现存在XSS跨站脚本漏洞,网站源码如下,那位高手帮我看看该如何修复这个漏洞!
网站源码如下:
<http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
set rs_xx=server.CreateObject("adodb.recordset")
sql_xx="select * from System_isSystemConfig_Table"
rs_xx.open sql_xx,dconn,1,1
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=rs_xx("SiteInfo")%></title>
<meta name="Keywords" content="<%=rs_xx("Keywords")%>" />
<meta name="Description" content="<%=rs_xx("descriptions")%>" />
<%rs.close%>
<link href="css.css" type="text/css" rel="stylesheet" />
</head>
<body>
<table width="1004" height="1046" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
  <td align="left" valign="top"><!--#include file="top.asp"-->
    <table width="1004" height="170" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="286" height="5"></td>
      <td width="718"></td>
    </tr>
<tr>
      <td height="165" align="left" valign="top"><!--#include file="left.asp"--></td>
      <td align="right" valign="top"><table width="670" border="0" cellspacing="0" cellpadding="0" style="border:1px #6d4f46 solid">
        <tr>
<%
bigclass=request.QueryString("bigclass")
if bigclass="" then
rs.open "select * from news where ntype='产品展示' order by id desc",dconn,1,1
bigclass=rs("bigclass")
else
rs.open "select * from news where bigclass='"& bigclass &"' order by id desc",dconn,1,1
end if
%>
        <td height="35" align="left" valign="middle" style="text-indent:15px; line-height:25px; border-bottom:1px #6d4f46 solid">当前位置:首页 >> <%=bigclass%></td>
        </tr>
        <tr>
        <td height="398" align="left" valign="top">
<div style="width:706px;">
<%
if rs.eof then
response.Write("<br/> 内容正在编辑当中……")
else
rs.pagesize=6
yeshu=request.QueryString("yeshu")
if int(yeshu)="" or int(yeshu)<1 then
yeshu=1
end if
if int(yeshu)>rs.pagecount then
yeshu=rs.pagecount
end if
rs.absolutepage=yeshu
i=(yeshu-1)*rs.pagesize+1
do while not rs.eof and j<rs.pagesize
%><div style="width:210px; height:180px; float:left">
<table width="210" height="180" border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td height="150" align="right"><table width="1" border="0" cellspacing="0" cellpadding="0" style="border:1px #333333 solid">
              <tr>
                <td><a href="product_in.asp?id=<%=rs("id")%>"><img src="<%=rs("pic")%>" width="169" height="131" border="0" style="margin:2px" /></a></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="center"><a href="product_in.asp?id=<%=rs("id")%>"><%=rs("ntitle")%></a></td>
          </tr>
        </table>
</div>
<%
i=i+1
j=j+1
rs.movenext
loop
end if
rs.close
%></div></td>
        </tr>
        <tr>
        <td height="30" align="center" valign="middle"><a href="product.asp?yeshu=1&bigclass=<%=bigclass%>">首页</a> <a href="product.asp?yeshu=<%=yeshu-1%>&bigclass=<%=bigclass%>">上一页</a> <a href="product.asp?yeshu=<%=yeshu+1%>&bigclass=<%=bigclass%>">下一页</a> <a href="product.asp?yehsu=<%=rs.pagecount%>&bigclass=<%=bigclass%>">末页</a></td>
        </tr>
      </table></td>
    </tr>
    </table>
    <table width="1004" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="5"></td>
    </tr>
    </table>
    <!--#include file="footer.asp"-->
  </td>
</tr>
</table>
</body>
</html>

0

主题

149

回帖

15

牛毛

初生牛犊

积分
15
发表于 2012-12-11 10:35:30 | 显示全部楼层 来自 浙江省金华市
千年一见的好文~~~~
已绑定手机
已实名认证

80

主题

105

回帖

527

牛毛

一级牛人

www.zhonghaoliangyou.com

积分
527
发表于 2012-12-11 12:48:59 | 显示全部楼层 来自 山东省济南市
我的站就出现了这样的问题

89

主题

198

回帖

329

牛毛

一级牛人

积分
329
发表于 2012-12-11 14:19:56 | 显示全部楼层 来自 河南省郑州市
一个网站是否安全对一个网站很重要的
您需要登录后才可以回帖 登录 | 开放注册

本版积分规则

帮助|Archiver|小黑屋|通信管理局专项备案号:[2008]238号|NB5社区 ( 皖ICP备08004151号;皖公网安备34010402700514号 )

GMT+8, 2025-4-26 07:04 , Processed in 0.539281 second(s), 48 queries .

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表