#!/bin/bash # # Copyright (C) 2005-2006 nickelplated.net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # GNU/GPL license can be found here: http://www.gnu.org/licenses/gpl.txt # # permcheck.sh # Script to find and remove suid/sgid flags from all but necessary binaries like # passwd and su and to find questionably unsafe file permissions and attributes # on your filesystem and fix them. There are 4 modes of operation, --checksuid, # --removesuid, --checkperm, and --removeperm. Use --checksuid to find any files # with suid or sgid flags. Next use --removesuid and enter any files to exclude. # Use --checkperm to find any unsafe file and directory permissions. Next use # --removeperm and enter any files to exclude. Viola! All of the questionably # unsafe file and directory permissions have been removed. # # version: 0.2 (051606002) # - added support for solaris # - updated flags # - updated find directives # - still not completed (existing functions tested and working) # version: 0.1 # - initial release usage() { echo "usage: $1