zoukankan      html  css  js  c++  java
  • 解决<script src=http://3b3.org/c.js></script>

     EXEC   sp_MSforeachtable   'exec   sp_changeobjectowner   ''?'',''dbo'''

    一、进入SQL统一删除字段被挂的js 。
    操作方式如下:dbo.数据表 SET 字段= REPLACE(字段, '<script src=http://3b3.org/c.js></script>', '')

    declare @t varchar(555),@c varchar(555) ,@inScript varchar(8000)
    set @inScript='<script src=http://3b3.org/c.js></script>'
    declare table_cursor cursor for select a.name,b.name from sysobjects a,syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)
    open table_cursor
    fetch next from table_cursor into @t,@c
    while(@@fetch_status=0)
    begin
    exec('update ['+@t+'] set ['+@c+']=replace(cast(['+@c+'] as varchar(8000)),'''+@inScript+''','''')' )
    fetch next from table_cursor into @t,@c
    end
    close table_cursor
    deallocate table_cursor;


    二、修改SQL服务中自定义用户和sa的密码。
    一般情况下,SQL数据库被入侵成功的情况下,自定义帐户和SA的密码已经暴露,修改这些帐户密码为第三步做准备。
    三、彻底杜绝SQL注入。
    1.不要使用sa用户连接数据库。
    SA帐户拥有所有数据库和数据表的操作权限,在网页中使用SA连接数据库安全隐患非常大。
    2、新建一个public权限数据库用户,并用这个用户访问数据库。
    为了增加安全系数,建议每个数据库建立独立的只有public权限管理帐户,并用这个用户访问数据库有利于SQL的安全性。
    3、[角色]去掉角色public对sysobjects与syscolumns对象的select访问权限
    4、[用户]用户名称-> 右键-属性-权限-在sysobjects与syscolumns上面打“×”

  • 相关阅读:
    Linux中的防火墙
    Jinja2模板概述
    Ansible触发器-tag标签-忽略错误
    Ansible流程控制
    Ansible变量
    Play-book格式写法
    Redis哨兵(Sentinel)
    Redis 主从复制
    Redis介绍及安装
    Keepalived高可用集群搭建
  • 原文地址:https://www.cnblogs.com/zwei1121/p/1506828.html
Copyright © 2011-2022 走看看