Group 42 Sells Out!

Root For A Day is Root For Ever

by FNF of Group 42


This trick only applies to UNIX type systems. Basically the idea here is that if you can get root privileges just once then you can write a little program that will allow you to become super user without ever needing to know the root passowrd. Even if the password changes it will have no effect on you.

All you need to do is compile a a two line program like this:

main()
{
        setuid(0);
        system("sh");
}
Have this compiled and wait for a chance to have super user access. It is amazing how many people will log on as root and then wander away from their terminal. When you get your chance to be a super user execute the following commands:

chown root your-program-name
chmod +s your-program-name
From now on anytime you execute your program you will have a super user shell.

Another take on this is to write a program that will check for if the user running it has a super user shell and to do the chown and chmod for you. You could try to get your program into a directory that is in the system search path and name it somthing like la or some other name that is a commonly used mistake command. Next time someone logged in with root privilages types la instead of ls (a common mistake), your program will run and you will have root privs next time you login.


HOME | GROUP 42 | DISCLAIMER | HELP
Copyright © 1984-1996, Group 42