Appendix A. SUID and SGID Files

The Set-User ID (SUID) and Set-Group ID (SGID) bits allow an application to be run as the user or group that owns the application. In most cases, the owner is root. The main reason for this is to give users the capability to modify files or have access to resources that require special privileges. The unfortunate aspect of this is that such applications can often be exploited to perform malicious operations or used to access private information. SUID and SGID files should not be treated lightly. Administrators should know which files on their system are SUID or SGID, especially those owned by root. The security implications of SUID and SGID files are covered in more detail in Chapter 4, “What Is This UNIX Thing?,”

Like many operating systems, Mac OS X has a number of installed SUID and SGID files. Many of these programs do not necessarily require such permissions; some are not even useful. This appendix provides a listing of all the installed SUID and SGID files. In addition, it provides suggestions for dealing with some of these files to improve the security of your system(s).

Table A.1 lists all the SUID and SGID files installed with Mac OS X and Mac OS X Server, and their ownership information. All listings in this appendix are based on Mac OS X and Mac OS X Server version 10.2.3, build 6G30.

Table A.1. Installed SUID and SGID Applications

FILE

OWNER

GROUP

SUID

SGID

/bin/df

root

operator

 

X

/bin/ps

root

wheel

X

 

/bin/rcp

root

wheel

X

 

/sbin/dmesg

root

kmem

 

X

/sbin/dump

root

tty

X

X

/sbin/mount_nfs

root

wheel

X

 

/sbin/mount_smbfs

root

wheel

X

 

/sbin/ping

root

wheel

X

 

/sbin/ping6

root

wheel

X

 

/sbin/rdump

root

tty

X

X

/sbin/restore

root

tty

X

X

/sbin/route

root

wheel

X

 

/sbin/rrestore

root

tty

X

X

/sbin/shutdown

root

operator

X

 

/sbin/umount

root

wheel

X

 

/usr/bin/at

root

wheel

X

 

/usr/bin/atq

root

wheel

X

 

/usr/bin/atrm

root

wheel

X

 

/usr/bin/batch

root

wheel

X

 

/usr/bin/chfn

root

wheel

X

 

/usr/bin/chpass

root

wheel

X

 

/usr/bin/chsh

root

wheel

X

 

/usr/bin/crontab

root

wheel

X

 

/usr/bin/fstat

root

kmem

 

X

/usr/bin/login

root

wheel

X

 

/usr/bin/lppasswd

daemon

admin

X

 

/usr/bin/nfsstat

root

kmem

 

X

/usr/bin/passwd

root

wheel

X

 

/usr/bin/quota

root

wheel

X

 

/usr/bin/rlogin

root

wheel

X

 

/usr/bin/rsh

root

wheel

X

 

/usr/bin/setregion

root

wheel

X

 

/usr/bin/smbutil

root

wheel

X

 

/usr/bin/su

root

wheel

X

 

/usr/bin/sudo

root

wheel

X

 

/usr/bin/top

root

wheel

X

 

/usr/bin/uptime

root

kmem

 

X

/usr/bin/w

root

kmem

 

X

/usr/bin/wall

root

tty

 

X

/usr/bin/write

root

tty

 

X

/usr/libexec/authopen

root

wheel

X

 

/usr/libexec/chkpasswd

root

wheel

X

 

/usr/libexec/load_hdi

root

wheel

X

 

/usr/libexec/load_webdav

root

wheel

X

 

/usr/libexec/ssh-keysign

root

wheel

X

 

/usr/sbin/DirectoryService

root

wheel

X

 

/usr/sbin/lsof

root

kmem

 

X

/usr/sbin/netstat

root

wheel

X

 

/usr/sbin/pppd

root

wheel

X

 

/usr/sbin/pstat

root

kmem

 

X

/usr/sbin/scselect

root

wheel

X

 

/usr/sbin/sendmail

root

smmsp

X

 

/usr/sbin/traceroute

root

wheel

X

 

/usr/sbin/traceroute6

root

wheel

X

 

/usr/sbin/trpt

root

kmem

 

X

/Applications/Utilities/
Disk Utility.appContents/MacOS/
Disk Utility

root

admin

X

 
/Applications/Utilities/NetInfo
Manager.app/Contents/MacOS/
NetInfo Manager

root

admin

X

 
/Applications/Utilities/ODBC
Administrator.app/Contents/
Resources/iodbcadmintool

root

admin

