int main(int ac, char **av) { int uid; uid = geteuid(); setreuid(uid, uid); char **arguments = av + 1; system(*arguments); return 0; }2. As userA, compile it, ie
gcc a.c -o aaa3. As userA, set the sticky bit, ie
chmod 4755 aaa4. now you can run any command as UserA, like this:
>aaa 'whoami' userA >aaa 'touch file1' >ls -al file1 -rw-r----- 1 userA group
No comments:
Post a Comment