Exploit databaseDownload repository ZIP
GH-73d1055f0aee52a9ff3f9e6e6ba0c4b3
nobodyatall648/cve-2021-3156
Sources for CVE-2021-3156
85 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files6
nobodyatall648/cve-2021-3156Revision 026504aac1bd
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2021-3156_checker.py
Python · 768 bytes#!/usr/bin/python3
from subprocess import Popen, PIPE
#command to test sudo command CVE-2021-3156 vulnerability
#sudoedit -s $(perl -e 'print "A"x65535 . "\\"')
shell_command = '''sudoedit -s $(perl -e 'print "A"x65535 . "\\\\"')'''
print("[*] Executing sudoedit -s command with overflow payloads.")
#checking CVE-2021-3156 vulnerability on sudoedit -s
proc = Popen(shell_command, shell=True, stdout=PIPE, stderr=PIPE)
out, err = proc.communicate()
if("Segmentation fault" in err.decode() or "malloc()" in err.decode()):
print("[!] The current sudo version was vulnerable to CVE-2021-3156.", end="\n\n")
print("[important] Please use CVE-2021-3156_patcher.sh to patch the vulnerability.")
else:
print("[*] The current sudo version are safe from CVE-2021-3156.")