-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdecider.sh
293 lines (213 loc) · 5.76 KB
/
decider.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
#/bin/bash
white="\033[1;37m"
grey="\033[0;37m"
purple="\033[0;35m"
red="\033[1;31m"
green="\033[1;32m"
yellow="\033[1;33m"
Purple="\033[0;35m"
Cyan="\033[0;36m"
Cafe="\033[0;33m"
Fiuscha="\033[0;35m"
blue="\033[1;34m"
transparent="\e[0m"
function top1(){
echo
echo -e " $blue\e[5m/~$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$~"'\'
echo -e " $blue| $ $ |\e[25m"
echo -e " $blue\e[5m| $\e[25m"$green" Project-Moana " "${red}C""${green}a""${yellow}p""${red}t""${green}i""${yellow}v""${red}e" "${green}P""${yellow}o""${red}r""${green}t""${yellow}a""${red}l" $blue" \e[5m$ |\e[25m"
echo -e " $blue\e[5m| $ $ |\e[25m"
echo -e " $blue\e[5m| $ \e[25m ""Created by:" $Cafe"Muhammad Ahmad"$blue"\e[5m $ |\e[25m"
echo -e " $blue\e[5m| $ $ |"
echo -e " $blue\~$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$~/\e[25m""$transparent"
echo
echo
}
confg=attack.conf
#############################Cr
varr1=`awk '{if(NR==1) print $0}' $confg`
varr2=`awk '{if(NR==2) print $0}' $confg`
varr3=`awk '{if(NR==3) print $0}' $confg`
varr4=`awk '{if(NR==4) print $0}' $confg`
varr5=`awk '{if(NR==5) print $0}' $confg`
#Edit config
function enter_new_name {
top1
echo "
"
echo -e $green"Enter the name of AP:" $transparent " ( previously: $varr2 )"
read -p ">> " neww2
if [ -z $neww2 ]; then
echo -e $red"You haven't entered a value. Try again" $transparent
enter_new_name
else
sleep 0.2
fi
}
function enter_new_mac {
echo "
"
echo -e $green"Enter the MAC of the AP:"$transparent " ( previously: $varr3 )"
read -p ">> " neww3
if [ -z $neww3 ]; then
echo -e $red"You haven't entered a value. Try again" $transparent
enter_new_mac
else
sleep 0.2
fi
}
function enter_new_ch {
echo "
"
echo -e $green"Enter the Channel number of AP:" $transparent" ( previously: $varr4 )"
read -p ">> " neww4
if [ -z $neww4 ]; then
echo -e $red"You haven't entered a value. Try again" $transparent
enter_new_ch
else
sleep 0.2
fi
}
function final_check {
echo "
"
shouldloop=true;
while $shouldloop; do
echo -e $green"Do you want to change the configuration file again? [y/n]: "$transparent
read -p ">>> " delconf4
shouldloop=false;
if [ $delconf4 == 'y' ]; then
clear
enter_new_name
enter_new_mac
enter_new_ch
final_check
elif [ $delconf4 == 'n' ]; then
echo "$varr1
$neww2
$neww3
$neww4
$varr5" >"$confg"
./start_attack.sh
else
echo -e $red"Enter a valid response Y or n"$transparent;
shouldloop=true;
fi
done
}
function manual {
clear
top1
echo ""
echo "The previous configuration is as follows:"
echo "
"
echo -e $yellow"AP interface =" $transparent" $varr1"
sleep 0.2
echo -e $yellow"AP Name ="$transparent " $varr2"
sleep 0.2
echo -e $yellow"AP Mac =" $transparent " $varr3"
sleep 0.2
echo -e $yellow"Ap Channel =" $transparent " $varr4"
sleep 0.2
echo -e $yellow"Deauthenticating interface ="$transparent " $varr5"
echo "
"
shouldloop=true;
while $shouldloop; do
echo -e $green"Do you want to change the configuration? [y/n]: " $transparent
read -p ">>> " delconf3
shouldloop=false;
if [ $delconf3 == 'y' ]; then
clear
enter_new_name
enter_new_mac
enter_new_ch
final_check
elif [ $delconf3 == 'n' ]; then
echo "Your attack with same conf will commence."
./start_attack.sh
else
echo -e $red"Enter a valid response Y or n"$transparent;
shouldloop=true;
fi
done
}
function restore_conf {
echo -e $yellow"AP interface =" $transparent" $varr1"
sleep 0.5
echo -e $yellow"AP Name ="$transparent " $varr2"
sleep 0.5
echo -e $yellow"AP Mac =" $transparent " $varr3"
sleep 0.5
echo -e $yellow"Ap Channel =" $transparent " $varr4"
sleep 0.5
echo -e $yellow"Deauthenticating interface ="$transparent " $varr5"
sleep 2
clear
./start_attack.sh
}
function options_menu {
top1
echo -e $yellow"Here you have to select an option to how to create the Captive Portal." $transparent
echo ""
echo -e $blue"Restore previous configuration:"$transparent " It will create the Captive Portal with already defined configuration i.e (Name,channel,Mac)."
echo ""
echo -e $blue"Manual Configuration:"$transparent " You have to configuration manually."
echo ""
echo -e $blue"New Configuration:"$transparent " It will create new configuration by searching for Target network. $red\e[5m(Note: Run this at first time.)\e[25m$transparent"
echo ""
echo -e $green"Select an option"$transparent
echo ""
echo -e $blue"1)"$transparent " Restore previous configuration"
echo -e $blue"2)"$transparent " Manual configuration"
echo -e $blue"3)"$transparent " New Configuration"
read -p ">>> " menu
if [ $menu == '1' ]; then
restore_conf
elif [ $menu == '2' ]; then
manual
elif [ $menu == '3' ]; then
clear
./new_conf.sh
fi
}
function dis_ap_inter_mon1 {
ifconfig $varr1 down
iwconfig $varr1 mode managed
ifconfig $varr1 up
echo "Monitor mode disabled on $varr1."
}
#disable deauth inter mon
function dis_deauth_inter_mon {
ifconfig $varr5 down
iwconfig $varr5 mode managed
ifconfig $varr5 up
echo "Monitor mode disabled on $varr5."
}
function check_disable_deauth_intermon1 {
if [ -z "$varr5" ]
then
echo "You haven't selected a Deauthenticating interface. So can't disable monitor mode."
else
dis_deauth_inter_mon
fi
}
function clean_shit {
clear
top1
echo ""
echo -e $red"Cleaning Mess..." $transparent
echo ""
dis_ap_inter_mon1
check_disable_deauth_intermon1
sleep 1
clear
exit
}
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
clean_shit
}
options_menu