目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2021-27850 PoC — Apache Tapestry 代码问题漏洞

来源
关联漏洞
标题: Apache Tapestry 代码问题漏洞 (CVE-2021-27850)
Description:Apache Tapestry是美国阿帕奇(Apache)基金会的一款使用Java语言编写的Web应用程序框架。 Apache Tapestry 5.7.0, upgrade to 5.7.1 or later 存在安全漏洞,攻击者可利用该漏洞可以通过请求URL“http: localhost:8080 assets something services AppModule.class”下载文件“AppModule.class”,该URL包含一个HMAC密钥。
Description
A Proof of concept for CVE-2021-27850 affecting Apache Tapestry and leading to unauthencticated remote code execution.
介绍
# CVE-2021-27850 Exploit #

## Overview ##

CVE-2021-27850 is a critical unauthenticated remote code execution vulnerability that was found in all recent versions of Apache Tapestry, by downloading the AppModule.class file we can leak the HMAC Secret key used to sign all the serialized objects in apache Tapestry.

We encountered this CVE in a real life assessment and as far as I know there are no public exploits available on how Tapestry signs the serialized objects so we decided to publish the following POC that we have used after digging in apache Tapestry source code for a long time x) .

**Kudos to my senpai [Fares](https://tn.linkedin.com/in/mohamed-amine-fares-71833215a)**

## Usage ##

1- Clone this repo

2- Run the following command 

```sh
javac -classpath commons-codec-1.15/commons-codec-1.15.jar:. Exploit.java
```

3- Finally run the following:

```sh
java -cp commons-codec-1.15/commons-codec-1.15.jar:. Exploit [Tapestry Key] [Ysoserial Payload] [Command To Execute]
```

Where [Tapestry Key] is the Hmac key leaked from the AppModule.class , [Ysoserial Payload] is the payload you want to use from ysoserial and [Command To Execute] the command you want to execute.

![IMG](https://imgur.com/Je8bWC9.png)

**Note:** Unlike the usual Java deserialization exploits where the commands you run are limited ( no pipes or special chars .. ) you can use here any complex command you want since we are appending the following before executing the command ``` sh -c $@|sh . echo ``` .

**References:**

http://cve.mitre.org/cgi-bin/cvename.cgi?name=2021-27850

https://github.com/apache/tapestry-5
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →