you could try my script out and edit it as necessary basically its a combination of things using iwconfig and wlanconfig check it and edited it where necessary like the filepath: /mnt/sdb1 is used because my bt4 is liveboot on my eeepc through usb
even if you dont use that it. if you go over whats happening in it you can figure it out pretty simplyCode:#!/bin/bash echo "Lifi v.01 Apr 4,2009 -Rifken Technologies" echo "This version supports OPEN WEP WPA and WPA2-PSK Encrypted AccessPoints." echo -n "Press Any Key To Continue..." read continue echo "---------------------" echo "Bringing down the NIC" echo "---------------------" ifconfig ath0 down ifconfig wifi0 down echo "---------------" echo "Interfaces down" echo "---------------" echo "-" echo -n "Would you like to perform a random MAC spoof for your NIC? y/n: " read SPOOF if [ $SPOOF == "y" ] then echo "Spoofing Mac Address for ath0:" sleep 2 echo "------------------------------" macchanger -r ath0 echo "------------------------------" sleep 3 echo "-" echo "Spoofing Mac address for wifi0:" echo "-------------------------------" macchanger -r wifi0 echo "-------------------------------" sleep 2 echo "-" echo "Mac Addresses have been spoofed" fi sleep 1 ifconfig ath0 up ifconfig wifi0 up wlanconfig ath0 destroy ifconfig wifi0 down sleep 1 wlanconfig ath0 create wlandev wifi0 wlanmode managed & sleep 1 ifconfig ath0 up sleep 1 ifconfig wifi0 up echo "-" echo "NIC has been brought up!" echo "-" echo "Scanning For Access Points" echo "--------------------------------------------------" sleep 4 wlanconfig ath0 list ap sleep 6 echo "--------------------------------------------------" echo -n "Choose ESSID: " read ESSID sleep 2 echo "-" echo -n "Choose BSSID or type n: " read BSSID sleep 2 echo "AP's Encryption: 'OPN' 'WEP' 'WPA'" echo -n "> " read ENC if [ $ENC == "OPN" ] then if [ $BSSID != "n" ] then echo "------------------------------------------------------------" echo "Connecting to: OPEN AP '$ESSID' with MAC '$BSSID'" echo "------------------------------------------------------------" sleep 3 iwconfig ath0 essid '$ESSID' ap $BSSID else echo "------------------------------------------" echo "Connecting to: OPEN AP '$ESSID'" echo "------------------------------------------" sleep 3 iwconfig ath0 essid '$ESSID' fi fi if [ $ENC == "WEP" ] then echo -n "WEP KEY: " read WEPKEY if [ $BSSID != "n" ] then echo "---------------------------------------------------------------" echo "Connecting to: WEP Encrypted AP '$ESSID' with MAC '$BSSID'" echo "---------------------------------------------------------------" sleep 3 iwconfig ath0 essid '$ESSID' ap $BSSID key $WEPKEY else echo "----------------------------------------" echo "Connectiong to: WEP Encrypted AP '$ESSID'" echo "----------------------------------------" iwconfig ath0 essid '$ESSID' key $WEPKEY fi fi if [ $ENC == "WPA" ] then echo -n "WPA PASSPHRASE: " read WPAPASS if [ $BSSID != "n" ] then echo "-" echo "Creating temp wpa_supplicant.conf with AP's Info" L1="network={" L2='ssid="' L3="$ESSID" L4='"' L5="bssid=$BSSID" L6='psk="' L7="$WPAPASS" L8='"' L9="}" rm -rf wpa_supplicant.conf touch wpa_supplicant.conf echo -e $L1 >> wpa_supplicant.conf echo -e $L2$L3$L4 >> wpa_supplicant.conf echo -e $L5 >> wpa_supplicant.conf echo -e $L6$L7$L8 >> wpa_supplicant.conf echo -e $L9 >> wpa_supplicant.conf sleep 4 echo "-" echo "File Created" echo "-" echo "-----------------------------------------------------------" echo "Connecting to WPA Encrypted AP '$ESSID' with MAC '$BSSID'" echo "-----------------------------------------------------------" wpa_supplicant -i ath0 -c /mnt/sdb1/wpa_supplicant.conf -B else echo "-" echo "Creating temp wpa_supplicant.conf with AP's Info" L1="network={" L2='ssid="' L3="$ESSID" L4='"' L5='psk="' L6="$WPAPASS" L7='"' L8="}" rm -rf wpa_supplicant.conf touch wpa_supplicant.conf echo -e $L1 >> wpa_supplicant.conf echo -e $L2$L3$L4 >> wpa_supplicant.conf echo -e $L5$L6$L7 >> wpa_supplicant.conf echo -e $L8 >> wpa_supplicant.conf sleep 4 echo "-" echo "File Created" echo "-" echo "-----------------------------------------------------------" echo "Connecting to WPA Encrypted AP '$ESSID'" echo "-----------------------------------------------------------" wpa_supplicant -i ath0 -c /mnt/sdb1/wpa_supplicant.conf -B fi fi dhclient ath0 echo "Successfully Connected To $ESSID" exit![]()


