Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2015-1328 — A Proof of Concept (PoC) exploit for CVE-2015-1328 | Kitploit
Tools/GitHubGitHub/0xf1d0/cve-2015-1328
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingLearning & EducationBinary Exploitation
GitHub0xf1d0/cve-2015-1328

CVE-2015-1328

A Proof of Concept (PoC) exploit for CVE-2015-1328

View Repository
1201 year agoNot yet reviewed
Share

CVE-2015-1328 Proof of Concept

A Proof of Concept (PoC) exploit for CVE-2015-1328, a privilege escalation vulnerability affecting the Linux kernel's overlayfs implementation. This vulnerability allows local unprivileged users to gain root access by exploiting improper permission checks in overlayfs mount operations within user namespaces.

Overview

CVE-2015-1328 is a critical security vulnerability that affects Linux kernels with overlayfs support and user namespaces enabled. The vulnerability allows an unprivileged local user to:

  1. Create a user namespace using unshare(CLONE_NEWUSER)
  2. Mount overlayfs filesystems within the namespace
  3. Exploit permission checking flaws to write to /etc/ld.so.preload
  4. Execute a malicious shared library to gain root privileges

This PoC demonstrates the vulnerability by:

  • Using namespace isolation to bypass mount restrictions
  • Mounting overlayfs to manipulate system files
  • Injecting a custom shared library via /etc/ld.so.preload
  • Hijacking getuid() to execute a root shell

Affected Systems

  • Ubuntu 14.04 LTS with kernel versions prior to 3.19.0-21.21
  • Systems with:
    • User namespaces enabled (kernel.unprivileged_userns_clone=1)
    • Overlayfs filesystem support
    • Unpatched kernel versions

Requirements

  • GCC compiler with 32-bit support
  • Linux kernel with user namespaces and overlayfs support
  • Appropriate system libraries (-m32 flag support)

Building

The project includes a Makefile for easy compilation:

make

This will compile:

  • ofs - The main exploit binary (static 32-bit)
  • ofs-lib.so - The shared library for LD_PRELOAD hook (32-bit)

Manual Compilation

If you prefer to compile manually:

# Compile main exploit
gcc -o ofs ofs.c -m32 -static

# Compile shared library
gcc -m32 -fPIC -shared -o ofs-lib.so ofs-lib.c -ldl -static-libgcc

Usage

⚠️ WARNING: This exploit will modify system files and attempt to gain root privileges. Only use in controlled environments with proper authorization.

  1. Compile the exploit:

    make
    
  2. Run the exploit:

    ./ofs
    
  3. If successful, the exploit will:

    • Create necessary namespace structures
    • Mount overlayfs filesystems
    • Write to /etc/ld.so.preload
    • Execute /bin/su which triggers the malicious library
    • Spawn a root shell

How It Works

Exploit Flow

  1. Namespace Creation: The exploit creates a new user namespace using unshare(CLONE_NEWUSER)
  2. Mount Namespace: Creates a mount namespace using clone() with CLONE_NEWNS
  3. Overlayfs Mount: Mounts overlayfs filesystems to manipulate system directories
  4. File Manipulation: Uses overlayfs to rename files and write to /etc/ld.so.preload
  5. Library Injection: Writes a malicious shared library to /tmp/ofs-lib.so
  6. Privilege Escalation: Executes /bin/su, which triggers the preloaded library
  7. Root Shell: The library hijacks getuid() and spawns a root shell

Technical Details

  • The exploit uses clone() with a custom stack to create isolated mount namespaces
  • Overlayfs mounts allow file manipulation within the namespace that affects the host
  • The shared library (ofs-lib.so) hooks getuid() via LD_PRELOAD
  • When /bin/su calls getuid(), the malicious function is executed instead

Code Structure

.
├── ofs.c          # Main exploit code
├── ofs-lib.c      # Shared library for privilege escalation
├── lib_so.h       # Embedded binary library data
├── Makefile       # Build configuration
└── README.md      # This file

Key Files

  • ofs.c: Contains the main exploit logic, namespace creation, and mount operations
  • ofs-lib.c: Implements the getuid() hook that spawns a root shell
  • lib_so.h: Contains the compiled shared library as a binary array (for embedding)

Mitigation

To protect against this vulnerability:

  1. Update the kernel to a patched version (3.19.0-21.21 or later for Ubuntu 14.04)
  2. Disable user namespaces if not required:
    echo 0 > /proc/sys/kernel/unprivileged_userns_clone
    
  3. Use AppArmor/SELinux to restrict namespace creation capabilities
  4. Monitor system logs for suspicious mount operations

Legal and Ethical Disclaimer

This code is provided for educational and security research purposes only.

  • Unauthorized use of this exploit against systems without explicit permission is illegal
  • This PoC is intended for:
    • Security researchers studying kernel vulnerabilities
    • System administrators testing their systems' resilience
    • Educational purposes in controlled environments
  • The authors are not responsible for any misuse of this code
  • Always ensure you have proper authorization before testing on any system

References

  • CVE-2015-1328
  • Ubuntu Security Advisory
  • Kernel.org Git Commit
  • Cloud Foundry Advisory
  • Exploit DB Author: rebel

License

This project is provided as-is for educational purposes. Use responsibly and in accordance with all applicable laws and regulations.

Download Tool

Related Tools

  • PEASS-ng

    PEASS - Privilege Escalation Awesome Scripts SUITE (with colors)

  • PrivescCheck

    Privilege Escalation Enumeration Script for Windows

  • LinEnum

    Scripted Local Linux Enumeration & Privilege Escalation Checks

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    Callisto

    jetp1ane/callisto

    Automated binary vulnerability analysis tool that decompiles executables via Ghidra, scans pseudo-C code with Semgrep, and validates findings using GPT-3.5-Turbo to reduce false positives.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    One-tap Android kernel exploit app for CVE-2026-43499, providing privilege escalation via kernel module loading, with offset extraction and on-device analysis tools.

    888
  • 3

    DFRoot

    a2333c/dfroot

    Android root tool for Samsung Galaxy S25 Ultra (SM-S938B) that chains DirtyFrag CVE-2026-43284 and CVE-2026-43499 to gain root automatically at boot via KernelSU.

    433
  • 4

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    385
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    365
  • 6

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    342

Explore all tools

Browse our collection of tools

View all tools →