First of all I dont clearly understand the problem and second of all that cant be the whole script. Is it?
The code links under laps some of the air suite statements.while [[ $Decision2 != 16 ]]
do
clear
echo -e "WPA options: Custom Options:"
echo -e " 1. Deauthentication 13. Aircrack"
echo -e "WEP options: 14. Tcpdump"
echo -e " 2. Fake authentication 15. packet-forge"
echo -e " 3. Interactive Packet Replay"
echo -e " 4. ARP Request Replay"
echo -e " 5. Korek Chopchop"
echo -e " 6. Fragmentation"
echo -e " 7. Caffe-latte"
echo -e " 8. Client-Oriented Fragmentation"
echo
echo
echo -e "Controling parameters"
echo -e " 9. Change AP MAC"
echo -e " 10. Change Client MAC"
echo -e " 11. Change injecting device"
echo -e " 12. Open separate bash prompt"
echo
echo -e " 16. Exit, Close"
echo
echo -n "Enter command: "
read Decision2
if [[ $Decision2 == 1 ]]; then
xterm -T 'Deauthencation-WPA' -e 'aireplay-ng -0 10 -a $apMAC -c $clientMAC $aireDevice ; bash' &
elif [[ $Decision2 == 2 ]]; then
xterm -T 'Fake Authencation-WEP' -e 'aireplay-ng -1 1 -a $apMAC -h $clientMAC $aireDevice ; bash' &
elif [[ $Decision2 == 3 ]]; then
xterm -T 'Interactive-Packet-Replay' -e 'aireplay-ng -2 -b $apMAC -h $clientMAC -d FF:FF:FF:FF:FF:FF -t 1 $aireDevice ; bash' &
elif [[ $Decision2 == 4 ]]; then
xterm -T 'ARP-Request-Replay' -e 'aireplay-ng -3 -b $apMAC -h $clientMAC $aireDevice ; bash' &
elif [[ $Decision2 == 5 ]]; then
xterm -T 'Korek/chopchop-WEP' -e 'aireplay-ng -4 -a $apMAC -h $clientMAC $aireDevice ; bash' &
elif [[ $Decision2 == 6 ]]; then
xterm -T 'Fragmentation-WEP' -e 'aireplay-ng -5 -b $apMAC -s $clientMAC -d FF:FF:FF:FF:FF:FF $aireDevice ; bash' &
elif [[ $Decision2 == 7 ]]; then
xterm -T 'Caffe-Latte-WEP' -e 'aireplay-ng -6 -b $apMAC -h $clientMAC $airDevice ; bash' &
elif [[ $Decision2 == 8 ]]; then
xterm -T 'Client-Oriented-Frag-WEP' -e 'aireplay-ng -7 -b $apMAC -h $clientMAC $airDevice ; bash' &
elif [[ $Decision2 == 9 ]]; then
echo -n "Enter the new AP MAC: "
read apMAC
elif [[ $Decision2 == 10 ]]; then
echo -n "Enter the new Client MAC: "
read clientMAC
elif [[ $Decision2 == 11 ]]; then
echo -n "Enter the new device to inject: "
read aireDevice
elif [[ $Decision2 == 12 ]]; then
xterm -T "New Bash" -e 'bash' &
elif [[ $Decision2 == 13 ]]; then
xterm -T 'Aircrack' -e 'aircrack-ng $fileLocation-01.cap ; bash' &
elif [[ $Decision2 == 14 ]]; then
xterm -T 'Tcpdump' -e 'tcpdump -n -e -s0 -vvv -i $aireDevice | grep -i DeAuth ; bash' &
elif [[ $Decision2 == 15 ]]; then
echo -n "What is the .xor file called: "
read xorlocation
xterm -T 'Packet-forge' -e ' packetforge-ng -0 -a $apMAC -h $clientMAC -k 255.255.255.255 -l 255.255.255.255 -y $xorLocation -w arp-request ; bash' &
elif [[ $Decision2 == 16 ]]; then
exit 1
else
exit 1
fi
done
I do no what is wrong, I added Bash as a second command to see the error. It shows up saying Invalid AP MAC, but when I put it again, directly from airodump, it still says it is wrong. Is the problem with the if...else statements or the xterm statements. Lastly, I know many if...else statements looks cluttered but I could not get switch or case statements working. Any help would be greatly appreciated.
Thanks,
red
First of all I dont clearly understand the problem and second of all that cant be the whole script. Is it?
No only the part not working. I will include the whole script. The problem is that when I set the variables, apMAC, clientMAC, and aireDevice, aireplay-ng does not accept it. When it is ran, it says, "Invalid AP MAC address". But, it is clearly right because I can pop up another terminal, input the same information, and it works. I want to know what is wrong with the syntax now that is causing the problem.
redCode:#!/bin/bash if [[ "$USER" != "root" ]] then echo "Sorry! You Have to be root to use this script" echo exit 1 fi echo -e "Active devices currently" xterm -e 'iwconfig ; bash' & echo echo -n "Enter device to be used: " read Device1 echo - n "*************Setting up Monitoring Mode****************" xterm -e ifconfig $Device1 down xterm -e macchanger -A $Device1 xterm -e ifconfig $Device1 up xterm -e airmon-ng stop $Device1 xterm -e airmon-ng start $Device1 echo -n "Any more[y/n]? " read Decision if [[ $Decision == 'y' ]]; then echo -n "Enter device: " read Device2 xterm -e ifconfig $Device2 down xterm -e macchanger -A $Device2 xterm -e ifconfig $Device2 up xterm -e airmon-ng stop $Device2 xterm -e airmon-ng start $Device2 else echo -e "Monitor mode up and running" fi echo -e "************Starting airodump-ng**************" xterm -e airodump-ng $Device1 & sleep 5 echo -n "Displaying all wireless devices + VAP's" echo xterm -e 'airmon-ng ; bash' & echo -e "Enter channel: " read channel echo -e "Where should the .pcap be saved: " read fileLocation echo -e "Device to be used: " read airDevice echo -e "WEP or WPA: " read wirelessEncrypt if [[ wirelessEncrypt == 'wep' ]]; then xterm -e airodump-ng -c $channel -w $fileLocation --ivs $airDevice & else xterm -e airodump-ng -c $channel -w $fileLocation $airDevice & fi Decision2='' apMAC='' clientMAC='' echo -e "*******************Aireplay Options************************" echo -e "Now, enter the bssid of the AP in question: " read apMAC echo -e "Now, enter a client associated with the AP: " read clientMAC echo -e "Last but not the least, device to inject" echo -n "(Remember, it needs to be in monitor mode): " read aireDevice echo echo while [[ $Decision2 != 16 ]] do echo -e "WPA options: Custom Options:" echo -e " 1. Deauthentication 13. Aircrack" echo -e "WEP options: 14. Tcpdump" echo -e " 2. Fake authentication 15. packet-forge" echo -e " 3. Interactive Packet Replay" echo -e " 4. ARP Request Replay" echo -e " 5. Korek Chopchop" echo -e " 6. Fragmentation" echo -e " 7. Caffe-latte" echo -e " 8. Client-Oriented Fragmentation" echo echo echo -e "Controling parameters" echo -e " 9. Change AP MAC" echo -e " 10. Change Client MAC" echo -e " 11. Change injecting device" echo -e " 12. Open separate bash prompt" echo echo -e " 16. Exit, Close" echo echo -n "Enter command: " read Decision2 if [[ $Decision2 == 1 ]]; then xterm -T 'Deauthencation-WPA' -e 'aireplay-ng -0 10 -a $apMAC -c $clientMAC $aireDevice ; bash' & elif [[ $Decision2 == 2 ]]; then xterm -T 'Fake Authencation-WEP' -e 'aireplay-ng -1 1 -a $apMAC -h $clientMAC $aireDevice ; bash' & elif [[ $Decision2 == 3 ]]; then xterm -T 'Interactive-Packet-Replay' -e 'aireplay-ng -2 -b $apMAC -h $clientMAC -d FF:FF:FF:FF:FF:FF -t 1 $aireDevice ; bash' & elif [[ $Decision2 == 4 ]]; then xterm -T 'ARP-Request-Replay' -e 'aireplay-ng -3 -b $apMAC -h $clientMAC $aireDevice ; bash' & elif [[ $Decision2 == 5 ]]; then xterm -T 'Korek/chopchop-WEP' -e 'aireplay-ng -4 -a $apMAC -h $clientMAC $aireDevice ; bash' & elif [[ $Decision2 == 6 ]]; then xterm -T 'Fragmentation-WEP' -e 'aireplay-ng -5 -b $apMAC -s $clientMAC -d FF:FF:FF:FF:FF:FF $aireDevice ; bash' & elif [[ $Decision2 == 7 ]]; then xterm -T 'Caffe-Latte-WEP' -e 'aireplay-ng -6 -b $apMAC -h $clientMAC $airDevice ; bash' & elif [[ $Decision2 == 8 ]]; then xterm -T 'Client-Oriented-Frag-WEP' -e 'aireplay-ng -7 -b $apMAC -h $clientMAC $airDevice ; bash' & elif [[ $Decision2 == 9 ]]; then echo -n "Enter the new AP MAC: " read apMAC elif [[ $Decision2 == 10 ]]; then echo -n "Enter the new Client MAC: " read clientMAC elif [[ $Decision2 == 11 ]]; then echo -n "Enter the new device to inject: " read aireDevice elif [[ $Decision2 == 12 ]]; then xterm -T "New Bash" -e 'bash' & elif [[ $Decision2 == 13 ]]; then xterm -T 'Aircrack' -e 'aircrack-ng $fileLocation-01.cap ; bash' & elif [[ $Decision2 == 14 ]]; then xterm -T 'Tcpdump' -e 'tcpdump -n -e -s0 -vvv -i $aireDevice | grep -i DeAuth ; bash' & elif [[ $Decision2 == 15 ]]; then echo -n "What is the .xor file called: " read xorlocation xterm -T 'Packet-forge' -e ' packetforge-ng -0 -a $apMAC -h $clientMAC -k 255.255.255.255 -l 255.255.255.255 -y $xorLocation -w arp-request ; bash' & elif [[ $Decision2 == 16 ]]; then exit 1 elif [[ $Decision2 == 17 ]]; then echo "$apMAC" echo "$clientMAC" echo "aireDevice" else exit 1 fi done exit 1
Edit:
Ask suggested by another, I put double quotes around my statements and it worked.
Sample:
Code:xterm -T 'Blah' ''aircrack-ng /path/to/file ; bash'' &