I'm a bit new to this, so I'm not sure where to look.
I have access to a server that as a command that executes a limited version of systemctl, and I want to expand it.
The command acts as follows: It allows specific users without sudo rights to execute systemctl. It only allows the user to run systemctl on 3 specific services.
I took a peek at how this was originally accomplished, and the creator of this command made an executable file (ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, for GNU/Linux 3.2.0, stripped) that has is owned by root and has the setuid bit as true. I tried de-compiling the executable and it seems to just check if the user is a specific user and run systemctl as root.
I have two issues:
- I'm not sure how to turn this back into valid source code.
- I'm concerned about security risks with using the setuid bit.