Share
## https://sploitus.com/exploit?id=B1D3E607-E3F9-5D60-8A28-7A7C22E0ABFC
# CopyFail โ€“ CVE-2026-31431  
Examples of PoCs and payloads for CopyFail (CVE-2026-31431). โ€“ Technical Overview:  

## Testing Environment  
| Distribution | Kernel Version |
| --- | --- |
| Ubuntu 24.04 LTS | 6.17.0-1007-aws |
| Amazon Linux 2023 | 6.18.8-9.213.amzn2023 |
| RHEL 10.1 | 6.12.0-124.45.1.el10_1 |
| SUSE 16 | 6.12.0-160000.9-default |

## Quick Usage  
Execute `copyfail_exp.py` on a Linux target machine using a non-root user to obtain root privileges.  

### Payload Compilation Guide  
The following steps are used to regenerate payload files locally for debugging and verification.  

#### 1) x86_64 Assembly Version (`payloads/x86_64.asm`)  
Install dependencies:  
```bash
apt install -y nasm
```  
Compile:  
```bash
nasm -f bin x86_64.asm -o payload.bin
```  
Check the output:  
```bash
wc -c payload.bin
xxd payload.bin
```  

#### 2) AArch64 Assembly Version (`payloads/aarch64.s`)  
Install dependencies:  
```bash
apt install -y binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu
```  
Compile:  
```bash
aarch64-linux-gnu-as aarch64.s -o aarch64.o
aarch64-linux-gnu-objcopy -O binary -j .text aarch64.o aarch64.bin
```  
Check the output:  
```bash
wc -c payload.bin
file payload.bin
xxd payload.bin
```  

#### 3) Cross-platform C Version (`payloads/payload.c`)  
Compile:  
```bash
gcc -Os -s payload.c -o payload.bin
```  
Check the output:  
```bash
wc -c payload.bin
file payload.bin
```