Re: No Root Shell with SUID /bin/bash
From: Joachim Blaabjerg (styx@SuxOS.org)Date: 04/24/02
- Previous message: Denis Ducamp: "Re: No Root Shell with SUID /bin/bash"
- In reply to: Peter Pan: "Re: No Root Shell with SUID /bin/bash"
- Next in thread: Peter Pan: "Re: No Root Shell with SUID /bin/bash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Joachim Blaabjerg <styx@SuxOS.org> To: Peter Pan <radiodrinker@yahoo.de> Date: Tue, 23 Apr 2002 22:02:46 +0000
On Saturday 20 April 2002 08:22, Peter Pan wrote:
> setuid(0);
> if(getuid()){
> printf("must be suid root.\n");
> } else {
>
<snip>
> system("/bin/sh");
<snip>
Hm... Wouldn't it be an idea to postpone that setuid(0) to _after_ you're
checked that the md5sums match (optionally change back to the old uid after
you've verified that you have permission to setuid(0))? I guess it doesn't
have any practical effect, but it's a matter of good programming practice. A
program doesn't need to have root privileges to get the password and verify
it. Image the scenario that there is a vulnerability in the hexToString
function. That piece of good programming practice would make all the
difference in the world... ;)
Regards,
-- Joachim Blaabjerg styx@SuxOS.org www.SuxOS.org
- Previous message: Denis Ducamp: "Re: No Root Shell with SUID /bin/bash"
- In reply to: Peter Pan: "Re: No Root Shell with SUID /bin/bash"
- Next in thread: Peter Pan: "Re: No Root Shell with SUID /bin/bash"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|