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-2021-3156 — Proof-of-concept exploit for CVE-2021-3156, a heap-based buffer overflow in sudo that allows local privilege escalation to root via sudoedit -s. | Kitploit
Tools/GitHubGitHub/asepsaepdin/cve-2021-3156
Privilege EscalationVulnerability AnalysisExploitationLearning & EducationBinary Exploitation
GitHubasepsaepdin/cve-2021-3156

CVE-2021-3156

Proof-of-concept exploit for CVE-2021-3156, a heap-based buffer overflow in sudo that allows local privilege escalation to root via sudoedit -s.

View Repository
3 years 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-2021-3156 - Heap-Based Buffer Overflow in Sudo


⚠️ For educational and authorized security research purposes only

Original Exploit Authors

Very grateful to the original PoC author Qualys Research Team

Description

Sudo before 1.9.5p2 contains an off-by-one error that can result in a heap-based buffer overflow, which allows privilege escalation to root via "sudoedit -s" and a command-line argument that ends with a single backslash character.

Demo

sudo


Step Guides

  1. Install git, then clone the script from the github repository:

    root@kitploit:~
    sudo apt install git -y
    git clone https://github.com/asepsaepdin/CVE-2021-3156.git
    
  2. Compile the PoC using command:

    root@kitploit:~
    make
    
  3. Run the PoC using command:

    root@kitploit:~
    ./exploit
    

Credits

  • https://github.com/CptGibbon/CVE-2021-3156
  • https://nvd.nist.gov/vuln/detail/CVE-2021-3156
  • https://github.com/blasty/CVE-2021-3156
Download Tool