前几日发了一篇数据库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>
|