#!/bin/bash
# Copyright (C) 2009 David Francos Cuartero
#        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 2
#        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, write to the Free Software
#        Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

# Showing options:
	TERMINAL="xterm" # This is the most used term, and the most tested. if you comment this line default x-terminal-emulator will be used
    SHOW_airoscript_WARNING=1 # Disable this if you don't want the warning about usage to appear.

# This makes airoscript more interactive, if you want it to ask you less, comment next line
	INTERACTIVE=1

# This allows you to use unstable functions.
	UNSTABLE=0

# This is for the autopwn functions.
    attack_functions="fakeautoattack fragnoclient chopchopattack cafelatteattack hirteattack attackclient fragmentationattack pskarp   "
    autopwn_sleep="120" 
    autopwn_min_sleep="20"

# Set this to one to override mac checking
	FORCE_MAC_ADDRESS=0

# And this, external functions
	EXTERNAL=1 

# Theme file
	THEME="default"

#Your dhcp client utility
	DHCPSOFT="dhclient"

# Debug:
	# Uncomment next line to make airoscript not launch terminals, just print the command to be executed.
	#	CDCMD="echo "
	# And change this to "", if you wanna have time to read commands ;-)
	CLEAR="clear"
    clear=$CLEAR
	#Allows all terminal windows to stay on screen after the operation they contain is finished
	DEBUG="0"

#This is the interface you want to use to perform the attack
#If you dont set this, airoscript will ask you.
	WIFI="" 
	IWIFI="" # If you set wifi (and only then) you can specify Injection Wifi Card here. So if you have to use different interfaces for injection and reading, use this.
#Paths
	# Note this can affect some configurations and some systems.
	# For example, in systems where you have compiled aircrack-ng 
	# or in slax it'll be /usr/bin or BINDIR and SBINDIR
	# And, on some systems, mdk3 will be installed on /usr/bin/
	PREFIX="/usr"
    AIRPREFIX="/usr" # This way we don't need to have airoscript in the same path as aircrack...

	BINDIR="$AIRPREFIX/bin/"
	SBINDIR="$AIRPREFIX/bin/"                     

    # Binary files.
	AIRMON=$SBINDIR"airmon-ng"		
	AIRODUMP=$SBINDIR"airodump-ng"
	AIREPLAY=$SBINDIR"aireplay-ng"	
	AIRCRACK=$BINDIR"aircrack-ng"
	ARPFORGE=$BINDIR"packetforge-ng"
	WESSIDE=$SBINDIR"wesside-ng"
	AIRSERV=$SBINDIR"airserv-ng"
	TKIPTUN=$SBINDIR"tkiptun-ng"
    IVSTOOLS=$SBINDIR"ivstools"
	MACCHANGER=$BINDIR"macchanger"
	iwconfig="iwconfig"

	# Fix to be able to use screenrc defined screenrc's
	[[ "$SCREENRC" == "" ]] && SCREENRC="$PREFIX/share/airoscript/screenrc"

    # FUNCTION FILES
	FUNCTIONS="$PREFIX/share/airoscript-ng/functions.sh"
	IFUNCTIONS="$PREFIX/share/airoscript-ng/functions_internal.sh"
	SCREEN_FUNCTIONS="$PREFIX/share/airoscript-ng/functions_screen.sh"
	UNSTABLEF="$PREFIX/share/airoscript-ng/functions_unstable.sh"
	EXTF="$PREFIX/share/airoscript-ng/functions_external.sh"

	THEMEDIR="$PREFIX/share/airoscript-ng/themes"
    
 # Change this if your terminal is not in /usr/bin, for example, on /usr/X11R6/bin or /usr/bin ... 
	TERMBIN="/usr/bin/"

# Path to optional binaries
	MDK3="/usr/bin/mdk3"
	JTD="jazzteldecrypter"
	WLD="wlandecrypter"

# Set variables for airoscript's locale
	export TEXTDOMAINDIR=$PREFIX/sharee
	export TEXTDOMAIN=airoscript

#################### This is rarely modified.##########################33
#This is the rate per second at wich packets will be injected
	INJECTRATE="330"

#How many times the deauth attack is run
	DEAUTHTIME="4"

#Time between re-association with target AP
	AUTHDELAY="80"
	KEEPALIVE="30"

#Fudge factor setting
	FUDGEFACTOR="2"

########## From here, people usually don't modddify anything...###############

#The path where the data is stored
    TMPDIR="/tmp"
	DUMP_PATH=`mktemp -d`

# Create airoscript main dir
	mkdir ~/.airoscript 2> /dev/null

# Path to your wordlist file (for WPA and WEP dictionnary attack)
	if [ -e ~/.airoscript/worlist.txt ]; then WORDLIST=~/.airoscript/wordlist.txt
	else WORDLIST="$DUMP_PATH/wordlist.txt"; fi 

#The Mac address used to associate with AP during fakeauth			
	FAKE_MAC="00:06:25:02:FF:D8"
    # FIXME THIS WILL WORK WHEN MACCHANGER ACCEPTS MY PATCH
    # FAKE_MAC=`macchanger --show --random wlan0|tail -n1|cut -d: -f2,3,4,5,6,7|cut -d\( -f1`
	Host_IP="255.255.255.255"
	Client_IP="255.255.255.255"

# Fragmentation IP
	FRAG_HOST_IP="255.255.255.255"
	FRAG_CLIENT_IP="255.255.255.255"

# Default packet size values for tkiptun-ng attack
	TKIPTUN_MAX_PL=100
	TKIPTUN_MIN_PL=80
