PHP!function_exists ("t7fc56270e7a70fa81a5935b72eacbe29") code decryption _php Tips

Source: Internet
Author: User
Tags eval ord
Copy Code code as follows:

< PHP if (!function_exists ("T7fc56270e7a70fa81a5935b72eacbe29")) {function T7fc56270e7a70fa81a5935b72eacbe29 ($ tf186217753c37b9b9f958d906208506e) {$TF 186217753c37b9b9f958d906208506e = Base64_decode ($ TF186217753C37B9B9F958D906208506E); $T 7fc56270e7a70fa81a5935b72eacbe29 = 0; $T 9d5ed678fe57bcca610140957afab571 = 0; $T 0d61f8370cad1d412f80b84d143e1257 = 0; $TF 623e75af30e62bbd73d6df5b50bb7b5 = (ord ($TF 186217753c37b9b9f958d906208506e[1]) << 8) + ORD ($ TF186217753C37B9B9F958D906208506E[2]); $T 3a3ea00cfc35332cedf6e5e9a32e94da = 3; $T 800618943025315f869e4e1f09471012 = 0; $TDFCF 28D0734569A6A693BC8194DE62BF = 16; $TC 1d9f50f86825a1a2302ec2449c17196 = ""; $TDD 7536794b63bf90eccfd37f9b147d7f = strlen ($TF 186217753c37b9b9f958d906208506e); $TFF 44570aca8241914870afbc310cdb85 = __file__; $TFF 44570aca8241914870afbc310cdb85 = file_get_contents ($TFF 44570aca8241914870afbc310cdb85); $TA 5f3c6a11b03839d46af9fb43c97c188 = 0; Preg_match (Base64_decode ("lyhwcmludhxzchjpbnr8zwnobykv"), $TFF 44570aca8241914870afbc310cdb85, $TA 5f3c6a11b03839d46af9fb43c97c188); for (; $T 3a3ea00cfc35332cedf6e5e9a32e94da< $TDD 7536794b63bf90eccfd37f9b147d7f;) {if (count ($TA 5f3c6a11b03839d46af9fb43c97c188)) exit; if ($TDFCF 28D0734569A6A693BC8194DE62BF = = 0) {$ Tf623e75af30e62bbd73d6df5b50bb7b5 = (Ord ($TF 186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da++ ] << 8); $TF 623e75af30e62bbd73d6df5b50bb7b5 + + ord ($TF 186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da+ +]); $TDFCF 28D0734569A6A693BC8194DE62BF = 16; } if ($TF 623e75af30e62bbd73d6df5b50bb7b5 & 0x8000) {$T 7fc56270e7a70fa81a5935b72eacbe29 = (Ord ($ tf186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da++]) << 4); $T 7fc56270e7a70fa81a5935b72eacbe29 + + (ord $TF 186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da ] >> 4); if ($T 7fc56270e7a70fa81a5935b72eacbe29) {$T 9d5ed678fe57bcca610140957afab571 = (Ord ($ tf186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da++]) &0x0f) + 3; for ($T 0d61f8370cad1d412f80b84d143e1257 = 0; $T 0d61f8370cad1d412f80b84d143e1257 < $ t9d5ed678fe57bcca610140957afab571; $T 0d61f8370cad1d412f80b84d143e1257++) $TC 1d9f50f86825a1a2302ec2449c17196[$T 800618943025315f869e4e1f09471012+$ T0D61F8370CAD1D412F80B84D143E1257] = $TC 1d9f50f86825a1a2302ec2449c17196[$T 800618943025315f869e4e1f09471012-$ t7fc56270e7a70fa81a5935b72eacbe29+ $T 0d61f8370cad1d412f80b84d143e1257]; $T 800618943025315f869e4e1f09471012 + + $T 9d5ed678fe57bcca610140957afab571; else {$T 9d5ed678fe57bcca610140957afab571 = (Ord ($TF 186217753c37b9b9f958d906208506e[$ t3a3ea00cfc35332cedf6e5e9a32e94da++]) << 8); $T 9d5ed678fe57bcca610140957afab571 + + ord ($TF 186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da+ +]) + 16; for ($T 0d61f8370cad1d412f80b84d143e1257 = 0; $T 0d61f8370cad1d412f80b84d143e1257 < $ t9d5ed678fe57bcca610140957afab571; $TC 1d9f50f86825a1a2302ec2449c17196[$T 800618943025315f869e4e1f09471012+ $T 0d61f8370cad1d412f80b84d143e1257++] = $ Tf186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da]); $T 3a3ea00cfc35332cedf6e5e9a32e94da++; $T 800618943025315f869e4e1f09471012 + + $T 9d5ed678fe57bcca610140957afab571; } else $TC 1d9f50f86825a1a2302ec2449c17196[$T 800618943025315f869e4e1f09471012++] = $ tf186217753c37b9b9f958d906208506e[$T 3a3ea00cfc35332cedf6e5e9a32e94da++]; $TF 623e75af30e62bbd73d6df5b50bb7b5 <<= 1; $TDFCF 28d0734569a6a693bc8194de62bf--; if ($T 3a3ea00cfc35332cedf6e5e9a32e94da = = $TDD 7536794b63bf90eccfd37f9b147d7f) {$TFF 44570aca8241914870afbc310cdb85 = Implode ("", $TC 1d9f50f86825a1a2302ec2449c17196); $TFF 44570aca8241914870afbc310cdb85 = "?". > ". $TFF 44570aca8241914870afbc310cdb85." < "." return $TFF 44570aca8241914870afbc310cdb85; Eval (t7fc56270e7a70fa81a5935b72eacbe29 ("A lot of seemingly base64_encode code"));?>

Replace the eval directly with Echo, and the resulting page is blank! Really depressed, this recruit is not a miss, Ah, today encountered the code written by Gao ...

Replace it slowly, replacing the long variable with a short, enhanced readability of the code.
Copy Code code as follows:

< PHP
if (!function_exists ("Bear01″)")
{
function Bear01 ($bear 02)
{
$bear = Base64_decode ($bear 02);
$bear 01 = 0;
$bear 03 = 0;
$bear 04 = 0;
$bear = (ord ($bear 02[1]) < < 8) + ord ($bear 02[2]);
$bear 06 = 3;
$bear 07 = 0;
$bear 08 = 16;
$bear 09 = "";
$bear = strlen ($bear 02);
$bear = __file__;
$bear = file_get_contents ($bear 11);
$bear 12 = 0;
Preg_match (Base64_decode ("lyhwcmludhxzchjpbnr8zwnobykv"), $bear, $bear 12); (Print|sprint|echo)/
for (; $bear 06< $bear 10;)
{
if (count ($bear)) exit;
if ($bear 08 = 0)
{
$bear = (Ord ($bear 02[$bear 06++]) < < 8);
$bear + + ord ($bear 02[$bear 06++]);
$bear 08 = 16;
}
if ($bear & 0x8000)
{
$bear = (Ord ($bear 02[$bear 06++]) < < 4);
$bear + = (Ord ($bear 02[$bear)) >> 4);
if ($bear 01)
{
$bear = (Ord ($bear 02[$bear 06++]) & 0x0f) + 3;
for ($bear = 0 $bear < $bear $bear 04++)
$bear 09[$bear 07+ $bear] = $bear 09[$bear 07-$bear 01+ $bear 04];
$bear + + $bear 03;
}
Else
{
$bear = (Ord ($bear 02[$bear 06++]) < < 8);
$bear + + ord ($bear 02[$bear 06++]) + 16;
for ($bear = 0 $bear < $bear $bear 09[$bear 07+ $bear 04++] = $bear 02[$bear 06]);
$bear 06++; $bear + + $bear 03;
}
}
Else
$bear 09[$bear 07++] = $bear 02[$bear 06++];
$bear < <= 1;
$bear 08–;
if ($bear = $bear 10)
{
$bear one = Implode ("", $bear 09);
$bear 11 = "?". > ". $bear 11." < "."
return $bear 11;
}
}
}
}
Eval (Bear01 ("A lot of seemingly base64_encode code"));?>

which
Preg_match (Base64_decode ("lyhwcmludhxzchjpbnr8zwnobykv"), $bear, $bear 12);

It's a decode.
/(Print|sprint|echo)/
Haha, echo is in there, will
/(Print|sprint)/
Base64_encode and then replaced, Eval replaced with echo output, and the hidden code finally came to the daylight.
in fact, the simple is in three steps can be:
The first step: Search Preg_match (Base64_decode ("lyhwcmludhxzchjpbnr8zwnobykv") is replaced by: Preg_match (Base64_decode (" lyhwcmludhxzchjpbnqplw== ") can
Step two: Replace the eval (the following eval in the T7fc56270e7a70fa81a5935b72eacbe29 string with echo or print)
Step three: Then look at the source file to see the PHP code (right-view source file).

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.