-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoMon.sh
executable file
·226 lines (182 loc) · 5.04 KB
/
AutoMon.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
#!/bin/bash
#Know your network interface by typing "ip a" in your terminal.
#(My network interface is called "wlp58s0")
#Write yours in the variable "net_interface" below
net_interface="wlp58s0"
echo "" #
echo "which based distro you have ?" #
echo "" # FIRST QUESTION (WICH DISTRO?)
echo "Type 1 if you have a Debian based distro." #
echo "Type 2 if you have a Red Hat based distro." #
echo "Type 3 if you have a Arch based distro." #
echo ""
read DISTRO
if [ $DISTRO = "1" ]; #DEBIAN BASED
then
echo ""
echo "Do you have aircrack-ng installed on this PC ?"
echo ""
echo "Type Y if yes"
echo "Type N if no, and want to install it"
echo ""
read DEB_INPUT1
if [[ $DEB_INPUT1 = "y" || $DEB_INPUT1 = "Y" ]];
then
echo ""
echo "Well! We can start"
echo ""
elif [[ $DEB_INPUT1 = "n" || $DEB_INPUT1 = "N" ]];
then
echo ""
echo "So we will install it now!"
echo "First we have to update the package lists"
apt-get update
echo ""
echo ""
echo "Now we can install it"
echo ""
echo ""
echo ""
echo " Installing..."
echo ""
apt-get install aircrack-ng
apt-get install iwconfig
echo ""
echo ""
else
echo "Invalid input"
echo ""
fi
echo "Type 1 = Active Monitor Mode"
echo "Type 2 = Deactivate Monitor Mode"
echo ""
read DEB_INPUT2
if [ $DEB_INPUT2 = "1" ];
then
echo ""
echo "Activating..."
airmon-ng start $net_interface
iwconfig
elif [ $DEB_INPUT2 = "2" ];
then
echo ""
echo "Deactivating..."
airmon-ng stop $net_interface"mon"
iwconfig
else
echo "Invalid input. Try again with 1 or 2."
fi
elif [ $DISTRO = "2" ]; #RED HAT BASED
then
echo ""
echo "Do you have aircrack-ng installed on this PC ?"
echo ""
echo "Type Y if yes"
echo "Type N if no, and want to install it"
echo ""
read RPM_INPUT1
if [[ $RPM_INPUT1 = "y" || $RPM_INPUT1 = "Y" ]];
then
echo ""
echo "Well! We can start"
echo ""
elif [[ $RPM_INPUT1 = "n" || $RPM_INPUT1 = "N" ]];
then
echo ""
echo "So we will install it now!"
echo "First we have to update the package lists"
yum check-update
echo ""
echo ""
echo "Now we can install it"
echo ""
echo ""
echo ""
echo " Installing..."
echo ""
yum install aircrack-ng
yum install iw
yum install wireless-tools
echo ""
echo ""
else
echo "Invalid input"
echo ""
fi
echo "Type 1 = Active Monitor Mode"
echo "Type 2 = Deactivate Monitor Mode"
echo ""
read RPM_INPUT2
if [ $RPM_INPUT2 = "1" ];
then
echo ""
echo "Activating..."
airmon-ng start $net_interface
iwconfig
elif [ $RPM_INPUT2 = "2" ];
then
echo ""
echo "Deactivating..."
airmon-ng stop $net_interface"mon"
iwconfig
else
echo "Invalid input. Try again with 1 or 2."
fi
elif [ $DISTRO = "3" ]; #ARCH-LINUX BASED
then
echo ""
echo "Do you have aircrack-ng installed on this PC ?"
echo ""
echo "Type Y if yes"
echo "Type N if no, and want to install it"
echo ""
read ARCH_INPUT1
if [[ $ARCH_INPUT1 = "y" || $ARCH_INPUT1 = "Y" ]];
then
echo ""
echo "Well! We can start"
echo ""
elif [[ $ARCH_INPUT1 = "n" || $ARCH_INPUT1 = "N" ]];
then
echo ""
echo "So we will install it now!"
echo "First we have to update the package lists"
pacman -Syy
echo ""
echo ""
echo "Now we can install it"
echo ""
echo ""
echo ""
echo " Installing..."
echo ""
pacman -S aircrack-ng
pacman -S wireless-tools
echo ""
echo ""
else
echo "Invalid input"
echo ""
fi
echo "Type 1 = Active Monitor Mode"
echo "Type 2 = Deactivate Monitor Mode"
echo ""
read ARCH_INPUT2
if [ $ARCH_INPUT2 = "1" ];
then
echo ""
echo "Activating..."
airmon-ng start $net_interface
iwconfig
elif [ $ARCH_INPUT2 = "2" ];
then
echo ""
echo "Deactivating..."
airmon-ng stop $net_interface"mon"
iwconfig
else
echo "Invalid input. Try again with 1 or 2."
fi
else
echo "Invalid Input. Try With 1, 2 or 3"
fi