-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstart.sh
790 lines (555 loc) · 16.1 KB
/
start.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
#/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"
confg=attack.conf
touch $confg
function top1(){
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
}
function main_header {
clear
echo
echo
echo
sleep 0.07 && echo -e "$cyan "
sleep 0.07 && echo -e " ⌠▓▒▓▒◘ ⌠▓▒▓▒◘ ┌▓\ /▓┐ ◘▒▒◘ /▒/\▒\ ⌠◘▒ ▒ /▒/\▒\ "
sleep 0.07 && echo -e " ║▒_ ▓▒ │▒║ ▓ │▒ ▒ ▒ ▒| ▓ ▓ │▓ ▓ │▓ ▓ ▓ │▒ ▒ "
sleep 0.07 && echo -e " ≡◙◙◙◙◘ ║◙▒▓▒◘ │▓ ▓ ▓| ▒ ▒ │▒▓▒▒▓▒ │▒ ▒ ▒ │▓▒▓▓▒▓ "
sleep 0.07 && echo -e " ║▒ │▒▓__ │▒ ▒| ▓ ▓ │▓ ▓ │▓ ▓ ▓ │▒ ▒ "
sleep 0.07 && echo -e " ⌡▓ ⌡▓ ▓ OJECT │▓ ▓| ◘▒▒◘ ⌡▒ ▒ ⌡▒ ▒◘ ⌡▓ ▓ "
sleep 0.07 && echo -e "¯ ¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯ "
echo
sleep 0.07 && echo -e " CAPTIVE PORTAL" $transparent
echo
echo
sleep 0.7 && echo -e " Created by:"$green" MUHAMMAD AHMAD"$transparent
echo
echo
echo
sleep 1 && echo -e $yellow"Welcome to Project Moana Captive Portal. Your own Captive Portal creater..." $transparent
sleep 4
clear
}
chmod a+x decider.sh
chmod a+x new_conf.sh
chmod a+x start_attack.sh
function installdependences {
top1
echo -e $green"Updating your system..."$transparent
echo "Running apt-get update..."
sleep 1
clear
apt-get update
sleep 1
clear
if
apt-get update | grep 'Err'
[ $? == 0 ]; then
clear
echo "
"
echo "apt-get failed to update your system."
echo ""
echo "This may be due to NO internet connectivity. Make sure you have a stable internet connection."
echo ""
echo "Failed to get the required packages. EXITING....."
sleep 3
clear
exit
else
sleep 1
fi
if ! hash airodump-ng 2>/dev/null; then
echo -e $green"Installing Aircrack-ng..."$transparent
apt-get install aircrack-ng
sleep 0.025
clear
else
echo -e $green"Aircrack-ng already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash awk 2>/dev/null; then
echo -e $green"Installing gawk..."$transparent
apt-get install gawk
sleep 0.025
clear
else
echo -e $green"gawk already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash dhcpd 2>/dev/null; then
echo -e $green"Installing isc-dhcp-server..."$transparent
apt-get install isc-dhcp-server
sleep 0.025
clear
else
echo -e $green"isc-dhcp-server already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash hostapd 2>/dev/null; then
echo -e $green"Installing hostapd..."$transparent
apt-get install hostapd
sleep 0.025
clear
else
echo -e $green"Hostapd already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash iwconfig 2>/dev/null; then
echo -e $green"Installing iwconfig..."$transparent
apt-get install iwconfig
sleep 0.025
clear
else
echo -e $green"iwconfig already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash lighttpd 2>/dev/null; then
echo -e $green"Installing lighttpd..." $transparent
apt-get install lighttpd
sleep 0.025
clear
else
echo -e $green"lighttpd already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash macchanger 2>/dev/null; then
echo -e $green"Installing macchanger..." $transparent
apt-get install macchanger
sleep 0.025
clear
else
echo -e $green"macchanger already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash mdk3 2>/dev/null; then
echo -e $green"Installing mdk3..."$transparent
apt-get install mdk3
sleep 0.025
clear
else
echo -e $green"mdk3 already Installed..."$transparent
sleep 0.6
clear
fi
if ! [ -f /usr/bin/nmap ]; then
echo -e $green"Installing nmap..."$transparent
apt-get install nmap
sleep 0.025
clear
else
echo -e $green"nmap already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash python 2>/dev/null; then
echo -e $green"Installing python..." $transparent
apt-get install python
sleep 0.025
clear
else
echo -e $green"python already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash xterm 2>/dev/null; then
echo -e $green"Installing xterm..."$transparent
apt-get install xterm
sleep 0.025
clear
else
echo -e $green"xterm already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash openssl 2>/dev/null; then
echo -e $green"Installing openssl..."$transparent
apt-get install openssl
sleep 0.025
clear
else
echo -e $green"openssl already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash rfkill 2>/dev/null; then
echo -e $green"Installing rfkill..."$transparent
apt-get install rfkill
sleep 0.025
clear
else
echo -e $green"rfkill already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash iptables 2>/dev/null; then
echo -e $green"Installing iptables..."$transparent
apt-get install iptables
sleep 0.025
clear
else
echo -e $green"iptables already Installed..."$transparent
sleep 0.6
clear
fi
if ! hash php-cgi 2>/dev/null; then
echo -e $green"Installing php-cgi..."$transparent
apt-get install php-cgi
sleep 0.025
clear
else
echo -e $green"php-cgi already Installed..."$transparent
sleep 0.6
clear
fi
}
###############################################################################################
function checkdependences {
echo "
"
echo -e $yellow"Checking for dependences....."$transparent
echo "
"
echo -ne "airmon-ng......."
if ! hash airmon-ng 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "airodump-ng....."
if ! hash airodump-ng 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "awk............."
if ! hash awk 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "dhcpd..........."
if ! hash dhcpd 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent" (isc-dhcp-server)"
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "hostapd........."
if ! hash hostapd 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "iwconfig........"
if ! hash iwconfig 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "lighttpd........"
if ! hash lighttpd 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "macchanger......"
if ! hash macchanger 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "mdk3............"
if ! hash mdk3 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "nmap............"
if ! [ -f /usr/bin/nmap ]; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "python.........."
if ! hash python 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "xterm..........."
if ! hash xterm 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "openssl........."
if ! hash openssl 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "rfkill.........."
if ! hash rfkill 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "iptables.........."
if ! hash iptables 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
echo -ne "php-cgi.........."
if ! hash php-cgi 2>/dev/null; then
echo -e "\e[1;31mNot installed"$transparent""
exit=1
else
echo -e "\e[1;32mOK!"$transparent""
fi
sleep 0.025
sleep 1
clear
if [ "$exit" = "1" ]; then
installdependences
fi
sleep 1
}
############################################List interfaces
function list_interfaces {
List=`ls /sys/class/net/ | grep -v "lo" `
set -- $List
interface1=$1
interface2=$2
interface3=$3
interface4=$4
interface5=$5
}
#######################################Chose ap interface
function choose_ap_inter {
top1
echo -e $yellow"The available interfaces are:" $transparent
echo ""
airmon-ng
#echo ""
echo -e $green"Select a interface for Access Point:"$transparent
echo -e $blue "1-"$transparent " $interface1"
echo -e $blue "2-"$transparent " $interface2"
echo -e $blue "3-"$transparent " $interface3"
echo -e $blue "4-"$transparent " $interface4"
echo -e $blue "5-"$transparent " $interface5"
read -p ">>> " n
case $n in
1) ap_inter=$interface1;;
2) ap_inter=$interface2;;
3) ap_inter=$interface3;;
4) ap_inter=$interface4;;
5) ap_inter=$interface5;;
*) echo "invalid option";;
esac
}
#Check ap_inter
function check_ap_inter {
if [ -z "$ap_inter" ]
then
echo -e $red"You haven't selected a valid interface. Try again" $transparent
choose_ap_inter
check_ap_inter
else
echo "$ap_inter interface selected for AP."
fi
clear
}
#######################################Chose deauth inter
function choose_deauth_inter {
airmon-ng
echo "
"
echo -e $green"Select a interface for Deauthentication (Optional)"$transparent
echo ""
echo "To use to deauthenticate real AP"
echo ""
echo "Press ENTER to skip"
echo ""
echo -e $blue "1-"$transparent " $interface1"
echo -e $blue "2-"$transparent " $interface2"
echo -e $blue "3-"$transparent " $interface3"
echo -e $blue "4-"$transparent " $interface4"
echo -e $blue "5-"$transparent " $interface5"
read -p ">>> " n
case $n in
1) deauth_inter=$interface1;;
2) deauth_inter=$interface2;;
3) deauth_inter=$interface3;;
4) deauth_inter=$interface4;;
5) deauth_inter=$interface5;;
*) echo "No interface selected"
unset_deauth_inter;;
esac
clear
}
############################################Final chcking
function final_option {
top1
echo "
"
echo "Interfaces are:
$ap_inter
$deauth_inter
"
echo "
"
shouldloop=true;
while $shouldloop; do
echo -e $green"Do you want to change the interfaces? [y/n]:$transparent "
read -p ">>> " delconf
shouldloop=false;
if [ $delconf == 'y' ]; then
unset_deauth_inter
choose_ap_inter
check_ap_inter
choose_deauth_inter
final_option
elif [ $delconf == 'n' ]; then
echo "Your interfaces have been selected"
else
echo -e $red"Enter a valid response Y or n"$transparent;
shouldloop=true;
fi
done
clear
}
function unset_deauth_inter {
unset deauth_inter
}
###########################################Check if same
function check_if_same {
echo "Checking if your interfaces for AP and deauthenticating are same.
When they are same they don't work properly."
if [ "$ap_inter" == "$deauth_inter" ];then
echo -e $red"Your interfaces are same. Choose different ones."
sleep 0.5
unset_deauth_inter
final_option
check_if_same
else
sleep 0.5
echo "Interfaces are different..We are good to go"
echo "
"
fi
}
##########################################Enable Monitor
function ap_inter_mon {
echo "Enabling monitor mode"
ifconfig $ap_inter down
iwconfig $ap_inter mode monitor
ifconfig $ap_inter up
echo "Monitor mode enabled on $ap_inter."
sleep 1
}
function deauth_inter_mon {
ifconfig $deauth_inter down
iwconfig $deauth_inter mode monitor
ifconfig $deauth_inter up
echo "Monitor mode enabled on $deauth_inter."
sleep 1
}
#################################Check if deauth availabe
####################################Disable monitor
#Disable ap_intermon
#######################check if found deauth then enable monior
function check_enable_deauth_intermon {
if [ -z "$deauth_inter" ]
then
echo -e $red"You haven't selected a Deauthenticating interface. So can't enable monitor mode."$transparent
else
deauth_inter_mon
fi
}
#####################Check if found deauth then disble monitor
clear
verr1=`awk '{if(NR==1) print $0}' $confg` 2>/dev/null
verr2=`awk '{if(NR==2) print $0}' $confg` 2>/dev/null
verr3=`awk '{if(NR==3) print $0}' $confg` 2>/dev/null
verr4=`awk '{if(NR==4) print $0}' $confg` 2>/dev/null
verr5=`awk '{if(NR==5) print $0}' $confg` 2>/dev/null
function new_inter_in_conf {
nus1="$ap_inter"
nus2="$deauth_inter"
echo "$nus1
$verr2
$verr3
$verr4
$nus2" >"$confg"
}
main_header
checkdependences
list_interfaces
choose_ap_inter
check_ap_inter
choose_deauth_inter
final_option
check_if_same
rfkill unblock all
ap_inter_mon
check_enable_deauth_intermon
new_inter_in_conf
clear
sleep 2
./decider.sh