前言
本来是在cnvd上看到了有人发Pluck CMS的洞,但是没有公开细节,便想着自己挖一下。
但是审完第一个后发现已经有两位同学写出来了
当时自己的思路跟第一个同学一样,第二个同学的思路自己确实没有想到,佩服佩服。
但是心有不甘,自己就继续挖掘了一下,又发现了两处可以任意命令执行的地方。
正文
第一处:过滤不严导致单引号逃逸
这个跟第一篇思路一样,只不过找到了另一处未过滤的点
在function.php里面blog_save_post()函数
function blog_save_post($title, $category, $content, $current_seoname = null, $force_time = null) {
//Check if 'posts' directory exists, if not; create it.
if (!is_dir(BLOG_POSTS_DIR)) {
mkdir(BLOG_POSTS_DIR);
chmod(BLOG_POSTS_DIR, 0777);
}
//Create seo-filename
$seoname = seo_url($title);
//Sanitize variables.
$title = sanitize($title, true);
$content = sanitizePageContent($content, false);
if (!empty($current_seoname)) {
$current_filename = blog_get_post_filename($current_seoname);
$parts = explode('.', $current_filename);
$number = $parts[0];