
Educational, non-functional Linux kernel exploit template for CVE-2024-1086 — lab-only security research and teaching (use in controlled VMs only).
🛡️ Polished educational Linux kernel exploit for security research
This project provides a robust, non-functional template for studying CVE-2024-1086, a use-after-free vulnerability in the Linux kernel's netfilter: nf_tables component, enabling local privilege escalation. Designed for security researchers and students, it combines a C exploit template with an enhanced Java wrapper for reliable diagnostics, configuration, and execution, intended for use in a controlled lab environment only (e.g., a VM with a vulnerable kernel).
⚠️ Warning: The C code is non-functional, using placeholder values, and requires significant modification to work. Unauthorized use on production systems or without permission is illegal and unethical. Use responsibly to advance kernel security knowledge.
nf_tables module--check, --run, --dry-run, --payload, and --config optionsnf_tables exploits┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ 🔍 Java Diagnostics │───▶│ 💻 Exploit Runner │───▶│ 🔐 C Exploit Template│
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ 🔒 System Validation│───▶│ 📝 Logging Engine │───▶│ 🛡️ Kernel Netlink │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
│ │
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ 🧪 Test Suite │ │ 📜 Config Management│
└─────────────────────┘ └─────────────────────┘
The project integrates a Java wrapper for secure diagnostics, logging, and configuration with a C exploit template simulating kernel interaction via Netlink sockets, supported by a test suite for validation.
Ensure you have the following tools installed:
sudo apt install build-essential)sudo apt install openjdk-11-jdk)org.json:json:20230227 (via Maven or JAR)commons-cli:commons-cli:1.5.0 (via Maven or JAR)Operating System:
CONFIG_USER_NS=y)nf_tables module enabled (CONFIG_NF_TABLES=y)Lab Environment:
Clone the Repository
git clone https://github.com/karim4353/CVE-2024-1086-Exploit.git
cd CVE-2024-1086-Exploit
Install Dependencies
sudo apt update
sudo apt install build-essential openjdk-11-jdk
# Download libraries or add to Maven
wget https://repo1.maven.org/maven2/org/json/json/20230227/json-20230227.jar
wget https://repo1.maven.org/maven2/commons-cli/commons-cli/1.5.0/commons-cli-1.5.0.jar
Build the C Exploit
make
Run the Java Wrapper
javac -cp ".:json-20230227.jar:commons-cli-1.5.0.jar" -d . src/main/java/com/example/cve20241086/ExploitRunner.java
java -cp ".:json-20230227.jar:commons-cli-1.5.0.jar" com.example.cve20241086.ExploitRunner --run
Options: --check, --run, --dry-run, --payload <path>, --config <file>, --help
Run Tests
./tests/run_tests.sh
For detailed setup, see Setup Guide.
CVE-2024-1086-Exploit/
├── src/
│ ├── main/
│ │ ├── c/
│ │ │ └── exploit.c # 🔐 C exploit template
│ │ ├── java/
│ │ │ └── com/example/cve20241086/
│ │ │ └── ExploitRunner.java # 🔍 Java wrapper
│ │ └── resources/
│ │ └── config.json # 📜 Exploit configuration
│ └── test/
│ ├── c/
│ │ └── test_exploit.c # 🧪 C test cases
│ └── java/
│ └── com/example/cve20241086/
│ └── ExploitRunnerTest.java # 🧪 Java test cases
├── Makefile # 🛠️ Build script
├── README.md # 📝 This file
├── CONTRIBUTING.md # 🤝 Contribution guidelines
├── LICENSE # 📄 MIT license
└── tests/
└── run_tests.sh # 🧪 Test runner script
Test the project in a secure lab environment:
# Check system vulnerability
java -cp ".:json-20230227.jar:commons-cli-1.5.0.jar" com.example.cve20241086.ExploitRunner --check
# Run exploit (non-functional)
java -cp ".:json-20230227.jar:commons-cli-1.5.0.jar" com.example.cve20241086.ExploitRunner --run
# Run tests
./tests/run_tests.sh
# Clean build artifacts
make clean
We welcome contributions to enhance this educational project! See Contributing Guidelines for details on:
nf_tablesexploit_log.txt