I understand that we cannot do ptrace in suid binaries. However, I am wondering why we cannot do ptrace after the binary quotes prevail in uid instead of euid.
For example, in a binary binary, the suid-binary password goes after a few steps.
seteuid (euid);
ret_chdir = chdir (path);
seteuid (ruid);
system("whoami");
printf("Enter any char");
scanf("%c", &junk);
In my case, when "whoami" is printed, this is the process user name, but not the process owner. When the program expects spam input, I try to connect to the current process with uid as the username, but it failed, even though the binary refused this privilege. Is it possible that ptrace attach uses the saved-uid state to decide that I am not the owner?
source
share