# Webgrind fileviewer.phtml 任意文件读取漏洞 CVE-2018-12909 ## 漏洞描述 Webgrind是一套PHP执行时间分析工具。其中Webgrind 1.5版本中存在安全漏洞,该漏洞源于程序依靠用户输入来显示文件。攻击者可以通过漏洞读取服务器敏感文件 ## 漏洞影响 ``` Webgrind <= 1.5 ``` ## FOFA ``` app="Webgrind" ``` ## 漏洞复现 主页面 ![image-20220829102424295](https://typora-notes-1308934770.cos.ap-beijing.myqcloud.com/202208291024336.png) 方法调用在 index.php 中 ![image-20220829102436964](https://typora-notes-1308934770.cos.ap-beijing.myqcloud.com/202208291024049.png) 当参数为 fileviewer 时,将参数传递包含在文件 templates/fileviewer.phtml 中 ![image-20220829102450812](https://typora-notes-1308934770.cos.ap-beijing.myqcloud.com/202208291024892.png) 参数 file 传入 `fileviewer.phtml` 通过函数 `highlight_file` 显示在页面中, 验证POC ``` /index.php?op=fileviewer&file=/etc/passwd ``` ![image-20220829102503956](https://typora-notes-1308934770.cos.ap-beijing.myqcloud.com/202208291025034.png)