Re: y won't this work: chmod u+s /bin/sh
From: Nico Kadel-Garcia (nkadel_at_verizon.net)
Date: 06/06/03
- Next message: Massimo Ciscato: "Re: Remove Firewall"
- Previous message: Nico Kadel-Garcia: "Re: Removing hacker's file"
- In reply to: Kasper Dupont: "Re: y won't this work: chmod u+s /bin/sh"
- Next in thread: Paul Kimoto: "Re: y won't this work: chmod u+s /bin/sh"
- Reply: Paul Kimoto: "Re: y won't this work: chmod u+s /bin/sh"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 06 Jun 2003 12:39:12 GMT
Kasper Dupont wrote:
> Vilmos Soti wrote:
>>The kernel ignores the suid bit for shell scripts due to
>>race condition. When you execute a program, the system
>>checks if it is an executable. If the first two bytes
>>are "#!", then it is supposed to be a script which should
>>be executed with the program which's name immediately
>>follows the "#!" bytes. That program is called, and the name
>>of the script is passed to it as an argument. And here is
>>a gap between the first read, and when the program (shell,
>>perl, etc.) opens the file. If the file is replaced during
>>that time, then it can cause problems. Therefore, the
>>suid bit is ignored for scripts.
>
>
> On my system /bin/sh is *not* a script.
Scripts that need to be executed as root should either be sudo'd, which
is not very safe because scripts can often be replaced if not locked
down with root ownership, or written with perl and run with suidperl
(which does decent checking of the script itself).
- Next message: Massimo Ciscato: "Re: Remove Firewall"
- Previous message: Nico Kadel-Garcia: "Re: Removing hacker's file"
- In reply to: Kasper Dupont: "Re: y won't this work: chmod u+s /bin/sh"
- Next in thread: Paul Kimoto: "Re: y won't this work: chmod u+s /bin/sh"
- Reply: Paul Kimoto: "Re: y won't this work: chmod u+s /bin/sh"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|