1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
#!/bin/sh
#
# tiger - A UN*X security checking system
# Copyright (C) 1993 Douglas Lee Schales, David K. Hess, David R. Safford
#
# Please see the file `COPYING' for the complete copyright notice.
#
# util/mksig - 04/22/93
#
#-----------------------------------------------------------------------------
#
basedir=${TIGERHOMEDIR:=.}
for parm
do
case $parm in
-B) basedir=$2; break;;
esac
done
[ ! -r $basedir/config ] && {
echo "--ERROR-- [init002e] No 'config' file in \`$basedir'."
exit 1
}
. $basedir/config
haveallof()
{
retval=0
what=$1
shift
for file
do
eval cmd=\$$file
[ ! -n "$cmd" ] && {
echo "--ERROR-- [init001e] Don't have all required $what (missing $file)"
retval=1
}
done
return $retval
}
haveallof commands CAT CC || exit 1
haveallof variables BASEDIR TESTLINK WORKDIR
[ ! $TESTEXEC $MD5 ] && {
echo "Don't see MD5... exiting..."
}
comment="$OS $REV"
DIRLIST="/usr/bin /bin /usr/local/bin /usr/sbin /etc /usr/lib /sbin /lib /usr/libexec /usr/local/sbin /usr/X11/bin /usr/games /usr/lib/emacs/20.2/i386-redhat-linux /usr/lib/news/bin /var/lib/games"
outfile="signatures.$OS-$REV-$ARCH"
echo "Working..."
{
echo "#"
echo "# Signature file for $OS $REV $ARCH, generated `date`"
echo "#"
while read file
do
indir=
for dir in $DIRLIST
do
[ ! $TESTLINK $dir ] && {
[ -f $dir/$file -a ! $TESTLINK $dir/$file -a $TESTEXEC $dir/$file ] && {
indir=$dir
if [ -r $indir/$file ]; then
sig=`$MD5 < $indir/$file`
echo "Y . $indir/${file} ${sig} $comment"
else
echo "# $indir/$file not readable."
fi
}
}
done
if [ ! -n "$indir" ]; then
echo "# $file not found."
fi
done <<EOL
XConsole
Xwrapper
at
atc
bash
battlestar
canfield
cardctl
chage
chfn
chsh
cribbage
crontab
ct
cu
dm
dos
dump
dumpreg
gpasswd
in.fingerd
in.ftpd
in.rexecd
in.rlogind
in.rshd
in.telnetd
in.tftpd
inc
inetd
inndstart
ksh
lockfile
login
lpc
lpd
lpq
lpr
lprm
man
minicom
mount
movemail
mutt
named
netreport
newgrp
ntpdate
nwsfind
nxterm
passwd
phantasia
ping
portmap
procmail
pwdb_chkpwd
rcp
rdist
restore
restorefont
restorepalette
restoretextmode
rlogin
robots
rpc.mountd
rpc.yppasswdd
rsh
rxvt
sail
screen
sendmail
seyon
snake
sperl5.00404
ssh
sshd
startinnfeed
su
suidperl
tcpd
tcsh
telnet
tetris-bsd
traceroute
trojka.scores
umount
userhelper
usernetctl
uucico
uucp
uuname
uustat
uux
uuxqt
vga_connectN
vga_klondike
vga_mines
vga_ohhell
vga_othello
vga_solitaire
vga_spider
wall
write
xbill
xhextris
xlock
xscreensaver
xterm
xtrojka.score
ypbind
ypserv
zgv
zsh
EOL
} > $outfile
$RM -f $WORKDIR/snefru
echo "Signatures stored in $outfile."
|