#!/bin/bash
#   
#  This is the Solaris Tool, version 0.54 for SunOS 5.4 systems.
#  Scripted by so1o@insecurity.org to save me alot of time ftp'ing exloits
#  around, as well as saving time patching and looking for vunerable programs.
#
#  Thanks to Ultima, TrN, xFli, Darkcyde, special-k, mstrhelix, etc. etc.
#
#  Send suggestions, modifications or flames to so1o@insecurity.org
#
#  Usage : soltool [-scan] [-root] [-fix]
#

if [ $1x = x ]; then
	. header.54
	header
	. usage.mod
        usage
	exit 1
fi

if [ "$1" = '-scan' ]; then
        . header.54
	header
	. scanner.54
        scanner
	exit 0
fi

if [ "$1" = '-root' ]; then
        . header.54
	header
                if [ -s /tmp/suidprogs ]; then
                echo ""
                for i in `/bin/cat /tmp/suidprogs`
                        do
                        . rootit.54
			rootit $i
                        done
                else
                        echo " "
                        echo " oOo No log files detected, please run with -scan flag first."
                        echo " "
                fi
 	exit 0
fi

if [ "$1" = '-fix' ]; then
	. header.54
        header
	if whoami | grep root 1> /dev/null 2> /dev/null
	then
                if [ -s /tmp/suidprogs ]; then
                echo " "
                for i in `/bin/cat /tmp/suidprogs`
  			do
                        . chmod.mod
			chmod $i
			done
		exit 0
		else
                        echo " "
                        echo " oOo Please run with the -scan flag first."
                        echo " "
		fi
	else 
                echo " "
                echo " oOo You must be root to use the -fix flag."
                echo " "
		exit 1
	fi
fi
