设为首页
加入收藏
帮助中心
首页 | 红盾通告 | 信息中心 | ASP技术 | 数据库 | 网页设计 | 网管专栏 | OICQ攻略 | 墨客频道 | 网站运营 |
当前位置:首页 >> 数据库 >> SQL Server >> 正文
最新信息
·SQL2000做附加数据库时报:…
·数据库sql被挂马终极批量删…
·动网论坛全文索引建立帮助
·论坛不支持文章内容搜索的…
·打造抵御SQL注入攻击的MSS…
·10个保护SQL Server 2000安…
·sql server安全设置攻略
·SQL Server安全设置清单列…
·使用 SQL Server 时需要经…
·SQL中触发器实例讲解
资料搜索
热点信息
·如何压缩SQL Server 2000数…
·SQL中触发器实例讲解
·日志文件满而造成SQL数据库…
·10个保护SQL Server 2000安…
·使用 SQL Server 时需要经…
·SQL2000做附加数据库时报:…
·SQL SERVER的安全隐患:触…
·asp如何连接sql server并实…
·SQL Server不能启动的常见…
·一种简单的表中删除重复行…
推荐信息
·打造抵御SQL注入攻击的MSS…
·SQL Server数据库开发的二…
·Sqlserver 优化的方法
·SQLServer吞噬的内存解决办…
·SQL SERVER日志清除的两种…
·如何压缩SQL Server 2000数…
·SQL Server 2000 SP4发布
·动网论坛全文索引建立帮助
·10个保护SQL Server 2000安…
·SQL Server安全设置清单列…


Google
 
数据库sql被挂马终极批量删除木马方法
〖编辑:Cloudy | 浏览:人次〗

前几日发了一篇数据库sql被挂马终极批量删除木马方法,虽然也可以起到批量删除木马的作用,但是如果被挂马字段特别多的话还是比较麻烦的。今天无意中在网上找到了一个高人写的asp批量删除木马的程序,功能很强大,你只需要把你的服务器IP、数据库名、用户名、密码和被挂马的字段填写上去,而后点击提交就可以批量清楚木马了,是不是迫不及待了。

用法:新建一个asp文件比如sql.asp,把上边代码复制进去上传到你的服务器空间里边,然后运行http://你的域名/sql.asp。填写参数开始查杀,是不是很方便。就是界面有点丑陋,你可以查看相关的css手册来美化一下收藏备用。

源文件:

