Could sudo be modified to give instant root access?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Could sudo be modified to give instant root access?
Been wondering this for a while, and seems pretty straightforward. Why hasn't someone modified the freely available sudo source, took out the part where it asks for the user's password, compile it, and use it on most any box to instantly gain root privileges? If this does work, I'd like to try it on Android to see how far I can get.
The sudo binary needs to be setuid root to evalate privileges of the user running the command. You can't install sudo on a system that you don't already have root access to because you won't be able to install the binary setuid root.
The sudo binary needs to be setuid root to evalate privileges of the user running the command. You can't install sudo on a system that you don't already have root access to because you won't be able to install the binary setuid root.
Ah, OK. So it's not as simple as deleting a few lines of code and (re)compiling?
Ah, OK. So it's not as simple as deleting a few lines of code and (re)compiling?
You are right, there is no way to modify a few lines of code and rebuild - to achieve it. sudo should be installed by root first, and also root can configure it to skip that step (so that feature is already implemented, but by default not in use).
It's already quite easy for most people to gain root access. Simply do sudo su and enter your own login password (if you have one), and ... there you are.
Mind you, it shouldn't be that easy ... it shouldn't be possible at all. But many Unix/Linux/OSX users are just as lazy as the next bloke.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.