Exploit databaseDownload repository ZIP
GH-11599b11e3ec2526a71bedead293fc63
kernelzeroday/cve-2021-3156-baron-samedit
Sources for CVE-2021-3156
85 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files31
kernelzeroday/cve-2021-3156-baron-sameditRevision 33ff21070921
- ↑..Parent directory
- regress/
- Makefile.in
- example_approval_plugin.py
- example_audit_plugin.py
- example_conversation.py
- example_debugging.py
- example_group_plugin.py
- example_io_plugin.py
- example_policy_plugin.py
- pyhelpers.c
- pyhelpers.h
- pyhelpers_cpychecker.h
- python_baseplugin.c
- python_convmessage.c
- python_importblocker.c
- python_loghandler.c
- python_plugin.exp
- python_plugin_approval.c
- python_plugin_approval_multi.inc
- python_plugin_audit.c
- python_plugin_audit_multi.inc
- python_plugin_common.c
- python_plugin_common.h
- python_plugin_group.c
- python_plugin_io.c
- python_plugin_io_multi.inc
- python_plugin_policy.c
- sudo_python_debug.c
- sudo_python_debug.h
- sudo_python_module.c
- sudo_python_module.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/sudo-1.9.5p1/plugins/python/example_approval_plugin.py
Python · 557 bytesimport sudo
from datetime import datetime
class BusinessHoursApprovalPlugin(sudo.Plugin):
def check(self, command_info: tuple, run_argv: tuple,
run_env: tuple) -> int:
error_msg = ""
now = datetime.now()
if now.weekday() >= 5:
error_msg = "That is not allowed on the weekend!"
if now.hour < 8 or now.hour > 17:
error_msg = "That is not allowed outside the business hours!"
if error_msg:
sudo.log_info(error_msg)
raise sudo.PluginReject(error_msg)