ASP/Visual Basic Code复制内容到剪贴板
<%Server.ScriptTimeout=999999999
Response.Buffer =true%>
<title>sql数据库清木马_100天网页设计网</title>
</head>
<style>
  td{font-size:12px;}
  .div{ border:1px #CCCCCC solid; padding:3px; margin:10px;}
  .span{ height:20px; background-color:#CCCCCC; padding:3px;}
</style>
<body>
<p>
  <%
  
  
if request.Form<>"" then
 connstr="PROVIDER=SQLOLEDB;DATA SOURCE="&request("ip")";DATABASE="&request("database")";UID="&request("uname")";PWD="&request("pwd")""  
 'connstr=conn
 set conn=server.CreateObject("adodb.Connection")
 conn.open connstr
  
badstr=request("badstr")
select case request("type")
   case "56"  
 str="int"  
   case "175"  
 str="char"  
   case "167"  
 str="varchar"  
   case "35"  
 str="text"  
   case "239"  
 str="nchar"  
   case "231"  
 str="nvarchar"  
   case "99"  
 str="ntext"  
end select
  
select case request("bigclass")
case "char"  
  response.Write("<br><br><b>全部字符型字段:</b><br><br>")
  set rs=conn.execute("SELECT dbo.syscolumns.name AS Column_name,dbo.sysobjects.name as tablename FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE dbo.sysobjects.name in (select [name] from sysobjects where xtype='U' and status <>0 and NOT (name LIKE 'dtproperties')) and  dbo.syscolumns.xtype='"&request("type")"' ")
if not rs.eof then
   do while not rs.eof

conn.execute("update ["&rs("tablename")"] set ["&rs("Column_name")"]=replace(["&rs("Column_name")"],'"&badstr"','')")
  
response.Write("<span class=span>"&rs("Column_name")"("&rs("tablename")")  </span>")
   rs.movenext
   loop
end if
   rs.close
   set rs=nothing
case "text"  
response.Write("<br><br><b>全部ntext字段:</b><br><br>")
  set rs=conn.execute("SELECT dbo.syscolumns.name AS Column_name,dbo.sysobjects.name as tablename FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE dbo.sysobjects.name in (select [name] from sysobjects where xtype='U' and status <>0 and NOT (name LIKE 'dtproperties')) and  dbo.syscolumns.xtype='"&request("type")"' ")
if not rs.eof then
   do while not rs.eof

'conn.execute("update ["&rs("tablename")&"] set ["&rs("Column_name")&"]=replace(["&rs("Column_name")&"],'"&badstr&"','')")
conn.execute("update ["&rs("tablename")"] set ["&rs("Column_name")"] =replace(cast(["&rs("Column_name")"] as varchar(8000)),'"&badstr"','')")
response.Write("<span class=span>"&rs("Column_name")"("&rs("tablename")")  </span>")
   rs.movenext
   loop
end if
   rs.close
   set rs=nothing
end select
  
end if
 %>
</p>
<%if request("ip")="" then
 ip="127.0.0.1"  
  else
 ip=request("ip")
  end if
  if request("datebase")="" then
 datebase="dbname"  
  else
 datebase=request("datebase")
  end if
  if request("uname")="" then
 uname="uname"  
  else
 uname=request("uname")
  end if
  if request("pwd")="" then
 pwd="123456"  
  else
 pwd=request("pwd")
  end if
 
  if request("badstr")="" then
 badstr="<script src=http://3b3.org/c.js></script>"  
  else
 badstr=request("badstr")
  end if
  %>
<form id="form1" name="form1" method="post" action="">
  <table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td height="25">服务ip:</td>
  <td height="25"><input type="text" name="ip" style="width:200px;"  value="<%=ip%>"/></td>
</tr>
 
  <tr>
  <td height="25">数据库</td>
  <td height="25"><input type="text" name="datebase" style="width:200px;" value="<%=datebase%>"/></td>
</tr>
<tr>
  <td height="25">用户名</td>
  <td height="25"><input type="text" name="uname" style="width:200px;" value="<%=uname%>"/></td>
</tr>
<tr>
  <td height="25">密码</td>
  <td height="25"><input type="text" name="pwd" style="width:200px;" value="<%=pwd%>"/></td>
</tr>
 
<tr>
  <td height="25">特征码</td>
  <td height="25"><label>
<input type="text" name="badstr" style="width:500px;" value="<%=badstr%>"/>
  </label></td>
</tr>
<tr>
  <td width="74" height="25">选择类型</td>
  <td width="526" height="25">
   <select name="bigclass">
<option value="char">字符型</option>
<option value="text">文本型</option>
  </select>  </td>
</tr>
 <tr>
  <td width="74" height="25">数据类型</td>
  <td width="526" height="25">
   <select name="type">
<option value="175">char</option>
<option value="167">varchar</option>
  <option value="35">text</option>
  <option value="239">nchar</option>
  <option value="231">nvarchar</option>
  <option value="99">ntext</option>
  </select>  </td>
</tr>
 <tr>
  <td width="74" height="25"> </td>
  <td width="526" height="25"><label>
<input type="submit" name="Submit" value="提交" />
  </label></td>
</tr>
  </table>
</form>
<p> </p>
<table width="307" border="0" cellspacing="0" cellpadding="0">
  <tr>
<td height="20">字段类型</td>
<td height="20">xtype</td>
  </tr>
  <tr>
<td width="120" height="20">int</td>
<td width="187" height="20">56</td>
  </tr>
  <tr>
<td height="20">char</td>
<td height="20">175</td>
  </tr>
  <tr>
<td height="20">varchar</td>
<td height="20">167</td>
  </tr>
  <tr>
<td height="20">text</td>
<td height="20">35</td>
  </tr>
  <tr>
<td height="20">nchar</td>
<td height="20">239</td>
  </tr>
  <tr>
<td height="20">nvarchar</td>
<td height="20">231</td>
  </tr>
  <tr>
<td height="20">ntext</td>
<td height="20">99</td>
  </tr>
  
</table>
<p>清楚text ntext</p>
<p>   update 表名 set content =replace(cast(content as varchar(8000)),'特征码','')</p>
</body>
</html>


录入时间:2009-12-07 12:26:07 [打印本页] [关闭窗口] [返回顶部]
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

Copyright © 2006-2014 0733168.Com Inc All Rights Reserved
关于我们 | 广告合作 | 联系我们 | 法律声明 | 友情链接 | 意见反馈
本站所收录信息、社区话题、及本站所做之广告均属其个人行为,与本站立场无关
湘ICP备06008436号