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

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2024-2961 PoC — GNU C Library 安全漏洞

来源
关联漏洞
标题: GNU C Library 安全漏洞 (CVE-2024-2961)
Description:GNU C Library(glibc,libc6)是一种按照LGPL许可协议发布的开源免费的C语言编译程序。 GNU C Library 2.39 及之前版本存在安全漏洞,该漏洞源于 iconv() 函数可能会缓冲区溢出,导致应用程序崩溃或覆盖相邻变量。
Description
This repository contains a C program to test for CVE-2024-2961, a buffer overflow vulnerability in the iconv() function of glibc.
介绍

# Testing CVE-2024-2961 (V1 - Under Analysis)

This repository contains a C program to test for CVE-2024-2961, which involves a buffer overflow vulnerability in the `iconv()` function of the GNU C Library (glibc). Due to the structure of PHP’s heap, this overflow can be exploited to modify part of a free list pointer, ultimately providing an arbitrary write primitive within the program’s memory. Consequently, any attacker with a file read vulnerability and a controlled prefix on a PHP application can achieve RCE. Similarly, forcing PHP to call iconv() with controlled parameters grants the attacker the same capability.

## Prerequisites

- A system with glibc version 2.39 or older.
- GCC (GNU Compiler Collection) installed.
- `iconv` library installed.

## Steps to Test

### 1. Check glibc Version

Ensure that your system has glibc version 2.39 or older:

```bash
ldd --version
```

### 2. Clone the Repository

Clone this repository to your local machine:

```bash
git clone https://github.com/exfil0/test_iconv.git
cd test_iconv
```

### 3. Compile the Program

Use GCC to compile the C program:

```bash
gcc -o test_iconv test_iconv.c -liconv
```

### 4. Run the Program

Execute the compiled program:

```bash
./test_iconv
```

### 5. Analyze the Results

- If the program crashes or behaves unexpectedly, it might be an indication of the buffer overflow.
- Use debugging tools like `gdb` to analyze the crash and confirm if it is related to the vulnerability.

### Optional: Debugging with GDB

If you encounter a crash, you can use `gdb` to get more details:

```bash
gdb ./test_iconv
```

Within GDB, run the program:

```gdb
run
```

If the program crashes, you can inspect the state of the program:

```gdb
bt
```

This will give you a backtrace of the crash, which can help in diagnosing if the overflow is due to the CVE.

### Optional: Using Sanitizers

Compile the program with AddressSanitizer to catch the overflow:

```bash
gcc -fsanitize=address -o test_iconv test_iconv.c -liconv
./test_iconv
```

AddressSanitizer will provide detailed information if there is a buffer overflow.

## Mitigation

If the vulnerability is confirmed, consider updating glibc to a version where this issue is patched. You can download and install the latest version from the GNU project's website or your distribution's package manager.

## Research

For more details on this vulnerability, you can read the following research article:
[GLIBC Flaw CVE-2024-2961 Opens Door to RCE, PoC Exploit Published](https://securityonline.info/glibc-flaw-cve-2024-2961-opens-door-to-rce-poc-exploit-published/)

## Disclaimer

This code is for educational and testing purposes only. Do not use it on systems without proper authorization.
文件快照

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

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