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

目标: 1000 元 · 已筹: 1359 元

100%

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

来源
关联漏洞
标题: Linux kernel 安全漏洞 (CVE-2022-25265)
Description:Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 5.16.10及之前版本存在安全漏洞,该漏洞源于某些二进制文件可能具有exec-all属性,如果它们是在大约2003年构建的(例如,使用GCC 3.2.2和Linux内核2.4.20)。这可能会导致位于文件的非可执行区域的字节的执行。
Description
Bypassing Linux Executable Space Protection using 20+ years old tools (CVE-2022-25265).
介绍
# Executable Space Protection Bypass (CVE-2022-25265)

This POC demonstrates execution of bytes located in supposedly non-executable region of binary, therefore completely bypassing executable-space protection.  

The root cause of this can be found here:
https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/elf.h#L280  

## Brief
As it turns out, binary files built on either systems lacking NX or IA32 systems with NX, which do NOT contain the `PT_GNU_STACK` header will be marked with `exec-all`.  
This allows for complete RWX to/from everywhere in the binary.  


To achieve this, we use "historical" building tools.  
In this case, gcc 3.2.2 running on x86 Slackware9 with Linux 2.4.20  
We will end up with a binary file which can be executed on modern Linux systems, in this case **Linux 5.16.1**

The very same effect MIGHT be achievable with specific linker arguments/scripts, although I have NOT verified this.

The following code will copy assembled bytes of function `dummy()` to character array `harmless_str_buf` and execute the destination array as function.  

[Demo with reverse shell](https://youtu.be/zj5z7eB_frk)

# *** DISCLAIMER ***
This demonstration serves completely for educational purposes.
Under no circumstances can the author of this code be held responsible
for any direct or indirect damage caused by misusing any provided code and/or information. 

See [LICENSE](https://github.com/x0reaxeax/exec-prot-bypass/blob/main/LICENSE) for more details
文件快照

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

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