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

目标: 1000 元 · 已筹: 1336

100%

CVE-2023-41717 PoC — Zscaler Proxy 安全漏洞

来源
关联漏洞
标题: Zscaler Proxy 安全漏洞 (CVE-2023-41717)
Description:Zscaler Proxy是Zscaler公司的一个代理应用软件。 Zscaler Proxy 3.6.1.25及之前版本存在安全漏洞,该漏洞源于存在不适当的文件类型控制,允许本地攻击者绕过文件下载/上传限制。
Description
This repository is to provide a write-up and PoC for CVE-2023-41717.
介绍
# CVE-2023-41717
Inappropriate file type control in Zscaler Proxy versions 3.6.1.25 and prior allows local attackers to bypass file download/upload restrictions.


## Executive Summary
During the summer of 2022, I have found a vulnerability affecting the ZScaler proxy (versions 3.6.1.25 and prior). This vulnerability would allow local attackers to bypass the restriction on downloads/uploads of password-protected archives using tools like Burp or even native Microsoft utilities like Bitsadmin, which relies on the Background Intelligent Transfer Service (BITS) protocol.

Per Microsoft’s documentation, the BITS protocol *“defines a way to transfer large payloads from a client to an HTTP server or vice versa, even in the face of interruptions, by sending the payload in multiple fragments”*. This allows to bypass restrictions based on file type as Zscaler is not able to properly reconstruct the file across multiple requests. 

Although this proof of concept will focus only on the _download_ aspect, this vulnerability applies to the uploads as well.

## Proof of Concept
In this section, two different methods for bypassing Zscaler’s restrictions on downloading password-protected archives are highlighted. 
Tests were performed on version 3.6.1.25 of the client, using the following [URL](https://www.malware-traffic-analysis.net/2022/10/04/2022-10-04-IOCs-for-IcedID-infection-with-Cobalt-Strike.txt.zip). 

### Method 1: Manual crafting of HTTP requests

The first method involves modifying HTTP request, which can be done either using a browser or a tool like Burp Suite. For the sake of this test, I have chosen the former.

The image below shows the request being intercepted and blocked by Zscaler. The request is then retransmitted after adding the `Range` header with value `bytes = 0-x`, where `x` is an arbitrary value smaller than the total file size.

![ZScaler blocking password-protected downloads](https://github.com/federella/CVE-2023-41717/blob/main/images/1.png)

Once the request is retransmitted, a response with status code “206 Partial Content” is received. The response headers will show the total file size, while the response payload is encoded in base64.

![Sample response 1/2](https://github.com/federella/CVE-2023-41717/blob/main/images/2.png)

![Sample response 2/2](https://github.com/federella/CVE-2023-41717/blob/main/images/3.png)

The requests are repeated by manually increasing the byte range value, until the last file chunk is reached.

![Multiple requests](https://github.com/federella/CVE-2023-41717/blob/main/images/4.png)

The resulting payload can be reconstructed in various ways: for this test, a custom Powershell script has been used (you can find it in **Reconstruct-Payload.ps1**). 

The MD5 hash of the reconstructed zip file (`CE6CFFEA60C6CDF40C998E56B6EFBD20`) matches the expected one found on Virus Total.

![PowerShell Script](https://github.com/federella/CVE-2023-41717/blob/main/images/5.png)


![Resulting hash](https://github.com/federella/CVE-2023-41717/blob/main/images/6.png)

![Hash check on VT](https://github.com/federella/CVE-2023-41717/blob/main/images/7.png)

### Method 2: BITS

The second method leverages Microsoft's BITS protocol, which natively splits the download requests in chunks.

This test has been done using the CLI utility **bitsadmin.exe**, with the following command line:

`bitsadmin.exe /transfer <job name> /download /priority normal <URL> <path_destination_file>`

![Bitsadmin commandline](https://github.com/federella/CVE-2023-41717/blob/main/images/8.png)


![Bitsadmin test](https://github.com/federella/CVE-2023-41717/blob/main/images/9.png)

The resulting zip’s MD5 hash matches the one found in the previous section.
文件快照

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

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