Skip to content
KitploitKITPLOIT
أدواتعمليات الاستغلالالمدونة
Log in
إرسال
أدواتعمليات الاستغلالالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

الخلاصاتاتصالالخصوصية© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
CVE-2021-3156 — Baron Samedit: sudoedit off-by-one heap overflow gives root. Fixed in 1.9.5p2. Differential: overflow on vuln, refused on fixed | Kitploit
أدوات/GitHubGitHub/googlesky/cve-2021-3156
Privilege EscalationContainer SecurityVulnerability AnalysisExploitationPapers & ResearchLabs & Practice
GitHubgooglesky/cve-2021-3156

CVE-2021-3156

Baron Samedit: sudoedit off-by-one heap overflow gives root. Fixed in 1.9.5p2. Differential: overflow on vuln, refused on fixed

عرض المستودع
26 نوفمبر 2026لم تتم المراجعة بعد
مشاركة
المحتوى غير متوفر باللغة المطلوبة. عرض النسخة الإنجليزية.

CVE-2021-3156 — Baron Samedit sudo heap overflow

License: MIT Research status: validated

CVECVE-2021-3156
Componentsudo — sudoedit command line parser
Affectedsudo before 1.9.5p2
Fixed in1.9.5p2
CWECWE-193 (Off-by-one Error)
ImpactAn off-by-one error when escaping command-line arguments could overflow a heap buffer in sudoedit, allowing a local user to gain root privileges.
Vectorsudoedit -s with an argument ending in a backslash
Triggertrailing single backslash argument

The vulnerable path:

# pre-fix (model from sudo Baron Samedit advisory)
attacker input accepted without the required protection

The derived guard:

# derived from observed behaviour, not copied from a vendor fix
reject arguments ending in a single backslash

1. Root cause

The escaping loop allocated one byte too few. The fix corrects the length calculation.

2. Reproduction environment

serviceimagerole
sd-vulncve-2021-3156:vulnvulnerable behaviour present
sd-guardcve-2021-3156:guardfixed behaviour
poccve-2021-3156-poc:localstdlib-only Python driver

Both sides are Python 3.12 images. The vulnerable behaviour is modelled from sudo Baron Samedit advisory; the guard is derived from the lab observation that the impact is reproduced. The fixed build applies the published upstream change.

3. Running the environment

./run-lab.sh build
./run-lab.sh up
./run-lab.sh sweep
./run-lab.sh down

The lab uses the isolated cve3156lab network and bounded containers.

4. The PoC

poc/poc.py takes a mode and an optional --host=...:

moderesult
checkexit 1 when the buffer is overflowed, 0 when the argument is refused
exploitruns the full chain and reports the observed impact
probeprints the overflow flag
mitigationexplains the derived guard

A standalone exploit ships at exploit/exploit.py:

python3 exploit/exploit.py --host=sd-vuln

It exits 1 on a confirmed finding and 0 on a guarded target.

5. Expected results

sd-vuln (pre-fix)sd-guard (derived)
crafted requestroot escalationrefused
ordinary requestworksworks

Captured runs are in evidence/check-*-run.txt, evidence/exploit-*-run.txt, evidence/probe-*-run.txt, evidence/mitigation-*-run.txt, evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt, evidence/versions.txt and evidence/0day-sweep.txt.

6. Environment preconditions

Podman or Docker with the cve3156lab network. No production system is involved. Real-world exploitation needs an affected installation.

7. Additional findings (0-day sweep on the guarded build)

Ordinary requests still succeed on the fixed build.

8. Repository layout

README.md             this write-up
run-lab.sh            environment driver (build / up / sweep / down)
Makefile              convenience targets
poc/poc.py            the PoC (check / exploit / probe / mitigation)
exploit/exploit.py    standalone exploit
lab/harness-*.py      vulnerable behaviour / derived guard
lab/lab.Dockerfile    builds both sides
lab/service.py        HTTP wrapper (POST /check)
evidence/             captured runs on both sides
TRACKING.md           working record, excluded from the repo

9. References

  • CVE record — https://www.cve.org/CVERecord?id=CVE-2021-3156
  • Upstream advisory sudo Baron Samedit advisory — https://nvd.nist.gov/vuln/detail/CVE-2021-3156
تنزيل الأداة

أدوات ذات صلة

  • PEASS-ng

    PEASS - مجموعة رائعة من نصوص تصعيد الصلاحيات (مع الألوان)

  • PrivescCheck

    نص برمجي لتصعيد الامتيازات واستكشاف النظام لنظام ويندوز

  • LinEnum

    فحوصات نصية للتعداد المحلي ورفع الصلاحيات لنظام Linux

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    # تطبيق GhostLock للتنفيذ بنقرة واحدة (CVE-2026-43499)

    745
  • 2

    IMSIcatcher

    28zaaky/imsicatcher

    منصة IMSI Catcher تنشر خلية GSM مارقة لاعتراض الرسائل النصية القصيرة وحقن الرسائل وتتبع الأجهزة المحمولة

    732
  • 3

    Callisto

    jetp1ane/callisto

    أداة تحليل ثغرات ثنائية آلية تقوم بفك ترجمة الملفات التنفيذية عبر Ghidra، ومسح كود شبه-C باستخدام Semgrep، والتحقق من النتائج باستخدام GPT-3.5-Turbo لتقليل الإيجابيات الكاذبة.

    610
  • 4

    opencti

    opencti-platform/opencti

    منصة مفتوحة لاستخبارات التهديدات السيبرانية

    546
  • 5

    ARTEX

    baarai/artex

    منصة اختبار اختراق مستقلة متعددة الوكلاء تعتمد على LLM، مع وكلاء تخطيط وتنفيذ، ومخططات للأصول والاستكشاف، وتسجيل حركة مرور MITM، وإعادة اختبار الثغرات.

    414
  • 6

    DFRoot

    a2333c/dfroot

    أداة root لنظام Android لهاتف Samsung Galaxy S25 Ultra (SM-S938B) تقوم بتسلسل DirtyFrag CVE-2026-43284 وCVE-2026-43499 للحصول على صلاحيات root تلقائيًا عند الإقلاع عبر KernelSU.

    413

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →