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-2023-0386-OverlayFS — Copy fake in-memory files to disk using overlayFS | Kitploit
Tools/GitHubGitHub/pwncone/cve-2023-0386-overlayfs
Privilege EscalationVulnerability AnalysisExploitationLearning & EducationBinary Exploitation
GitHubpwncone/cve-2023-0386-overlayfs

CVE-2023-0386-OverlayFS

Copy fake in-memory files to disk using overlayFS

View Repository
234 months agoNot yet reviewed
Share

CVE-2023-0386 - OverlayFS / FUSE

Original CVE source written by xkaneiki: https://github.com/xkaneiki/CVE-2023-0386/tree/main

Rewritten so the exploit can be run in 1 shell (original exploit requires 2 shells).

# Compile
make all
# Create mount point for fuse filesystem
mkdir -p /tmp/fusepwn/lower
# Start fuse (which serves a SUID binary)
./fuse /tmp/fusepwn/lower
# Run exploit (which copies fuse's fake SUID binary onto disk with real SUID privs via overlayfs)
./exp
# Run shell
/tmp/fusepwn/upper/bin

Cleanup

# unmount fuse filesystem
fusermount -u /tmp/fusepwn/lower
# remove all 
rm -rf /tmp/fusepwn
# unmount overlayfs (root only. not required)
umount /tmp/fusepwn/merge

Notes

  • Use findmnt to view mounted filesystems
  • The overlayfs mount is only visible by root (not sure why)

How it Works

fuse.c creates a fuse file system mounted at /tmp/fusepwn/lower and serves a fake SUID binary owned by root. This is an in-memory filesystem, so we can lie about the permissions set

exp.c then creates an overlayfs mount in /tmp/fusepwn and opens the fake SUID binary (/tmp/fusepwn/lower/bin). When opened, this triggers overlayfs to perform a copy-up which writes the fake SUID binary to disk with real SUID privileges and owned by root.

The vulnerability exists in overlayfs in that it blindly trusts whatever file permissions are being served to it by the lower filesystem. If the lower filesystem is the kernel, this is fine (because it can't be manipulated without root permissions). If the lower filesystem can be manipulated by the user, this isn't fine because we can lie about what files are there (like by using FUSE)

Patch

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4f11ada10d0ad3fd53e2bd67806351de63a4f9c3

The patch checks if the UID/GID of the file is valid within the user's namespace. If it's not, it fails the copy up.

i.e.

  • we're bob
  • we create a new namespace as root by mapping 1000 (bob's UID) to 0 (root) in proc/self/uid_map
  • we try to trigger a copy-up on a root-owned file
  • overylayfs checks bob's mapping and sees that the user's namespace is actually 1000 (bob) and not 0 (root) like the file is and fails the copy-up

Helpful Resources

  • Helpful blog: https://engineering.facile.it/blog/eng/write-filesystem-fuse/
  • Example FUSE implementation: https://man.openbsd.org/fuse_main.3

Diagram

diagram

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    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.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    371
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    336
  • 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.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    322

Explore all tools

Browse our collection of tools

View all tools →