Monday, April 3, 2023

setuid as someone (ssh as someone)




/* This binary is intended to be a setuid script wrapper for dbRsync.pl.
   
Usage:-
   >gcc setuid_swap.c -o newfilename
   >chmod 4755 newfilename

*/

int main(int ac, char **av) {
    int uid;
    uid = geteuid();
    setreuid(uid, uid);
    execv( "/usr/bin/ssh", av );
}

No comments:

Post a Comment

How To Bypass Kerberos(kinit) Authentication

Whenever you try to setuid and impersonate as someone else to run something, it is very likely that you will run into kerberos/kinit issues....