# 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.


# ----------- External software --------------
    MDK3="mdk3" # Path for mdk3, fix this: should be neccesary, as mdk3 is a plugin now.
	DHCPSOFT="dhclient" #Your dhcp client utility, set to dhcpcd on bt4 or other dhcpcd systems.
	TERMINAL="xterm"

# ----------- AIRCRACK_NG CONFIG
#This is the rate per second at wich packets will be injected
	INJECTRATE="1000"

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

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

#Fudge factor setting
	FUDGEFACTOR="2"

# ----------- AUTOPWN ------------------
# This is for the autopwn functions.
    attack_functions=(wep_attacks_fakeauto wep_attacks_fakeinteractive wep_attacks_chopchop wep_attacks_caffelate wep_attacks_hirte wep_attacks_arpreplay_auto wep_attacks_arpreplay_interactive wep_attacks_fragmentation wep_attacks_chopchopclient wep_attacks_pskarp)
    set -a autopwn_sleep
    autopwn_min_ivs=50000
    autopwn_sleep=("8000" "6000" "6000" "6000" "6000" "6000")
    autopwn_tries=("3" "3" "3" "3" "3" "3")
    time_to_scan=12


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

#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 (IF, it's been a while already since I sent it)
    # 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

#Paths
    # Set this up for special airoscript-ng and aircrack-ng installations.
	prefix="/usr/local" # Airoscript and other tools path
    path="$prefix/share/airoscript-ng/"
    b_prefix="/usr/local" # Aircrack-ng path 
	bindir="$b_prefix/bin/" # add bin to paths
	sbindir="$b_prefix/sbin/" # Same     
	TERMBIN="/usr/bin/" # If your terminal is in /usr/X11... foo, then this is for you.
    [[ -e /etc/airoscript-ng_packaged.conf ]] && source /etc/airoscript-ng_packaged.conf # On debian-packaged installs, do this.

# -------------------------- External configuration files ------------------
    # Fix to be able to use screenrc defined screenrc's
	[[ "$SCREENRC" == "" ]] && SCREENRC="/etc/screenrc.airoscript"
    # John the ripper config defaults
    [[ "$jtr_conf" == "" ]] && jtr_conf="~/.john/john.conf"

# ---------------- Internal configurations -----------------
	export TEXTDOMAINDIR=$prefix/share/locale
	export TEXTDOMAIN=airoscript
# Debug:
    clear="clear" # Command to clear screen, comment to never clear screen.
	hold=0 # Dont close terminal windows
    debug=0 # Show extra info

# Dont delete this
    CURRENT=1
    cd $DUMP_PATH
	mkdir ~/.airoscript 2> /dev/null # Create airoscript main dir

# Resolution stuff
    available_resos=( 640x480 800x480 800x600 1024x600 1024x768 1280x768 1280x800 1280x1024 1440x900 1600x1200 )

function set_resolution_data(){
while true; do
    case $1 in
		1  ) TLX="83";TLY="11";TRX="60";TRY="18";BLX="75";BLY="18";
               BRX="27";BRY="17";bLX="100";bLY="30";bRX="54";bRY="25"; setterminal; break;;
		2 ) TLX="90";TLY="11";TRX="60";TRY="18";BLX="78";BLY="26";
               BRX="52";BRY="15";bLX="130";bLY="30";bRX="78";bRY="25"; setterminal; break;;
		3 ) TLX="92";TLY="11";TRX="68";TRY="25";BLX="78";BLY="26";
               BRX="52";BRY="15";bLX="92" ;bLY="39";bRX="78";bRY="24"; setterminal; break;;
		4 ) TLX="92";TLY="14";TRX="68";TRY="25";BLX="92";BLY="36";
               BRX="74";BRY="20";bLX="100";bLY="52";bRX="54";bRY="25"; setterminal; break;;
		5 ) TLX="92";TLY="14";TRX="68";TRY="25";BLX="92";BLY="36";
               BRX="74";BRY="20";bLX="100";bLY="52";bRX="54";bRY="25"; setterminal; break;;
    	6 ) TLX="100";TLY="20";TRX="109";TRY="20";BLX="100";BLY="30";
               BRX="109";BRY="20";bLX="100";bLY="52";bRX="109";bRY="30"; setterminal; break;;
		7 ) TLX="100";TLY="20";TRX="109";TRY="20";BLX="100";BLY="30";
               BRX="109";BRY="20";bLX="100";bLY="52";bRX="109";bRY="30"; setterminal; break;;
		8 ) TLX="110";TLY="35";TRX="99";TRY="40";BLX="110";BLY="35";
               BRX="99";BRY="30";bLX="110";bLY="72";bRX="99";bRY="40"; setterminal; break;;
		9 ) TLX="110";TLY="35";TRX="99";TRY="40";BLX="110";BLY="35";
               BRX="99";BRY="30";bLX="110";bLY="72";bRX="99";bRY="40"; setterminal; break;;
		10) TLX="130";TLY="40";TRX="68";TRY="25";BLX="130";BLY="40";
               BRX="132";BRY="35";bLX="130";bLY="85";bRX="132";bRY="48"; setterminal; break;;
		* ) _ "Unknown response. Try again"; sleep 1; reson=1; $clear ;;
		esac
done
    }
