From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1020c6,8c9469280c4ae1c2 X-Google-Attributes: gid1020c6,public X-Google-Thread: 1164f8,8c9469280c4ae1c2 X-Google-Attributes: gid1164f8,public X-Google-Thread: 10b612,8c9469280c4ae1c2 X-Google-Attributes: gid10b612,public X-Google-ArrivalTime: 1992-04-29 05:33:49 PST Xref: sparky comp.sys.dec:2751 comp.unix.ultrix:4118 comp.unix.admin:3039 Newsgroups: comp.sys.dec,comp.unix.ultrix,comp.unix.admin Path: sparky!uunet!infonode!ingr!spm!nik!nik From: nik@nik.b23a.ingr.com (Nik Simpson) Subject: Re: Floppy Disk Security? (Re: Help: how to set the ownership ...) Message-ID: <1992Apr29.123349.26439@nik.b23a.ingr.com> Organization: Intergraph Systems Product Marketing References: <1992Apr23.123258.21085@ircam.fr> Date: Wed, 29 Apr 1992 12:33:49 GMT In article smckinty@sunicnc.France.Sun.COM (Steve McKinty - Sun ICNC) writes: >In article <1992Apr23.123258.21085@ircam.fr>, francis@ircam.fr (Joseph Francis) writes: > > > > > Yes, I'm utterly curious about suid programs, and "root" ownership. > > What is to prevent someone with an appropriate disk drive to twiddle a > > few bits on a floppy and create suid root shells and such, mount and > > execute them? Enquiring minds want to know. In the far-flung future I > > may have to administer a group of laptop workstations, and aside from > > simply "Just Say NO" to mounted floppy filesystems, I can't see an > >"Just say No" is the best option. It is possible on at least some Unixes >(maybe most, I don't know) to use a 'nosuid' option for mount, which prevents >any suid programs from doing the suid. The problem of a mountable floppy file system can be overcome I think , I wrote a "mount" command for a floppy that does the following :- 1) Traps all user generated signals 2) Gets the real uid of the person running it, if uid=0 then the mounter is root already so no point in worrying 3) Change owner and group of Floppy device file to "root" and set protection to 700, this prevents later attacks with file system debuggers etc. 4) Mount the floppy file system. 5) Change owner and group of mount point to root and set protection to 700 this stops access while the rest of the checks are carried out. 6) Scan the floppy for any setuid/setgid files and remove the setuid or setgid bit. 7) Scan the floppy for any device files, change ownership to root and set protection to 550. 8) Reset permissions on the mount point to be owned by the mount requestor with 700 permissions. The corresponding unmount command just resets the permissions on the mount point and device file to appopriate values after unmounting the floppy. Since floppy file systems are rarely larger than 2500 blocks max the overhead of this checking is small. I think this makes the floppy mount command safe, If anybody can think of ways around this I'd be interested. The source is for a System V based machine, I don't know how portable it is as I don't have anything else to try it on, I'll mail the source on request. -- |--------------------------------------------------| | Nik Simpson Mail : nik@ingr.com | | Intergraph Corp. System Product Marketing | |--------------------------------------------------|