Is there a way for one process (such as an executable or bash script) to elevate the privileges of another, running, process? e.g. If I have a program running as normal user user
, is it possible for another process, running as root
to elevate the privileges of the first as if it had been run as root originally?
I have seen exploits modify the credential struct of a process to perform this, but I'm not sure if there's a way to do this more legitimately.
Looking further into this, it appears that there is no way to do this without installing a kernel module; essentially a rootkit. The kind of thing I want is demonstrated here.
If you want to make a program always run with admin privileges, right-click on the program's executable file, select Properties. Here, select the Run this program as an administrator box. Click Apply > OK.
With the PROCESS privilege, a user has access to information about all threads, even those belonging to other users. Without the PROCESS privilege, nonanonymous users have access to information about their own threads but not threads for other users, and anonymous users have no access to thread information.
No, these properties of a process cannot be altered after it starts.
No. The only way to elevate a process’s privileges is by exec
ing a setuid binary (such as /usr/bin/sudo
); you can’t do it to an already running process.
You can, however, ask sudo to copy a file to a temporary path, launch your editor with your own privileges on the temporary path, and then copy the result back in place as root:
sudo -e filename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With