X

 
/System/Library/CoreServices/
AuthorizationTrampoline

root

wheel

X

 
/System/Library/CoreServices/
Classic Startup.app/Contents/
Resources/TruBlueEnvironment

root

wheel

X

 
/System/Library/CoreServices/
Finder.app/Contents/Resources/
OwnerGroupTool

root

wheel

X

 
/System/Library/Filesystems/
AppleShare/afpLoad

root

wheel

X

 
/System/Library/Filesystems/
AppleShare/check_afp.app/
Contents/MacOS/check_afp

root

daemon

X

 
/System/Library/Filesystems/
cd9660.fs/cd9660.util

root

wheel

X

 
/System/Library/Frameworks/
ApplicationServices.framework/
Versions/A/Frameworks/
PrintCore.framework/Versions/A/
Resources/PrinterSharingTool

root

wheel

X

 
/System/Library/Printers/
Libraries/aehelper

root

wheel

X

 
/System/Library/Printers/
IOMs/LPRIOM.plugin/Contents/
MacOS/LPRIOMHelper

root

wheel

X

 
/System/Library/Printers/
Libraries/csregprinter

root

wheel

X

 
/System/Library/PrivateFrameworks/
Admin.framework/Versions/A/
Resources/readconfig

root

wheel

X

 
/System/Library/PrivateFrameworks/
Admin.framework/Versions/A/
Resources/writeconfig

root

wheel

X

 
/System/Library/PrivateFrameworks/
DesktopServicesPriv.framework/
Versions/A/Resources/Locum

root

wheel

X

 
/System/Library/PrivateFrameworks/
NetworkConfig.framework/Versions/
A/Resources/NetCfgTool

root

wheel

X

 

In addition to the applications in Table A.1, Mac OS X Server has the following SUID and SGID applications shown in Table A.2.

Table A.2. Installed SUID and SGID Applications with Mac OS X Server

FILE

OWNER

GROUP

SUID

SGID

/usr/sbin/NeST

root

wheel

X

 

/usr/sbin/networksetup

root

wheel

X

 
/usr/sbin/
PrintServiceAccess

root

wheel

X

 

/usr/sbin/systemsetup

root

wheel

X

 
/Applications/Utilities/AppleShare
IP Migration.app/Contents/MacOS/
AppleShare IP Migration

root

admin

X

X

The information in the Table A.1 and Table A.2 will probably change with future releases or updates to Mac OS X. The following command can be used to locate all SUID and SGID files on a system. This command also can be useful to locate any such files that may have been added since the initial installation.

sudo find / -xdev ( -perm -02000 -or -perm -04000 ) -ls -type f

SUID Files

The applications shown in the list that follows are all SUID apps that we suggest be removed. The remote applications (rcp, rdump, rrestore, rlogin, rsh) are of no real use on modern UNIX systems. The “ch*” applications (chfn, chpass, chsh) allow users to change their shell, finger information, and other credentials. Some administrators may not want their users to have such capabilities. Also, these applications are useless in most cases because Mac OS X defaults to storing this information in NetInfo, not the /etc/passwd file on which these applications operate. The sliplogin application has a dirty past that has lead to unauthorized access exploits. Previous versions of Mac OS X shipped a sliplogin program that contained a buffer overflow.

If you do not feel comfortable removing these programs, at least change them so that they are not SUID.

  • /bin/rcp

  • /sbin/rdump

  • /sbin/rrestore

  • /usr/bin/rlogin

  • /usr/bin/rsh

  • /usr/bin/chfn

  • /usr/bin/chpass

  • /usr/bin/chsh

  • /usr/sbin/sliplogin

The applications in this next list should probably have their SUID bits removed. All these are applications that should really only be used by administrators.

  • /usr/bin/at

  • /usr/bin/atq

  • /usr/bin/atrm

  • /usr/bin/batch

  • /usr/bin/crontab

  • /usr/sbin/netstat

  • /usr/sbin/traceroute

  • /usr/sbin/scselect

  • /sbin/dump

  • /sbin/restore

  • /sbin/route

SGID Files

The applications in the list that follows should probably have their SGID bits removed. It was suggested previously that the remote applications (rdump, rrestore) be removed, or at least their SGID bits removed. The wall and write applications have a history of being exploited and are not necessary.

  • /usr/bin/wall

  • /usr/bin/write

  • /sbin/dump

  • /sbin/rdump

  • /sbin/restore

  • /sbin/rrestore

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.188.64