Discuz! X2.5 Remote Code Execution Vulnerability warning and EXP [XDAY]

Source: Internet
Author: User

When you see the discuz dede vulnerability, you will be inspired. Haha ......
 
The process is simple. Remember that there is no need to post too much code.
 
Diff
 
Balabalabala .....
 
If (! Defined ('in _ discuz ')){
-89,7 + 89,7 @@
}
}
If ($ searcharray & $ replacearray ){
-$ Content = preg_replace ("/(<a \ s +. *?>. *? <\/A>) | () | (\ [Attach \] (\ d +) \ [\/attach \])/ies ", 'helper _ seo: base64_transform (" encode ", "<relatedlink>", "\ 1 \ 2 \ 3", "</relatedlink>") ', $ content );
+ $ Content = preg_replace ("/(<a \ s +. *?>. *? <\/A>) | () | (\ [Attach \] (\ d +) \ [\/attach \])/ies "," helper_seo: base64_transform ('encoding', '<relatedlink> ', '\ 1 \ 2 \ 3',' </relatedlink> ') ", $ content );
$ Content = preg_replace ($ searcharray, $ replacearray, $ content, 1 );
$ Content = preg_replace ("/<relatedlink> (.*?) <\/Relatedlink>/ies "," helper_seo: base64_transform ('decode', '', '\ 1','') ", $ content );
}
@-100,7 + 100,7 @ www.2cto.com
 
Public static function base64_transform ($ type, $ prefix, $ string, $ suffix ){
If ($ type = 'encoding '){
-Return $ prefix. base64_encode (str_replace ("\ '", "'", $ string). $ suffix ;//--
+ Return $ prefix. base64_encode (str_replace ("\\\" "," \ "", $ string). $ suffix;
} Elseif ($ type = 'decode '){
Return $ prefix. base64_decode ($ string). $ suffix;
}
It is clear enough that the problem is located near line 92 of/source/class/helper/helper_seo.php:
 
$ Content = preg_replace ("/(. *? <\/A>) | (\ [attach \] (\ d +) \ [\/attach \])/ies ", 'helper _ seo :: base64_transform ("encode", "", "\ 1 \ 2 \ 3", "") ', $ content );
 
Preg_replace uses the e modifier and double quotation marks, which causes remote arbitrary code execution.
 
The Forum must support a number of functions. For more information about the functions, see row 68 $ _ G ['cache'] ['relatedlink'] And relatedlink in grep. Do not paste the specific code first, find the seo function that needs to be enabled in the background, and click "operation"-"Link"/"admin. php? Frames = yes & action = misc & operation = relatedlink, and at least one link needs to be set. This function is not available to all administrators, but I think most of it will be available, it can only be a shell tips in the background.
 
Function_core.php 1925
Function parse_related_link ($ content, $ extent ){
Return helper_seo: parse_related_link ($ content, $ extent );
}
 
View Regular Expressions
 
"/(<A \ s +. *?>. *? <\/A>) | () | (\ [Attach \] (\ d +) \ [\/attach \])/ies"
So is the method still used? Various places, such as source/include/space/space_blog.php, all understand: P
 
The detailed usage method will be made public later. I will go to work in the company's data center later to see the scope of the impact. After five points, I will find a program for a long time.

Author's blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.