Run a binary owned by root without sudo

executablepermissions

I had a question on a job interview:

How can you execute (run) the program with the user user1 without sudo privileges and without access to the root account:

$ whoami
user1
$ ls -l ~/binary_program
-rw-r--r-- 1 root root 126160 Jan 17 18:57 /home/user1/binary_program

Best Answer

Since you have read permission:

$ cp ~/binary_program my_binary
$ chmod +x my_binary
$ ./my_binary

Of course this will not auto-magically grant you escalated privileges. You would still be executing that binary as a regular user.

Related Question