Phpwind background SQL Injection for code reading in bed

Source: Internet
Author: User

This vulnerability is a background injection with little impact. I don't want to launch it myself, but the vulnerability itself may have little impact. However, the entire vulnerability analysis process should be recorded when you are still interested, because in the future, I will know that I was still interested in analyzing it. PHPWIND is a product that I have always felt best for security purposes. I like this clever solution. This product uses the checkVar function to globally convert... in GP (GET, POST ..) <= All are replaced with HTML entities, so even if you find an SQL injection, you will be restricted from using functions and subqueries, even if you find a code execution vulnerability, it is restricted to the beginning of the function and php tag. The above section is also one of the reasons why I wrote this vulnerability. I think such a product should be known. First, I found a function. DeleteMessagesByMessageIds function deleteMessagesByMessageIds ($ messageIds) {$ messageIds = is_array ($ messageIds) in lib/message/db/ms_messagesdb.class.php )? S: sqlImplode ($ messageIds): $ messageIds; $ query = $ this-> _ db-> query ("delete from ". $ this-> _ tableName. "WHERE mid in (". $ messageIds. ")"); return $ this-> _ db-> affected_rows ();} so I know that if there is nothing to limit messageIds to be an array, if it is a string, it will cause SQL injection, and then I need to find out where it is not required to be an array. Then I found the manageMessageWithMessageIds function in lib/message/search. ms. php. Next, I found that it was called in the background. In admin/superdel. in php, S: gp (array ('delid'), 'P'); empty ($ delid) & adminmsg ("select the message to delete "); $ messageServer-> manageMessageWithMessageIds ($ delid); adminmsg ('operate _ success ', "$ url"); previously I mentioned checkVar, I sincerely admire the people who do this. The reason why we can inject it here is that this function has been put in the background. Function checkVar (& $ var) {if (is_array ($ var) {foreach ($ var as $ key => $ value) {S :: checkVar ($ var [$ key]) ;}} elseif (P_W! = 'Admincp') {$ var = str_replace (array ('.. ',') ',' <',' = '), array (' & #46; & #46; ',' & #41; ',' & #60; ',' & #61; '), $ var);} elseif (str_replace (array (' <iframe ',' <meta ',' <script '),'', $ var )! = $ Var) {global $ basename; $ basename = 'javascript: history. go (-1); '; adminmsg ('word _ error');} In} elseif (P_W! = 'Admincp') {solution: S: gp (array ('delid'), 'P', 2 );:)

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.