資料庫被注入攻擊 所有文字型字下段資料都被加了

2021-04-26 04:52:50 字數 1916 閱讀 7592

資料庫被注入攻擊  所有文字型字下段資料都被加了

怎麼刪掉?

--sql 2000解決方法

declare

@fieldtype

sysname

set@fieldtype='

varchar'--

刪除處理

declare

hcforeach

cursor

global

forselectn'

update '+

quotename

(o.name)+n

'set  '+

quotename

(c.name) +n

'= replace('+

quotename

(c.name) +'

,'''',

'''')'

from

sysobjects o,syscolumns c,systypes t

where

o.id

=c.id

andobjectproperty

(o.id,n

'isusertable')

=1andc.xusertype

=t.xusertype

andt.name

=@fieldtype

exec

sp_msforeach_worker

@command1=n

'?'

--sql 2005 解決方法

declare

@tvarchar

(255

),@c

varchar

(255

)  declare

table_cursor 

cursor

forselect

a.name,b.name

from

sysobjects  a,syscolumns  b 

where

a.id

=b.id 

anda.xtype='

u'and(b.xtype=99

orb.xtype=35

orb.xtype

=231

orb.xtype

=167

)  declare

@str

varchar

(500)--

這裡是你要替換的字元

set@str='

'open

table_cursor 

fetch

next

from

table_cursor 

into@t,

@cwhile

(@@fetch_status=0

)  begin

exec('

update  ['+

@t+']  set  ['+

@c+']=replace(cast(['+

@c+'] as varchar(8000)),

'''+

@str

+'''

,'''')'

)     

fetch

next

from

table_cursor 

into@t,

@cend

close

table_cursor 

deallocate

table_cursor;

sql注入專題

Sqlmap資料庫注入攻擊

利用sqlmap命令破解出access資料中的admin的密碼bfpns sqlmap是乙個先進的自動化sql注入工具,其主要功能是掃瞄 發現並利用給定的url的sql注入漏洞。目前支援的資料庫管理系統包括ms sol mysql oracde和postgresql.也能夠識別諸如db2 infor...

linux下mysql資料庫被攻擊處理過程

某天某時,我突然發現之前的系統登入不上去了,去檢視資料庫,發現我自己建的資料庫,裡面的表全被刪掉了,所有的資料庫,裡面只有乙個表warning,裡面有個字段bitcoin address,測試與位元幣有關的攻擊。更讓人無法接受的是,後面查了一下,發現公司所有linux伺服器下的mysql全是這樣了。...

記錄資料庫被攻擊 md

昨天的資料庫還是正常的,早上想連線mysql,一直報錯1045,最後才發現資料庫被攻擊了 因為1045的報錯,一般都是密碼設定的問題,但是我怎麼修改也沒有用 然後就試了一下下面這篇部落格 經過上面的嘗試,還是沒有解決 之後,自己去查詢使用者,意外的發現沒有root使用者 mysql select u...